aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-1786.rs
blob: 1c46fee6a87024e013b3f6284aaed2a584efe755 (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
25
26
#[lang = "sized"]
pub trait Sized {}

#[lang = "clone"]
trait Clone {
    fn clone(&self) -> Self;

    fn clone_from(&mut self, source: &Self) {
        *self = source.clone()
    }
}

#[lang = "copy"]
pub trait Copy: Clone {
    // Empty.
}

mod impls {
    use super::Clone;

    impl Clone for char {
        fn clone(&self) -> Self {
            *self
        }
    }
}