Skip to content

ICE: unsupported pattern constructor Opaque(OpaqueId(0)) #143203

Open
@matthiaskrgr

Description

@matthiaskrgr

Code

#![feature(loop_match)]
fn test_f32(state: f32) {
    #[loop_match]
    loop {
        state = 'blk: {
            match state {
                1.0 =>
                {
                    #[const_continue]
                    break 'blk 2.5
                }
                4.0..3.0 => {
                    todo!()
                }
            }
        }
    }
}

pub fn main() {}

Meta

rustc --version --verbose:

rustc 1.90.0-nightly (11ad40bb8 2025-06-28)
binary: rustc
commit-hash: 11ad40bb839ca16f74784b4ab72596ad85587298
commit-date: 2025-06-28
host: x86_64-unknown-linux-gnu
release: 1.90.0-nightly
LLVM version: 20.1.7

Error output

error[E0579]: lower range bound must be less than upper
  --> code.rs:12:17
   |
12 |                 4.0..3.0 => {
   |                 ^^^^^^^^
Backtrace

error: internal compiler error: compiler/rustc_mir_build/src/builder/matches/mod.rs:2989:17: unsupported pattern constructor Opaque(OpaqueId(0))


thread 'rustc' panicked at compiler/rustc_mir_build/src/builder/matches/mod.rs:2989:17:
Box<dyn Any>
stack backtrace:
   0:     0x73ee7ccbc953 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h10462444a160a23e
   1:     0x73ee7d402c3f - core::fmt::write::h51c0bcd32e9179f7
   2:     0x73ee7ccb2583 - std::io::Write::write_fmt::h908d59959b12b593
   3:     0x73ee7ccbc7b2 - std::sys::backtrace::BacktraceLock::print::h559827260e117eb5
   4:     0x73ee7ccc02aa - std::panicking::default_hook::{{closure}}::hf7d7aca232e21fee
   5:     0x73ee7ccbfe2f - std::panicking::default_hook::h951460af7eec7d79
   6:     0x73ee7bd872b3 - std[c4951d6ea725fdb1]::panicking::update_hook::<alloc[ed4ebd4d2712f38a]::boxed::Box<rustc_driver_impl[5beb55ce640fb1f6]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x73ee7ccc0afb - std::panicking::rust_panic_with_hook::h679177229d0a92a0
   8:     0x73ee7bdc0da1 - std[c4951d6ea725fdb1]::panicking::begin_panic::<rustc_errors[f7c34cc2e5c865c0]::ExplicitBug>::{closure#0}
   9:     0x73ee7bdb5316 - std[c4951d6ea725fdb1]::sys::backtrace::__rust_end_short_backtrace::<std[c4951d6ea725fdb1]::panicking::begin_panic<rustc_errors[f7c34cc2e5c865c0]::ExplicitBug>::{closure#0}, !>
  10:     0x73ee7bdb5107 - std[c4951d6ea725fdb1]::panicking::begin_panic::<rustc_errors[f7c34cc2e5c865c0]::ExplicitBug>
  11:     0x73ee7bdca881 - <rustc_errors[f7c34cc2e5c865c0]::diagnostic::BugAbort as rustc_errors[f7c34cc2e5c865c0]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x73ee7c3965fa - rustc_middle[280599a7c0b63cac]::util::bug::opt_span_bug_fmt::<rustc_span[63a709b6f97e6c64]::span_encoding::Span>::{closure#0}
  13:     0x73ee7c37614a - rustc_middle[280599a7c0b63cac]::ty::context::tls::with_opt::<rustc_middle[280599a7c0b63cac]::util::bug::opt_span_bug_fmt<rustc_span[63a709b6f97e6c64]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x73ee7c375fbb - rustc_middle[280599a7c0b63cac]::ty::context::tls::with_context_opt::<rustc_middle[280599a7c0b63cac]::ty::context::tls::with_opt<rustc_middle[280599a7c0b63cac]::util::bug::opt_span_bug_fmt<rustc_span[63a709b6f97e6c64]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x73ee794a5f20 - rustc_middle[280599a7c0b63cac]::util::bug::bug_fmt
  16:     0x73ee7c4037da - <rustc_mir_build[61250234fad639b8]::builder::Builder>::static_pattern_match_inner
  17:     0x73ee7d882733 - <rustc_mir_build[61250234fad639b8]::builder::Builder>::stmt_expr
  18:     0x73ee7d86d667 - <rustc_mir_build[61250234fad639b8]::builder::Builder>::expr_into_dest
  19:     0x73ee7d85edb3 - <rustc_mir_build[61250234fad639b8]::builder::Builder>::as_temp::{closure#0}
  20:     0x73ee7d86cad8 - <rustc_mir_build[61250234fad639b8]::builder::Builder>::expr_into_dest
  21:     0x73ee7d86b1af - <rustc_mir_build[61250234fad639b8]::builder::Builder>::expr_into_dest
  22:     0x73ee7e3abac3 - <rustc_mir_build[61250234fad639b8]::builder::Builder>::ast_block_stmts
  23:     0x73ee7e3a9845 - <rustc_mir_build[61250234fad639b8]::builder::Builder>::ast_block
  24:     0x73ee7d86ba43 - <rustc_mir_build[61250234fad639b8]::builder::Builder>::expr_into_dest
  25:     0x73ee7d86b1af - <rustc_mir_build[61250234fad639b8]::builder::Builder>::expr_into_dest
  26:     0x73ee7d87bf25 - <rustc_mir_build[61250234fad639b8]::builder::Builder>::lower_match_arms
  27:     0x73ee7c404c57 - <rustc_mir_build[61250234fad639b8]::builder::Builder>::in_breakable_scope::<<rustc_mir_build[61250234fad639b8]::builder::Builder>::expr_into_dest::{closure#4}>
  28:     0x73ee7d873d8f - <rustc_mir_build[61250234fad639b8]::builder::Builder>::expr_into_dest
  29:     0x73ee7d85edb3 - <rustc_mir_build[61250234fad639b8]::builder::Builder>::as_temp::{closure#0}
  30:     0x73ee7d86cad8 - <rustc_mir_build[61250234fad639b8]::builder::Builder>::expr_into_dest
  31:     0x73ee7d86b1af - <rustc_mir_build[61250234fad639b8]::builder::Builder>::expr_into_dest
  32:     0x73ee7e3abac3 - <rustc_mir_build[61250234fad639b8]::builder::Builder>::ast_block_stmts
  33:     0x73ee7e3a9845 - <rustc_mir_build[61250234fad639b8]::builder::Builder>::ast_block
  34:     0x73ee7d86ba43 - <rustc_mir_build[61250234fad639b8]::builder::Builder>::expr_into_dest
  35:     0x73ee7d86b1af - <rustc_mir_build[61250234fad639b8]::builder::Builder>::expr_into_dest
  36:     0x73ee7d88660f - rustc_mir_build[61250234fad639b8]::builder::build_mir
  37:     0x73ee7d408576 - rustc_mir_transform[c248dae4784aeba2]::mir_built
  38:     0x73ee7d408547 - rustc_query_impl[90fda7b54e01eb8a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[90fda7b54e01eb8a]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[280599a7c0b63cac]::query::erase::Erased<[u8; 8usize]>>
  39:     0x73ee7d67bdee - rustc_query_system[7573c0cbc77994c3]::query::plumbing::try_execute_query::<rustc_query_impl[90fda7b54e01eb8a]::DynamicConfig<rustc_data_structures[8aa99e22adfe0321]::vec_cache::VecCache<rustc_span[63a709b6f97e6c64]::def_id::LocalDefId, rustc_middle[280599a7c0b63cac]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[7573c0cbc77994c3]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[90fda7b54e01eb8a]::plumbing::QueryCtxt, false>
  40:     0x73ee7d67b849 - rustc_query_impl[90fda7b54e01eb8a]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  41:     0x73ee7de5f1ea - rustc_mir_build[61250234fad639b8]::check_unsafety::check_unsafety
  42:     0x73ee7de5ef63 - rustc_query_impl[90fda7b54e01eb8a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[90fda7b54e01eb8a]::query_impl::check_unsafety::dynamic_query::{closure#2}::{closure#0}, rustc_middle[280599a7c0b63cac]::query::erase::Erased<[u8; 0usize]>>
  43:     0x73ee7de5e579 - rustc_query_system[7573c0cbc77994c3]::query::plumbing::try_execute_query::<rustc_query_impl[90fda7b54e01eb8a]::DynamicConfig<rustc_data_structures[8aa99e22adfe0321]::vec_cache::VecCache<rustc_span[63a709b6f97e6c64]::def_id::LocalDefId, rustc_middle[280599a7c0b63cac]::query::erase::Erased<[u8; 0usize]>, rustc_query_system[7573c0cbc77994c3]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[90fda7b54e01eb8a]::plumbing::QueryCtxt, false>
  44:     0x73ee7de5e251 - rustc_query_impl[90fda7b54e01eb8a]::query_impl::check_unsafety::get_query_non_incr::__rust_end_short_backtrace
  45:     0x73ee7d67a621 - <rustc_middle[280599a7c0b63cac]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface[8a437e4317c52b63]::passes::run_required_analyses::{closure#1}::{closure#0}>::{closure#0}
  46:     0x73ee7d677ff2 - rustc_interface[8a437e4317c52b63]::passes::analysis
  47:     0x73ee7d6774cb - rustc_query_impl[90fda7b54e01eb8a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[90fda7b54e01eb8a]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[280599a7c0b63cac]::query::erase::Erased<[u8; 0usize]>>
  48:     0x73ee7e46707c - rustc_query_system[7573c0cbc77994c3]::query::plumbing::try_execute_query::<rustc_query_impl[90fda7b54e01eb8a]::DynamicConfig<rustc_query_system[7573c0cbc77994c3]::query::caches::SingleCache<rustc_middle[280599a7c0b63cac]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[90fda7b54e01eb8a]::plumbing::QueryCtxt, false>
  49:     0x73ee7e466c46 - rustc_query_impl[90fda7b54e01eb8a]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  50:     0x73ee7e672716 - rustc_interface[8a437e4317c52b63]::passes::create_and_enter_global_ctxt::<core[22eaa475d40112dd]::option::Option<rustc_interface[8a437e4317c52b63]::queries::Linker>, rustc_driver_impl[5beb55ce640fb1f6]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  51:     0x73ee7e62acaf - rustc_interface[8a437e4317c52b63]::interface::run_compiler::<(), rustc_driver_impl[5beb55ce640fb1f6]::run_compiler::{closure#0}>::{closure#1}
  52:     0x73ee7e5dbeb8 - std[c4951d6ea725fdb1]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[8a437e4317c52b63]::util::run_in_thread_with_globals<rustc_interface[8a437e4317c52b63]::util::run_in_thread_pool_with_globals<rustc_interface[8a437e4317c52b63]::interface::run_compiler<(), rustc_driver_impl[5beb55ce640fb1f6]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  53:     0x73ee7e5dbb96 - <<std[c4951d6ea725fdb1]::thread::Builder>::spawn_unchecked_<rustc_interface[8a437e4317c52b63]::util::run_in_thread_with_globals<rustc_interface[8a437e4317c52b63]::util::run_in_thread_pool_with_globals<rustc_interface[8a437e4317c52b63]::interface::run_compiler<(), rustc_driver_impl[5beb55ce640fb1f6]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[22eaa475d40112dd]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  54:     0x73ee7e5e1e7d - std::sys::pal::unix::thread::Thread::new::thread_start::hbedf4cad2dfbb9f8
  55:     0x73ee780a57eb - <unknown>
  56:     0x73ee7812918c - <unknown>
  57:                0x0 - <unknown>

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 `/home/matthias/vcs/github/CRED/rustc-ice-2025-06-29T16_47_13-239544.txt` to your bug report

query stack during panic:
#0 [mir_built] building MIR for `test_f32`
#1 [check_unsafety] unsafety-checking `test_f32`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 2 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0579`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-loop_matchwhen you match up with someone and they really throw you for a loopI-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.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions