rust/tests/ui/lint/lints-on-stmt-not-overridden-130142.rs

20 lines
347 B
Rust

// Regression test for issue #130142
// Checks that we emit no warnings when a lint's level
// is overridden by an expect or allow attr on a Stmt node
//@ check-pass
#[must_use]
pub fn must_use_result() -> i32 {
42
}
fn main() {
#[expect(unused_must_use)]
must_use_result();
#[allow(unused_must_use)]
must_use_result();
}