blob: 8293d029951faf0f219eef181b49f5136e12a347 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// build-pass
// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck
#![feature(rustc_attrs)]
macro_rules! apply {
($val:expr) => {
#[rustc_layout_scalar_valid_range_start($val)]
#[repr(transparent)]
pub(crate) struct NonZero<T>(pub(crate) T);
}
}
apply!(1);
fn main() {
let _x = unsafe { NonZero(1) };
}
|