-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Fix ICE from zero-length span when suggesting to remove trailing semi-colon from final statement in block #118953
Fix ICE from zero-length span when suggesting to remove trailing semi-colon from final statement in block #118953
Conversation
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
3637fb4
to
03d5cea
Compare
@rustbot label -S-waiting-on-review +S-waiting-on-author |
03d5cea
to
4ba9f66
Compare
@rustbot review |
On the original issue, you wrote:
Should this be fixed by changing the spans that appears in the |
Seeing this just now. |
Ok, I wasn't sure if it was out of scope for this PR and/or if it intentional for some reason, and as I could solve this by reusing a pattern already used in other places for diagnostics in HIR I thought reusing that pattern instead of making major changes was a safer idea. Would you prefer if I submitted the fixes for this inside this PR or opened a new one? |
ping @cjgillot for a pending question in this comment. Thanks. |
This PR if the fix is very close to the current code. |
I guess the above comment should qualify this PR back to the author @rustbot author |
Ping from triage: I'm closing this due to inactivity, Please reopen when you are ready to continue with this. @rustbot label: +S-inactive |
This fixes #114251
The span for the suggestion of removing the semi-colon from the final statement in a block was constructed with zero-length, resulting in an ICE when debug-assersions were enabled.
This PR fixes that by ensuring that the span covers the semi-colon and isn't just zero-length.
It includes a regression test.
🖤