-
Notifications
You must be signed in to change notification settings - Fork 13.3k
regression: ICE - byte index is not a char boundary #111485
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@Nilstrieb this seems like another indoc ICE like #106191...? Kinda minimal repro (the bytes matter quite a lot, so e.g., renaming use indoc::formatdoc;
fn main() {
let x = formatdoc! {
r#"━━━━━━━━
│ {a} {d}
│
│ {longish_name} {c}
'{e}'
"#
, a = "".to_string()
, longish_name = "".to_string()
, c = "".to_string()
, d = "".to_string()
, e = "".to_string()
};
} |
Actually, upon bisection, this seems to have regressed in @m-ou-se's #109664. searched nightlies: from nightly-2023-01-01 to nightly-2023-05-13 |
relevant part of the stack trace from a debug+unoptimized build of rustc:
|
Running fn main() {
indoc::formatdoc! {
r#"abcabcabcabcabcabcabcab
abcde
abcdefghij
abc {cc}
"#,
cc = "".to_string(),
};
} gives a tree that contains
even though line 5 is the line with That span is used for the Before #109664, it used the span of the So, the span of In cases where that span was already used, such as for diagnostics/errors (e.g. when you replace |
The reason that that mir code is trying to access the source code underneath the span at all is because it tries to create a span of the |
So, the short term workaround is to make |
Doing that in #111560 |
…r=cjgillot Simplify find_width_of_character_at_span. This makes `find_width_of_character_at_span` simpler and more robust against bad spans. Fixes (but does not close, per beta policy) rust-lang#111485
…r=cjgillot Simplify find_width_of_character_at_span. This makes `find_width_of_character_at_span` simpler and more robust against bad spans. Fixes (but does not close, per beta policy) rust-lang#111485
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-medium |
Closing as fixed, #111560 is merged and backported. |
https://crater-reports.s3.amazonaws.com/beta-1.70-2/beta-2023-05-08/reg/aiken-1.0.4-alpha/log.txt
The text was updated successfully, but these errors were encountered: