]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/unsafe/ranged_ints2.rs
9a6bb18f9266494cd926f8f4d05b84d5cfeac803
1 // revisions: mirunsafeck thirunsafeck
2 // [thirunsafeck]compile-flags: -Z thir-unsafeck
4 #![feature(rustc_attrs)]
6 #[rustc_layout_scalar_valid_range_start(1)]
8 pub(crate) struct NonZero
<T
>(pub(crate) T
);
10 let mut x
= unsafe { NonZero(1) }
;
11 let y
= &mut x
.0; //~ ERROR mutation of layout constrained field is unsafe