1 // ignore-tidy-linelength
3 #![feature(lint_reasons)]
8 //~^ WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
9 //~| NOTE `#[warn(unfulfilled_lint_expectations)]` on by default
10 //~| NOTE this `expect` is overridden by a `allow` attribute before the `unused_mut` lint is triggered
11 reason = "this `expect` is overridden by a `allow` attribute before the `unused_mut` lint is triggered"
17 reason = "this overrides the previous `expect` lint level and allows the `unused_mut` lint here"
25 //~^ WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
26 //~| NOTE this `expect` is overridden by a `warn` attribute before the `unused_mut` lint is triggered
27 reason = "this `expect` is overridden by a `warn` attribute before the `unused_mut` lint is triggered"
32 //~^ NOTE the lint level is defined here
33 reason = "this overrides the previous `expect` lint level and warns about the `unused_mut` lint here"
37 //~^ WARNING variable does not need to be mutable [unused_mut]
38 //~| NOTE this overrides the previous `expect` lint level and warns about the `unused_mut` lint here
39 //~| HELP remove this `mut`
43 #[expect(unused_variables)]
44 //~^ WARNING this lint expectation is unfulfilled
45 #[forbid(unused_variables)]
46 //~^ NOTE the lint level is defined here
47 fn check_expect_then_forbid() {
48 let this_is_my_function = 3;
49 //~^ ERROR unused variable: `this_is_my_function` [unused_variables]
50 //~| HELP if this is intentional, prefix it with an underscore