kvarn::prelude::utils::prelude::compact_str::core::cell

Struct UnsafeCell

1.6.0 ยท source
pub struct UnsafeCell<T>
where T: ?Sized,
{ /* private fields */ }
Expand description

The core primitive for interior mutability in Rust.

If you have a reference &T, then normally in Rust the compiler performs optimizations based on the knowledge that &T points to immutable data. Mutating that data, for example through an alias or by transmuting a &T into a &mut T, is considered undefined beha