]> git.lizzy.rs Git - rust.git/blob - tests/ui/dyn-star/align.rs
fb41a05a0660ba19e45dc5f652b43fdf0f856111
[rust.git] / tests / ui / dyn-star / align.rs
1 // revisions: normal over_aligned
2 //[normal] check-pass
3
4 #![feature(dyn_star)]
5 //~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
6
7 use std::fmt::Debug;
8
9 #[cfg_attr(over_aligned,      repr(C, align(1024)))]
10 #[cfg_attr(not(over_aligned), repr(C))]
11 #[derive(Debug)]
12 struct AlignedUsize(usize);
13
14 fn main() {
15     let x = AlignedUsize(12) as dyn* Debug;
16     //[over_aligned]~^ ERROR `AlignedUsize` needs to be a pointer-sized type
17 }