diff options
Diffstat (limited to 'tests/ui/lint/dead-code/with-impl.rs')
-rw-r--r-- | tests/ui/lint/dead-code/with-impl.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/lint/dead-code/with-impl.rs b/tests/ui/lint/dead-code/with-impl.rs new file mode 100644 index 000000000..812fcdd09 --- /dev/null +++ b/tests/ui/lint/dead-code/with-impl.rs @@ -0,0 +1,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()); +} |