]> git.lizzy.rs Git - rust.git/blobdiff - tests/fail/stacked_borrows/illegal_write1.rs
Format tests with rustfmt (225-275 of 300)
[rust.git] / tests / fail / stacked_borrows / illegal_write1.rs
index dd262a341ed2df1d2101352459288f4fa3b3c9af..5bdd4ef1f052af97d2ae124b285bca2e5208e62d 100644 (file)
@@ -2,8 +2,10 @@ fn main() {
     let target = Box::new(42); // has an implicit raw
     let xref = &*target;
     {
-        let x : *mut u32 = xref as *const _ as *mut _;
-        unsafe { *x = 42; } // invalidates shared ref, activates raw
+        let x: *mut u32 = xref as *const _ as *mut _;
+        unsafe {
+            *x = 42;
+        } // invalidates shared ref, activates raw
     }
     let _x = *xref; //~ ERROR borrow stack
 }