aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/derive_macro6.rs
blob: b7bf7a78acd1b3eb901af861e4021d12e816f12f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#[lang = "sized"]
pub trait Sized {}

pub trait Copy {}
pub trait Clone {
    fn clone(&self) -> Self;
}

#[lang = "phantom_data"]
pub struct PhantomData<T>;

pub struct AssertParamIsCopy<T: Copy> {
    pub _field: PhantomData<T>,
}

impl Copy for i32 {}
impl Copy for i64 {}
impl Copy for U {}

#[derive(Clone)]
union U {
    i: i32,
    f: f64,
}