1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
struct Foo<T>(T); impl<X> Foo<X> { fn new(a: X) -> Self { Self(a) } fn test(self) -> X { self.0 } } fn main() { let a; a = Foo::new(123); let b = a.test(); // { dg-warning "unused name" "" { target *-*-* } .-1 } }