r[safety]
r[safety.intro] Unsafe operations are those that can potentially violate the memory-safety guarantees of Rust's static semantics.
r[safety.unsafe-ops] The following language level features cannot be used in the safe subset of Rust:
r[safety.unsafe-deref]
r[safety.unsafe-static]
r[safety.unsafe-union-access]
union
, other than to assign to it.r[safety.unsafe-call]
r[safety.unsafe-target-feature-call]
target_feature
][attributes.codegen.target_feature] from a function that does not have a target_feature
attribute enabling the same features (see [attributes.codegen.target_feature.safety-restrictions]).r[safety.unsafe-impl]
r[safety.unsafe-extern]
extern
block[^extern-2024].r[safety.unsafe-attribute]
[^extern-2024]: Prior to the 2024 edition, extern blocks were allowed to be declared without unsafe
.