summaryrefslogtreecommitdiffstats
path: root/tests/ui/dyn-star/align.rs
blob: fb41a05a0660ba19e45dc5f652b43fdf0f856111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// revisions: normal over_aligned
//[normal] check-pass

#![feature(dyn_star)]
//~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes

use std::fmt::Debug;

#[cfg_attr(over_aligned,      repr(C, align(1024)))]
#[cfg_attr(not(over_aligned), repr(C))]
#[derive(Debug)]
struct AlignedUsize(usize);

fn main() {
    let x = AlignedUsize(12) as dyn* Debug;
    //[over_aligned]~^ ERROR `AlignedUsize` needs to be a pointer-sized type
}