Skip to content

rust-intrinsic ABI functions should be unsafe #6370

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
brson opened this issue May 9, 2013 · 7 comments
Closed

rust-intrinsic ABI functions should be unsafe #6370

brson opened this issue May 9, 2013 · 7 comments
Labels
A-type-system Area: Type system E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented May 9, 2013

They seem to be safe by default now when other foreign ABI's are unsafe.

Reasonable people disagree.

@alexcrichton
Copy link
Member

It seems like some of them like sinf32/logf32/etc probably shouldn't be unsafe. Other ones like forget/init/atomic_* probably should be unsafe.

The safe ones could be re-exported via a non-unsafe function though, because default unsafe is probably more reasonable.

@thestinger
Copy link
Contributor

I would prefer if they were unsafe by default and you could explicitly tag them with #[safe].

@bblum
Copy link
Contributor

bblum commented Jul 3, 2013

nominating backwards-compatible

@bblum
Copy link
Contributor

bblum commented Jul 3, 2013

This seems like it should be a pretty easy change to make, so giving this E-easy. The relevant function to change is check_intrinsic_type in middle/typeck/check/mod.rs.

@bblum
Copy link
Contributor

bblum commented Aug 12, 2013

what, i just had this bug for triage a month ago

@catamorphism
Copy link
Contributor

@brson says this is an implementation detail. De-milestoning

@alexcrichton
Copy link
Member

This appears to have been done now, all intrinsics are unsafe.

We can explicitly expose safe versions if we need to.

flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 20, 2020
…valuations, r=llogiq,flip1995

Fix FP in `unnecessary_lazy_evaluations`

Fix rust-lang/rust-clippy#6343

changelog: Fix FP in `unnecessary_lazy_evaluations`
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-type-system Area: Type system E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

5 participants