rust/tests/ui/lint/dead-code/with-impl.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
240 B
Rust
Raw Normal View History

2019-03-27 20:47:39 -05:00
// run-pass
#![deny(dead_code)]
2022-07-25 15:36:03 -05:00
pub struct GenericFoo<T>(#[allow(unused_tuple_struct_fields)] T);
2019-03-27 20:47:39 -05:00
type Foo = GenericFoo<u32>;
impl Foo {
fn bar(self) -> u8 {
0
}
}
fn main() {
println!("{}", GenericFoo(0).bar());
}