-
Notifications
You must be signed in to change notification settings - Fork 1.7k
panic [index out of bounds] at clippy_lints/src/misc_early.rs:413:38 #4480
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
Comments
cc @lzutao It seems that the index calculation for the suffix separation position can be wrong in some cases: rust-clippy/clippy_lints/src/misc_early.rs Lines 411 to 413 in a3fcaee
Would it be possible for you to extract a reproducible example? |
I know very little about proc-macro. I submitted the fix in #4486. Hopefully |
@imp Can you checkout the fix in #4486? Steps to do this:
After that report back if this fixed the ICE. |
Yep, I can confirm that the fix doesn't panic! Thanks a lot! |
Nice, in that case, we can merge it. |
Fix index out of bound in case of empty snippet cc #4480 changelog: none
Starting about a week ago we are hitting panic when running clippy on one of our crates
thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 18446744073709551612', src/tools/clippy/clippy_lints/src/misc_early.rs:413:38
I would guess c1a4b26 may have something to do with it as the code in question appeared in this commit about same time.
Unfortunately the crate that fails to clippy is private (and really large), so I am not able to share it as an example for panic reproduction.
The text was updated successfully, but these errors were encountered: