What do we do with "unconst" operations? · Issue #14 · rust-lang/const-eval (original) (raw)

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.