Skip to content

Internal Compiler Error on stable (Broken MIR) #96512

Closed
@conradludgate

Description

@conradludgate

Code

There's only so much that I can share. The code that seems to be erroring is similar to

enum Enum {
    Variant(Variant)
}

    tokio::spawn(async move {
        let Enum::Variant(value) = enum;
        dispatch(value).await.unwrap();
    });

Meta

rustc --version --verbose:

rustc 1.60.0 (7737e0b5c 2022-04-04)
binary: rustc
commit-hash: 7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c
commit-date: 2022-04-04
host: aarch64-apple-darwin
release: 1.60.0
LLVM version: 14.0.0
rustc 1.62.0-nightly (69a5d2481 2022-04-27)
binary: rustc
commit-hash: 69a5d2481e856a5a18885390b8cf6950b9ff8dd3
commit-date: 2022-04-27
host: aarch64-apple-darwin
release: 1.62.0-nightly
LLVM version: 14.0.1

Error output

warning: Error finalizing incremental compilation session directory `.../target/debug/incremental/app-k3kpcf5j5syk/s-g9a4ygf568-1sdh6k2-working`: No such file or directory (os error 2)

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: broken MIR in DefId(0:2156 ~ app[24b6]::{closure#0}::{closure#0}) ((_33.0: Variant)): can't project out of PlaceTy { ty: Enum, variant_index: None }
  --> src/app/src/handler.rs:90:29
   |
90 |       tokio::spawn(async move {
   |  _____________________________^
91 | |         let Enum::Variant(value) = enum;
92 | |         dispatch(value).await.unwrap();
93 | |     });
   | |_____^
   |
   = note: delayed at compiler/rustc_borrowck/src/type_check/mod.rs:860:31

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_borrowck/src/type_check/mod.rs:795:20

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at /rustc/69a5d2481e856a5a18885390b8cf6950b9ff8dd3/compiler/rustc_middle/src/ty/relate.rs:419:59

error: internal compiler error: broken MIR in DefId(0:2159 ~ app[24b6]::{closure#0}::{closure#0}::{closure#2}) (((_1.0: Variant).0: Variant)): bad field access (uuid::Uuid: Variant): NoSolution
  --> src/app/src/handler.rs:91:26
   |
91 |         let Enum::Variant(value) = enum;
   |                           ^^^^^
   |
   = note: delayed at compiler/rustc_borrowck/src/type_check/mod.rs:770:29
Backtrace

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1347:13
stack backtrace:
   0:        0x104dc3e30 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5766446765602b2f
   1:        0x104e15730 - core::fmt::write::h1454cf4bd27645af
   2:        0x104db6e88 - std::io::Write::write_fmt::h6d4bd601dc063fa4
   3:        0x104dc6b30 - std::panicking::default_hook::{{closure}}::he3278aaa6dd4ffe3
   4:        0x104dc680c - std::panicking::default_hook::h83712f1c80d5cc94
   5:        0x10c0cf59c - rustc_driver[ab005e2210e4776d]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:        0x104dc720c - std::panicking::rust_panic_with_hook::hb3ff747d28bd5b62
   7:        0x10fcb30ec - std[288a9308ea2c3692]::panicking::begin_panic::<rustc_errors[300f3d566adbb64d]::ExplicitBug>::{closure#0}
   8:        0x10fcb30a4 - std[288a9308ea2c3692]::sys_common::backtrace::__rust_end_short_backtrace::<std[288a9308ea2c3692]::panicking::begin_panic<rustc_errors[300f3d566adbb64d]::ExplicitBug>::{closure#0}, !>
   9:        0x10ff847f4 - std[288a9308ea2c3692]::panicking::begin_panic::<rustc_errors[300f3d566adbb64d]::ExplicitBug>
  10:        0x10fcbe0b8 - std[288a9308ea2c3692]::panic::panic_any::<rustc_errors[300f3d566adbb64d]::ExplicitBug>
  11:        0x10fcc21d0 - <rustc_errors[300f3d566adbb64d]::HandlerInner as core[30328a0cdeb81e9a]::ops::drop::Drop>::drop
  12:        0x10c0e364c - core[30328a0cdeb81e9a]::ptr::drop_in_place::<rustc_session[cb45daf2430bcebe]::parse::ParseSess>
  13:        0x10c0e6c50 - <alloc[ba9ec2f9f2fb29e6]::rc::Rc<rustc_session[cb45daf2430bcebe]::session::Session> as core[30328a0cdeb81e9a]::ops::drop::Drop>::drop
  14:        0x10c0d6498 - core[30328a0cdeb81e9a]::ptr::drop_in_place::<rustc_interface[1aaaf20b10225d55]::interface::Compiler>
  15:        0x10c0d454c - rustc_span[cfdc8e2acaf4a144]::with_source_map::<core[30328a0cdeb81e9a]::result::Result<(), rustc_errors[300f3d566adbb64d]::ErrorGuaranteed>, rustc_interface[1aaaf20b10225d55]::interface::create_compiler_and_run<core[30328a0cdeb81e9a]::result::Result<(), rustc_errors[300f3d566adbb64d]::ErrorGuaranteed>, rustc_driver[ab005e2210e4776d]::run_compiler::{closure#1}>::{closure#1}>
  16:        0x10c07c720 - rustc_interface[1aaaf20b10225d55]::interface::create_compiler_and_run::<core[30328a0cdeb81e9a]::result::Result<(), rustc_errors[300f3d566adbb64d]::ErrorGuaranteed>, rustc_driver[ab005e2210e4776d]::run_compiler::{closure#1}>
  17:        0x10c0758f0 - <scoped_tls[726aaecfe4f649cb]::ScopedKey<rustc_span[cfdc8e2acaf4a144]::SessionGlobals>>::set::<rustc_interface[1aaaf20b10225d55]::interface::run_compiler<core[30328a0cdeb81e9a]::result::Result<(), rustc_errors[300f3d566adbb64d]::ErrorGuaranteed>, rustc_driver[ab005e2210e4776d]::run_compiler::{closure#1}>::{closure#0}, core[30328a0cdeb81e9a]::result::Result<(), rustc_errors[300f3d566adbb64d]::ErrorGuaranteed>>
  18:        0x10c0c286c - std[288a9308ea2c3692]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[1aaaf20b10225d55]::util::run_in_thread_pool_with_globals<rustc_interface[1aaaf20b10225d55]::interface::run_compiler<core[30328a0cdeb81e9a]::result::Result<(), rustc_errors[300f3d566adbb64d]::ErrorGuaranteed>, rustc_driver[ab005e2210e4776d]::run_compiler::{closure#1}>::{closure#0}, core[30328a0cdeb81e9a]::result::Result<(), rustc_errors[300f3d566adbb64d]::ErrorGuaranteed>>::{closure#0}, core[30328a0cdeb81e9a]::result::Result<(), rustc_errors[300f3d566adbb64d]::ErrorGuaranteed>>
  19:        0x10c09c520 - <<std[288a9308ea2c3692]::thread::Builder>::spawn_unchecked_<rustc_interface[1aaaf20b10225d55]::util::run_in_thread_pool_with_globals<rustc_interface[1aaaf20b10225d55]::interface::run_compiler<core[30328a0cdeb81e9a]::result::Result<(), rustc_errors[300f3d566adbb64d]::ErrorGuaranteed>, rustc_driver[ab005e2210e4776d]::run_compiler::{closure#1}>::{closure#0}, core[30328a0cdeb81e9a]::result::Result<(), rustc_errors[300f3d566adbb64d]::ErrorGuaranteed>>::{closure#0}, core[30328a0cdeb81e9a]::result::Result<(), rustc_errors[300f3d566adbb64d]::ErrorGuaranteed>>::{closure#1} as core[30328a0cdeb81e9a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  20:        0x104dcfadc - std::sys::unix::thread::Thread::new::thread_start::ha367c009d033f6c1
  21:        0x1908e626c - __pthread_deallocate

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.glacierICE tracked in rust-lang/glacier.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions