-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 type parameter
Self/#0 (Self/0) out of range when substituting, substs=[]
on November 30th nightly
#10021
Comments
Tpt
added
C-bug
Category: Clippy is not doing the correct thing
I-ICE
Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
labels
Dec 1, 2022
smoelius
added a commit
to smoelius/rust-clippy
that referenced
this issue
Dec 3, 2022
Merged
bors
added a commit
that referenced
this issue
Dec 4, 2022
Fix 10021 This PR proposes a fix for #10021. The problem is similar to the one that `@mikerite` described in #9505. The compiler is generating an empty substitution for a call, even though the type of `Self` seems to be needed for a predicate. In `@mikerite's` case, the call was to [`IntoFuture::into_future`](https://doc.rust-lang.org/std/future/trait.IntoFuture.html#tymethod.into_future). In this case, the call is to [`Try::branch`](https://doc.rust-lang.org/std/ops/trait.Try.html#tymethod.branch). The proposed fix is to verify that the parameter whose type is changing has an index within the substitution. The strikes me as a reasonable approach, since if the check were to fail, the following code would be a no-op: https://github.com/rust-lang/rust-clippy/blob/4c123a06ba3c2ec17d3a4dfa251dccdc5368b712/clippy_lints/src/methods/unnecessary_to_owned.rs#L420-L428 Like `@mikerite's` original solution, this solution turns ICEs into false negatives. changelog: fix `unnecessary_to_owned` false positive involving `Try::branch`
flip1995
pushed a commit
to flip1995/rust-clippy
that referenced
this issue
Dec 17, 2022
bors
added a commit
that referenced
this issue
Dec 29, 2023
Remove mitigations for incorrect node args This change https://github.com/rust-lang/rust/pull/118420/files#r1419874371 adds a missing `write_args` to properly record node args for lang-item calls. Thus, in the `unnecessary_to_owned` lint, this ensures that the `call_generic_args` extracted by `get_callee_generic_args_and_args` are always correct, and we can remove the mitigation for #9504 and #10021 since the root cause has been fixed. I'm not sure if there is other now-unnecessary code that can be removed, but this is the one I found when investigating #11965 (comment). changelog: none
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
First, thank you so much for the Clippy team for your amazing work.
Sadly, it seems #9505 has not fixed the error in all cases. When running clippy using November 30th nightly I still get the error on this repository.
To reproduce:
git clone https://github.com/oxigraph/rio cd rio cargo +nightly clippy
This is maybe a duplicate of #9675
Feel free to reach out if you need help.
Version
Error output
Backtrace
The text was updated successfully, but these errors were encountered: