-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
ICE: attempt to subtract with overflow, compiler/rustc_errors/src/lib.rs:348:47 #89280
Comments
This is from a diagnostic constructed in a pre-expansion pass. Maybe this has something to do with the ICE |
I'm able to reproduce this by running trait X {
fn test(x: u32, (
)) {}
}
fn main() {} And it needs |
I thought this had been solved by a recent @oli-obk PR :( |
No, I just avoided a malformed span that was hitting the same ICE The ICE itself will occur for any multi line span where the end is to the left of the start: #89046 (comment) |
…ultiple-lines, r=oli-obk emitter: current substitution can be multi-line Fixes rust-lang#89280. In `splice_lines`, there is some arithmetic to compute the required alignment such that future substitutions in a suggestion are aligned correctly. However, this assumed that the current substitution's span was only on a single line. In circumstances where this was not true, it could result in a arithmetic overflow when the substitution's end column was less than the substitution's start column. r? `@oli-obk`
…ultiple-lines, r=oli-obk emitter: current substitution can be multi-line Fixes rust-lang#89280. In `splice_lines`, there is some arithmetic to compute the required alignment such that future substitutions in a suggestion are aligned correctly. However, this assumed that the current substitution's span was only on a single line. In circumstances where this was not true, it could result in a arithmetic overflow when the substitution's end column was less than the substitution's start column. r? ``@oli-obk``
…ultiple-lines, r=oli-obk emitter: current substitution can be multi-line Fixes rust-lang#89280. In `splice_lines`, there is some arithmetic to compute the required alignment such that future substitutions in a suggestion are aligned correctly. However, this assumed that the current substitution's span was only on a single line. In circumstances where this was not true, it could result in a arithmetic overflow when the substitution's end column was less than the substitution's start column. r? ```@oli-obk```
Code
Rebase bdb5a5ffe17 over ac8dd1b, then run
x test src/tools/clippy
. I think this is thewrite_literal_2
test.cc @rust-lang/clippy, but I think this is an issue with rustc_errors, not clippy itself.
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: