@@ -11,13 +11,13 @@ struct S(i32);
1111fn foo ( test : bool , x : & mut S , y : S , mut z : S ) -> S {
1212 let ret;
1313 // `ret` starts off uninitialized
14- unsafe { rustc_peek ( & ret) ; }
14+ rustc_peek ( & ret) ;
1515
1616 // All function formal parameters start off initialized.
1717
18- unsafe { rustc_peek ( & x) } ; //~ ERROR rustc_peek: bit not set
19- unsafe { rustc_peek ( & y) } ; //~ ERROR rustc_peek: bit not set
20- unsafe { rustc_peek ( & z) } ; //~ ERROR rustc_peek: bit not set
18+ rustc_peek ( & x) ; //~ ERROR rustc_peek: bit not set
19+ rustc_peek ( & y) ; //~ ERROR rustc_peek: bit not set
20+ rustc_peek ( & z) ; //~ ERROR rustc_peek: bit not set
2121
2222 ret = if test {
2323 :: std:: mem:: replace ( x, y)
@@ -27,21 +27,21 @@ fn foo(test: bool, x: &mut S, y: S, mut z: S) -> S {
2727 } ;
2828
2929 // `z` may be uninitialized here.
30- unsafe { rustc_peek ( & z) ; }
30+ rustc_peek ( & z) ;
3131
3232 // `y` is definitely uninitialized here.
33- unsafe { rustc_peek ( & y) ; }
33+ rustc_peek ( & y) ;
3434
3535 // `x` is still (definitely) initialized (replace above is a reborrow).
36- unsafe { rustc_peek ( & x) ; } //~ ERROR rustc_peek: bit not set
36+ rustc_peek ( & x) ; //~ ERROR rustc_peek: bit not set
3737
3838 :: std:: mem:: drop ( x) ;
3939
4040 // `x` is *definitely* uninitialized here
41- unsafe { rustc_peek ( & x) ; }
41+ rustc_peek ( & x) ;
4242
4343 // `ret` is now definitely initialized (via `if` above).
44- unsafe { rustc_peek ( & ret) ; } //~ ERROR rustc_peek: bit not set
44+ rustc_peek ( & ret) ; //~ ERROR rustc_peek: bit not set
4545
4646 ret
4747}
0 commit comments