Debian Codegraph @

gcc/testsuite/rust/compile/derive-debug1.rs

raw
1 #[lang = "sized"]
2 trait Sized {}
3
4 mod core {
5 pub mod result {
6 pub enum Result<T, E> {
7 #[lang = "Ok"]
8 Ok(T),
9 #[lang = "Err"]
10 Err(E),
11 }
12 }
13
14 mod fmt {
15 struct Formatter; // { dg-warning "is never constructed" }
16 struct Error; // { dg-warning "is never constructed" }
17
18 type Result = core::result::Result<(), Error>;
19
20 trait Debug {
21 fn fmt(&self, fmt: &mut Formatter) -> Result;
22 }
23 }
24 }
25
26 #[derive(Debug)] // { dg-warning "unused name" }
27 // { dg-warning "stub implementation" "" { target *-*-* } .-1 }
28 struct Foo { a: i32, b: i64 } // { dg-warning "is never constructed" }
29
30 #[derive(Debug)] // { dg-warning "unused name" }
31 // { dg-warning "stub implementation" "" { target *-*-* } .-1 }
32 struct Bar(i32, i32); // { dg-warning "is never constructed" }
33
34 #[derive(Debug)] // { dg-warning "unused name" }
35 // { dg-warning "stub implementation" "" { target *-*-* } .-1 }
36 enum Baz {
37 A,
38 B(i32),
39 C { a: i32 }
40 }
41