pub unsafe auto trait Freeze { }
๐ฌThis is a nightly-only experimental API. (
freeze
#121675)Expand description
Used to determine whether a type contains
any UnsafeCell
internally, but not through an indirection.
This affects, for example, whether a static
of that type is
placed in read-only static memory or writable static memory.
This can be used to declare that a constant with a generic type
will not contain interior mutability, and subsequently allow
placing the constant behind references.
ยงSafety
This trait is a core part of the language, it is just expressed as a trait in libcore for convenience. Do not implement it for other types.
Implementorsยง
impl<T> Freeze for NonZero<T>where
T: ZeroablePrimitive + Freeze,
Available on non-crate feature
ferrocene_certified
only.impl<T: PointeeSized> !Freeze for UnsafeCell<T>
Available on non-crate feature
ferrocene_certified
only.