Closed
Description
The following code (playground):
pub struct GenericFoo<T>(T);
type Foo = GenericFoo<u32>;
impl Foo {
fn bar(self) -> u8 {
0
}
}
fn main() {
println!("{}", GenericFoo(0).bar());
}
results in the warning:
warning: type alias is never used: `Foo`
--> src/main.rs:3:1
|
3 | type Foo = GenericFoo<u32>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(dead_code)] on by default
This is incorrect, since the Foo
impl uses it (and it can be unwieldy to write it out otherwise).