Closed
Description
At some point between rustc
nightly-2023-03-05
(works) and nightly-2023-07-01
(does not work) the following stopped compiling:
#![deny(warnings)]
struct X;
impl X {
#[expect(unused)]
fn unused();
// This is failing with `warning: this lint expectation is unfulfilled`.
// Only the first `#[expect(unused)]` in an impl block works as expected.
#[expect(unused)]
fn unused2();
}
fn main() {
let _ = X;
}
RUSTFLAGS="-D warnings" cargo check
I have not bisected for the exact commit that broke this.
I have only tried to reproduce this error using #[expect(unused)]
. It's possible that this is also broken for other lints.
PR: #114417