fork/rust
git clone https://git.julia.blue/fork/rust
73528e339aa
1.40.0
1// aux-build:edition-lint-paths.rs 2// run-rustfix 3// compile-flags:--extern edition_lint_paths 4// edition:2018 5 6// The "normal case". Ideally we would remove the `extern crate` here, 7// but we don't. 8 9#![deny(rust_2018_idioms)] 10#![allow(dead_code)] 11 12 13//~^ ERROR unused extern crate 14 15// Shouldn't suggest changing to `use`, as `bar` 16// would no longer be added to the prelude which could cause 17// compilation errors for imports that use `bar` in other 18// modules. See #57672. 19extern crate edition_lint_paths as bar; 20 21fn main() { 22 // This is not considered to *use* the `extern crate` in Rust 2018: 23 use edition_lint_paths::foo; 24 foo(); 25 26 // But this should be a use of the (renamed) crate: 27 crate::bar::foo(); 28}