Skip to content

ICE: assertion failed: b.index() < self.live_nodes #141689

Closed
@cynecx

Description

@cynecx

Code

fn main() {
    let x = 0;
    'r: {
        continue 'r;
    };
}

Playground

Meta

rustc --version --verbose:

rustc 1.87.0 (17067e9ac 2025-05-09) running on x86_64-unknown-linux-gnu

Error output

error[E0696]: `continue` pointing to a labeled block
 --> src/main.rs:4:9
  |
3 | /     'r: {
4 | |         continue 'r;
  | |         ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
5 | |     };
  | |_____- labeled block the `continue` points to

Backtrace

thread 'rustc' panicked at compiler/rustc_passes/src/liveness/rwu_table.rs:63:9:
assertion failed: b.index() < self.live_nodes
stack backtrace:
   0:     0x77d84ba8a3c3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hc04c8f544ab24d66
   1:     0x77d84c205b51 - core::fmt::write::hfe57b7174b7d8eab
   2:     0x77d84d68e011 - std::io::Write::write_fmt::h154385efa8565236
   3:     0x77d84ba8a222 - std::sys::backtrace::BacktraceLock::print::h0c8f24e22f5873a8
   4:     0x77d84ba8cada - std::panicking::default_hook::{{closure}}::hd07d57e6a602c8e4
   5:     0x77d84ba8c65f - std::panicking::default_hook::h63d12f7d95bd91ed
   6:     0x77d84aaf0450 - std[ab9b65b5f5dd2f44]::panicking::update_hook::<alloc[4810a64b00f2b3b7]::boxed::Box<rustc_driver_impl[ddaea9a5059e4009]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x77d84ba8d353 - std::panicking::rust_panic_with_hook::h33b18b24045abff4
   8:     0x77d84ba8d016 - std::panicking::begin_panic_handler::{{closure}}::hf8313cc2fd0126bc
   9:     0x77d84ba8a899 - std::sys::backtrace::__rust_end_short_backtrace::h57fe07c8aea5c98a
  10:     0x77d84ba8cd0d - __rustc[95feac21a9532783]::rust_begin_unwind
  11:     0x77d848494960 - core::panicking::panic_fmt::hd54fb667be51beea
  12:     0x77d8490f9c6c - core::panicking::panic::h48a7e1f3665210c6
  13:     0x77d84cc4f3b5 - <rustc_hir[201392ed958526d3]::hir::Pat>::walk_::<<rustc_hir[201392ed958526d3]::hir::Pat>::each_binding_or_first<<rustc_passes[98c69e82b6fffdc9]::liveness::Liveness>::define_bindings_in_pat::{closure#0}>::{closure#0}>
  14:     0x77d84cc4f595 - <rustc_passes[98c69e82b6fffdc9]::liveness::Liveness>::propagate_through_block
  15:     0x77d84cc49428 - rustc_passes[98c69e82b6fffdc9]::liveness::check_liveness
  16:     0x77d84cc48a71 - rustc_query_impl[9eb226868f218d86]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9eb226868f218d86]::query_impl::check_liveness::dynamic_query::{closure#2}::{closure#0}, rustc_middle[f5c565be837cd477]::query::erase::Erased<[u8; 0usize]>>
  17:     0x77d84cc40b1d - rustc_query_system[719b00724ab1874c]::query::plumbing::try_execute_query::<rustc_query_impl[9eb226868f218d86]::DynamicConfig<rustc_data_structures[9ee724d09a4c196d]::vec_cache::VecCache<rustc_span[b87e37d4967e23ab]::def_id::LocalDefId, rustc_middle[f5c565be837cd477]::query::erase::Erased<[u8; 0usize]>, rustc_query_system[719b00724ab1874c]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[9eb226868f218d86]::plumbing::QueryCtxt, false>
  18:     0x77d84cc4088c - rustc_query_impl[9eb226868f218d86]::query_impl::check_liveness::get_query_non_incr::__rust_end_short_backtrace
  19:     0x77d84cb423ad - rustc_mir_build[4b8f3d81bbe6381]::builder::build_mir
  20:     0x77d84c209cf5 - rustc_mir_transform[3f8bf91e0e7bcf96]::mir_built
  21:     0x77d84c209cc7 - rustc_query_impl[9eb226868f218d86]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9eb226868f218d86]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[f5c565be837cd477]::query::erase::Erased<[u8; 8usize]>>
  22:     0x77d84c5f43ac - rustc_query_system[719b00724ab1874c]::query::plumbing::try_execute_query::<rustc_query_impl[9eb226868f218d86]::DynamicConfig<rustc_data_structures[9ee724d09a4c196d]::vec_cache::VecCache<rustc_span[b87e37d4967e23ab]::def_id::LocalDefId, rustc_middle[f5c565be837cd477]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[719b00724ab1874c]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[9eb226868f218d86]::plumbing::QueryCtxt, false>
  23:     0x77d84c5f3ecb - rustc_query_impl[9eb226868f218d86]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  24:     0x77d84cc4174f - rustc_mir_build[4b8f3d81bbe6381]::check_unsafety::check_unsafety
  25:     0x77d84cc41519 - rustc_query_impl[9eb226868f218d86]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9eb226868f218d86]::query_impl::check_unsafety::dynamic_query::{closure#2}::{closure#0}, rustc_middle[f5c565be837cd477]::query::erase::Erased<[u8; 0usize]>>
  26:     0x77d84cc40b11 - rustc_query_system[719b00724ab1874c]::query::plumbing::try_execute_query::<rustc_query_impl[9eb226868f218d86]::DynamicConfig<rustc_data_structures[9ee724d09a4c196d]::vec_cache::VecCache<rustc_span[b87e37d4967e23ab]::def_id::LocalDefId, rustc_middle[f5c565be837cd477]::query::erase::Erased<[u8; 0usize]>, rustc_query_system[719b00724ab1874c]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[9eb226868f218d86]::plumbing::QueryCtxt, false>
  27:     0x77d84cc407fe - rustc_query_impl[9eb226868f218d86]::query_impl::check_unsafety::get_query_non_incr::__rust_end_short_backtrace
  28:     0x77d84cc3d6a1 - rustc_interface[4f8e933b45f54331]::passes::run_required_analyses
  29:     0x77d84ccf639e - rustc_interface[4f8e933b45f54331]::passes::analysis
  30:     0x77d84ccf636d - rustc_query_impl[9eb226868f218d86]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9eb226868f218d86]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[f5c565be837cd477]::query::erase::Erased<[u8; 0usize]>>
  31:     0x77d84d18897d - rustc_query_system[719b00724ab1874c]::query::plumbing::try_execute_query::<rustc_query_impl[9eb226868f218d86]::DynamicConfig<rustc_query_system[719b00724ab1874c]::query::caches::SingleCache<rustc_middle[f5c565be837cd477]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[9eb226868f218d86]::plumbing::QueryCtxt, false>
  32:     0x77d84d188678 - rustc_query_impl[9eb226868f218d86]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  33:     0x77d84d331e87 - rustc_interface[4f8e933b45f54331]::passes::create_and_enter_global_ctxt::<core[6e25f1b983e4a449]::option::Option<rustc_interface[4f8e933b45f54331]::queries::Linker>, rustc_driver_impl[ddaea9a5059e4009]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  34:     0x77d84d323eaa - rustc_interface[4f8e933b45f54331]::interface::run_compiler::<(), rustc_driver_impl[ddaea9a5059e4009]::run_compiler::{closure#0}>::{closure#1}
  35:     0x77d84d164f08 - std[ab9b65b5f5dd2f44]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[4f8e933b45f54331]::util::run_in_thread_with_globals<rustc_interface[4f8e933b45f54331]::util::run_in_thread_pool_with_globals<rustc_interface[4f8e933b45f54331]::interface::run_compiler<(), rustc_driver_impl[ddaea9a5059e4009]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  36:     0x77d84d1657f4 - <<std[ab9b65b5f5dd2f44]::thread::Builder>::spawn_unchecked_<rustc_interface[4f8e933b45f54331]::util::run_in_thread_with_globals<rustc_interface[4f8e933b45f54331]::util::run_in_thread_pool_with_globals<rustc_interface[4f8e933b45f54331]::interface::run_compiler<(), rustc_driver_impl[ddaea9a5059e4009]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[6e25f1b983e4a449]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  37:     0x77d84d166bf7 - std::sys::pal::unix::thread::Thread::new::thread_start::h2717d4f9aca577e6
  38:     0x77d84708aaa4 - <unknown>
  39:     0x77d847117a34 - clone
  40:                0x0 - <unknown>

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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions