Skip to content

ICE: None in compiler/rustc_mir_build/src/build/matches/mod.rs #119786

Description

@matthiaskrgr

View all comments

snippet:

fn enum_upvar() {
    type T = impl Copy;
    let foo: T = Some((1u32, 2u32));
    let x = move || {
        match foo {
            None => (),
            Some(yield) => (),
        }
    };
}

Version information

rustc 1.77.0-nightly (ae9d24de8 2024-01-09)
binary: rustc
commit-hash: ae9d24de80b00b4158d1a29a212a6b02aeda0e75
commit-date: 2024-01-09
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.6

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc --edition=2021

Program output

error: expected identifier, found reserved keyword `yield`
 --> /tmp/icemaker_global_tempdir.x6UZht6u4SjU/rustc_testrunner_tmpdir_reporting.JA7y372p2elJ/mvce.rs:7:18
  |
7 |             Some(yield) => (),
  |                  ^^^^^ expected identifier, found reserved keyword
  |
help: escape `yield` to use it as an identifier
  |
7 |             Some(r#yield) => (),
  |                  ++

error[E0658]: `impl Trait` in type aliases is unstable
 --> /tmp/icemaker_global_tempdir.x6UZht6u4SjU/rustc_testrunner_tmpdir_reporting.JA7y372p2elJ/mvce.rs:2:14
  |
2 |     type T = impl Copy;
  |              ^^^^^^^^^
  |
  = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
  = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable

error[E0601]: `main` function not found in crate `mvce`
  --> /tmp/icemaker_global_tempdir.x6UZht6u4SjU/rustc_testrunner_tmpdir_reporting.JA7y372p2elJ/mvce.rs:10:2
   |
10 | }
   |  ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.x6UZht6u4SjU/rustc_testrunner_tmpdir_reporting.JA7y372p2elJ/mvce.rs`

warning: unused variable: `x`
 --> /tmp/icemaker_global_tempdir.x6UZht6u4SjU/rustc_testrunner_tmpdir_reporting.JA7y372p2elJ/mvce.rs:4:9
  |
4 |     let x = move || {
  |         ^ help: if this is intentional, prefix it with an underscore: `_x`
  |
  = note: `#[warn(unused_variables)]` on by default

