File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
src/tools/miri/tests/pass/stacked-borrows Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -265,13 +265,15 @@ fn write_does_not_invalidate_all_aliases() {
265265 assert_eq ! ( * x, 1337 ) ; // oops, the value changed! I guess not all pointers were invalidated
266266}
267267
268- fn box_into_raw_allows_interior_mutable_alias ( ) { unsafe {
269- let b = Box :: new ( std:: cell:: Cell :: new ( 42 ) ) ;
270- let raw = Box :: into_raw ( b) ;
271- let c = & * raw;
272- let d = raw. cast :: < i32 > ( ) ; // bypassing `Cell` -- only okay in Miri tests
273- // `c` and `d` should permit arbitrary aliasing with each other now.
274- * d = 1 ;
275- c. set ( 2 ) ;
276- drop ( Box :: from_raw ( raw) ) ;
277- } }
268+ fn box_into_raw_allows_interior_mutable_alias ( ) {
269+ unsafe {
270+ let b = Box :: new ( std:: cell:: Cell :: new ( 42 ) ) ;
271+ let raw = Box :: into_raw ( b) ;
272+ let c = & * raw;
273+ let d = raw. cast :: < i32 > ( ) ; // bypassing `Cell` -- only okay in Miri tests
274+ // `c` and `d` should permit arbitrary aliasing with each other now.
275+ * d = 1 ;
276+ c. set ( 2 ) ;
277+ drop ( Box :: from_raw ( raw) ) ;
278+ }
279+ }
You can’t perform that action at this time.
0 commit comments