-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
MIR generator compiler panic #52792
Comments
cc @cramertj |
cc @Zoxc |
|
@Zoxc I'm hitting this a lot at the moment-- any idea what the cause might be? I'd love to help get this resolved. |
I'm sometimes able to fix it by moving conditions that |
It also seems to have regressed between a1e6bc and 866a71-- updating the compiler caused this to happen in more places. |
Trying to fix in more places and it looks like it's always related to |
Smaller example: (playground) #![feature(async_await, await_macro, futures_api, arbitrary_self_types, pin)]
use std::sync::{Arc, atomic::{AtomicUsize, Ordering}};
struct Stream;
impl Stream {
async fn next(&mut self) -> Option<()> {
Some(())
}
}
fn main() {
let counter = Arc::new(AtomicUsize::new(0));
let fut = async move {
let mut stream = Stream;
loop {
let next = stream.next();
let opt = await!(next);
let is_some = opt.is_some();
if is_some {
counter.fetch_add(1, Ordering::SeqCst);
} else {
break;
}
}
};
} |
cc @rust-lang/compiler @alexcrichton this is blocking roll out of async/await in Fuchsia |
@Zoxc Looked at this and pointed out that it looks like typechecking thinks that |
@cavedweller Is working on bisecting this. |
I think the problem is that |
minimal repro: This ICE only surfaces after #52681 |
using |
@Zoxc Ah you need at the very least to use |
…eddyb Don't count MIR locals as borrowed after StorageDead when finding locals live across a yield terminator This should fix rust-lang#52792. r? @eddyb
The text was updated successfully, but these errors were encountered: