rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.2k stars 12.7k forks source link

ICE: dead: `non-ADT in struct pattern` #125323

Open matthiaskrgr opened 5 months ago

matthiaskrgr commented 5 months ago

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 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 - ::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::>::{closure#0} 12: 0x71722aa81a8b - as core::ops::function::Fn>::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::::{closure#0} 15: 0x71722751abf6 - std[c5e309103866e771]::sys_common::backtrace::__rust_end_short_backtrace::::{closure#0}, !> 16: 0x71722751a8d6 - std[c5e309103866e771]::panicking::begin_panic:: 17: 0x7172275271b1 - ::emit_producing_guarantee 18: 0x717227c23e98 - ::span_bug:: 19: 0x717227c3766d - rustc_middle[1a9664e0085f2636]::util::bug::opt_span_bug_fmt::::{closure#0} 20: 0x717227c3769a - rustc_middle[1a9664e0085f2636]::ty::context::tls::with_opt::::{closure#0}, !>::{closure#0} 21: 0x717227c31d3b - rustc_middle[1a9664e0085f2636]::ty::context::tls::with_context_opt::::{closure#0}, !>::{closure#0}, !> 22: 0x717227c2fa07 - rustc_middle[1a9664e0085f2636]::util::bug::span_bug_fmt:: 23: 0x717228c1d0bf - ::visit_pat 24: 0x717228c1981a - ::visit_expr 25: 0x717228c18c82 - rustc_hir[b268f985175477dc]::intravisit::walk_block:: 26: 0x717228c19832 - ::visit_expr 27: 0x717228c18c82 - rustc_hir[b268f985175477dc]::intravisit::walk_block:: 28: 0x717228c1d8be - rustc_hir[b268f985175477dc]::intravisit::walk_item:: 29: 0x717228c2113a - ::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::> 32: 0x7172295d1592 - rustc_query_system[44fec123c527e9c2]::query::plumbing::try_execute_query::>, 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::> 36: 0x717229307b3d - rustc_query_system[44fec123c527e9c2]::query::plumbing::try_execute_query::>, 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::> 40: 0x7172295d2a65 - rustc_query_system[44fec123c527e9c2]::query::plumbing::try_execute_query::>, 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::, rustc_driver_impl[339cabd2c49c1c37]::run_compiler::{closure#0}>::{closure#1} 43: 0x7172293f1cc9 - std[c5e309103866e771]::sys_common::backtrace::__rust_begin_short_backtrace::, 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 - <::spawn_unchecked_, 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 - as core::ops::function::FnOnce>::call_once::h26d0e5dfdd9c0f2f at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/alloc/src/boxed.rs:2022:9 46: 0x71722aa8b86b - as core::ops::function::FnOnce>::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 - 49: 0x71722432b6ec - 50: 0x0 - 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 - ::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::>::{closure#0} 12: 0x71722aa81a8b - as core::ops::function::Fn>::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 - as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_pat 21: 0x7172288aa2e0 - as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr 22: 0x7172288a5558 - rustc_hir[b268f985175477dc]::intravisit::walk_block::> 23: 0x7172288aa082 - as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr 24: 0x7172288aa2f9 - as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr 25: 0x7172288a9ffb - as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_expr 26: 0x7172288a5558 - rustc_hir[b268f985175477dc]::intravisit::walk_block::> 27: 0x717228a4bd9c - as rustc_hir[b268f985175477dc]::intravisit::Visitor>::visit_nested_body 28: 0x717228a45543 - 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::> 31: 0x717229307b3d - rustc_query_system[44fec123c527e9c2]::query::plumbing::try_execute_query::>, 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::> 37: 0x7172295d2a65 - rustc_query_system[44fec123c527e9c2]::query::plumbing::try_execute_query::>, 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::, rustc_driver_impl[339cabd2c49c1c37]::run_compiler::{closure#0}>::{closure#1} 40: 0x7172293f1cc9 - std[c5e309103866e771]::sys_common::backtrace::__rust_begin_short_backtrace::, 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 - <::spawn_unchecked_, 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 - as core::ops::function::FnOnce>::call_once::h26d0e5dfdd9c0f2f at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/alloc/src/boxed.rs:2022:9 43: 0x71722aa8b86b - as core::ops::function::FnOnce>::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 - 46: 0x71722432b6ec - 47: 0x0 - 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 - ::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::>::{closure#0} 12: 0x71722aa81a8b - as core::ops::function::Fn>::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 - ::visit_expr 21: 0x7172288c3043 - ::visit_expr 22: 0x7172288c31a8 - ::visit_expr 23: 0x7172288c2f61 - ::visit_expr 24: 0x7172288c2e82 - ::visit_block 25: 0x7172288c2fa2 - ::visit_expr 26: 0x7172288c7247 - rustc_privacy[ac658a02c7cc21f4]::check_mod_privacy 27: 0x7172288c7089 - rustc_query_impl[9ed179a0f1d308f7]::plumbing::__rust_begin_short_backtrace::> 28: 0x717229307b3d - rustc_query_system[44fec123c527e9c2]::query::plumbing::try_execute_query::>, 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::> 32: 0x7172295d2a65 - rustc_query_system[44fec123c527e9c2]::query::plumbing::try_execute_query::>, 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::, rustc_driver_impl[339cabd2c49c1c37]::run_compiler::{closure#0}>::{closure#1} 35: 0x7172293f1cc9 - std[c5e309103866e771]::sys_common::backtrace::__rust_begin_short_backtrace::, 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 - <::spawn_unchecked_, 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 - as core::ops::function::FnOnce>::call_once::h26d0e5dfdd9c0f2f at /rustc/20483b68265f64de79442cf489a5316f918578f0/library/alloc/src/boxed.rs:2022:9 38: 0x71722aa8b86b - as core::ops::function::FnOnce>::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 - 41: 0x71722432b6ec - 42: 0x0 - 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 ```

fmease commented 5 months ago

Min:

fn main() {
    for _ in 0..0 {
        [(); loop {}];
    }
}
matthiaskrgr commented 4 months ago

bisects to #121206