Poor error messages with cargo fix
with broken code
#10955
Labels
A-diagnostics
Area: Error and warning messages generated by Cargo itself.
Command-fix
S-triage
Status: This issue is waiting on initial triage.
There are two related issues with error messages generated with
cargo fix
when the code starts in a broken state.Example 1
If the code starts with both an error, and suggestion diagnostics,
cargo fix --broken-code
prints a large message that tells you there is a bug and to use--broken-code
. That is not a good suggestion since the user is already using--broken-code
, and there isn't a bug.results in:
If the first pass running
rustc
fails, then I don't think PLEASE_REPORT_THIS_BUG should be displayed. Instead, a different error message should be used to explain that the code is starting in a broken state andcargo fix
cannot handle this. This message may need to be customized whether or not--broken-code
is used.Example 2
Similar to above, if the code does not have any suggestions, and is a broken state, then it displays a relatively terse output.
cargo fix
displays (with or without--broken-code
):I think in this situation, it might be good to display some kind of message explaining that the code is starting in a broken state and that
cargo fix
needs to start with passing code. This message may need to be customized based on whether--broken-code
is used.Notes
These two examples may have the same solution.
A closely related issue is #8806 where Cargo does not tell you that non-machine-applicable suggestions aren't applied. This can cause confusion as to why suggestions aren't being applied, even with
--broken-code
.Meta
The text was updated successfully, but these errors were encountered: