gcc/testsuite/rust/compile/derive_macro1.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 | // This warning can be removed once we properly handle implems with #[automatically_derived] |
| 10 | #[derive(Clone)] // { dg-warning "unused name .self." } |
| 11 | pub struct S; |
| 12 | |
| 13 | fn main() { |
| 14 | let s = S; |
| 15 | let _s_clone = s.clone(); |
| 16 | } |