mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
79935714f3
Fix `non-constant value` ICE (#90878) This also fixes the same suggestion, which was kind of broken, because it just searched for the last occurence of `const` to replace with a `let`. This works great in some cases, but when there is no const and a leading space to the file, it doesn't work and panic with overflow because it thought that it had found a const. I also changed the suggestion to only trigger if the `const` and the non-constant value are on the same line, because if they aren't, the suggestion is very likely to be wrong. Also don't trigger the suggestion if the found `const` is on line 0, because that triggers the ICE. Asking Esteban to review since he was the last one to change the relevant code. r? ``@estebank`` Fixes #90878 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |