Closed
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