]>
Commit | Line | Data |
---|---|---|
94b46f34 XL |
1 | // aux-build:edition-lint-paths.rs |
2 | // run-rustfix | |
b7449926 XL |
3 | // compile-flags:--extern edition_lint_paths |
4 | // edition:2018 | |
94b46f34 XL |
5 | |
6 | // The "normal case". Ideally we would remove the `extern crate` here, | |
7 | // but we don't. | |
8 | ||
94b46f34 XL |
9 | #![deny(rust_2018_idioms)] |
10 | #![allow(dead_code)] | |
11 | ||
12 | ||
13 | //~^ ERROR unused extern crate | |
14 | ||
15 | use edition_lint_paths as bar; | |
16 | //~^ ERROR `extern crate` is not idiomatic in the new edition | |
17 | ||
18 | fn main() { | |
19 | // This is not considered to *use* the `extern crate` in Rust 2018: | |
20 | use edition_lint_paths::foo; | |
21 | foo(); | |
22 | ||
23 | // But this should be a use of the (renamed) crate: | |
24 | crate::bar::foo(); | |
25 | } | |
26 |