-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 when pointing at multi bytes character #80185
Conversation
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
Oh, |
0e4ff14
to
f387efb
Compare
So, in rust/compiler/rustc_span/src/source_map.rs Lines 777 to 790 in 8bb302d
I think using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer that we work out how to fix next_point
(or find_width_of_character_at_span
) so that it returns a correct span here. Assuming that sp
is valid (and if it isn't, we should fix that), I'd expect that calling next_point
should always do the correct thing.
src/test/ui/parser/issue-80134.rs
Outdated
@@ -0,0 +1,10 @@ | |||
fn main() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rename this test file to be more descriptive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What the name do you prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multibyte-char-use-seperator-issue-80134.rs
? It's long but I'm trying to avoid landing more tests that are named issue-XXXXX.rs
.
If you don't think there's a more general fix here then I'm happy to land this - I'll approve and r=me after the last comment is resolved :) |
f387efb
to
4ae99cc
Compare
Rebased and applied filename suggestion on review.
I don't have any idea how we could fix it right now, I'm going to r=you for now as the regression would affect rustfix only. Created a Zulip stream for further discussion: https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.60SourceMap.3A.3Anext_point.60.20cannot.20point.20multibyte.20character @bors r=davidtwco |
📌 Commit 4ae99cc has been approved by |
Rollup of 7 pull requests Successful merges: - rust-lang#80185 (Fix ICE when pointing at multi bytes character) - rust-lang#80260 (slightly more typed interface to panic implementation) - rust-lang#80311 (Improvements to NatVis support) - rust-lang#80337 (Use `desc` as a doc-comment for queries if there are no doc comments) - rust-lang#80381 (Revert "Cleanup markdown span handling") - rust-lang#80492 (remove empty wraps, don't return Results from from infallible functions) - rust-lang#80509 (where possible, pass slices instead of &Vec or &String (clippy::ptr_arg)) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #80134
Seems this ICE was introduced by #73953, checking width of span to avoid ICE.