]> git.lizzy.rs Git - rust.git/blob - tests/ui/unsafe/ranged_ints_macro.rs
Merge commit '1480cea393d0cee195e59949eabdfbcf1230f7f9' into clippyup
[rust.git] / tests / ui / unsafe / ranged_ints_macro.rs
1 // build-pass
2 // revisions: mir thir
3 // [thir]compile-flags: -Z thir-unsafeck
4
5 #![feature(rustc_attrs)]
6
7 macro_rules! apply {
8     ($val:expr) => {
9         #[rustc_layout_scalar_valid_range_start($val)]
10         #[repr(transparent)]
11         pub(crate) struct NonZero<T>(pub(crate) T);
12     }
13 }
14
15 apply!(1);
16
17 fn main() {
18     let _x = unsafe { NonZero(1) };
19 }