2017-06-23 21:22:06 -05:00
|
|
|
// Forbidding a group (here, `unused`) overrules subsequent allowance of both
|
|
|
|
// the group, and an individual lint in the group (here, `unused_variables`);
|
|
|
|
// and, forbidding an individual lint (here, `non_snake_case`) overrules
|
2018-08-29 08:21:01 -05:00
|
|
|
// subsequent allowance of a lint group containing it (here, `nonstandard_style`). See
|
2017-06-23 21:22:06 -05:00
|
|
|
// Issue #42873.
|
|
|
|
|
2020-11-07 17:14:38 -06:00
|
|
|
// If you turn off deduplicate diagnostics (which rustc turns on by default but
|
|
|
|
// compiletest turns off when it runs ui tests), then the errors are
|
|
|
|
// (unfortunately) repeated here because the checking is done as we read in the
|
|
|
|
// errors, and currently that happens two or three different times, depending on
|
|
|
|
// compiler flags.
|
|
|
|
//
|
|
|
|
// The test is much cleaner if we deduplicate, though.
|
|
|
|
|
|
|
|
// compile-flags: -Z deduplicate-diagnostics=yes
|
|
|
|
|
2017-06-23 21:22:06 -05:00
|
|
|
#![forbid(unused, non_snake_case)]
|
2021-01-29 18:06:00 -06:00
|
|
|
#![forbid(forbidden_lint_groups)]
|
2017-06-23 21:22:06 -05:00
|
|
|
|
2021-09-04 06:26:25 -05:00
|
|
|
#[allow(unused_variables)]
|
2021-01-29 18:06:00 -06:00
|
|
|
//~^ ERROR incompatible with previous
|
|
|
|
//~| WARNING this was previously accepted by the compiler
|
2017-07-26 23:51:09 -05:00
|
|
|
fn foo() {}
|
|
|
|
|
2020-11-07 17:14:38 -06:00
|
|
|
#[allow(unused)] //~ ERROR incompatible with previous
|
2021-01-29 18:06:00 -06:00
|
|
|
//~^ WARNING this was previously accepted by the compiler
|
2017-07-26 23:51:09 -05:00
|
|
|
fn bar() {}
|
|
|
|
|
2020-11-07 17:14:38 -06:00
|
|
|
#[allow(nonstandard_style)] //~ ERROR incompatible with previous
|
2017-06-23 21:22:06 -05:00
|
|
|
fn main() {
|
|
|
|
println!("hello forbidden world")
|
|
|
|
}
|