]> git.lizzy.rs Git - rust.git/blob - src/test/ui/imports/extern-crate-used.rs
Auto merge of #55780 - ogoffart:span_source_text, r=petrochenkov
[rust.git] / src / test / ui / imports / extern-crate-used.rs
1 // Extern crate items are marked as used if they are used
2 // through extern prelude entries introduced by them.
3
4 // edition:2018
5
6 #![deny(unused_extern_crates)]
7
8 extern crate core as iso1; //~ ERROR `extern crate` is not idiomatic in the new edition
9 extern crate core as iso2; //~ ERROR `extern crate` is not idiomatic in the new edition
10 extern crate core as iso3; //~ ERROR `extern crate` is not idiomatic in the new edition
11 extern crate core as iso4; //~ ERROR `extern crate` is not idiomatic in the new edition
12
13 // Doesn't introduce its extern prelude entry, so it's still considered unused.
14 extern crate core; //~ ERROR unused extern crate
15
16 mod m {
17     use iso1::any as are_you_okay1;
18     use ::iso2::any as are_you_okay2;
19     type AreYouOkay1 = iso3::any::Any;
20     type AreYouOkay2 = ::iso4::any::Any;
21
22     use core::any as are_you_okay3;
23     use ::core::any as are_you_okay4;
24     type AreYouOkay3 = core::any::Any;
25     type AreYouOkay4 = ::core::any::Any;
26 }
27
28 fn main() {}