1 // revisions: mirunsafeck thirunsafeck
2 // [thirunsafeck]compile-flags: -Z thir-unsafeck
4 #![feature(rustc_attrs)]
5 #![allow(unused,dead_code)]
8 #[rustc_layout_scalar_valid_range_start(1)]
11 let mut foo = unsafe { NonZero((1,)) };
13 //~^ ERROR: mutation of layout constrained field is unsafe
17 #[rustc_layout_scalar_valid_range_start(1)]
20 let mut foo = unsafe { NonZero((1,)) };
22 // ^ not unsafe because the result of the block expression is a new place