2 // ignore-tidy-linelength
4 #![feature(lint_reasons)]
7 #![expect(unfulfilled_lint_expectations, reason = "idk why you would expect this")]
8 //~^ WARNING this lint expectation is unfulfilled
9 //~| NOTE `#[warn(unfulfilled_lint_expectations)]` on by default
10 //~| NOTE idk why you would expect this
11 //~| NOTE the `unfulfilled_lint_expectations` lint can't be expected and will always produce this message
13 #[expect(unfulfilled_lint_expectations, reason = "a local: idk why you would expect this")]
14 //~^ WARNING this lint expectation is unfulfilled
15 //~| NOTE a local: idk why you would expect this
16 //~| NOTE the `unfulfilled_lint_expectations` lint can't be expected and will always produce this message
17 pub fn normal_test_fn() {
18 #[expect(unused_mut, reason = "this expectation will create a diagnostic with the default lint level")]
19 //~^ WARNING this lint expectation is unfulfilled
20 //~| NOTE this expectation will create a diagnostic with the default lint level
21 let mut v = vec![1, 1, 2, 3, 5];
24 // Check that lint lists including `unfulfilled_lint_expectations` are also handled correctly
25 #[expect(unused, unfulfilled_lint_expectations, reason = "the expectation for `unused` should be fulfilled")]
26 //~^ WARNING this lint expectation is unfulfilled
27 //~| NOTE the expectation for `unused` should be fulfilled
28 //~| NOTE the `unfulfilled_lint_expectations` lint can't be expected and will always produce this message
29 let value = "I'm unused";
32 #[expect(warnings, reason = "this suppresses all warnings and also suppresses itself. No warning will be issued")]
33 pub fn expect_warnings() {
34 // This lint trigger will be suppressed
36 let mut v = vec![1, 1, 2, 3, 5];