]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/outer-forbid.rs
generalize bindings_with_variant_name lint
[rust.git] / src / test / ui / lint / outer-forbid.rs
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
5 // Issue #42873.
6
7 #![forbid(unused, non_snake_case)]
8
9 #[allow(unused_variables)] //~ ERROR overruled
10                            //~| ERROR overruled
11                            //~| ERROR overruled
12 fn foo() {}
13
14 #[allow(unused)] //~ ERROR overruled
15                  //~| ERROR overruled
16                  //~| ERROR overruled
17 fn bar() {}
18
19 #[allow(nonstandard_style)] //~ ERROR overruled
20                             //~| ERROR overruled
21                             //~| ERROR overruled
22 fn main() {
23     println!("hello forbidden world")
24 }