-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ICE: Broken MIR #72651
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
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. |
Uh oh!
There was an error while loading. Please reload this page.
EDIT: Here's MCVE: #72651 (comment)
Error:
Reproduce:
The text was updated successfully, but these errors were encountered: