3 ms·
Problem is an uninit value is unstable. The compiler could be using it to store something else, and could change what it's storing at different times. You need
by iudqnolq 3y ago
Problem is an uninit value is unstable. The compiler could be using it to store something else, and could change what it's storing at different times. You need a freeze operation to say "I don't care what that this is, but it should have one value".
https://www.ralfj.de/blog/2019/07/14/uninit.html https://www.ralfj.de/blog/2019/07/14/uninit.html
- tialaramex 3y agoRight, I have seen that post but I didn't end up remembering the use of "freeze" to name this operation. I'd be fine if it was named freeze, labelled unsafe and specifically called out in Safety as requiring that all bit patterns for T are valid representations of T which I think meets the requirement, but it sounds like this can't be done (easily?) without help from LLVM