thread 'rustc' panicked at compiler/rustc_mir_build/src/build/expr/as_place.rs:253:31:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x7f3a2358c7e6 - std::backtrace_rs::backtrace::libunwind::trace::h5bb3bcbd9bf843dc
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f3a2358c7e6 - std::backtrace_rs::backtrace::trace_unsynchronized::h2be7c62a2fc2f0ae
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f3a2358c7e6 - std::sys_common::backtrace::_print_fmt::h0eb797837574729c
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f3a2358c7e6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9cfb89fe3b10d684
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f3a235deed0 - core::fmt::rt::Argument::fmt::h05c1336e950869a8
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/core/src/fmt/rt.rs:142:9
   5:     0x7f3a235deed0 - core::fmt::write::hf9ed93bf0be8a0ba
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f3a2358014f - std::io::Write::write_fmt::h575af11d100da1a8
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/std/src/io/mod.rs:1810:15
   7:     0x7f3a2358c5c4 - std::sys_common::backtrace::_print::h4efb82e5b25d472e
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f3a2358c5c4 - std::sys_common::backtrace::print::h6788dd5df6617703
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f3a2358f357 - std::panicking::default_hook::{{closure}}::hfa58db406ef5c661
  10:     0x7f3a2358f0b9 - std::panicking::default_hook::h60a66ef279ae47ef
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/std/src/panicking.rs:292:9
  11:     0x7f3a2635c9bc - std[6b9fb5ba93d727e9]::panicking::update_hook::<alloc[30b92f95685fae2c]::boxed::Box<rustc_driver_impl[54e7dbd11c712533]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f3a2358faa6 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h37eedb2cb21c4dfc
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/alloc/src/boxed.rs:2030:9
  13:     0x7f3a2358faa6 - std::panicking::rust_panic_with_hook::hbea871998462fd45
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/std/src/panicking.rs:785:13
  14:     0x7f3a2358f7b9 - std::panicking::begin_panic_handler::{{closure}}::h45ad8d6a57ea4023
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/std/src/panicking.rs:651:13
  15:     0x7f3a2358cce6 - std::sys_common::backtrace::__rust_end_short_backtrace::h6e4a62ed56190aa9
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7f3a2358f550 - rust_begin_unwind
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/std/src/panicking.rs:647:5
  17:     0x7f3a235db5d5 - core::panicking::panic_fmt::hfc52fd0216040145
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/core/src/panicking.rs:72:14
  18:     0x7f3a235db693 - core::panicking::panic::h37bd7f6a16f3c553
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/core/src/panicking.rs:144:5
  19:     0x7f3a2802fef5 - <rustc_mir_build[a392e445574d452]::build::Builder>::match_simplified_candidates
  20:     0x7f3a27b0f562 - <rustc_mir_build[a392e445574d452]::build::Builder>::lower_match_tree
  21:     0x7f3a27fbb5c1 - <rustc_mir_build[a392e445574d452]::build::Builder>::match_expr
  22:     0x7f3a27b06905 - <rustc_mir_build[a392e445574d452]::build::Builder>::expr_into_dest
  23:     0x7f3a27b06d05 - <rustc_mir_build[a392e445574d452]::build::Builder>::expr_into_dest
  24:     0x7f3a249a92dd - <rustc_mir_build[a392e445574d452]::build::Builder>::ast_block_stmts
  25:     0x7f3a27b05ca3 - <rustc_mir_build[a392e445574d452]::build::Builder>::expr_into_dest
  26:     0x7f3a27b06d05 - <rustc_mir_build[a392e445574d452]::build::Builder>::expr_into_dest
  27:     0x7f3a27dfe87e - rustc_mir_build[a392e445574d452]::build::mir_build::{closure#0}
  28:     0x7f3a27b019b0 - rustc_mir_build[a392e445574d452]::build::mir_built
  29:     0x7f3a27b01633 - rustc_query_impl[aafdc9ab48500bbf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[aafdc9ab48500bbf]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>
  30:     0x7f3a27affd39 - rustc_query_system[5609ae2ca0b8284d]::query::plumbing::try_execute_query::<rustc_query_impl[aafdc9ab48500bbf]::DynamicConfig<rustc_query_system[5609ae2ca0b8284d]::query::caches::VecCache<rustc_span[79961d1f3d44db5f]::def_id::LocalDefId, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[aafdc9ab48500bbf]::plumbing::QueryCtxt, false>
  31:     0x7f3a27aff910 - rustc_query_impl[aafdc9ab48500bbf]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  32:     0x7f3a27732b30 - rustc_mir_transform[a66e1bf0036969f9]::ffi_unwind_calls::has_ffi_unwind_calls
  33:     0x7f3a2773269d - rustc_query_impl[aafdc9ab48500bbf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[aafdc9ab48500bbf]::query_impl::has_ffi_unwind_calls::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 1usize]>>
  34:     0x7f3a27a51007 - rustc_query_system[5609ae2ca0b8284d]::query::plumbing::try_execute_query::<rustc_query_impl[aafdc9ab48500bbf]::DynamicConfig<rustc_query_system[5609ae2ca0b8284d]::query::caches::VecCache<rustc_span[79961d1f3d44db5f]::def_id::LocalDefId, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[aafdc9ab48500bbf]::plumbing::QueryCtxt, false>
  35:     0x7f3a27a50c03 - rustc_query_impl[aafdc9ab48500bbf]::query_impl::has_ffi_unwind_calls::get_query_non_incr::__rust_end_short_backtrace
  36:     0x7f3a27a02c83 - rustc_mir_transform[a66e1bf0036969f9]::mir_const
  37:     0x7f3a27a02baf - rustc_query_impl[aafdc9ab48500bbf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[aafdc9ab48500bbf]::query_impl::mir_const::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>
  38:     0x7f3a27affd39 - rustc_query_system[5609ae2ca0b8284d]::query::plumbing::try_execute_query::<rustc_query_impl[aafdc9ab48500bbf]::DynamicConfig<rustc_query_system[5609ae2ca0b8284d]::query::caches::VecCache<rustc_span[79961d1f3d44db5f]::def_id::LocalDefId, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[aafdc9ab48500bbf]::plumbing::QueryCtxt, false>
  39:     0x7f3a27aff850 - rustc_query_impl[aafdc9ab48500bbf]::query_impl::mir_const::get_query_non_incr::__rust_end_short_backtrace
  40:     0x7f3a2587a5e2 - rustc_mir_transform[a66e1bf0036969f9]::mir_promoted
  41:     0x7f3a27b732e0 - rustc_query_impl[aafdc9ab48500bbf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[aafdc9ab48500bbf]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 16usize]>>
  42:     0x7f3a27b735aa - rustc_query_system[5609ae2ca0b8284d]::query::plumbing::try_execute_query::<rustc_query_impl[aafdc9ab48500bbf]::DynamicConfig<rustc_query_system[5609ae2ca0b8284d]::query::caches::VecCache<rustc_span[79961d1f3d44db5f]::def_id::LocalDefId, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[aafdc9ab48500bbf]::plumbing::QueryCtxt, false>
  43:     0x7f3a284e3853 - rustc_query_impl[aafdc9ab48500bbf]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  44:     0x7f3a284e3970 - rustc_borrowck[df3a95fa1272e840]::mir_borrowck
  45:     0x7f3a284e3899 - rustc_query_impl[aafdc9ab48500bbf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[aafdc9ab48500bbf]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>
  46:     0x7f3a27affd39 - rustc_query_system[5609ae2ca0b8284d]::query::plumbing::try_execute_query::<rustc_query_impl[aafdc9ab48500bbf]::DynamicConfig<rustc_query_system[5609ae2ca0b8284d]::query::caches::VecCache<rustc_span[79961d1f3d44db5f]::def_id::LocalDefId, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[aafdc9ab48500bbf]::plumbing::QueryCtxt, false>
  47:     0x7f3a27aff794 - rustc_query_impl[aafdc9ab48500bbf]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  48:     0x7f3a281f3fc9 - <rustc_borrowck[df3a95fa1272e840]::type_check::TypeChecker>::prove_closure_bounds
  49:     0x7f3a284a10ae - <rustc_borrowck[df3a95fa1272e840]::type_check::TypeChecker>::typeck_mir
  50:     0x7f3a252e86d1 - rustc_borrowck[df3a95fa1272e840]::type_check::type_check
  51:     0x7f3a252ccc09 - rustc_borrowck[df3a95fa1272e840]::nll::compute_regions
  52:     0x7f3a284f3b97 - rustc_borrowck[df3a95fa1272e840]::do_mir_borrowck
  53:     0x7f3a284e3e51 - rustc_borrowck[df3a95fa1272e840]::mir_borrowck
  54:     0x7f3a284e3899 - rustc_query_impl[aafdc9ab48500bbf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[aafdc9ab48500bbf]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>
  55:     0x7f3a27affd39 - rustc_query_system[5609ae2ca0b8284d]::query::plumbing::try_execute_query::<rustc_query_impl[aafdc9ab48500bbf]::DynamicConfig<rustc_query_system[5609ae2ca0b8284d]::query::caches::VecCache<rustc_span[79961d1f3d44db5f]::def_id::LocalDefId, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[aafdc9ab48500bbf]::plumbing::QueryCtxt, false>
  56:     0x7f3a27aff794 - rustc_query_impl[aafdc9ab48500bbf]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  57:     0x7f3a28ad1259 - rustc_middle[d060b801b30d0b16]::query::plumbing::query_get_at::<rustc_query_system[5609ae2ca0b8284d]::query::caches::VecCache<rustc_span[79961d1f3d44db5f]::def_id::LocalDefId, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>>.llvm.9191639156879714653.cold.0
  58:     0x7f3a2649dfbd - <rustc_hir_analysis[c481e10dc51c4446]::collect::type_of::opaque::TaitConstraintLocator>::check
  59:     0x7f3a2648bf20 - <rustc_hir_analysis[c481e10dc51c4446]::collect::type_of::opaque::TaitConstraintLocator as rustc_hir[a3b1848d05e218a2]::intravisit::Visitor>::visit_item
  60:     0x7f3a286098fc - rustc_hir_analysis[c481e10dc51c4446]::collect::type_of::type_of_opaque
  61:     0x7f3a28608e5b - rustc_query_impl[aafdc9ab48500bbf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[aafdc9ab48500bbf]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>
  62:     0x7f3a2765ef54 - rustc_query_system[5609ae2ca0b8284d]::query::plumbing::try_execute_query::<rustc_query_impl[aafdc9ab48500bbf]::DynamicConfig<rustc_query_system[5609ae2ca0b8284d]::query::caches::DefaultCache<rustc_span[79961d1f3d44db5f]::def_id::DefId, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[aafdc9ab48500bbf]::plumbing::QueryCtxt, false>
  63:     0x7f3a2864321e - rustc_query_impl[aafdc9ab48500bbf]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
  64:     0x7f3a2765dbae - rustc_middle[d060b801b30d0b16]::query::plumbing::query_get_at::<rustc_query_system[5609ae2ca0b8284d]::query::caches::DefaultCache<rustc_span[79961d1f3d44db5f]::def_id::DefId, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>>
  65:     0x7f3a258a3678 - rustc_hir_analysis[c481e10dc51c4446]::collect::type_of::type_of
  66:     0x7f3a276600be - rustc_query_impl[aafdc9ab48500bbf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[aafdc9ab48500bbf]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>
  67:     0x7f3a2765ef54 - rustc_query_system[5609ae2ca0b8284d]::query::plumbing::try_execute_query::<rustc_query_impl[aafdc9ab48500bbf]::DynamicConfig<rustc_query_system[5609ae2ca0b8284d]::query::caches::DefaultCache<rustc_span[79961d1f3d44db5f]::def_id::DefId, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[aafdc9ab48500bbf]::plumbing::QueryCtxt, false>
  68:     0x7f3a2765eb1d - rustc_query_impl[aafdc9ab48500bbf]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  69:     0x7f3a2765dbae - rustc_middle[d060b801b30d0b16]::query::plumbing::query_get_at::<rustc_query_system[5609ae2ca0b8284d]::query::caches::DefaultCache<rustc_span[79961d1f3d44db5f]::def_id::DefId, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 8usize]>>>
  70:     0x7f3a28144033 - rustc_hir_analysis[c481e10dc51c4446]::check::check::check_item_type
  71:     0x7f3a27d9d0d9 - rustc_hir_analysis[c481e10dc51c4446]::check::wfcheck::check_well_formed
  72:     0x7f3a27d9bf73 - rustc_query_impl[aafdc9ab48500bbf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[aafdc9ab48500bbf]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 1usize]>>
  73:     0x7f3a27d9b671 - rustc_query_system[5609ae2ca0b8284d]::query::plumbing::try_execute_query::<rustc_query_impl[aafdc9ab48500bbf]::DynamicConfig<rustc_query_system[5609ae2ca0b8284d]::query::caches::VecCache<rustc_hir[a3b1848d05e218a2]::hir_id::OwnerId, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[aafdc9ab48500bbf]::plumbing::QueryCtxt, false>
  74:     0x7f3a27d9b3db - rustc_query_impl[aafdc9ab48500bbf]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  75:     0x7f3a27d98d77 - rustc_hir_analysis[c481e10dc51c4446]::check::wfcheck::check_mod_type_wf
  76:     0x7f3a27d98cbb - rustc_query_impl[aafdc9ab48500bbf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[aafdc9ab48500bbf]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 1usize]>>
  77:     0x7f3a27d97e7b - rustc_query_system[5609ae2ca0b8284d]::query::plumbing::try_execute_query::<rustc_query_impl[aafdc9ab48500bbf]::DynamicConfig<rustc_query_system[5609ae2ca0b8284d]::query::caches::DefaultCache<rustc_span[79961d1f3d44db5f]::def_id::LocalModDefId, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[aafdc9ab48500bbf]::plumbing::QueryCtxt, false>
  78:     0x7f3a27d97c09 - rustc_query_impl[aafdc9ab48500bbf]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
  79:     0x7f3a27d97b1a - <rustc_middle[d060b801b30d0b16]::hir::map::Map>::try_par_for_each_module::<rustc_hir_analysis[c481e10dc51c4446]::check_crate::{closure#4}::{closure#0}>::{closure#0}
  80:     0x7f3a27afd9dc - rustc_hir_analysis[c481e10dc51c4446]::check_crate
  81:     0x7f3a28037559 - rustc_interface[82b52b903971ad5b]::passes::analysis
  82:     0x7f3a2803719f - rustc_query_impl[aafdc9ab48500bbf]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[aafdc9ab48500bbf]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 1usize]>>
  83:     0x7f3a285c3824 - rustc_query_system[5609ae2ca0b8284d]::query::plumbing::try_execute_query::<rustc_query_impl[aafdc9ab48500bbf]::DynamicConfig<rustc_query_system[5609ae2ca0b8284d]::query::caches::SingleCache<rustc_middle[d060b801b30d0b16]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[aafdc9ab48500bbf]::plumbing::QueryCtxt, false>
  84:     0x7f3a285c3615 - rustc_query_impl[aafdc9ab48500bbf]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  85:     0x7f3a2835d708 - rustc_interface[82b52b903971ad5b]::interface::run_compiler::<core[ea75208d289faa44]::result::Result<(), rustc_span[79961d1f3d44db5f]::ErrorGuaranteed>, rustc_driver_impl[54e7dbd11c712533]::run_compiler::{closure#0}>::{closure#0}
  86:     0x7f3a285e8fc6 - std[6b9fb5ba93d727e9]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[82b52b903971ad5b]::util::run_in_thread_with_globals<rustc_interface[82b52b903971ad5b]::util::run_in_thread_pool_with_globals<rustc_interface[82b52b903971ad5b]::interface::run_compiler<core[ea75208d289faa44]::result::Result<(), rustc_span[79961d1f3d44db5f]::ErrorGuaranteed>, rustc_driver_impl[54e7dbd11c712533]::run_compiler::{closure#0}>::{closure#0}, core[ea75208d289faa44]::result::Result<(), rustc_span[79961d1f3d44db5f]::ErrorGuaranteed>>::{closure#0}, core[ea75208d289faa44]::result::Result<(), rustc_span[79961d1f3d44db5f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ea75208d289faa44]::result::Result<(), rustc_span[79961d1f3d44db5f]::ErrorGuaranteed>>
  87:     0x7f3a285e8df3 - <<std[6b9fb5ba93d727e9]::thread::Builder>::spawn_unchecked_<rustc_interface[82b52b903971ad5b]::util::run_in_thread_with_globals<rustc_interface[82b52b903971ad5b]::util::run_in_thread_pool_with_globals<rustc_interface[82b52b903971ad5b]::interface::run_compiler<core[ea75208d289faa44]::result::Result<(), rustc_span[79961d1f3d44db5f]::ErrorGuaranteed>, rustc_driver_impl[54e7dbd11c712533]::run_compiler::{closure#0}>::{closure#0}, core[ea75208d289faa44]::result::Result<(), rustc_span[79961d1f3d44db5f]::ErrorGuaranteed>>::{closure#0}, core[ea75208d289faa44]::result::Result<(), rustc_span[79961d1f3d44db5f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ea75208d289faa44]::result::Result<(), rustc_span[79961d1f3d44db5f]::ErrorGuaranteed>>::{closure#1} as core[ea75208d289faa44]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  88:     0x7f3a235999d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h646d8cfdd583ca20
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/alloc/src/boxed.rs:2016:9
  89:     0x7f3a235999d5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h79a5366d4b935d3e
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/alloc/src/boxed.rs:2016:9
  90:     0x7f3a235999d5 - std::sys::unix::thread::Thread::new::thread_start::h1e5e13c4b7d7a988
                               at /rustc/ae9d24de80b00b4158d1a29a212a6b02aeda0e75/library/std/src/sys/unix/thread.rs:108:17
  91:     0x7f3a233859eb - <unknown>
  92:     0x7f3a234097cc - <unknown>
  93:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.77.0-nightly (ae9d24de8 2024-01-09) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z dump-mir-dir=dir

query stack during panic:
#0 [mir_built] building MIR for `enum_upvar::{closure#0}`
#1 [has_ffi_unwind_calls] checking if `enum_upvar::{closure#0}` contains FFI-unwind calls
#2 [mir_const] preparing `enum_upvar::{closure#0}` for borrow checking
#3 [mir_promoted] promoting constants in MIR for `enum_upvar::{closure#0}`
#4 [mir_borrowck] borrow-checking `enum_upvar::{closure#0}`
#5 [mir_borrowck] borrow-checking `enum_upvar`
#6 [type_of_opaque] computing type of opaque `enum_upvar::T::{opaque#0}`
#7 [type_of] computing type of `enum_upvar::T::{opaque#0}`
#8 [check_well_formed] checking that `enum_upvar::T::{opaque#0}` is well-formed
#9 [check_mod_type_wf] checking that types are well-formed in top-level module
#10 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors; 1 warning emitted

Some errors have detailed explanations: E0601, E0658.
For more information about an error, try `rustc --explain E0601`.

Activity

  1. added
    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.
    C-bugCategory: This is a bug.
    on Jan 9, 2024
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 9, 2024
  3. matthiaskrgr commented on Jan 9, 2024

    @matthiaskrgr
    MemberAuthor

    Hmm, this bisects to #117565 cc @estebank

  4. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 11, 2024
  5. Noratrieb commented on Jan 25, 2024

    @Noratrieb
    Member

    This is really weird, it only happens when the binding is a keyword..., is the PR doing recovery incorrectly?

  6. compiler-errors commented on Jan 25, 2024

    @compiler-errors
    Contributor

    @Nilstrieb: It's recovering the keyword as a wildcard. This also ICEs, probably doesn't bisect to that PR but before it:

    #![feature(type_alias_impl_trait)]
    
    fn enum_upvar() {
        type T = impl Copy;
        let foo: T = Some((1u32, 2u32));
        let x = move || {
            match foo {
                None => (),
                Some(_) => (),
            }
        };
    }
  7. Noratrieb commented on Jan 25, 2024

    @Noratrieb
    Member

    Haha, I was trying to properly minimize this to be able to properly bisect it and turned it into an ident pattern which was fine, it didn't occur to me that it would recover to a wildcard :D.

  8. added
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    on Jan 25, 2024
  9. changed the title [-]ICE: `None` in as_place.rs[/-] [+]ICE: `None` in `compiler/rustc_mir_build/src/build/matches/mod.rs`[/+] on Mar 28, 2024
  10. matthiaskrgr commented on Mar 29, 2024

    @matthiaskrgr
    MemberAuthor

    #119786 (comment) this
    bisects to

    Regression in nightly-2022-03-31

    fetching (via remote github) commits from max(9c06e1b, 2022-03-28) to c5cf08d
    ending github query because we found starting sha: 9c06e1b
    get_commits_between returning commits, len: 8
    commit[0] 2022-03-29: Auto merge of #95448 - Dylan-DPC:rollup-wpj5yto, r=Dylan-DPC
    commit[1] 2022-03-30: Auto merge of #95455 - RalfJung:miri, r=RalfJung
    commit[2] 2022-03-30: Auto merge of #94081 - oli-obk:lazy_tait_take_two, r=nikomatsakis
    commit[3] 2022-03-30: Auto merge of #95466 - Dylan-DPC:rollup-g7ddr8y, r=Dylan-DPC
    commit[4] 2022-03-30: Auto merge of #95241 - Gankra:cleaned-provenance, r=workingjubilee
    commit[5] 2022-03-30: Auto merge of #94963 - lcnr:inherent-impls-std, r=oli-obk,m-ou-se
    commit[6] 2022-03-30: Auto merge of #95458 - calebcartwright:sync-rustfmt-subtree, r=calebcartwright
    commit[7] 2022-03-30: Auto merge of #95425 - nnethercote:yet-more-parse_tt-improvements, r=petrochenkov
    ERROR: no CI builds available between 9c06e1b and c5cf08d within last 167 days

    which is probably also #94081 ? cc @oli-obk

  11. removed
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    on Mar 29, 2024
  12. added
    S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.
    on Apr 15, 2024
  13. Nadrieril commented on Jul 19, 2024

    @Nadrieril
    Member

    Fun fact: this is edition-specific. Works on 2018, ICEs on 2021.

  14. 23 remaining items

  15. added
    A-closuresArea: Closures (`|…| { … }`)
    A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
    A-patternsRelating to patterns and pattern matching
    T-typesRelevant to the types team, which will review and decide on the PR/issue.
    on Jan 24, 2026
  16. matthiaskrgr commented on Jun 7, 2026

    @matthiaskrgr
    MemberAuthor

    with debug assertions:

    thread 'rustc' (3857502) panicked at /rustc-dev/43a4909ee98ed4d006d9d773f5d94dc58e34f846/compiler/rustc_mir_build/src/builder/matches/match_pair.rs:168:13:
    assertion failed: place.is_some()
    stack backtrace:
       0:     0x7f583c57ef6c - std[a7ae9e4724cd14fe]::backtrace_rs::backtrace::libunwind::trace
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
       1:     0x7f583c57ef6c - std[a7ae9e4724cd14fe]::backtrace_rs::backtrace::trace_unsynchronized::<std[a7ae9e4724cd14fe]::sys::backtrace::_print_fmt::{closure#1}>
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
       2:     0x7f583c57ef6c - std[a7ae9e4724cd14fe]::sys::backtrace::_print_fmt
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/sys/backtrace.rs:74:9
       3:     0x7f583c57ef6c - <<std[a7ae9e4724cd14fe]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[29b9cd7ad4f139be]::fmt::Display>::fmt
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/sys/backtrace.rs:44:26
       4:     0x7f58375844ae - <core[29b9cd7ad4f139be]::fmt::rt::Argument>::fmt
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/core/src/fmt/rt.rs:152:76
       5:     0x7f58375844ae - core[29b9cd7ad4f139be]::fmt::write
       6:     0x7f583c59601c - std[a7ae9e4724cd14fe]::io::default_write_fmt::<std[a7ae9e4724cd14fe]::sys::stdio::unix::Stderr>
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/io/mod.rs:623:11
       7:     0x7f583c59601c - <std[a7ae9e4724cd14fe]::sys::stdio::unix::Stderr as std[a7ae9e4724cd14fe]::io::Write>::write_fmt
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/io/mod.rs:1661:13
       8:     0x7f583c5430d4 - <std[a7ae9e4724cd14fe]::sys::backtrace::BacktraceLock>::print
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/sys/backtrace.rs:47:9
       9:     0x7f583c5430d4 - std[a7ae9e4724cd14fe]::panicking::default_hook::{closure#0}
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/panicking.rs:292:27
      10:     0x7f583c56d2b1 - std[a7ae9e4724cd14fe]::panicking::default_hook
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/panicking.rs:319:9
      11:     0x7f5838a67198 - <alloc[d0f55afb5295b851]::boxed::Box<dyn for<'a, 'b> core[29b9cd7ad4f139be]::ops::function::Fn<(&'a std[a7ae9e4724cd14fe]::panic::PanicHookInfo<'b>,), Output = ()> + core[29b9cd7ad4f139be]::marker::Send + core[29b9cd7ad4f139be]::marker::Sync> as core[29b9cd7ad4f139be]::ops::function::Fn<(&std[a7ae9e4724cd14fe]::panic::PanicHookInfo,)>>::call
                                   at /rustc-dev/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/alloc/src/boxed.rs:2291:9
      12:     0x7f5838a67198 - rustc_driver_impl[a6775abbfb30c688]::install_ice_hook::{closure#1}
                                   at /rustc-dev/43a4909ee98ed4d006d9d773f5d94dc58e34f846/compiler/rustc_driver_impl/src/lib.rs:1483:17
      13:     0x7f5838a67198 - <alloc[d0f55afb5295b851]::boxed::Box<rustc_driver_impl[a6775abbfb30c688]::install_ice_hook::{closure#1}> as core[29b9cd7ad4f139be]::ops::function::Fn<(&dyn for<'a, 'b> core[29b9cd7ad4f139be]::ops::function::Fn<(&'a std[a7ae9e4724cd14fe]::panic::PanicHookInfo<'b>,), Output = ()> + core[29b9cd7ad4f139be]::marker::Send + core[29b9cd7ad4f139be]::marker::Sync, &std[a7ae9e4724cd14fe]::panic::PanicHookInfo)>>::call
                                   at /rustc-dev/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/alloc/src/boxed.rs:2291:9
      14:     0x7f5838a67198 - std[a7ae9e4724cd14fe]::panicking::update_hook::<alloc[d0f55afb5295b851]::boxed::Box<rustc_driver_impl[a6775abbfb30c688]::install_ice_hook::{closure#1}>>::{closure#0}
                                   at /rustc-dev/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/panicking.rs:235:47
      15:     0x7f583c56d64a - <alloc[d0f55afb5295b851]::boxed::Box<dyn for<'a, 'b> core[29b9cd7ad4f139be]::ops::function::Fn<(&'a std[a7ae9e4724cd14fe]::panic::PanicHookInfo<'b>,), Output = ()> + core[29b9cd7ad4f139be]::marker::Send + core[29b9cd7ad4f139be]::marker::Sync> as core[29b9cd7ad4f139be]::ops::function::Fn<(&std[a7ae9e4724cd14fe]::panic::PanicHookInfo,)>>::call
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/alloc/src/boxed.rs:2291:9
      16:     0x7f583c56d64a - std[a7ae9e4724cd14fe]::panicking::panic_with_hook
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/panicking.rs:822:13
      17:     0x7f583c5431d4 - std[a7ae9e4724cd14fe]::panicking::panic_handler::{closure#0}
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/panicking.rs:680:13
      18:     0x7f583c531f99 - std[a7ae9e4724cd14fe]::sys::backtrace::__rust_end_short_backtrace::<std[a7ae9e4724cd14fe]::panicking::panic_handler::{closure#0}, !>
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/sys/backtrace.rs:182:18
      19:     0x7f583c54510d - __rustc[926e37eea3b2551b]::rust_begin_unwind
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/panicking.rs:678:5
      20:     0x7f583758510c - core[29b9cd7ad4f139be]::panicking::panic_fmt
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/core/src/panicking.rs:80:14
      21:     0x7f58375850d2 - core[29b9cd7ad4f139be]::panicking::panic
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/core/src/panicking.rs:150:5
      22:     0x7f583a4f303e - rustc_mir_build[9026d587fb562adf]::builder::matches::match_pair::squash_inter_pat
      23:     0x7f583a49a4e8 - <rustc_mir_build[9026d587fb562adf]::builder::matches::FlatPat>::from_inter_pat
                                   at /rustc-dev/43a4909ee98ed4d006d9d773f5d94dc58e34f846/compiler/rustc_mir_build/src/builder/matches/match_pair.rs:96:9
      24:     0x7f583a49a4e8 - <rustc_mir_build[9026d587fb562adf]::builder::matches::FlatPat>::new
                                   at /rustc-dev/43a4909ee98ed4d006d9d773f5d94dc58e34f846/compiler/rustc_mir_build/src/builder/matches/match_pair.rs:81:9
    ..
    ..
    ..
     328:     0x7f0cb4e6c7a9 - std[a7ae9e4724cd14fe]::thread::lifecycle::spawn_unchecked::<rustc_interface[2069e58f22b60b4e]::util::run_in_thread_with_globals<rustc_interface[2069e58f22b60b4e]::util::run_in_thread_pool_with_globals<rustc_interface[2069e58f22b60b4e]::interface::run_compiler<(), rustc_driver_impl[a6775abbfb30c688]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1}
                                   at /rustc-dev/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/thread/lifecycle.rs:68:26
     329:     0x7f0cb4e6c7a9 - <std[a7ae9e4724cd14fe]::thread::lifecycle::spawn_unchecked<rustc_interface[2069e58f22b60b4e]::util::run_in_thread_with_globals<rustc_interface[2069e58f22b60b4e]::util::run_in_thread_pool_with_globals<rustc_interface[2069e58f22b60b4e]::interface::run_compiler<(), rustc_driver_impl[a6775abbfb30c688]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[29b9cd7ad4f139be]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
                                   at /rustc-dev/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/core/src/ops/function.rs:250:5
     330:     0x7f0cb897afaf - <alloc[d0f55afb5295b851]::boxed::Box<dyn core[29b9cd7ad4f139be]::ops::function::FnOnce<(), Output = ()> + core[29b9cd7ad4f139be]::marker::Send> as core[29b9cd7ad4f139be]::ops::function::FnOnce<()>>::call_once
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/alloc/src/boxed.rs:2277:9
     331:     0x7f0cb897afaf - <std[a7ae9e4724cd14fe]::sys::thread::unix::Thread>::new::thread_start
                                   at /rustc/43a4909ee98ed4d006d9d773f5d94dc58e34f846/library/std/src/sys/thread/unix.rs:118:17
     332:     0x7f0cb1e981b9 - <unknown>
     333:     0x7f0cb1f1d21c - <unknown>
     334:                0x0 - <unknown>
    
    error: the compiler unexpectedly panicked. This is a bug
    
    note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
    
    note: please make sure that you have updated to the latest nightly
    
    note: please attach the file at `/tmp/im/2/rustc-ice-2026-06-07T18_52_54-3857553.txt` to your bug report
    
    note: rustc 1.98.0-nightly (43a4909ee 2026-06-07) running on x86_64-unknown-linux-gnu
    
    note: compiler flags: --crate-type lib
    
    query stack during panic:
    #0 [mir_built] building MIR for `enum_upvar::{closure#0}`
    #1 [has_ffi_unwind_calls] checking if `enum_upvar::{closure#0}` contains FFI-unwind calls
    #2 [mir_promoted] promoting constants in MIR for `enum_upvar::{closure#0}`
    #3 [mir_borrowck] borrow-checking `enum_upvar`
    #4 [type_of_opaque] computing type of opaque `enum_upvar::T::{opaque#0}`
    #5 [type_of] computing type of `enum_upvar::T::{opaque#0}`
    #6 [check_well_formed] checking that `enum_upvar::T::{opaque#0}` is well-formed
    #7 [check_type_wf] checking that types are well-formed
    #8 [analysis] running analysis passes on crate `a`
    end of query stack
    error: aborting due to 2 previous errors
    
    For more information about this error, try `rustc --explain E0658`.
    
  17. added a commit that references this issue on Jul 15, 2026
  18. added a commit that references this issue on Jul 15, 2026
  19. added
    fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.
    on Aug 11, 2026
  20. added 2 commits that reference this issue on Oct 5, 2026
  21. added a commit that references this issue on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-closuresArea: Closures (`|…| { … }`)A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.A-patternsRelating to patterns and pattern matchingC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions