-
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: Broken MIR #72651
Comments
72105 has been fixed but I'm still getting a rustc ICE when checking with
|
I've created an MCVE. Seems it's related to borrowing the pattern variable in the match guard after an fn main() {}
struct StructA {}
struct StructB {}
impl StructA {
fn fn_taking_struct_b(&self, struct_b: &StructB) -> bool {
true
}
}
async fn get_struct_a_async() -> StructA {
StructA {}
}
async fn ice() {
match Some(StructB {}) {
Some(struct_b) if get_struct_a_async().await.fn_taking_struct_b(&struct_b) => {}
_ => {}
}
}
|
Assigning |
A smaller MVCE is in #74961 (comment): async fn some_future() -> u8 { 1 }
pub async fn bad_mir(x: u8) {
match x {
y if some_future().await == y => (),
_ => (),
}
} |
So in our call today we dug into this (will post video later). I'm pretty sure that the problem is this:
This may or may not be what https://github.com/rust-lang/rust/pull/75213/files is doing, we didn't read it quite deeply enough to tell, but it seems like it might be a bit simpler. |
EDIT: Here's MCVE: #72651 (comment)
Error:
Reproduce:
The text was updated successfully, but these errors were encountered: