1 // This test is checking that you cannot override a `forbid` by adding in other
2 // attributes later in the same scope. (We already ensure that you cannot
3 // override it in nested scopes).
5 // If you turn off deduplicate diagnostics (which rustc turns on by default but
6 // compiletest turns off when it runs ui tests), then the errors are
7 // (unfortunately) repeated here because the checking is done as we read in the
8 // errors, and curretly that happens two or three different times, depending on
11 // I decided avoiding the redundant output was not worth the time in engineering
12 // effort for bug like this, which 1. end users are unlikely to run into in the
13 // first place, and 2. they won't see the redundant output anyway.
15 // compile-flags: -Z deduplicate-diagnostics=yes
17 #![forbid(forbidden_lint_groups)]
19 fn forbid_first(num: i32) -> i32 {
22 //~^ ERROR: deny(unused) incompatible with previous forbid
23 //~| WARNING being phased out
24 //~| ERROR: deny(unused) incompatible with previous forbid
25 //~| WARNING being phased out
32 fn forbid_last(num: i32) -> i32 {
41 fn forbid_multiple(num: i32) -> i32 {