- Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-loop_matchwhen you match up with someone and they really throw you for a loopwhen you match up with someone and they really throw you for a loopI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
auto-reduced (treereduce-rust):
struct Foo { x: u32, } impl Foo { const TARGET: u8 = todo!(); fn test_u8(mut state: u8) -> &'static str { #[loop_match] loop { state = 'blk: { match state { 0 => { #[const_continue] break 'blk Self::TARGET; } _ => unreachable!(), } } } } }original:
#![feature(loop_match)] struct Foo { x: u32, } impl Foo { const TARGET: u8 = todo!(); fn test_u8(mut state: u8) -> &'static str { #[loop_match] loop { state = 'blk: { match state { 0 => { #[const_continue] break 'blk Self::TARGET; } _ => unreachable!(), } } } } } pub fn main() {}Version information
rustc 1.90.0-nightly (556d20a83 2025-07-04) binary: rustc commit-hash: 556d20a834126d2d0ac20743b9792b8474d6d03c commit-date: 2025-07-04 host: x86_64-unknown-linux-gnu release: 1.90.0-nightly LLVM version: 20.1.7 Possibly related line of code:
rust/compiler/rustc_mir_build/src/builder/mod.rs
Lines 813 to 825 in 556d20a
| &body, | |
| &mut |_, _| Ok(()), | |
| &mut std::io::stdout(), | |
| options, | |
| ) | |
| .unwrap(); | |
| span_bug!(self.fn_span, "no terminator on block {:?}", index); | |
| } | |
| } | |
| body | |
| } | |
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
error[E0658]: the `#[loop_match]` attribute is an experimental feature --> /tmp/icemaker_global_tempdir.F82SoCFLeZN5/rustc_testrunner_tmpdir_reporting.U9FDonRpqCZm/mvce.rs:9:9 | 9 | #[loop_match] | ^^^^^^^^^^^^^ | = note: see issue #132306 <https://github.com/rust-lang/rust/issues/132306> for more information = help: add `#![feature(loop_match)]` to the crate attributes to enable = note: this compiler was built on 2025-07-04; consider upgrading it if it is out of date error[E0658]: the `#[const_continue]` attribute is an experimental feature --> /tmp/icemaker_global_tempdir.F82SoCFLeZN5/rustc_testrunner_tmpdir_reporting.U9FDonRpqCZm/mvce.rs:14:25 | 14 | #[const_continue] | ^^^^^^^^^^^^^^^^^ | = note: see issue #132306 <https://github.com/rust-lang/rust/issues/132306> for more information = help: add `#![feature(loop_match)]` to the crate attributes to enable = note: this compiler was built on 2025-07-04; consider upgrading it if it is out of date error[E0601]: `main` function not found in crate `mvce` --> /tmp/icemaker_global_tempdir.F82SoCFLeZN5/rustc_testrunner_tmpdir_reporting.U9FDonRpqCZm/mvce.rs:23:2 | 23 | } | ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.F82SoCFLeZN5/rustc_testrunner_tmpdir_reporting.U9FDonRpqCZm/mvce.rs` error[E0080]: evaluation panicked: not yet implemented --> /tmp/icemaker_global_tempdir.F82SoCFLeZN5/rustc_testrunner_tmpdir_reporting.U9FDonRpqCZm/mvce.rs:6:24 | 6 | const TARGET: u8 = todo!(); | ^^^^^^^ evaluation of `Foo::TARGET` failed here | = note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info) error: internal compiler error: compiler/rustc_mir_build/src/builder/mod.rs:819:17: no terminator on block 7 --> /tmp/icemaker_global_tempdir.F82SoCFLeZN5/rustc_testrunner_tmpdir_reporting.U9FDonRpqCZm/mvce.rs:8:5 | 8 | / fn test_u8(mut state: u8) -> &'static str { 9 | | #[loop_match] 10 | | loop { 11 | | state = 'blk: { ... | 22 | | } | |_____^ thread 'rustc' panicked at compiler/rustc_mir_build/src/builder/mod.rs:819:17: Box<dyn Any> stack backtrace: 0: 0x74dee8b37cf3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h76857e2fde385eaa 1: 0x74dee9202b3f - core::fmt::write::h534df39e8dafa1d4 2: 0x74dee8b2d933 - std::io::Write::write_fmt::hcae8fcc366e280f5 3: 0x74dee8b37b52 - std::sys::backtrace::BacktraceLock::print::h77df0a5d3b05db73 4: 0x74dee8b3b64a - std::panicking::default_hook::{{closure}}::h644006a989100667 5: 0x74dee8b3b1cf - std::panicking::default_hook::h097d001cff27e98d 6: 0x74dee7c052a3 - std[9f5bc91d2013a052]::panicking::update_hook::<alloc[bcc6f639c33194c0]::boxed::Box<rustc_driver_impl[524854abdb57a7ca]::install_ice_hook::{closure#1}>>::{closure#0} 7: 0x74dee8b3be9b - std::panicking::rust_panic_with_hook::h98472680a38e6480 8: 0x74dee7c3f581 - std[9f5bc91d2013a052]::panicking::begin_panic::<rustc_errors[3b8acae0d0dc2219]::ExplicitBug>::{closure#0} 9: 0x74dee7c33a96 - std[9f5bc91d2013a052]::sys::backtrace::__rust_end_short_backtrace::<std[9f5bc91d2013a052]::panicking::begin_panic<rustc_errors[3b8acae0d0dc2219]::ExplicitBug>::{closure#0}, !> 10: 0x74dee7c33727 - std[9f5bc91d2013a052]::panicking::begin_panic::<rustc_errors[3b8acae0d0dc2219]::ExplicitBug> 11: 0x74dee7c49051 - <rustc_errors[3b8acae0d0dc2219]::diagnostic::BugAbort as rustc_errors[3b8acae0d0dc2219]::diagnostic::EmissionGuarantee>::emit_producing_guarantee 12: 0x74dee818a97c - <rustc_errors[3b8acae0d0dc2219]::DiagCtxtHandle>::span_bug::<rustc_span[63d065dece4b0bed]::span_encoding::Span, alloc[bcc6f639c33194c0]::string::String> 13: 0x74dee821f5a7 - rustc_middle[d8231fd76845eb01]::util::bug::opt_span_bug_fmt::<rustc_span[63d065dece4b0bed]::span_encoding::Span>::{closure#0} 14: 0x74dee81ff64a - rustc_middle[d8231fd76845eb01]::ty::context::tls::with_opt::<rustc_middle[d8231fd76845eb01]::util::bug::opt_span_bug_fmt<rustc_span[63d065dece4b0bed]::span_encoding::Span>::{closure#0}, !>::{closure#0} 15: 0x74dee81ff4bb - rustc_middle[d8231fd76845eb01]::ty::context::tls::with_context_opt::<rustc_middle[d8231fd76845eb01]::ty::context::tls::with_opt<rustc_middle[d8231fd76845eb01]::util::bug::opt_span_bug_fmt<rustc_span[63d065dece4b0bed]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !> 16: 0x74dee62b35d7 - rustc_middle[d8231fd76845eb01]::util::bug::span_bug_fmt::<rustc_span[63d065dece4b0bed]::span_encoding::Span> 17: 0x74dee98b6ba9 - <rustc_mir_build[a7d95d2955a869a9]::builder::Builder>::finish 18: 0x74dee98acd75 - rustc_mir_build[a7d95d2955a869a9]::builder::build_mir 19: 0x74dee9208476 - rustc_mir_transform[61a4e3101155c394]::mir_built 20: 0x74dee9208447 - rustc_query_impl[fe73a8fb7725e5ca]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[fe73a8fb7725e5ca]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d8231fd76845eb01]::query::erase::Erased<[u8; 8usize]>> 21: 0x74dee93db9ae - rustc_query_system[176abc31a821c69f]::query::plumbing::try_execute_query::<rustc_query_impl[fe73a8fb7725e5ca]::DynamicConfig<rustc_data_structures[8f046e94416a31bd]::vec_cache::VecCache<rustc_span[63d065dece4b0bed]::def_id::LocalDefId, rustc_middle[d8231fd76845eb01]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[176abc31a821c69f]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[fe73a8fb7725e5ca]::plumbing::QueryCtxt, false> 22: 0x74dee93db409 - rustc_query_impl[fe73a8fb7725e5ca]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace 23: 0x74dee9c4e074 - rustc_mir_build[a7d95d2955a869a9]::check_unsafety::check_unsafety 24: 0x74dee9c4ddd9 - rustc_query_impl[fe73a8fb7725e5ca]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[fe73a8fb7725e5ca]::query_impl::check_unsafety::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d8231fd76845eb01]::query::erase::Erased<[u8; 0usize]>> 25: 0x74dee9c4d3eb - rustc_query_system[176abc31a821c69f]::query::plumbing::try_execute_query::<rustc_query_impl[fe73a8fb7725e5ca]::DynamicConfig<rustc_data_structures[8f046e94416a31bd]::vec_cache::VecCache<rustc_span[63d065dece4b0bed]::def_id::LocalDefId, rustc_middle[d8231fd76845eb01]::query::erase::Erased<[u8; 0usize]>, rustc_query_system[176abc31a821c69f]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[fe73a8fb7725e5ca]::plumbing::QueryCtxt, false> 26: 0x74dee9c4d0cd - rustc_query_impl[fe73a8fb7725e5ca]::query_impl::check_unsafety::get_query_non_incr::__rust_end_short_backtrace 27: 0x74dee9c4c4a6 - <rustc_middle[d8231fd76845eb01]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface[bc523bc0d67cae4b]::passes::run_required_analyses::{closure#1}::{closure#0}>::{closure#0} 28: 0x74dee9c49f42 - rustc_interface[bc523bc0d67cae4b]::passes::analysis 29: 0x74dee9c493eb - rustc_query_impl[fe73a8fb7725e5ca]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[fe73a8fb7725e5ca]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[d8231fd76845eb01]::query::erase::Erased<[u8; 0usize]>> 30: 0x74deea29028e - rustc_query_system[176abc31a821c69f]::query::plumbing::try_execute_query::<rustc_query_impl[fe73a8fb7725e5ca]::DynamicConfig<rustc_query_system[176abc31a821c69f]::query::caches::SingleCache<rustc_middle[d8231fd76845eb01]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[fe73a8fb7725e5ca]::plumbing::QueryCtxt, false> 31: 0x74deea28fe76 - rustc_query_impl[fe73a8fb7725e5ca]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace 32: 0x74deea49f5d6 - rustc_interface[bc523bc0d67cae4b]::passes::create_and_enter_global_ctxt::<core[7216d62010c43d92]::option::Option<rustc_interface[bc523bc0d67cae4b]::queries::Linker>, rustc_driver_impl[524854abdb57a7ca]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0} 33: 0x74deea467603 - rustc_interface[bc523bc0d67cae4b]::interface::run_compiler::<(), rustc_driver_impl[524854abdb57a7ca]::run_compiler::{closure#0}>::{closure#1} 34: 0x74deea406c38 - std[9f5bc91d2013a052]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[bc523bc0d67cae4b]::util::run_in_thread_with_globals<rustc_interface[bc523bc0d67cae4b]::util::run_in_thread_pool_with_globals<rustc_interface[bc523bc0d67cae4b]::interface::run_compiler<(), rustc_driver_impl[524854abdb57a7ca]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()> 35: 0x74deea406916 - <<std[9f5bc91d2013a052]::thread::Builder>::spawn_unchecked_<rustc_interface[bc523bc0d67cae4b]::util::run_in_thread_with_globals<rustc_interface[bc523bc0d67cae4b]::util::run_in_thread_pool_with_globals<rustc_interface[bc523bc0d67cae4b]::interface::run_compiler<(), rustc_driver_impl[524854abdb57a7ca]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[7216d62010c43d92]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 36: 0x74deea404efd - std::sys::pal::unix::thread::Thread::new::thread_start::hda409a1a1f6b906b 37: 0x74dee3ea57eb - <unknown> 38: 0x74dee3f2918c - <unknown> 39: 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: rustc 1.90.0-nightly (556d20a83 2025-07-04) running on x86_64-unknown-linux-gnu query stack during panic: #0 [mir_built] building MIR for `<impl at /tmp/icemaker_global_tempdir.F82SoCFLeZN5/rustc_testrunner_tmpdir_reporting.U9FDonRpqCZm/mvce.rs:5:1: 5:9>::test_u8` #1 [check_unsafety] unsafety-checking `<impl at /tmp/icemaker_global_tempdir.F82SoCFLeZN5/rustc_testrunner_tmpdir_reporting.U9FDonRpqCZm/mvce.rs:5:1: 5:9>::test_u8` #2 [analysis] running analysis passes on this crate end of query stack error: aborting due to 5 previous errors Some errors have detailed explanations: E0080, E0601, E0658. For more information about an error, try `rustc --explain E0080`. @rustbot label +F-loop_match
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-loop_matchwhen you match up with someone and they really throw you for a loopwhen you match up with someone and they really throw you for a loopI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.