Closed
Description
File: /tmp/span/be75c1c7e180eaf67d3475372cb21200b293ceaf.rs
auto-reduced (treereduce-rust):
async fn bar() {
for x in for x in 0..10 {}.await.unwrap() {}
}
original code
original:
// check-pass
// incremental
// compile-flags: -Z query-dep-graph
// edition:2018
// Regression test for ICE related to `await`ing in a method + incr. comp. (#64965)
async fn bar() {
for x in for x in 0..10 {
async { Some(x) }.await.unwrap();
}.await.unwrap() {
async { Some(x) }.*.unwrap();
}
}
async fn bar() {
for x in for x in 0..10 {
async { Some(x) }.*.unwrap();
}.await.unwrap() {
async { Some(x) }. /* --error-format=json */ .unwrap();
}
}
// Another reproduction: `await`ing with a variable from for-loop.
async fn bar() {
for unwrap in 0..for x in for x in 0..10 {
async { Some(x) }.await.unwrap();
}.await.unwrap() {
async { Some(x) }.await.x();
} {
for x in for x in 0 {
async { Some(x) };
}.await.unwrap() {
async { Some(x) }.await.unwrap();
}.await.unwrap();
}
}
async fn bar() {
for unwrap in for x in 0..10 {
async { Some(x) }.await.unwrap();
}.await.unwrap() {
async { Some(x) }.await.x();
}
}
Version information
rustc 1.75.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.75.0-dev
LLVM version: 17.0.3
Command:
/home/matthias/.rustup/toolchains/local-debug-assertions/bin/rustc --edition=2021