We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent adcc0d2 commit c197dc4Copy full SHA for c197dc4
src/libcore/intrinsics.rs
@@ -1162,6 +1162,10 @@ extern "rust-intrinsic" {
1162
/// // Even leaking `v` "uses" it, and hence is undefined behavior.
1163
/// // mem::forget(v); // ERROR
1164
///
1165
+ /// // In fact, `v` is invalid according to basic type layout invariants, so *any*
1166
+ /// // operation touching it is undefined behavior.
1167
+ /// // let v2 = v; // ERROR
1168
+ ///
1169
/// unsafe {
1170
/// // Let us instead put in a valid value
1171
/// ptr::write(&mut v as *mut Box<i32>, Box::new(42i32));
0 commit comments