- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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).
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.