mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
18 lines
480 B
Rust
18 lines
480 B
Rust
|
// 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
|
||
|
}
|