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

[beta] fix: Don't back out changes with --broken-code #6316

Merged
merged 1 commit into from
Nov 14, 2018

Conversation

alexcrichton
Copy link
Member

This is a beta backport of #6312

This commit updates the behavior of `cargo fix` when the `--broken-code`
flag is passed to Cargo. Previously Cargo would always back out
automatically applied changes to files whenever the fixed code failed to
compile. Now, with the `--broken-code` flag, fixed code is left as-is.
This means that if the fixed code can be more easily inspected by
humans to detect bugs and such.

The main use case intended here is that if you're working with a large
code base then lints like the edition idiom lints aren't 100% finished
yet to work as smoothly as `cargo fix`. The idiom lints are often
useful, however, to transition code to be idiomatic (who would have
guessed!) in the new edition.

To ease the experience of using not-quite-ready lints this flag can be
used to hopefully "fix 90% of lint warnings" and then the remaining
compiler errors can be sifted through manually. The intention is that we
have edition documentation indicating this workflow which also
encourages filing bugs for anything that fails to fix, and hopefully
this new behavior will make it easier for us to narrow down what the
minimal test case is too!
@alexcrichton
Copy link
Member Author

@bors: r+

@bors
Copy link
Contributor

bors commented Nov 14, 2018

📌 Commit 3e746ae has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Nov 14, 2018

⌛ Testing commit 3e746ae with merge c1c6ce5f78287ae234fbaeb7de445417cf6575e6...

@bors
Copy link
Contributor

bors commented Nov 14, 2018

💔 Test failed - status-appveyor

@dwijnand
Copy link
Member

@bors: retry

@bors
Copy link
Contributor

bors commented Nov 14, 2018

⌛ Testing commit 3e746ae with merge 569507e...

bors added a commit that referenced this pull request Nov 14, 2018
[beta] fix: Don't back out changes with `--broken-code`

This is a beta backport of #6312
@bors
Copy link
Contributor

bors commented Nov 14, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 569507e to rust-1.31.0...

@bors bors merged commit 3e746ae into rust-lang:rust-1.31.0 Nov 14, 2018
@ehuss ehuss added this to the 1.31.0 milestone Feb 6, 2022
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

Successfully merging this pull request may close these issues.

4 participants