]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/lint/rfc-2383-lint-reason/expect_with_forbid.rs
1 #![feature(lint_reasons)]
3 #[forbid(unused_variables)]
4 //~^ NOTE `forbid` level set here
5 //~| NOTE `forbid` level set here
6 #[expect(unused_variables)]
7 //~^ ERROR incompatible with previous forbid [E0453]
8 //~| NOTE overruled by previous forbid
9 //~| ERROR incompatible with previous forbid [E0453]
10 //~| NOTE overruled by previous forbid
11 fn expect_forbidden_lint_1() {}
14 //~^ NOTE `forbid` level set here
15 //~| NOTE `forbid` level set here
16 //~| NOTE the lint level is defined here
18 //~^ ERROR incompatible with previous forbid [E0453]
19 //~| NOTE overruled by previous forbid
20 //~| ERROR incompatible with previous forbid [E0453]
21 //~| NOTE overruled by previous forbid
22 fn expect_forbidden_lint_2() {
23 // This while loop will produce a `while_true` lint as the lint level
24 // at this node is still `forbid` and the `while_true` check happens
25 // before the compilation terminates due to `E0453`
27 //~^ ERROR denote infinite loops with `loop { ... }`
32 expect_forbidden_lint_1();
33 expect_forbidden_lint_2();