aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/derive_macro3.rs
blob: 1c7d4737bfe98be687faecfc61385bd2b86c07c0 (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 Clone {
    fn clone(&self) -> Self;
}

pub trait Copy {}

impl Copy for i32 {}

impl<T> Clone for T
where
    T: Copy,
{
    fn clone(&self) -> Self {
        *self
    }
}

fn main() {
    let a = 15i32;
    let _ = a.clone();
}