]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/lint-directives-on-use-items-issue-10534.rs
Auto merge of #106884 - clubby789:fieldless-enum-debug, r=michaelwoerister
[rust.git] / tests / ui / lint / lint-directives-on-use-items-issue-10534.rs
1 #![deny(unused_imports)]
2 #![allow(non_upper_case_globals)]
3
4 // The aim of this test is to ensure that deny/allow/warn directives
5 // are applied to individual "use" statements instead of silently
6 // ignored.
7
8 #[allow(dead_code)]
9 mod a { pub static x: isize = 3; pub static y: isize = 4; }
10
11 mod b {
12     use a::x; //~ ERROR: unused import
13     #[allow(unused_imports)]
14     use a::y; // no error here
15 }
16
17 #[allow(unused_imports)]
18 mod c {
19     use a::x;
20     #[deny(unused_imports)]
21     use a::y; //~ ERROR: unused import
22 }
23
24 fn main() {}