]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rust-2018/extern-crate-idiomatic-in-2018.fixed
Rollup merge of #62351 - RalfJung:drop-in-place, r=cramertj
[rust.git] / src / test / ui / rust-2018 / extern-crate-idiomatic-in-2018.fixed
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.
19 extern crate edition_lint_paths as bar;
20
21 fn 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 }