-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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
Code
trait Tr {
type X;
}
impl Tr for () {
type X = Self;
}
fn foo() -> impl Tr {}
fn main() {
foo();
}Current output
No warning.Desired output
warning: associated type `X` is never used
--> src/main.rs:2:11
|
1 | trait Tr {
| -- associated type in this trait
2 | type X;
| ^
|
= note: `#[warn(dead_code)]` on by defaultRationale and extra context
No response
Other cases
No response
Rust Version
Build using the Nightly version: 1.81.0-nightly
(2024-07-12 c6727fc9b5c64cefa726)Anything else?
No response
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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.