-
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
…
in comment cause unexpected rustc panic
#61226
Comments
Regressed in 1.34.0. Used to be:
|
Miminized: struct X {}
fn f() {
X; //…
} Probably some span handcrafting? |
+1 |
I was idly curious, so I took a brief look at this. The diagnostic that triggers this was introduced in #57725, but I don't think it is responsible for the error (it's just stepping through characters looking for a closing brace). There is some strange math in
Starting with a span of (0,1), using I'm not familiar enough with this stuff to say how it should behave. It seems like |
triage: P-medium, removing nomination; the ICE to me appears to include enough information for a user to identify the offending character and work-around the problem (namely by getting rid of the character). I do agree with @ehuss that there should probably be two distinct functions corresponding to the two distinct purposes that they identified for the current callers of |
More test cases have been brought up in #63444 |
Do not ICE when synthesizing spans falling inside unicode chars Fix rust-lang#61226.
I guess this is the same bug, but the examples I've seen here concern non-ASCII characters in comments. I'm getting a similar rustc panic from an erroneous code without comments: main.rs: struct TestStruct {
my_str: String
}
fn main() {
let x = TestStruct("ä");
} Compilation attempt:
|
@miikkas Please file a new issue and reference this one. |
I think it's fixed, try |
When I used the character
…
in comment, combined with some (invalid) code preceding it, the compiler panicked.I tried this code:
I expected to see this happen: rustc compiles this code.
Instead, this happened: rustc panicked with the following output
Meta
rustc --version --verbose
:Backtrace:
The text was updated successfully, but these errors were encountered: