What transmutation safety conditions shall the compiler assume that you are checking?
true, the compiler assumes that you are ensuring (either dynamically or statically) that
destination referents do not have stricter alignment requirements than source referents.
true, the compiler assume that you are ensuring that lifetimes are not extended in a manner
that violates Rust’s memory model.
true, the compiler assumes that you have ensured that it is safe for you to violate the
type and field privacy of the destination type (and sometimes of the source type, too).
true, the compiler assumes that you are ensuring that the source type is actually a valid
instance of the destination type.
Do not assume that you have ensured any safety properties are met.
Assume only that alignment conditions are met.
Assume only that lifetime conditions are met.
Assume only that safety conditions are met.
Assume only that dynamically-satisfiable validity conditions are met.
+operation. Read more
othervalues to be equal, and is used by
!=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
-operation. Read more
Auto Trait Implementations§
Returns the argument unchanged.