Check AttrId for expectations.
This commit is contained in:
parent
17b322fa69
commit
94f8347bae
5 changed files with 73 additions and 167 deletions
9
tests/ui/lint/expect-unused-imports.rs
Normal file
9
tests/ui/lint/expect-unused-imports.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
//@ check-pass
|
||||
|
||||
#![deny(unused_imports)]
|
||||
#![deny(unfulfilled_lint_expectations)]
|
||||
|
||||
#[expect(unused_imports)]
|
||||
use std::{io, fs};
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -1,3 +1,11 @@
|
|||
warning: denote infinite loops with `loop { ... }`
|
||||
--> $DIR/force_warn_expected_lints_fulfilled.rs:8:5
|
||||
|
|
||||
LL | while true {
|
||||
| ^^^^^^^^^^ help: use `loop`
|
||||
|
|
||||
= note: requested on the command line with `--force-warn while-true`
|
||||
|
||||
warning: unused variable: `x`
|
||||
--> $DIR/force_warn_expected_lints_fulfilled.rs:18:9
|
||||
|
|
||||
|
|
@ -28,13 +36,5 @@ warning: unused variable: `this_should_fulfill_the_expectation`
|
|||
LL | let this_should_fulfill_the_expectation = "The `#[allow]` has no power here";
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_this_should_fulfill_the_expectation`
|
||||
|
||||
warning: denote infinite loops with `loop { ... }`
|
||||
--> $DIR/force_warn_expected_lints_fulfilled.rs:8:5
|
||||
|
|
||||
LL | while true {
|
||||
| ^^^^^^^^^^ help: use `loop`
|
||||
|
|
||||
= note: requested on the command line with `--force-warn while-true`
|
||||
|
||||
warning: 5 warnings emitted
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue