Open
Description
auto-reduced (treereduce-rust):
fn const_continue_to_block() -> u8 {
let state = 0;
#[loop_match]
loop {
state = 'blk: {
match state {
0 => {
#[const_continue]
break 'blk 1;
}
}
}
}
}
original:
//~^ ERROR invalid update of the `#[loop_match]` state
// is not part of a `#[loop_match]`) produces an error.
#![allow(DROPPED.load(Ordering::Relaxed))]
#![feature(loop_match)]
#![allow(incomplete_features)]
fn const_continue_to_block() -> u8 {
let state = 0;
#[loop_match]
loop {
state = 'blk: {
match state {
0 => {
#[const_continue]
break 'blk 1;
}
}
}
}
}
Version information
rustc 1.90.0-nightly (d51b6f971 2025-06-27)
binary: rustc
commit-hash: d51b6f97122671c5de27cfc08cded235357e0d97
commit-date: 2025-06-27
host: x86_64-unknown-linux-gnu
release: 1.90.0-nightly
LLVM version: 20.1.7
Possibly related line of code:
rust/compiler/rustc_errors/src/emitter.rs
Lines 1437 to 1449 in d51b6f9
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
error[E0658]: the `#[loop_match]` attribute is an experimental feature
--> /tmp/icemaker_global_tempdir.DDBBdwlrHwzN/rustc_testrunner_tmpdir_reporting.SsAeHJq0I0ud/mvce.rs:3:5
|
3 | #[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-06-27; consider upgrading it if it is out of date
error[E0658]: the `#[const_continue]` attribute is an experimental feature
--> /tmp/icemaker_global_tempdir.DDBBdwlrHwzN/rustc_testrunner_tmpdir_reporting.SsAeHJq0I0ud/mvce.rs:8:21
|
8 | #[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-06-27; consider upgrading it if it is out of date
error[E0601]: `main` function not found in crate `mvce`
--> /tmp/icemaker_global_tempdir.DDBBdwlrHwzN/rustc_testrunner_tmpdir_reporting.SsAeHJq0I0ud/mvce.rs:14:2
|
14 | }
| ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.DDBBdwlrHwzN/rustc_testrunner_tmpdir_reporting.SsAeHJq0I0ud/mvce.rs`
error: the target of this `#[const_continue]` is not statically known
--> /tmp/icemaker_global_tempdir.DDBBdwlrHwzN/rustc_testrunner_tmpdir_reporting.SsAeHJq0I0ud/mvce.rs:9:21
|
9 | break 'blk 1;
| ^^^^^^^^^^^^
|
thread 'rustc' panicked at compiler/rustc_errors/src/emitter.rs:1443:91:
called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `mir_build_const_continue_unknown_jump_target`:
the attribute `note` was missing
help: add `.note = <message>`
stack backtrace:
0: 0x7fd97d306d93 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h172786a053088a80
1: 0x7fd97da02c3f - core::fmt::write::h7e8ea7c2bf766230
2: 0x7fd97d2fc9c3 - std::io::Write::write_fmt::h8aef4545d51610bc
3: 0x7fd97d306bf2 - std::sys::backtrace::BacktraceLock::print::hcaf1ccd6afbf2e1d
4: 0x7fd97d30a6ea - std::panicking::default_hook::{{closure}}::h4ce4779ce8a3e31a
5: 0x7fd97d30a26f - std::panicking::default_hook::hafe5dcd1475f74c9
6: 0x7fd97c3e51f3 - std[ac406385963d06ba]::panicking::update_hook::<alloc[762d5bb616333adc]::boxed::Box<rustc_driver_impl[2409353bb348a1fe]::install_ice_hook::{closure#1}>>::{closure#0}
7: 0x7fd97d30af3b - std::panicking::rust_panic_with_hook::h2b643051b0ee54bd
8: 0x7fd97d30ac3a - std::panicking::begin_panic_handler::{{closure}}::h2f43df37d8ec1fc9
9: 0x7fd97d307269 - std::sys::backtrace::__rust_end_short_backtrace::hdd0bf39addaa3bbd
10: 0x7fd97d30a91d - __rustc[ec5114c7948ebf25]::rust_begin_unwind
11: 0x7fd979a999c0 - core::panicking::panic_fmt::h7cdf2f61e2255620
12: 0x7fd979bf4d76 - core::result::unwrap_failed::h26253e0b18f7a20d
13: 0x7fd97f006501 - <rustc_errors[5eec380c76c0dcb8]::emitter::HumanEmitter>::msgs_to_buffer
14: 0x7fd97f0074c1 - <rustc_errors[5eec380c76c0dcb8]::emitter::HumanEmitter>::emit_messages_default_inner::{closure#0}
15: 0x7fd97ef0486b - <rustc_errors[5eec380c76c0dcb8]::emitter::HumanEmitter as rustc_errors[5eec380c76c0dcb8]::emitter::Emitter>::emit_diagnostic
16: 0x7fd97ef0c077 - <rustc_errors[5eec380c76c0dcb8]::DiagCtxtInner>::emit_diagnostic::{closure#3}
17: 0x7fd97ef09ecd - rustc_interface[e31b222a2d1d97f1]::callbacks::track_diagnostic::<core[1aae05a66286d11a]::option::Option<rustc_span[d438a3ce0d69ef07]::ErrorGuaranteed>>::{closure#0}
18: 0x7fd97ef0986b - rustc_interface[e31b222a2d1d97f1]::callbacks::track_diagnostic::<core[1aae05a66286d11a]::option::Option<rustc_span[d438a3ce0d69ef07]::ErrorGuaranteed>>
19: 0x7fd97ef08e7d - <rustc_errors[5eec380c76c0dcb8]::DiagCtxtInner>::emit_diagnostic
20: 0x7fd97ef08d3f - <rustc_errors[5eec380c76c0dcb8]::DiagCtxtHandle>::emit_diagnostic
21: 0x7fd97c429d21 - <rustc_errors[5eec380c76c0dcb8]::diagnostic::Diag<rustc_errors[5eec380c76c0dcb8]::diagnostic::BugAbort>>::emit_producing_nothing
22: 0x7fd97b78fa46 - <rustc_errors[5eec380c76c0dcb8]::diagnostic::FatalAbort as rustc_errors[5eec380c76c0dcb8]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
23: 0x7fd97df61ff4 - <rustc_mir_build[cdbca9784612547]::builder::Builder>::stmt_expr
24: 0x7fd97df60153 - <rustc_mir_build[cdbca9784612547]::builder::Builder>::stmt_expr
25: 0x7fd97e9e4360 - <rustc_mir_build[cdbca9784612547]::builder::Builder>::ast_block_stmts
26: 0x7fd97e9e3645 - <rustc_mir_build[cdbca9784612547]::builder::Builder>::ast_block
27: 0x7fd97df4b196 - <rustc_mir_build[cdbca9784612547]::builder::Builder>::expr_into_dest
28: 0x7fd97df3e4f3 - <rustc_mir_build[cdbca9784612547]::builder::Builder>::as_temp::{closure#0}
29: 0x7fd97df4c285 - <rustc_mir_build[cdbca9784612547]::builder::Builder>::expr_into_dest
30: 0x7fd97df4a8fa - <rustc_mir_build[cdbca9784612547]::builder::Builder>::expr_into_dest
31: 0x7fd97df5b741 - <rustc_mir_build[cdbca9784612547]::builder::Builder>::lower_match_arms
32: 0x7fd97ca61257 - <rustc_mir_build[cdbca9784612547]::builder::Builder>::in_breakable_scope::<<rustc_mir_build[cdbca9784612547]::builder::Builder>::expr_into_dest::{closure#4}>
33: 0x7fd97df5356d - <rustc_mir_build[cdbca9784612547]::builder::Builder>::expr_into_dest
34: 0x7fd97df3e4f3 - <rustc_mir_build[cdbca9784612547]::builder::Builder>::as_temp::{closure#0}
35: 0x7fd97df4c285 - <rustc_mir_build[cdbca9784612547]::builder::Builder>::expr_into_dest
36: 0x7fd97df4a8fa - <rustc_mir_build[cdbca9784612547]::builder::Builder>::expr_into_dest
37: 0x7fd97e9e58c3 - <rustc_mir_build[cdbca9784612547]::builder::Builder>::ast_block_stmts
38: 0x7fd97e9e3645 - <rustc_mir_build[cdbca9784612547]::builder::Builder>::ast_block
39: 0x7fd97df4b196 - <rustc_mir_build[cdbca9784612547]::builder::Builder>::expr_into_dest
40: 0x7fd97df4a8fa - <rustc_mir_build[cdbca9784612547]::builder::Builder>::expr_into_dest
41: 0x7fd97df65e8f - rustc_mir_build[cdbca9784612547]::builder::build_mir
42: 0x7fd97da08576 - rustc_mir_transform[f7ca16422ee96398]::mir_built
43: 0x7fd97da08547 - rustc_query_impl[cdda87a48a29190a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[cdda87a48a29190a]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[85d0084cd8285b0d]::query::erase::Erased<[u8; 8usize]>>
44: 0x7fd97dc6ee6e - rustc_query_system[c91322fa492962f5]::query::plumbing::try_execute_query::<rustc_query_impl[cdda87a48a29190a]::DynamicConfig<rustc_data_structures[deb77fa27d028d21]::vec_cache::VecCache<rustc_span[d438a3ce0d69ef07]::def_id::LocalDefId, rustc_middle[85d0084cd8285b0d]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[c91322fa492962f5]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[cdda87a48a29190a]::plumbing::QueryCtxt, false>
45: 0x7fd97dc6e8c9 - rustc_query_impl[cdda87a48a29190a]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
46: 0x7fd97e38ae2a - rustc_mir_build[cdbca9784612547]::check_unsafety::check_unsafety
47: 0x7fd97e38aba3 - rustc_query_impl[cdda87a48a29190a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[cdda87a48a29190a]::query_impl::check_unsafety::dynamic_query::{closure#2}::{closure#0}, rustc_middle[85d0084cd8285b0d]::query::erase::Erased<[u8; 0usize]>>
48: 0x7fd97e38a1b9 - rustc_query_system[c91322fa492962f5]::query::plumbing::try_execute_query::<rustc_query_impl[cdda87a48a29190a]::DynamicConfig<rustc_data_structures[deb77fa27d028d21]::vec_cache::VecCache<rustc_span[d438a3ce0d69ef07]::def_id::LocalDefId, rustc_middle[85d0084cd8285b0d]::query::erase::Erased<[u8; 0usize]>, rustc_query_system[c91322fa492962f5]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[cdda87a48a29190a]::plumbing::QueryCtxt, false>
49: 0x7fd97e389e95 - rustc_query_impl[cdda87a48a29190a]::query_impl::check_unsafety::get_query_non_incr::__rust_end_short_backtrace
50: 0x7fd97dc6d6a1 - <rustc_middle[85d0084cd8285b0d]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface[e31b222a2d1d97f1]::passes::run_required_analyses::{closure#1}::{closure#0}>::{closure#0}
51: 0x7fd97dc6b072 - rustc_interface[e31b222a2d1d97f1]::passes::analysis
52: 0x7fd97dc6a54b - rustc_query_impl[cdda87a48a29190a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[cdda87a48a29190a]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[85d0084cd8285b0d]::query::erase::Erased<[u8; 0usize]>>
53: 0x7fd97ea8ba7c - rustc_query_system[c91322fa492962f5]::query::plumbing::try_execute_query::<rustc_query_impl[cdda87a48a29190a]::DynamicConfig<rustc_query_system[c91322fa492962f5]::query::caches::SingleCache<rustc_middle[85d0084cd8285b0d]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[cdda87a48a29190a]::plumbing::QueryCtxt, false>
54: 0x7fd97ea8b752 - rustc_query_impl[cdda87a48a29190a]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
55: 0x7fd97ec55dd6 - rustc_interface[e31b222a2d1d97f1]::passes::create_and_enter_global_ctxt::<core[1aae05a66286d11a]::option::Option<rustc_interface[e31b222a2d1d97f1]::queries::Linker>, rustc_driver_impl[2409353bb348a1fe]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
56: 0x7fd97ec474af - rustc_interface[e31b222a2d1d97f1]::interface::run_compiler::<(), rustc_driver_impl[2409353bb348a1fe]::run_compiler::{closure#0}>::{closure#1}
57: 0x7fd97ec714f8 - std[ac406385963d06ba]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[e31b222a2d1d97f1]::util::run_in_thread_with_globals<rustc_interface[e31b222a2d1d97f1]::util::run_in_thread_pool_with_globals<rustc_interface[e31b222a2d1d97f1]::interface::run_compiler<(), rustc_driver_impl[2409353bb348a1fe]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
58: 0x7fd97ec711d6 - <<std[ac406385963d06ba]::thread::Builder>::spawn_unchecked_<rustc_interface[e31b222a2d1d97f1]::util::run_in_thread_with_globals<rustc_interface[e31b222a2d1d97f1]::util::run_in_thread_pool_with_globals<rustc_interface[e31b222a2d1d97f1]::interface::run_compiler<(), rustc_driver_impl[2409353bb348a1fe]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[1aae05a66286d11a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
59: 0x7fd97ec6f7fd - std::sys::pal::unix::thread::Thread::new::thread_start::hf9e92a00dfd64138
60: 0x7fd9786a57eb - <unknown>
61: 0x7fd97872918c - <unknown>
62: 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: rustc 1.90.0-nightly (d51b6f971 2025-06-27) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [mir_built] building MIR for `const_continue_to_block`
#1 [check_unsafety] unsafety-checking `const_continue_to_block`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0601, E0658.
For more information about an error, try `rustc --explain E0601`.
@rustbot label +F-loop_match