Debian Codegraph @

gcc/testsuite/rust/execute/torture/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 impl Clone for i32 {
10 fn clone(&self) -> i32 {
11 *self
12 }
13 }
14
15 #[derive(Clone)]
16 struct S(i32, i32);
17
18 fn main() -> i32 {
19 let a = S(15, 15);
20 let b = a.clone();
21
22 b.0 - b.1
23 }