1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// run-pass #![deny(dead_code)] pub struct GenericFoo<T>(#[allow(unused_tuple_struct_fields)] T); type Foo = GenericFoo<u32>; impl Foo { fn bar(self) -> u8 { 0 } } fn main() { println!("{}", GenericFoo(0).bar()); }