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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
347 B
Rust
Raw Normal View History

// 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();
}