-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
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.F-associated_const_equality`#![feature(associated_const_equality)]``#![feature(associated_const_equality)]`L-dead_codeLint: dead_codeLint: dead_codeT-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
#![feature(associated_const_equality)]
trait Tr {
const I: i32;
}
impl Tr for () {
const I: i32 = 1;
}
fn foo() -> impl Tr<I = 1> {}
fn main() {
foo();
}
Current output
warning: associated constant `I` is never used
--> src/main.rs:4:11
|
3 | trait Tr {
| -- associated constant in this trait
4 | const I: i32;
| ^
|
= note: `#[warn(dead_code)]` on by default
warning: `playground` (bin "playground") generated 1 warning
### Desired output
```Shell
No warning.
Rationale and extra context
No response
Other cases
No response
Rust Version
Build using the Nightly version: 1.81.0-nightly
(2024-06-19 d8a38b00024cd7156dea)
Anything else?
No response
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.F-associated_const_equality`#![feature(associated_const_equality)]``#![feature(associated_const_equality)]`L-dead_codeLint: dead_codeLint: dead_codeT-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.
Type
Projects
Status
Done