-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove extern crate
when migrating to Rust 2018
#52829
Labels
A-edition-2018
Area: The 2018 edition
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
F-rust_2018_preview
`#![feature(rust_2018_preview)]`
Milestone
Comments
This was referenced Aug 24, 2018
I'm moving this forward up on the milestone list due to just having closed #52451 in favor of this issue, which was itself on the RC milestone. |
Ok so I've some triaging of
I'm testing out some ideas locally as well. |
I believe this should be fixed by #53684, I think the naive solution actually works well! |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Aug 27, 2018
This commit updates the `unused_extern_crates` lint to make automatic suggestions about removing `extern crate` annotations in the 2018 edition. This ended up being a little easier than originally though due to what's likely been fixed issues in the resolver! Closes rust-lang#52829
Mark-Simulacrum
added a commit
to Mark-Simulacrum/rust
that referenced
this issue
Aug 28, 2018
rustc: Suggest removing `extern crate` in 2018 This commit updates the `unused_extern_crates` lint to make automatic suggestions about removing `extern crate` annotations in the 2018 edition. This ended up being a little easier than originally though due to what's likely been fixed issues in the resolver! Closes rust-lang#52829
bors
added a commit
that referenced
this issue
Aug 29, 2018
rustc: Suggest removing `extern crate` in 2018 This commit updates the `unused_extern_crates` lint to make automatic suggestions about removing `extern crate` annotations in the 2018 edition. This ended up being a little easier than originally though due to what's likely been fixed issues in the resolver! Closes #52829
This was referenced Dec 3, 2018
fmease
added
A-edition-2018
Area: The 2018 edition
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
and removed
A-edition-2018-lints
labels
Dec 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-edition-2018
Area: The 2018 edition
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
F-rust_2018_preview
`#![feature(rust_2018_preview)]`
Migrated from rust-lang/cargo#5829
It's been mentioned/requested multiple times on the internals thread that
cargo fix
should remove theextern crate
statements when moving to Rust 2018.Motivation
One of the big draws of Rust 2018's module system is that all of the "redundant"
extern crate
lines can finally be removed. It took some of the excitement away when I went through all of thecargo fix
steps and still saw them there. I think it will just be a better experience for users to see one of the tangible benefits of this change. As it is right now, they just see thecrate::
in front of all of their local imports and they might not realize what a nice change the module system updates really are.After I manually removed the
extern crate
's I did get my satisfying result 😄, but let's give this to users on the first go around.Implementation
If I understand correctly this should be implemented in the compiler under the
#![warn(rust_2018_idioms)]
lints, rather thancargo fix
itself.cc @alexcrichton
The text was updated successfully, but these errors were encountered: