]> git.proxmox.com Git - rustc.git/blob - src/test/ui/lint/outer-forbid.rs
New upstream version 1.39.0+dfsg1
[rustc.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 fn foo() {}
11
12 #[allow(unused)] //~ ERROR overruled
13 fn bar() {}
14
15 #[allow(nonstandard_style)] //~ ERROR overruled
16 fn main() {
17 println!("hello forbidden world")
18 }