Skip to content
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

rustc: Suggest removing extern crate in 2018 #53684

Merged
merged 1 commit into from
Aug 29, 2018

Conversation

alexcrichton
Copy link
Member

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

@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 24, 2018
@Mark-Simulacrum
Copy link
Member

Could we add a test for when the crate is used only through macros, both in the use core::some_macro and the some_macro! with no import sense? I believe that some code at least handles that case separately, and recall different error messages, so would be good to check that we don't emit overlapping lints or anything like that.

@oli-obk
Copy link
Contributor

oli-obk commented Aug 25, 2018

r=me with @Mark-Simulacrum 's tests

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
@alexcrichton
Copy link
Member Author

Good idea @Mark-Simulacrum! While the resulting code isn't fantastic, it's reasonable in the sense it produces no warnings. I'll file a follow-up issue.

@bors: r=oli-obk

@bors
Copy link
Contributor

bors commented Aug 27, 2018

📌 Commit 51fd3bf has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2018
@alexcrichton
Copy link
Member Author

I've filed #53741 as a follow-up

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request 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
Copy link
Contributor

bors commented Aug 29, 2018

⌛ Testing commit 51fd3bf with merge f4e981c...

bors added a commit that referenced this pull request 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
@bors
Copy link
Contributor

bors commented Aug 29, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: oli-obk
Pushing f4e981c to master...

@bors bors merged commit 51fd3bf into rust-lang:master Aug 29, 2018
@alexcrichton alexcrichton deleted the suggest-remove branch August 29, 2018 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove extern crate when migrating to Rust 2018
5 participants