Code change:
<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![deny(unnecessary_extern_crate)] #![feature(alloc, test, libc)] extern crate alloc; //~^ ERROR `extern crate` is unnecessary in the new edition //~| HELP remove extern crate alloc as x; //~^ ERROR `extern crate` is unnecessary in the new edition //~| HELP use `use` #[macro_use] extern crate test; pub extern crate test as y; //~^ ERROR `extern crate` is unnecessary in the new edition //~| HELP use `pub use` pub extern crate libc; //~^ ERROR `extern crate` is unnecessary in the new edition //~| HELP use `pub use` mod foo { extern crate alloc; //~^ ERROR `extern crate` is unnecessary in the new edition //~| HELP use `use` extern crate alloc as x; //~^ ERROR `extern crate` is unnecessary in the new edition //~| HELP use `use` pub extern crate test; //~^ ERROR `extern crate` is unnecessary in the new edition //~| HELP use `pub use` pub extern crate test as y; //~^ ERROR `extern crate` is unnecessary in the new edition //~| HELP use `pub use` mod bar { extern crate alloc; //~^ ERROR `extern crate` is unnecessary in the new edition //~| HELP use `use` extern crate alloc as x; //~^ ERROR `extern crate` is unnecessary in the new edition //~| HELP use `use` } } fn main() {} </ins>

Related discussion:
text: We need to add an epoch lint for It will lint , suggesting removal in root mods, and replacement with in non-root mods. This is blocked on the ability to elide extern crate in the first place.
It is also blocked on a feature to force linkage of a crate, see this comment and the discussion afterwards:
cc
I think the lint should be by default off in cases with , such as: This is because of the ergonomics problems with macros and the new macro import system, expressed here: It's bewildering for the migrating users if a lint tells them not to use the syntax, but then finding out that many of the macros out there have downright bad ergonomics with the import syntax. (For clarification: I think this is an undesirable state of affairs, and we should be linting against all , but if we do that, the ergonomics problem with the macro import should be fixed somehow.)
I don't think we want at all, really. If we want to import macros, we should have another means of doing it. Otherwise we have an inconsistency. So yes, I think I agree with your last paragraph above all,
I've discussed this a bit in the tracking issue for the macros import system:
Thanks, you expressed the exact concern I had in a concise way.
Another thing this needs to lint is unlisted crates that are included in that clash with existing modules. I'm not quite sure on what the story needs to be here cc
Does it? I've thought one of the things the path clarity RFC was about was to have separate namespaces for top level modules and extern crates.
The current plan has changed a bit so I'm not sure if that is still true. (If stuff does change it will probably be RFCd again, there's a bit of experimentation going on)
Sigh I hope we won't discuss all of this crap all over again... I don't enjoy that but it is not me who wants to change things.
I've hidden your last comment, which I found hostile and unconstructive.
IDK what has been hearing, but for me, this is the latest state of consensus on that issue, and it seems to have separate namespaces: is that the case? You seem unresponsive on IRC that's why I'm using github.
That's mostly the latest state of consensus, yeah. Some tweaks have been made iirc. Everything has been implemented.