]> git.lizzy.rs Git - rust.git/blob - tests/ui/imports/unused-imports-in-test-module.rs
Auto merge of #106520 - ehuss:update-mdbook, r=Mark-Simulacrum
[rust.git] / tests / ui / imports / unused-imports-in-test-module.rs
1 #![deny(unused_imports)]
2
3 use std::io::BufRead; //~ ERROR unused import: `std::io::BufRead`
4
5 fn a() {}
6 fn b() {}
7
8 mod test {
9     use super::a; //~ ERROR unused import: `super::a`
10
11     #[test]
12     fn foo() {
13         a();
14         use crate::b;
15     }
16 }
17
18 mod tests {
19     use super::a; //~ ERROR unused import: `super::a`
20
21     #[test]
22     fn foo() {
23         a();
24         use crate::b;
25     }
26 }
27
28 mod test_a {
29     use super::a; //~ ERROR unused import: `super::a`
30
31     #[test]
32     fn foo() {
33         a();
34         use crate::b;
35     }
36 }
37
38 mod a_test {
39     use super::a; //~ ERROR unused import: `super::a`
40
41     #[test]
42     fn foo() {
43         a();
44         use crate::b;
45     }
46 }
47
48 mod tests_a {
49     use super::a; //~ ERROR unused import: `super::a`
50
51     #[test]
52     fn foo() {
53         a();
54         use crate::b;
55     }
56 }
57
58 mod a_tests {
59     use super::a; //~ ERROR unused import: `super::a`
60
61     #[test]
62     fn foo() {
63         a();
64         use crate::b;
65     }
66 }
67
68 mod fastest_search {
69     use super::a; //~ ERROR unused import: `super::a`
70
71     #[test]
72     fn foo() {
73         a();
74         use crate::b;
75     }
76 }
77
78 #[cfg(test)]
79 mod test_has_attr {
80     use super::a;
81
82     #[test]
83     fn foo() {
84         a();
85         use crate::b;
86     }
87 }
88
89 fn main() {}