- Notifications
You must be signed in to change notification settings - Fork 14k
Open
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.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.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
Consider the following code (play):
type T = (); struct S<X>(X); impl Clone for S<T> { fn clone(&self) -> Self { S(()) } } fn main() { let s = S(()); drop(s.clone()); }Today this emits the following warning diagnostic:
warning: type alias is never used: `T` --> src/main.rs:1:1 | 1 | type T = (); | ^^^^^^^^^^^^ | = note: #[warn(dead_code)] on by default But that type alias is not dead code. It is used in the impl Clone for S<T> { ... }, as one can see by trying to recompile the code after commenting out the type alias.
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.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.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.