WHAT-IF: Reading uninit RAM was not UB?

I honestly don't know, I was just mentioning that the general "less UB ⇒ win" is not that clear :smile:

Some kind of FrozenCell<T : ?Sized> that would wrap a MaybeUninit<T> and use @scottmcm .freeze() method under the hood might be a way to emulate your suggestion while making this "less-UB" be opt-in :thinking:

  • At which point I'd be looking forward to FrozenCell causing an ICE at some point :grin:
3 Likes