Skip to content

ICE: E0277 : span must not be empty.. / {OpaqueTypeKey { def_id: DefId(.. / report_selection_error' did not emit an error #117014

Closed
@matthiaskrgr

Description

@matthiaskrgr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some way

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions