-
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: None
in compiler/rustc_mir_build/src/build/matches/mod.rs
#119786
Comments
This is really weird, it only happens when the binding is a keyword..., is the PR doing recovery incorrectly? |
@Nilstrieb: It's recovering the keyword as a wildcard. This also ICEs, probably doesn't bisect to that PR but before it: #![feature(type_alias_impl_trait)]
fn enum_upvar() {
type T = impl Copy;
let foo: T = Some((1u32, 2u32));
let x = move || {
match foo {
None => (),
Some(_) => (),
}
};
} |
Haha, I was trying to properly minimize this to be able to properly bisect it and turned it into an ident pattern which was fine, it didn't occur to me that it would recover to a wildcard :D. |
None
in as_place.rsNone
in compiler/rustc_mir_build/src/build/matches/mod.rs
#119786 (comment) this Regression in nightly-2022-03-31 fetching (via remote github) commits from max(9c06e1b, 2022-03-28) to c5cf08d |
Fun fact: this is edition-specific. Works on 2018, ICEs on 2021. |
The bug is due to a rust/compiler/rustc_mir_build/src/build/matches/match_pair.rs Lines 95 to 107 in 3811f40
|
@Nadrieril: There's also a fair chance this has to do not with mir building, but with capture analysis. I've observed that |
Especially so because this is 2021-edition dependent, so something may be wrong with the edition 2021 precise closure capturing logic. |
the fact that this crashes in 2021 is probably related to 2021 closure capture edit https://doc.rust-lang.org/edition-guide/rust-2021/disjoint-capture-in-closures.html ? |
I really dislike the opaque type cast projection. I mean, I wrote it, but everything needed to carefully be tuned around it. It may just be easier to rip it out and instead reject these code patterns with opaques |
snippet:
Version information
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc --edition=2021
Program output
The text was updated successfully, but these errors were encountered: