fix(ops): correct error messages for cargo fix --broken-code#16681
fix(ops): correct error messages for cargo fix --broken-code#16681raushan728 wants to merge 1 commit intorust-lang:masterfrom
Conversation
|
r? @ehuss rustbot has assigned @ehuss. Use Why was this reviewer chosen?The reviewer was selected based on:
|
3973cf9 to
68ced81
Compare
|
r? epage |
|
A couple of quick notes
|
|
thanks for the review @epage
Happy to iterate on this! |
Thats the intention of that label: it needs that design work done.
I'm less concerned about the number of PRs and more about this closing the Issue without fully resolving it
shell notes, warns, etc
See our contrib docs: https://doc.crates.io/contrib/implementation/console.html |
|
thanks for docs @epage
this should fully resolve both example from the issue. will push update soon! |
68ced81 to
8c3c403
Compare
|
ready for re-review @epage |
|
I realized there were some misunderstandings on both our parts on this code and am working through some prep PRs to help straighten that out |
tests/testsuite/fix_n_times.rs
Outdated
| Note that you may be able to make some more progress in the near-term | ||
| fixing code with the `--broken-code` flag | ||
|
|
||
| [WARNING] could not apply fixes; the code is already in a broken state. consider using `--broken-code` to save partial progress |
There was a problem hiding this comment.
This error does not look like the case in Example 2. Are we sure we have the right situation?
There was a problem hiding this comment.
Are we no longer addressing Example 2?
src/cargo/util/diagnostic_server.rs
Outdated
| self.gctx.shell().warn( | ||
| "could not apply fixes; the code is already in a \ | ||
| broken state. broken code was saved as requested \ | ||
| with `--broken-code`", | ||
| )?; |
There was a problem hiding this comment.
I don't think this message is accurate. It looks like the fixes are applied but we want to report that it still fails
### What does this PR try to resolve? Instead of printing a warning as a - a warning - many individual blocks of text this switches us to print it all as a single warning. This will make it easier to adapt to annotate-snippets in the future (work is in progress). This was noticed while reviewing #16681 which led us down the wrong path there. ### How to test and review this PR?
This comment has been minimized.
This comment has been minimized.
bcf4239 to
dffe9cf
Compare
This comment has been minimized.
This comment has been minimized.
|
Hey @epage, conflict resolved i have also updated the warning message wording and fixed the fix_n_times test assertions based on your feedback (Note: The current CI failures seem to be unrelated nightly script breakages) |
A review was requested my I don't think my comments were addressed |
This comment has been minimized.
This comment has been minimized.
|
#16711 is now merged and it is safe to rebase |
dffe9cf to
23ac6a1
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@epage sry about the confusion earlier i had a git mix-up pushed the stashed code yest. i just rebased. ur previous feedback now addressed
|
Fixes #10955
Updates the error message when
cargo fixapplies suggestions but the code still fails to compile.--broken-codeif the flag is already passed.