1 // compile-flags: --force-warn while_true
2 // compile-flags: --force-warn unused_variables
3 // compile-flags: --force-warn unused_mut
6 #![feature(lint_reasons)]
8 fn expect_early_pass_lint(terminate: bool) {
10 //~^ WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
11 //~| NOTE `#[warn(unfulfilled_lint_expectations)]` on by default
13 println!("Do you know what a spin lock is?")
17 #[expect(unused_variables, reason="<this should fail and display this reason>")]
18 //~^ WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
19 //~| NOTE <this should fail and display this reason>
20 fn check_specific_lint() {
25 //~^ WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
26 fn check_multiple_lints_with_lint_group() {
27 let fox_name = "Sir Nibbles";
29 let what_does_the_fox_say = "*ding* *deng* *dung*";
31 println!("The fox says: {what_does_the_fox_say}");
32 println!("~ {fox_name}")
37 //~^ WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
38 fn check_overridden_expectation_lint_level() {
39 #[allow(unused_variables)]
40 let this_should_not_fulfill_the_expectation = "maybe";
41 //~^ WARNING unused variable: `this_should_not_fulfill_the_expectation` [unused_variables]
42 //~| NOTE requested on the command line with `--force-warn unused-variables`
43 //~| HELP if this is intentional, prefix it with an underscore
47 check_multiple_lints_with_lint_group();
48 check_overridden_expectation_lint_level();