-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
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
fn _foo() {
Bar {
#[expect(deprecated)]
foo: 0,
};
}
struct Bar {
#[deprecated = "reason"]
foo: u32,
}
Current output
warning: use of deprecated field `Bar::foo`: reason
--> src/lib.rs:4:9
|
4 | foo: 0,
| ^^^^^^
|
= note: `#[warn(deprecated)]` on by default
warning: this lint expectation is unfulfilled
--> src/lib.rs:3:18
|
3 | #[expect(deprecated)]
| ^^^^^^^^^^
|
= note: `#[warn(unfulfilled_lint_expectations)]` on by default
Desired output
n/a (empty)
Rationale and extra context
Expectation should be fulfilled, as the deprecated lint is actively being emitted from that field initialization. This works as expected if the expectation is moved elsewhere (e.g., to the function).
Other cases
Rust Version
Current stable (1.85)
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.