External Publication
Visit Post

Interior mutability and safety of ownership transfer in Rust

Rust Internals [Unofficial] March 5, 2026
Source

quinedot:

No, Freeze does not guarantee there is no interior mutability in the type. It only guarantees there is no shallow immutability in the inline values.

If i understand correctly this is enough here, as any data behind an indirection won't be copied by ptr::read/write and so won't be duplicated during the reallocation.

Discussion in the ATmosphere

Loading comments...