1 // Forbidding a group (here, `unused`) overrules subsequent allowance of both
2 // the group, and an individual lint in the group (here, `unused_variables`);
3 // and, forbidding an individual lint (here, `non_snake_case`) overrules
4 // subsequent allowance of a lint group containing it (here, `nonstandard_style`). See
7 // If you turn off deduplicate diagnostics (which rustc turns on by default but
8 // compiletest turns off when it runs ui tests), then the errors are
9 // (unfortunately) repeated here because the checking is done as we read in the
10 // errors, and currently that happens two or three different times, depending on
13 // The test is much cleaner if we deduplicate, though.
15 // compile-flags: -Z deduplicate-diagnostics=yes
17 #![forbid(unused, non_snake_case)]
18 #![forbid(forbidden_lint_groups)]
20 #[allow(unused_variables)] //~ ERROR incompatible with previous
21 //~^ ERROR incompatible with previous
22 //~| WARNING this was previously accepted by the compiler
23 //~| WARNING this was previously accepted by the compiler
26 #[allow(unused)] //~ ERROR incompatible with previous
27 //~^ WARNING this was previously accepted by the compiler
30 #[allow(nonstandard_style)] //~ ERROR incompatible with previous
32 println!("hello forbidden world")