Turns out that for some potential future extensions of Rust, we actually do need the ability to have poison stored in memory. For instance, we are considering a safe way of exposing “fast math” operations: we could have a new FastF32
type, operations on which have the LLVM fast-math flag set. This means those values can become poison, but that’s totally fine as long as well we do is run other float operations on them. Eventually the user will have to call to_f32
or so to get a regular float out, and then we would emit a freeze at the end. This would allow us to set nnan
and a bunch of other flags while still ensuring full safety – but of course those programs can have poison in a FastF32
, which could be stored to memory, which could then be manipulated with other types like MaybeUninit
and that all needs to work correctly.