gcc/testsuite/rust/compile/derive_macro3.rs
raw| 1 | #[lang = "sized"] |
| 2 | pub trait Sized {} |
| 3 | |
| 4 | #[lang = "clone"] |
| 5 | pub trait Clone { |
| 6 | fn clone(&self) -> Self; |
| 7 | } |
| 8 | |
| 9 | pub trait Copy {} |
| 10 | |
| 11 | impl Copy for i32 {} |
| 12 | |
| 13 | impl<T> Clone for T |
| 14 | where |
| 15 | T: Copy, |
| 16 | { |
| 17 | fn clone(&self) -> Self { |
| 18 | *self |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | fn main() { |
| 23 | let a = 15i32; |
| 24 | let _ = a.clone(); |
| 25 | } |