Skip to content
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: nightly async_closure "leftover child captures?" #124483

Closed
finnbear opened this issue Apr 28, 2024 · 2 comments
Closed

ICE: nightly async_closure "leftover child captures?" #124483

finnbear opened this issue Apr 28, 2024 · 2 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@finnbear
Copy link
Contributor

finnbear commented Apr 28, 2024

Code

#![feature(async_closure)]

fn main() {
    let bar = 0;
    async |inner| {
        bar;
    };
}

(I arrived at this particular ICE-producing code while minimizing a different ICE)

Meta

rustc 1.79.0-nightly (aed2187d5 2024-04-27)

Related: #62290

Error output

thread 'rustc' panicked at /rustc/aed2187d53b8789e3a37f50ae36f894a2a679077/compiler/rustc_middle/src/ty/closure.rs:469:13:
assertion `left == right` failed: leftover child captures?
  left: Some((0, CapturedPlace { var_ident: bar#0, place: Place { base_ty: i32, base: Upvar(UpvarId(HirId(DefId(0:3 ~ playground[2684]::main).4);`bar`;DefId(0:5 ~ playground[2684]::main::{closure#0}::{closure#0}))), projections: [] }, info: CaptureInfo { capture_kind_expr_id: Some(HirId(DefId(0:3 ~ playground[2684]::main).18)), path_expr_id: Some(HirId(DefId(0:3 ~ playground[2684]::main).18)), capture_kind: ByRef(ImmBorrow) }, mutability: Not, region: Some('?0) }))
 right: None

For comprehensive backtrace, see: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=0b55c6cfb1b792d1561c8e6398f48faf

Thanks for investigating this! Feel free to close this if ICE while compiling broken nightly-only code is tolerable.

@finnbear finnbear added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 28, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 28, 2024
@matthiaskrgr
Copy link
Member

looks like a duplicate of #123901

@finnbear
Copy link
Contributor Author

You're correct, thanks for noticing!

@finnbear finnbear closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants