Open
Description
auto-reduced (treereduce-rust):
fn f() -> isize {
let mut x: isize;
for _ in 0..0 {
let s = [(); {
let mut n = 113383;
while n != 0 {}
n
}];
}
return x;
}
fn main() {
f();
}
original:
fn f() -> isize {
let mut x: isize;
for _ in 0..0 {
// Tests the Collatz conjecture with an incorrect base case (0 instead of 1).
// The value of `n` will loop indefinitely (4 - 2 - 1 - 4).
let s = [(); {
let mut n = 113383; // #20 in https://oeis.org/A006884
while n != 0 {
//~^ ERROR is taking a long time
n = if n % 2 == 0 { n / 2 } else { 3 * n + 1 };
}
n
}];
s.nonexistent_method();
}
return x; //~ ERROR E0381
}
fn main() { f(); }
Version information
rustc 1.80.0-nightly (20483b682 2024-05-20)
binary: rustc
commit-hash: 20483b68265f64de79442cf489a5316f918578f0
commit-date: 2024-05-20
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.6
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
warning: variable does not need to be mutable
--> /tmp/icemaker_global_tempdir.zzqBIXw6v8FA/rustc_testrunner_tmpdir_reporting.yUVZ0OKyKfyq/mvce.rs:5:17
|
5 | let mut n = 113383;
| ----^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
error: constant evaluation is taking a long time
--> /tmp/icemaker_global_tempdir.zzqBIXw6v8FA/rustc_testrunner_tmpdir_reporting.yUVZ0OKyKfyq/mvce.rs:6:13
|
6 | while n != 0 {}
| ^^^^^^^^^^^^^^^
|
= note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
If your compilation actually takes a long time, you can safely allow the lint.
help: the constant being evaluated
--> /tmp/icemaker_global_tempdir.zzqBIXw6v8FA/rustc_testrunner_tmpdir_reporting.yUVZ0OKyKfyq/mvce.rs:4:22
|
4 | let s = [(); {
| ______________________^
5 | | let mut n = 113383;
6 | | while n != 0 {}
7 | | n
8 | | }];
| |_________^
= note: `#[deny(long_running_const_eval)]` on by default
error: internal compiler error: compiler/rustc_passes/src/dead.rs:232:18: non-ADT in struct pattern
--> /tmp/icemaker_global_tempdir.zzqBIXw6v8FA/rustc_testrunner_tmpdir_reporting.yUVZ0OKyKfyq/mvce.rs:3:5
|
3 | / for _ in 0..0 {
4 | | let s = [(); {
5 | | let mut n = 113383;
6 | | while n != 0 {}
7 | | n
8 | | }];
9 | | }
| |_____^
thread 'rustc' panicked at compiler/rustc_passes/src/dead.rs:232:18:
Box<dyn Any>
stack backtrace:
0: 0x71722aa7eb85 - std::backtrace_rs::backtrace::libunwind::trace::he6da4379aff6142d
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
1: 0x71722aa7eb85 - std::backtrace_rs::backtrace::trace_unsynchronized::h04955c5653afdd1c
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x71722aa7eb85 - std::sys_common::backtrace::_print_fmt::hc30939011ed55196
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys_common/backtrace.rs:68:5
3: 0x71722aa7eb85 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf756b4bf3ddd605a
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys_common/backtrace.rs:44:22
4: 0x71722aacdc7b - core::fmt::rt::Argument::fmt::h9c42aecae17e95df
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/core/src/fmt/rt.rs:165:63
5: 0x71722aacdc7b - core::fmt::write::h3aabe8e1c19492ff
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/core/src/fmt/mod.rs:1169:21
6: 0x71722aa7390f - std::io::Write::write_fmt::hbc02e2e90412ba60
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/io/mod.rs:1835:15
7: 0x71722aa7e95e - std::sys_common::backtrace::_print::h970a746ce9fd1dc8
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys_common/backtrace.rs:47:5
8: 0x71722aa7e95e - std::sys_common::backtrace::print::hd00c4744cd708d80
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys_common/backtrace.rs:34:9
9: 0x71722aa81359 - std::panicking::default_hook::{{closure}}::h256ffa346f3a5cd0
10: 0x71722aa8109d - std::panicking::default_hook::h56b6405526a5971f
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/panicking.rs:298:9
11: 0x7172274ee1f0 - std[c5e309103866e771]::panicking::update_hook::<alloc[c591fc82162bd1fd]::boxed::Box<rustc_driver_impl[339cabd2c49c1c37]::install_ice_hook::{closure#0}>>::{closure#0}
12: 0x71722aa81a8b - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h73ec01f48f3f5e0a
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/alloc/src/boxed.rs:2036:9
13: 0x71722aa81a8b - std::panicking::rust_panic_with_hook::h06514f03ccbf27e6
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/panicking.rs:799:13
14: 0x71722751dff4 - std[c5e309103866e771]::panicking::begin_panic::<rustc_errors[af6a3578d1bfd0d8]::ExplicitBug>::{closure#0}
15: 0x71722751abf6 - std[c5e309103866e771]::sys_common::backtrace::__rust_end_short_backtrace::<std[c5e309103866e771]::panicking::begin_panic<rustc_errors[af6a3578d1bfd0d8]::ExplicitBug>::{closure#0}, !>
16: 0x71722751a8d6 - std[c5e309103866e771]::panicking::begin_panic::<rustc_errors[af6a3578d1bfd0d8]::ExplicitBug>
17: 0x7172275271b1 - <rustc_errors[af6a3578d1bfd0d8]::diagnostic::BugAbort as rustc_errors[af6a3578d1bfd0d8]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
18: 0x717227c23e98 - <rustc_errors[af6a3578d1bfd0d8]::DiagCtxt>::span_bug::<rustc_span[2dc48e59aa1d19e]::span_encoding::Span, alloc[c591fc82162bd1fd]::string::String>
19: 0x717227c3766d - rustc_middle[1a9664e0085f2636]::util::bug::opt_span_bug_fmt::<rustc_span[2dc48e59aa1d19e]::span_encoding::Span>::{closure#0}
20: 0x717227c3769a - rustc_middle[1a9664e0085f2636]::ty::context::tls::with_opt::<rustc_middle[1a9664e0085f2636]::util::bug::opt_span_bug_fmt<rustc_span[2dc48e59aa1d19e]::span_encoding::Span>::{closure#0}, !>::{closure#0}
21: 0x717227c31d3b - rustc_middle[1a9664e0085f2636]::ty::context::tls::with_context_opt::<rustc_middle[1a9664e0085f2636]::ty::context::tls::with_opt<rustc_middle[1a9664e0085f2636]::util::bug::opt_span_bug_fmt<rustc_span[2dc48e59aa1d19e]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
22: 0x717227c2fa07 - rustc_middle[1a9664e0085f2636]::util::bug::span_bug_fmt::<rustc_span[2dc48e59aa1d19e]::span_encoding::Span>
23: 0x717228c1d0bf - <rustc_passes[a9ae99b733236bbd]::dead::MarkSymbolVisitor as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_pat
24: 0x717228c1981a - <rustc_passes[a9ae99b733236bbd]::dead::MarkSymbolVisitor as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr
25: 0x717228c18c82 - rustc_hir[b268f985175477dc]::intravisit::walk_block::<rustc_passes[a9ae99b733236bbd]::dead::MarkSymbolVisitor>
26: 0x717228c19832 - <rustc_passes[a9ae99b733236bbd]::dead::MarkSymbolVisitor as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr
27: 0x717228c18c82 - rustc_hir[b268f985175477dc]::intravisit::walk_block::<rustc_passes[a9ae99b733236bbd]::dead::MarkSymbolVisitor>
28: 0x717228c1d8be - rustc_hir[b268f985175477dc]::intravisit::walk_item::<rustc_passes[a9ae99b733236bbd]::dead::MarkSymbolVisitor>
29: 0x717228c2113a - <rustc_passes[a9ae99b733236bbd]::dead::MarkSymbolVisitor>::mark_live_symbols
30: 0x717228f1dc4a - rustc_passes[a9ae99b733236bbd]::dead::live_symbols_and_ignored_derived_traits
31: 0x7172295d2298 - rustc_query_impl[9ed179a0f1d308f7]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9ed179a0f1d308f7]::query_impl::live_symbols_and_ignored_derived_traits::dynamic_query::{closure#2}::{closure#0}, rustc_middle[1a9664e0085f2636]::query::erase::Erased<[u8; 8usize]>>
32: 0x7172295d1592 - rustc_query_system[44fec123c527e9c2]::query::plumbing::try_execute_query::<rustc_query_impl[9ed179a0f1d308f7]::DynamicConfig<rustc_query_system[44fec123c527e9c2]::query::caches::SingleCache<rustc_middle[1a9664e0085f2636]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[9ed179a0f1d308f7]::plumbing::QueryCtxt, false>
33: 0x7172295d0dc2 - rustc_query_impl[9ed179a0f1d308f7]::query_impl::live_symbols_and_ignored_derived_traits::get_query_non_incr::__rust_end_short_backtrace
34: 0x717228f1abec - rustc_passes[a9ae99b733236bbd]::dead::check_mod_deathness
35: 0x717228f1aa63 - rustc_query_impl[9ed179a0f1d308f7]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9ed179a0f1d308f7]::query_impl::check_mod_deathness::dynamic_query::{closure#2}::{closure#0}, rustc_middle[1a9664e0085f2636]::query::erase::Erased<[u8; 0usize]>>
36: 0x717229307b3d - rustc_query_system[44fec123c527e9c2]::query::plumbing::try_execute_query::<rustc_query_impl[9ed179a0f1d308f7]::DynamicConfig<rustc_query_system[44fec123c527e9c2]::query::caches::DefaultCache<rustc_span[2dc48e59aa1d19e]::def_id::LocalModDefId, rustc_middle[1a9664e0085f2636]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[9ed179a0f1d308f7]::plumbing::QueryCtxt, false>
37: 0x71722930ba3f - rustc_query_impl[9ed179a0f1d308f7]::query_impl::check_mod_deathness::get_query_non_incr::__rust_end_short_backtrace
38: 0x71722930e5b9 - rustc_interface[1cae66118a42494d]::passes::analysis
39: 0x71722930db1b - rustc_query_impl[9ed179a0f1d308f7]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9ed179a0f1d308f7]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[1a9664e0085f2636]::query::erase::Erased<[u8; 1usize]>>
40: 0x7172295d2a65 - rustc_query_system[44fec123c527e9c2]::query::plumbing::try_execute_query::<rustc_query_impl[9ed179a0f1d308f7]::DynamicConfig<rustc_query_system[44fec123c527e9c2]::query::caches::SingleCache<rustc_middle[1a9664e0085f2636]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[9ed179a0f1d308f7]::plumbing::QueryCtxt, false>
41: 0x7172295d27c9 - rustc_query_impl[9ed179a0f1d308f7]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
42: 0x71722940434e - rustc_interface[1cae66118a42494d]::interface::run_compiler::<core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>, rustc_driver_impl[339cabd2c49c1c37]::run_compiler::{closure#0}>::{closure#1}
43: 0x7172293f1cc9 - std[c5e309103866e771]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[1cae66118a42494d]::util::run_in_thread_with_globals<rustc_interface[1cae66118a42494d]::util::run_in_thread_pool_with_globals<rustc_interface[1cae66118a42494d]::interface::run_compiler<core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>, rustc_driver_impl[339cabd2c49c1c37]::run_compiler::{closure#0}>::{closure#1}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#0}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>
44: 0x7172293f1a76 - <<std[c5e309103866e771]::thread::Builder>::spawn_unchecked_<rustc_interface[1cae66118a42494d]::util::run_in_thread_with_globals<rustc_interface[1cae66118a42494d]::util::run_in_thread_pool_with_globals<rustc_interface[1cae66118a42494d]::interface::run_compiler<core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>, rustc_driver_impl[339cabd2c49c1c37]::run_compiler::{closure#0}>::{closure#1}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#0}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#2} as core[3219cb84013fadfb]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
45: 0x71722aa8b86b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h26d0e5dfdd9c0f2f
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/alloc/src/boxed.rs:2022:9
46: 0x71722aa8b86b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hdf40085d252d7219
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/alloc/src/boxed.rs:2022:9
47: 0x71722aa8b86b - std::sys::pal::unix::thread::Thread::new::thread_start::hb8758c3a30e7eae2
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys/pal/unix/thread.rs:108:17
48: 0x7172242aa1cf - <unknown>
49: 0x71722432b6ec - <unknown>
50: 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.80.0-nightly (20483b682 2024-05-20) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [live_symbols_and_ignored_derived_traits] finding live symbols in crate
#1 [check_mod_deathness] checking deathness of variables in top-level module
end of query stack
thread 'rustc' panicked at compiler/rustc_lint/src/builtin.rs:255:18:
struct pattern type is not an ADT
stack backtrace:
0: 0x71722aa7eb85 - std::backtrace_rs::backtrace::libunwind::trace::he6da4379aff6142d
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
1: 0x71722aa7eb85 - std::backtrace_rs::backtrace::trace_unsynchronized::h04955c5653afdd1c
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x71722aa7eb85 - std::sys_common::backtrace::_print_fmt::hc30939011ed55196
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys_common/backtrace.rs:68:5
3: 0x71722aa7eb85 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf756b4bf3ddd605a
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys_common/backtrace.rs:44:22
4: 0x71722aacdc7b - core::fmt::rt::Argument::fmt::h9c42aecae17e95df
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/core/src/fmt/rt.rs:165:63
5: 0x71722aacdc7b - core::fmt::write::h3aabe8e1c19492ff
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/core/src/fmt/mod.rs:1169:21
6: 0x71722aa7390f - std::io::Write::write_fmt::hbc02e2e90412ba60
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/io/mod.rs:1835:15
7: 0x71722aa7e95e - std::sys_common::backtrace::_print::h970a746ce9fd1dc8
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys_common/backtrace.rs:47:5
8: 0x71722aa7e95e - std::sys_common::backtrace::print::hd00c4744cd708d80
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys_common/backtrace.rs:34:9
9: 0x71722aa81359 - std::panicking::default_hook::{{closure}}::h256ffa346f3a5cd0
10: 0x71722aa8109d - std::panicking::default_hook::h56b6405526a5971f
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/panicking.rs:298:9
11: 0x7172274ee1f0 - std[c5e309103866e771]::panicking::update_hook::<alloc[c591fc82162bd1fd]::boxed::Box<rustc_driver_impl[339cabd2c49c1c37]::install_ice_hook::{closure#0}>>::{closure#0}
12: 0x71722aa81a8b - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h73ec01f48f3f5e0a
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/alloc/src/boxed.rs:2036:9
13: 0x71722aa81a8b - std::panicking::rust_panic_with_hook::h06514f03ccbf27e6
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/panicking.rs:799:13
14: 0x71722aa81804 - std::panicking::begin_panic_handler::{{closure}}::hdc456e662baa956f
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/panicking.rs:664:13
15: 0x71722aa7f049 - std::sys_common::backtrace::__rust_end_short_backtrace::he43c53287432c969
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys_common/backtrace.rs:171:18
16: 0x71722aa81537 - rust_begin_unwind
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/panicking.rs:652:5
17: 0x71722aaca243 - core::panicking::panic_fmt::h024d3c362d0de7b2
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/core/src/panicking.rs:72:14
18: 0x71722aaca3fc - core::panicking::panic_display::h2002a5effac02b61
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/core/src/panicking.rs:262:5
19: 0x71722aac9fec - core::option::expect_failed::h45e7b2795e933934
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/core/src/option.rs:1994:5
20: 0x7172288a32f3 - <rustc_lint[27457a7e2c080a19]::late::LateContextAndPass<rustc_lint[27457a7e2c080a19]::BuiltinCombinedModuleLateLintPass> as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_pat
21: 0x7172288aa2e0 - <rustc_lint[27457a7e2c080a19]::late::LateContextAndPass<rustc_lint[27457a7e2c080a19]::BuiltinCombinedModuleLateLintPass> as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr
22: 0x7172288a5558 - rustc_hir[b268f985175477dc]::intravisit::walk_block::<rustc_lint[27457a7e2c080a19]::late::LateContextAndPass<rustc_lint[27457a7e2c080a19]::BuiltinCombinedModuleLateLintPass>>
23: 0x7172288aa082 - <rustc_lint[27457a7e2c080a19]::late::LateContextAndPass<rustc_lint[27457a7e2c080a19]::BuiltinCombinedModuleLateLintPass> as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr
24: 0x7172288aa2f9 - <rustc_lint[27457a7e2c080a19]::late::LateContextAndPass<rustc_lint[27457a7e2c080a19]::BuiltinCombinedModuleLateLintPass> as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr
25: 0x7172288a9ffb - <rustc_lint[27457a7e2c080a19]::late::LateContextAndPass<rustc_lint[27457a7e2c080a19]::BuiltinCombinedModuleLateLintPass> as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr
26: 0x7172288a5558 - rustc_hir[b268f985175477dc]::intravisit::walk_block::<rustc_lint[27457a7e2c080a19]::late::LateContextAndPass<rustc_lint[27457a7e2c080a19]::BuiltinCombinedModuleLateLintPass>>
27: 0x717228a4bd9c - <rustc_lint[27457a7e2c080a19]::late::LateContextAndPass<rustc_lint[27457a7e2c080a19]::BuiltinCombinedModuleLateLintPass> as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_nested_body
28: 0x717228a45543 - <rustc_lint[27457a7e2c080a19]::late::LateContextAndPass<rustc_lint[27457a7e2c080a19]::BuiltinCombinedModuleLateLintPass> as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_nested_item
29: 0x717228a43929 - rustc_lint[27457a7e2c080a19]::lint_mod
30: 0x717228a43721 - rustc_query_impl[9ed179a0f1d308f7]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9ed179a0f1d308f7]::query_impl::lint_mod::dynamic_query::{closure#2}::{closure#0}, rustc_middle[1a9664e0085f2636]::query::erase::Erased<[u8; 0usize]>>
31: 0x717229307b3d - rustc_query_system[44fec123c527e9c2]::query::plumbing::try_execute_query::<rustc_query_impl[9ed179a0f1d308f7]::DynamicConfig<rustc_query_system[44fec123c527e9c2]::query::caches::DefaultCache<rustc_span[2dc48e59aa1d19e]::def_id::LocalModDefId, rustc_middle[1a9664e0085f2636]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[9ed179a0f1d308f7]::plumbing::QueryCtxt, false>
32: 0x7172293059bf - rustc_query_impl[9ed179a0f1d308f7]::query_impl::lint_mod::get_query_non_incr::__rust_end_short_backtrace
33: 0x717229305599 - rustc_lint[27457a7e2c080a19]::late::check_crate::{closure#1}
34: 0x717229304fc0 - rustc_lint[27457a7e2c080a19]::late::check_crate
35: 0x71722930e613 - rustc_interface[1cae66118a42494d]::passes::analysis
36: 0x71722930db1b - rustc_query_impl[9ed179a0f1d308f7]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9ed179a0f1d308f7]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[1a9664e0085f2636]::query::erase::Erased<[u8; 1usize]>>
37: 0x7172295d2a65 - rustc_query_system[44fec123c527e9c2]::query::plumbing::try_execute_query::<rustc_query_impl[9ed179a0f1d308f7]::DynamicConfig<rustc_query_system[44fec123c527e9c2]::query::caches::SingleCache<rustc_middle[1a9664e0085f2636]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[9ed179a0f1d308f7]::plumbing::QueryCtxt, false>
38: 0x7172295d27c9 - rustc_query_impl[9ed179a0f1d308f7]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
39: 0x71722940434e - rustc_interface[1cae66118a42494d]::interface::run_compiler::<core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>, rustc_driver_impl[339cabd2c49c1c37]::run_compiler::{closure#0}>::{closure#1}
40: 0x7172293f1cc9 - std[c5e309103866e771]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[1cae66118a42494d]::util::run_in_thread_with_globals<rustc_interface[1cae66118a42494d]::util::run_in_thread_pool_with_globals<rustc_interface[1cae66118a42494d]::interface::run_compiler<core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>, rustc_driver_impl[339cabd2c49c1c37]::run_compiler::{closure#0}>::{closure#1}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#0}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>
41: 0x7172293f1a76 - <<std[c5e309103866e771]::thread::Builder>::spawn_unchecked_<rustc_interface[1cae66118a42494d]::util::run_in_thread_with_globals<rustc_interface[1cae66118a42494d]::util::run_in_thread_pool_with_globals<rustc_interface[1cae66118a42494d]::interface::run_compiler<core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>, rustc_driver_impl[339cabd2c49c1c37]::run_compiler::{closure#0}>::{closure#1}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#0}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#2} as core[3219cb84013fadfb]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
42: 0x71722aa8b86b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h26d0e5dfdd9c0f2f
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/alloc/src/boxed.rs:2022:9
43: 0x71722aa8b86b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hdf40085d252d7219
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/alloc/src/boxed.rs:2022:9
44: 0x71722aa8b86b - std::sys::pal::unix::thread::Thread::new::thread_start::hb8758c3a30e7eae2
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys/pal/unix/thread.rs:108:17
45: 0x7172242aa1cf - <unknown>
46: 0x71722432b6ec - <unknown>
47: 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.80.0-nightly (20483b682 2024-05-20) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [lint_mod] linting top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
thread 'rustc' panicked at compiler/rustc_privacy/src/lib.rs:983:72:
called `Option::unwrap()` on a `None` value
stack backtrace:
0: 0x71722aa7eb85 - std::backtrace_rs::backtrace::libunwind::trace::he6da4379aff6142d
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
1: 0x71722aa7eb85 - std::backtrace_rs::backtrace::trace_unsynchronized::h04955c5653afdd1c
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x71722aa7eb85 - std::sys_common::backtrace::_print_fmt::hc30939011ed55196
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys_common/backtrace.rs:68:5
3: 0x71722aa7eb85 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf756b4bf3ddd605a
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys_common/backtrace.rs:44:22
4: 0x71722aacdc7b - core::fmt::rt::Argument::fmt::h9c42aecae17e95df
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/core/src/fmt/rt.rs:165:63
5: 0x71722aacdc7b - core::fmt::write::h3aabe8e1c19492ff
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/core/src/fmt/mod.rs:1169:21
6: 0x71722aa7390f - std::io::Write::write_fmt::hbc02e2e90412ba60
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/io/mod.rs:1835:15
7: 0x71722aa7e95e - std::sys_common::backtrace::_print::h970a746ce9fd1dc8
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys_common/backtrace.rs:47:5
8: 0x71722aa7e95e - std::sys_common::backtrace::print::hd00c4744cd708d80
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys_common/backtrace.rs:34:9
9: 0x71722aa81359 - std::panicking::default_hook::{{closure}}::h256ffa346f3a5cd0
10: 0x71722aa8109d - std::panicking::default_hook::h56b6405526a5971f
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/panicking.rs:298:9
11: 0x7172274ee1f0 - std[c5e309103866e771]::panicking::update_hook::<alloc[c591fc82162bd1fd]::boxed::Box<rustc_driver_impl[339cabd2c49c1c37]::install_ice_hook::{closure#0}>>::{closure#0}
12: 0x71722aa81a8b - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h73ec01f48f3f5e0a
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/alloc/src/boxed.rs:2036:9
13: 0x71722aa81a8b - std::panicking::rust_panic_with_hook::h06514f03ccbf27e6
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/panicking.rs:799:13
14: 0x71722aa817cb - std::panicking::begin_panic_handler::{{closure}}::hdc456e662baa956f
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/panicking.rs:656:13
15: 0x71722aa7f049 - std::sys_common::backtrace::__rust_end_short_backtrace::he43c53287432c969
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys_common/backtrace.rs:171:18
16: 0x71722aa81537 - rust_begin_unwind
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/panicking.rs:652:5
17: 0x71722aaca243 - core::panicking::panic_fmt::h024d3c362d0de7b2
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/core/src/panicking.rs:72:14
18: 0x71722aaca2ec - core::panicking::panic::h12f4d8e9147f72ae
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/core/src/panicking.rs:146:5
19: 0x71722aac9fc9 - core::option::unwrap_failed::hd990e365af457934
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/core/src/option.rs:1984:5
20: 0x7172288c39e8 - <rustc_privacy[ac658a02c7cc21f4]::NamePrivacyVisitor as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr
21: 0x7172288c3043 - <rustc_privacy[ac658a02c7cc21f4]::NamePrivacyVisitor as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr
22: 0x7172288c31a8 - <rustc_privacy[ac658a02c7cc21f4]::NamePrivacyVisitor as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr
23: 0x7172288c2f61 - <rustc_privacy[ac658a02c7cc21f4]::NamePrivacyVisitor as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr
24: 0x7172288c2e82 - <rustc_privacy[ac658a02c7cc21f4]::NamePrivacyVisitor as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_block
25: 0x7172288c2fa2 - <rustc_privacy[ac658a02c7cc21f4]::NamePrivacyVisitor as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr
26: 0x7172288c7247 - rustc_privacy[ac658a02c7cc21f4]::check_mod_privacy
27: 0x7172288c7089 - rustc_query_impl[9ed179a0f1d308f7]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9ed179a0f1d308f7]::query_impl::check_mod_privacy::dynamic_query::{closure#2}::{closure#0}, rustc_middle[1a9664e0085f2636]::query::erase::Erased<[u8; 0usize]>>
28: 0x717229307b3d - rustc_query_system[44fec123c527e9c2]::query::plumbing::try_execute_query::<rustc_query_impl[9ed179a0f1d308f7]::DynamicConfig<rustc_query_system[44fec123c527e9c2]::query::caches::DefaultCache<rustc_span[2dc48e59aa1d19e]::def_id::LocalModDefId, rustc_middle[1a9664e0085f2636]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[9ed179a0f1d308f7]::plumbing::QueryCtxt, false>
29: 0x71722930b73f - rustc_query_impl[9ed179a0f1d308f7]::query_impl::check_mod_privacy::get_query_non_incr::__rust_end_short_backtrace
30: 0x71722930e731 - rustc_interface[1cae66118a42494d]::passes::analysis
31: 0x71722930db1b - rustc_query_impl[9ed179a0f1d308f7]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[9ed179a0f1d308f7]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[1a9664e0085f2636]::query::erase::Erased<[u8; 1usize]>>
32: 0x7172295d2a65 - rustc_query_system[44fec123c527e9c2]::query::plumbing::try_execute_query::<rustc_query_impl[9ed179a0f1d308f7]::DynamicConfig<rustc_query_system[44fec123c527e9c2]::query::caches::SingleCache<rustc_middle[1a9664e0085f2636]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[9ed179a0f1d308f7]::plumbing::QueryCtxt, false>
33: 0x7172295d27c9 - rustc_query_impl[9ed179a0f1d308f7]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
34: 0x71722940434e - rustc_interface[1cae66118a42494d]::interface::run_compiler::<core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>, rustc_driver_impl[339cabd2c49c1c37]::run_compiler::{closure#0}>::{closure#1}
35: 0x7172293f1cc9 - std[c5e309103866e771]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[1cae66118a42494d]::util::run_in_thread_with_globals<rustc_interface[1cae66118a42494d]::util::run_in_thread_pool_with_globals<rustc_interface[1cae66118a42494d]::interface::run_compiler<core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>, rustc_driver_impl[339cabd2c49c1c37]::run_compiler::{closure#0}>::{closure#1}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#0}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>
36: 0x7172293f1a76 - <<std[c5e309103866e771]::thread::Builder>::spawn_unchecked_<rustc_interface[1cae66118a42494d]::util::run_in_thread_with_globals<rustc_interface[1cae66118a42494d]::util::run_in_thread_pool_with_globals<rustc_interface[1cae66118a42494d]::interface::run_compiler<core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>, rustc_driver_impl[339cabd2c49c1c37]::run_compiler::{closure#0}>::{closure#1}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#0}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3219cb84013fadfb]::result::Result<(), rustc_span[2dc48e59aa1d19e]::ErrorGuaranteed>>::{closure#2} as core[3219cb84013fadfb]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
37: 0x71722aa8b86b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h26d0e5dfdd9c0f2f
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/alloc/src/boxed.rs:2022:9
38: 0x71722aa8b86b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hdf40085d252d7219
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/alloc/src/boxed.rs:2022:9
39: 0x71722aa8b86b - std::sys::pal::unix::thread::Thread::new::thread_start::hb8758c3a30e7eae2
at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/std/src/sys/pal/unix/thread.rs:108:17
40: 0x7172242aa1cf - <unknown>
41: 0x71722432b6ec - <unknown>
42: 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.80.0-nightly (20483b682 2024-05-20) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [check_mod_privacy] checking privacy in top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 2 previous errors; 1 warning emitted
Metadata
Metadata
Assignees
Labels
Relating to patterns and pattern matchingCategory: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Status: This bug is tracked inside the repo by a `known-bug` test.Status: A Minimal Complete and Verifiable Example has been found for this issueRelevant to the compiler team, which will review and decide on the PR/issue.
Activity
fmease commentedon May 20, 2024
Min:
[-]ICE: `non-ADT in struct pattern`[/-][+]ICE: dead: `non-ADT in struct pattern`[/+]matthiaskrgr commentedon Jun 8, 2024
bisects to #121206
RalfJung commentedon Dec 1, 2024
This doesn't seem const-eval related to me? The panic is nowhere near const-eval, as far a I can see?
Looks like some part of the pattern matching machinery is not properly dealing with the fact that the constant failed to evaluate due to an infinite loop.
wxie7 commentedon Mar 15, 2025
Does the following code also cause an ICE for the same reason?
RalfJung commentedon Mar 16, 2025
Cc @oli-obk @BoxyUwU
Shunpoco commentedon Mar 18, 2025
I found the root cause, will create a PR shortly
@rustbot claim
Remove ty::Error on hanlde_filed_access
None
#138361