Make suggestion include the line number when the suggestion span is ambiguous #39152
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given a diagnostic builder using
span_label
s with the following output:If it is changed to use
span_suggestion
s (as I believe is the intention going forward), I see a couple of problems:The span being replaced in the suggestion is not part of the main body of the diagnostic and the line number where the change is suggested is not present. Because of this, it obscures where the suggested code should be written. This is exacerbated by the out of order presentation.
There're a few possible solutions:
span_suggestion
contains a span not in the main body or there're more than onespan_label
s in the diagnostic, show the line numberThe text was updated successfully, but these errors were encountered: