2017-06-24 02:22:06 +00: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 13:21:01 +00:00
|
|
|
// subsequent allowance of a lint group containing it (here, `nonstandard_style`). See
|
2017-06-24 02:22:06 +00:00
|
|
|
// Issue #42873.
|
|
|
|
|
2020-11-07 23:14:38 +00: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-24 02:22:06 +00:00
|
|
|
#![forbid(unused, non_snake_case)]
|
2021-01-30 00:06:00 +00:00
|
|
|
#![forbid(forbidden_lint_groups)]
|
2017-06-24 02:22:06 +00:00
|
|
|
|
2021-09-04 11:26:25 +00:00
|
|
|
#[allow(unused_variables)]
|
2021-01-30 00:06:00 +00:00
|
|
|
//~^ ERROR incompatible with previous
|
|
|
|
//~| WARNING this was previously accepted by the compiler
|
2017-07-27 04:51:09 +00:00
|
|
|
fn foo() {}
|
|
|
|
|
2020-11-07 23:14:38 +00:00
|
|
|
#[allow(unused)] //~ ERROR incompatible with previous
|
2021-01-30 00:06:00 +00:00
|
|
|
//~^ WARNING this was previously accepted by the compiler
|
2017-07-27 04:51:09 +00:00
|
|
|
fn bar() {}
|
|
|
|
|
2020-11-07 23:14:38 +00:00
|
|
|
#[allow(nonstandard_style)] //~ ERROR incompatible with previous
|
2017-06-24 02:22:06 +00:00
|
|
|
fn main() {
|
|
|
|
println!("hello forbidden world")
|
|
|
|
}
|