]> git.lizzy.rs Git - rust.git/commit
Auto merge of #51015 - nikomatsakis:issue-50672-remove-extern-crate-idiom, r=alexcrichton
authorbors <bors@rust-lang.org>
Sat, 2 Jun 2018 11:14:14 +0000 (11:14 +0000)
committerbors <bors@rust-lang.org>
Sat, 2 Jun 2018 11:14:14 +0000 (11:14 +0000)
commit1b3d737716a4ae40709da627fc3e726ce539e405
treead107f9ca290c0affa0925c015054904bbd76717
parent2954cb511922173b714aa930f6bd1721d40fa02d
parentb37cc851e65bd018556ccf7fc2cba1c7647b08db
Auto merge of #51015 - nikomatsakis:issue-50672-remove-extern-crate-idiom, r=alexcrichton

merge unused-extern-crate and unnecessary-extern-crate lints

Extend the `unused_extern_crates` lint to offer a suggestion to remove the extern crate and remove the `unnecessary_extern_crate` lint.

Still a few minor issues to fix:
- [x] this *does* now leave a blank line... (defer to https://github.com/rust-lang/rust/issues/51176)
  - idea: extend the span to be replaced by 1 character if the next character is a `\n`
- [x] what about macros? do we need to watch out for that? (defer to https://github.com/rust-lang/rust/issues/48704)
- [x] also it doesn't work for `extern crate foo; fn main() { foo::bar(); }`
  - this is subtle: the `foo` might be shadowing a glob import too, can't always remove
  - defer to https://github.com/rust-lang/rust/issues/51177
- [x] we also don't do the `pub use` rewrite thang (https://github.com/rust-lang/rust/issues/51013)

Spun off from https://github.com/rust-lang/rust/pull/51010

Fixes #50672

r? @alexcrichton
src/librustc/ty/mod.rs