982b49494e
This is to make the diff when stabilizing it easier to review.
18 lines
290 B
Rust
18 lines
290 B
Rust
// build-pass
|
|
|
|
#![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) };
|
|
}
|