-
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 when running on rustc sync-send-iterators-in-libcollections.rs #3144
Comments
I think this is a |
There was a similar issue that was moved from rustc to clippy |
Yes it seems to be the same error again as in #2580. |
Woops, #2831 fell under my radar. Both seem type inference related. |
This is a different issue than #2831, but it seems to work on the playground now: https://play.rust-lang.org/?gist=c285598e88463061408310dddd738b41&version=nightly&mode=debug&edition=2018 |
So, this doesn't crash anymore it seems. In order to close the issue, it would be good to add a regression test to our run-pass suite. If someone want's to pick this up as their first issue, I'm happy to write some more instructions if needed. |
@phansch it's still crashing for me :/ |
@matthiaskrgr huh, weird. In the playground it's not crashing for me: I will try it out locally later today |
My guess is it crashes on a lint that is not enabled by default and thus seems to work on playground. |
Now I can make it crash locally, just not in the playground. It also crashes if I have allowed all Clippy lints, so I think the cause is somewhere in the glue between Clippy and Rust. Maybe an incorrect configuration somewhere? I managed to reduce the code a bit further: use std::collections::HashSet;
fn is_sync<T>(_: T) where T: Sync {}
fn main() {
is_sync(HashSet::<usize>::new());
} It's probably also worth investigating why it doesn't crash on play.rust-lang.org. I will start with that tomorrow. (This was at 3971c42) |
One more thing I want to check: cargo new i3144
tee i3144/src/main.rs << END
use std::collections::HashSet;
fn is_sync<T>(_: T) where T: Sync {}
fn main() {
is_sync(HashSet::<usize>::new());
}
END
cd i3144
cargo clippy |
Mh yeah, I am getting that too. It crashes when directly running clippy-driver on it, but does not when running |
So the playground is probably using I experimented with |
I was now able to to isolate the cause by commenting out the various late lint passes. Although it doesn't show up in the backtrace, it seems to be caused somewhere in the |
Some more progress. The ICE is triggered from this invocation of rust-clippy/clippy_lints/src/needless_pass_by_value.rs Lines 188 to 196 in 4259377
The full and exact error message is: failed to lift:
canonicalized from:
which is emitted here: https://github.com/rust-lang/rust/blob/710ddc151baf9750e074229b8bdc794d63246eb8/src/librustc/infer/canonical/canonicalizer.rs#L481-L486 |
Fix ICE in needless_pass_by_value lint If I understand it correctly, we were first creating a type with a `RegionKind::ReErased` region and then deleted it again in `util::implements_trait` with: cx.tcx.erase_regions(&ty); causing the type query to fail. It looks like using `ReEmpty` works around that deletion. Fixes #3144
File https://github.com/rust-lang/rust/blob/master/src/test/run-pass/sync-send-iterators-in-libcollections.rs
reduced:
backtrace:
clippy 63a46b1
Found via #3142
The text was updated successfully, but these errors were encountered: