Rustacean Station  cover image

Presser with Gray Olson

Rustacean Station

00:00

Is It Possible to Create a Mutable Reference to an Uninitialized U 32?

Rust has a language of safety, invariance, and validity. Safety is just whether you actually perform a bad action or not; validity is like never actually happening in the first place. It can be valid to create a reference to an uninitialized u 32, which means it's valid to createreference to an invalid value. But as long as you don't actually do anything invalid, that's okay. So there are ongoing discussions on whether or not it should be relaxed such that it is still valid, though unsafe,. That would mean then that you could take like an immutable reference to a U32 in an uninitial buffer and just write a value to it. And that would be fine.

Play episode from 48:17
Transcript

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app