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.md
There is the question of whether we should overload unsafe to also mean unconst in const environments or whether we should create a new keyword like unconst, const unsafe or similar. The PR linked above uses the unsafe 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 like unconst which means essentially the same thing (but for a different set of operations), feels like it does not add any gains.
Spawned off rust-lang/rust#55009 (comment) (a PR making raw pointer to usize casts unsafe and making raw pointer operations unsafe.
These
unconstoperations are explained in https://github.com/rust-rfcs/const-eval/blob/master/const_safety.mdThere is the question of whether we should overload
unsafeto also meanunconstin const environments or whether we should create a new keyword likeunconst,const unsafeor similar. The PR linked above uses theunsafekeyword (but all operations still require feature gates).My view is that
unsafeallows 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 likeunconstwhich means essentially the same thing (but for a different set of operations), feels like it does not add any gains.