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 // Shouldn't suggest changing to `use`, as new name 9 // would no longer be added to the prelude which could cause 10 // compilation errors for imports that use the new name in 11 // other modules. See #57672. 12 extern crate core as iso1; 13 extern crate core as iso2; 14 extern crate core as iso3; 15 extern crate core as iso4; 16 17 // Doesn't introduce its extern prelude entry, so it's still considered unused. 18 extern crate core; //~ ERROR unused extern crate 19 20 mod m { 21 use iso1::any as are_you_okay1; 22 use ::iso2::any as are_you_okay2; 23 type AreYouOkay1 = dyn iso3::any::Any; 24 type AreYouOkay2 = dyn (::iso4::any::Any); 25 26 use core::any as are_you_okay3; 27 use ::core::any as are_you_okay4; 28 type AreYouOkay3 = dyn core::any::Any; 29 type AreYouOkay4 = dyn (::core::any::Any); 30 } 31 main()32fn main() {} 33