]>
Commit | Line | Data |
---|---|---|
c34b1796 | 1 | // aux-build:lint_unused_extern_crate.rs |
041b39d2 XL |
2 | // aux-build:lint_unused_extern_crate2.rs |
3 | // aux-build:lint_unused_extern_crate3.rs | |
4 | // aux-build:lint_unused_extern_crate4.rs | |
3b2f2976 | 5 | // aux-build:lint_unused_extern_crate5.rs |
1a4d82fc JJ |
6 | |
7 | #![deny(unused_extern_crates)] | |
8 | #![allow(unused_variables)] | |
85aaf69f | 9 | #![allow(deprecated)] |
1a4d82fc | 10 | |
3b2f2976 XL |
11 | extern crate lint_unused_extern_crate5; //~ ERROR: unused extern crate |
12 | ||
2c00a5a8 | 13 | pub extern crate lint_unused_extern_crate4; // no error, it is re-exported |
1a4d82fc | 14 | |
041b39d2 | 15 | extern crate lint_unused_extern_crate3; // no error, it is used |
1a4d82fc | 16 | |
041b39d2 XL |
17 | extern crate lint_unused_extern_crate2; // no error, the use marks it as used |
18 | // even if imported objects aren't used | |
1a4d82fc | 19 | |
c34b1796 | 20 | extern crate lint_unused_extern_crate as other; // no error, the use * marks it as used |
1a4d82fc JJ |
21 | |
22 | #[allow(unused_imports)] | |
041b39d2 | 23 | use lint_unused_extern_crate2::foo as bar; |
1a4d82fc JJ |
24 | |
25 | use other::*; | |
26 | ||
32a655c1 | 27 | mod foo { |
b7449926 | 28 | // Test that this is unused even though an earlier `extern crate` is used. |
041b39d2 | 29 | extern crate lint_unused_extern_crate2; //~ ERROR unused extern crate |
32a655c1 SL |
30 | } |
31 | ||
1a4d82fc | 32 | fn main() { |
041b39d2 | 33 | lint_unused_extern_crate3::foo(); |
1a4d82fc JJ |
34 | let y = foo(); |
35 | } |