# Freezing uninitialized values (freeze loads)

**URL:** <https://internals.rust-lang.org/t/freezing-uninitialized-values-freeze-loads/24495>\
**Category:** language design\
**Created:** [July 27, 2026, 6:40pm UTC](https://internals.rust-lang.org/t/freezing-uninitialized-values-freeze-loads/24495 "2026-07-27T18:40:53Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![honzasp](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/honzasp/32/14483_2.png) [@honzasp](https://internals.rust-lang.org/u/honzasp)\
**Post date:** [July 28, 2026, 7:51am UTC](https://internals.rust-lang.org/t/freezing-uninitialized-values-freeze-loads/24495/10 "2026-07-28T07:51:52Z")

</div>

The only prior proposal that I'm aware of is this:

> [@\`freeze(MaybeUninit\<T\>) -\> MaybeUninit\<T\>\` for masked reads](https://internals.rust-lang.org/t/freeze-maybeuninit-t-maybeuninit-t-for-masked-reads/17188):
>
> I'd like LLVM's freeze operation to be exposed at the Rust level. I've read through some past threads such as [this one](https://users.rust-lang.org/t/is-it-possible-to-read-uninitialized-memory-without-invoking-ub/63092/46?page=2) which discussed freezing on arbitrarily sized memory regions, which LLVM's freeze is not designed for. I'm instead looking for the following operation, which seems to be a perfect fit for LLVM's freeze semantics: unsafe fn freeze\<T\>(v: MaybeUninit\<T\>) -\> T It would be sufficient even to expose this on a limited set of types T, such as just the primitive types u8/u16/u32/u64/u1…

I discuss it as "Approach 1" in my post. From reading that discussion, it seems that the reason for not doing this is simply that nobody pursued it further.

But it's very much possible that I missed some other, similar proposals. If you know about them, could you please point me to them?

---

_[View the full topic](https://internals.rust-lang.org/t/freezing-uninitialized-values-freeze-loads/24495)._
