Skip to content

cargo fix: Prevent fixing in mixed up transition steps #5778

@alexcrichton

Description

@alexcrichton

A common problem we're seeing in the 2018 transition is that steps are performed out of order, rendering cargo fix not too useful any more! I think we should implement two important fixes in cargo fix to remedy the situation:

  • First, Cargo should be able to deduce a set of "interesting crates" which are actually being fixed. This is driven by the -p arguments on the command line.
  • Next, if these crates have the 2018 edition enabled and --prepare-for is passed, then an error is generated. You can't prepare for an edition if you're already in the 2018 edition!
  • And finally, if the crate is compiled but doesn't have #![feature(rust_2018_preview)] inside it then we should either warn or fail compilation.

This should hopefully fix the bugs of "you enabled the edition too early" or "you forgot to enable the feature gate"!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions