Skip to content

Remove extern crate when migrating to Rust 2018 #52829

Closed
@johnthagen

Description

@johnthagen

Migrated from rust-lang/cargo#5829

It's been mentioned/requested multiple times on the internals thread that cargo fix should remove the extern 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 the cargo 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 the crate:: 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 than cargo fix itself.

cc @alexcrichton

Metadata

Metadata

Assignees

Labels

A-edition-2018Area: The 2018 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.F-rust_2018_preview`#![feature(rust_2018_preview)]`

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions