]> git.lizzy.rs Git - rust.git/blobdiff - tests/compile-fail/rc_as_raw.rs
rustup
[rust.git] / tests / compile-fail / rc_as_raw.rs
index 086467eea311bea6d365fbbf20b9e82cd957b88f..cb50ca5fcece011f621e643bbffaef13f8b8ccd9 100644 (file)
@@ -17,5 +17,5 @@ fn main() {
     drop(strong);
     // But not any more. We can do Weak::as_raw(&weak), but accessing the pointer would lead to
     // undefined behaviour.
-    assert_eq!(42, **unsafe { &*Weak::as_raw(&weak) }); //~ ERROR dangling pointer
+    assert_eq!(42, **unsafe { &*Weak::as_raw(&weak) }); //~ ERROR dereferenced after this allocation got freed
 }