Debian Codegraph @

gcc/testsuite/rust/compile/issue-3403.rs

raw
1 pub struct Foo {
2 a: i32,
3 // { dg-warning "field is never read" "" { target *-*-* } .-1 }
4 }
5 pub struct Bar(i32);
6
7 #[lang = "sized"]
8 trait Sized {}
9
10 pub mod core {
11 pub mod default {
12 pub trait Default: Sized {
13 fn default() -> Self;
14 }
15
16 impl Default for i32 {
17 fn default() -> Self {
18 0
19 }
20 }
21 }
22 }
23
24 impl ::core::default::Default for Bar {
25 #[inline]
26 fn default() -> Bar {
27 Bar(core::default::Default::default())
28 }
29 }
30
31 impl ::core::default::Default for Foo {
32 #[inline]
33 fn default() -> Foo {
34 Foo {
35 a: core::default::Default::default(),
36 }
37 }
38 }