Skip to content

Rust 2018: cargo fix doesn't remove extern crate #53922

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

Closed
Procrat opened this issue Sep 3, 2018 · 2 comments
Closed

Rust 2018: cargo fix doesn't remove extern crate #53922

Procrat opened this issue Sep 3, 2018 · 2 comments

Comments

@Procrat
Copy link

Procrat commented Sep 3, 2018

From what I read in the edition guide, extern crate is now redundant. cargo fix didn't remove these statements however, causing the following two errors after switching to Rust 2018 (with uniform paths):

error: `chrono` import is ambiguous
  --> src/...
   |
5  | extern crate chrono;
   | -------------------- can refer to `self::chrono`
...
47 | use chrono::prelude::*;
   |     ^^^^^^ can refer to external crate `::chrono`
   |
   = help: write `::chrono` or `self::chrono` explicitly instead
   = note: relative `use` paths enabled by `#![feature(uniform_paths)]`

The second error I got feels like it should have been a warning:

error: `take_mut` import is redundant
 --> src/...
  |
8 | use take_mut;
  |     ^^^^^^^^
  |     |
  |     refers to external crate `::take_mut`
  |     defines `self::take_mut`, shadowing itself
  |
  = help: remove or write `::take_mut` explicitly instead
  = note: relative `use` paths enabled by `#![feature(uniform_paths)]`

cargo fix should probably also remove these redundant use statements?

Given some pointers, I'm happy to take a look at both/either this issue and/or the other one I filed!

@zackmdavis
Copy link
Member

Duplicate of #53797: I just left a comment with implementation hints there.

@alexcrichton
Copy link
Member

Indeed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants