-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What do we do with "unconst" operations? #14
Comments
Further datapoint: we could use unconst in the future to mark functions explicitly not meant to be const. then, in a future edition we can remove the need to mark things as const. |
The counterargument is that ppl might be confused why something is Would it make sense to also make raw pointer to |
In the const lang-team meeting with @rust-lang/wg-const-eval we did make some plans towards unconst operations, but nothing has happened since then I think. See the meeting notes. The first step would be an RFC specifying what "UB during CTFE" means. |
unsafe
keyword to also mean unconst
?
Would it be possible for unsafe blocks to be a superset of unconst blocks, so if you don't need unsafe you can just use unconst? |
There is now an RFC with a way to permit arbitrary I'm going ahead and close this issue |
Well, that RFC is mostly about
|
Spawned off rust-lang/rust#55009 (comment) (a PR making raw pointer to usize casts unsafe and making raw pointer operations unsafe.
These
unconst
operations are explained in https://github.com/rust-rfcs/const-eval/blob/master/const_safety.mdThere is the question of whether we should overload
unsafe
to also meanunconst
in const environments or whether we should create a new keyword likeunconst
,const unsafe
or similar. The PR linked above uses theunsafe
keyword (but all operations still require feature gates).My view is that
unsafe
allows you to do things that the compiler can't prove as sound but are still sound. If you mess that up, your code is unsound. Adding another keyword likeunconst
which means essentially the same thing (but for a different set of operations), feels like it does not add any gains.The text was updated successfully, but these errors were encountered: