Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE: non-ADT in struct pattern #121463

Closed
matthiaskrgr opened this issue Feb 22, 2024 · 0 comments · Fixed by #124240
Closed

ICE: non-ADT in struct pattern #121463

matthiaskrgr opened this issue Feb 22, 2024 · 0 comments · Fixed by #124240
Labels
C-bug Category: This is a bug. F-box_patterns `#![feature(box_patterns)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

#![feature(box_patterns)]

fn main() {
    // Test matching each shorthand notation for field patterns.
    let mut a = E::StructVar { boxed: Box::new(5_i32) };
    match a {
        E::StructVar { box boxed } => { }
    }
}

Meta

rustc --version --verbose:

rustc 1.78.0-nightly (1bb3a9f67 2024-02-22)
binary: rustc
commit-hash: 1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3
commit-date: 2024-02-22
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0

Error output

<output>
Backtrace

error: internal compiler error: compiler/rustc_passes/src/dead.rs:220:18: non-ADT in struct pattern
 --> 8B8ABEDF34D920D746BDE642A198548A323B94B40DDFECD48BC009BEC24F1745.rs:7:9
  |
7 |         E::StructVar { box boxed } => { }
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/compiler/rustc_middle/src/util/bug.rs:34:50:
Box<dyn Any>
stack backtrace:
   0:     0x7fd77d98caf6 - std::backtrace_rs::backtrace::libunwind::trace::h78343d613c85aaed
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7fd77d98caf6 - std::backtrace_rs::backtrace::trace_unsynchronized::hcb93ce9229fc04d1
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fd77d98caf6 - std::sys_common::backtrace::_print_fmt::hd1deae191b645ce3
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7fd77d98caf6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h70c1692dc58e0c3d
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fd77d9dda7c - core::fmt::rt::Argument::fmt::h3f3d607439a9453a
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/core/src/fmt/rt.rs:142:9
   5:     0x7fd77d9dda7c - core::fmt::write::hfd04ed51dd5b9740
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/core/src/fmt/mod.rs:1120:17
   6:     0x7fd77d98142f - std::io::Write::write_fmt::h61b6e15e92363464
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/io/mod.rs:1846:15
   7:     0x7fd77d98c8a4 - std::sys_common::backtrace::_print::h864105160a5448a9
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fd77d98c8a4 - std::sys_common::backtrace::print::ha7c3095d0e2711d4
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fd77d98f5eb - std::panicking::default_hook::{{closure}}::hea9282e63bea107d
  10:     0x7fd77d98f339 - std::panicking::default_hook::h7450394991cabc1f
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/panicking.rs:292:9
  11:     0x7fd78087122c - std[98ba4a421780dced]::panicking::update_hook::<alloc[d493190abddc557e]::boxed::Box<rustc_driver_impl[43b21fa76f9f6a29]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7fd77d98fd50 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hf5f4decde06499d8
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/alloc/src/boxed.rs:2030:9
  13:     0x7fd77d98fd50 - std::panicking::rust_panic_with_hook::h4f5747f949537183
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/panicking.rs:786:13
  14:     0x7fd78089d8d4 - std[98ba4a421780dced]::panicking::begin_panic::<rustc_errors[ae248042d377cb04]::ExplicitBug>::{closure#0}
  15:     0x7fd78089a7f6 - std[98ba4a421780dced]::sys_common::backtrace::__rust_end_short_backtrace::<std[98ba4a421780dced]::panicking::begin_panic<rustc_errors[ae248042d377cb04]::ExplicitBug>::{closure#0}, !>
  16:     0x7fd78089a4d6 - std[98ba4a421780dced]::panicking::begin_panic::<rustc_errors[ae248042d377cb04]::ExplicitBug>
  17:     0x7fd77f21c141 - <rustc_errors[ae248042d377cb04]::diagnostic::BugAbort as rustc_errors[ae248042d377cb04]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  18:     0x7fd780f5616d - rustc_middle[45b09470b66e946b]::util::bug::opt_span_bug_fmt::<rustc_span[e413bf6cc1fe2f31]::span_encoding::Span>::{closure#0}
  19:     0x7fd780f5619a - rustc_middle[45b09470b66e946b]::ty::context::tls::with_opt::<rustc_middle[45b09470b66e946b]::util::bug::opt_span_bug_fmt<rustc_span[e413bf6cc1fe2f31]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  20:     0x7fd780f511f8 - rustc_middle[45b09470b66e946b]::ty::context::tls::with_context_opt::<rustc_middle[45b09470b66e946b]::ty::context::tls::with_opt<rustc_middle[45b09470b66e946b]::util::bug::opt_span_bug_fmt<rustc_span[e413bf6cc1fe2f31]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  21:     0x7fd780f4fcb4 - rustc_middle[45b09470b66e946b]::util::bug::span_bug_fmt::<rustc_span[e413bf6cc1fe2f31]::span_encoding::Span>
  22:     0x7fd781f40648 - <rustc_passes[d8b4d4ae9293dc75]::dead::MarkSymbolVisitor as rustc_hir[8a1acb4dd3fb9914]::intravisit::Visitor>::visit_pat
  23:     0x7fd781cf5b7d - <rustc_passes[d8b4d4ae9293dc75]::dead::MarkSymbolVisitor as rustc_hir[8a1acb4dd3fb9914]::intravisit::Visitor>::visit_expr
  24:     0x7fd781f3d849 - rustc_hir[8a1acb4dd3fb9914]::intravisit::walk_item::<rustc_passes[d8b4d4ae9293dc75]::dead::MarkSymbolVisitor>
  25:     0x7fd782c346b7 - rustc_passes[d8b4d4ae9293dc75]::dead::live_symbols_and_ignored_derived_traits
  26:     0x7fd782c33854 - rustc_query_impl[b82009bdbcc4b375]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b82009bdbcc4b375]::query_impl::live_symbols_and_ignored_derived_traits::dynamic_query::{closure#2}::{closure#0}, rustc_middle[45b09470b66e946b]::query::erase::Erased<[u8; 8usize]>>
  27:     0x7fd7828f240e - rustc_query_system[8095494ab80f3bc1]::query::plumbing::try_execute_query::<rustc_query_impl[b82009bdbcc4b375]::DynamicConfig<rustc_query_system[8095494ab80f3bc1]::query::caches::SingleCache<rustc_middle[45b09470b66e946b]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[b82009bdbcc4b375]::plumbing::QueryCtxt, false>
  28:     0x7fd7826d86c2 - rustc_query_impl[b82009bdbcc4b375]::query_impl::live_symbols_and_ignored_derived_traits::get_query_non_incr::__rust_end_short_backtrace
  29:     0x7fd7826d8863 - rustc_passes[d8b4d4ae9293dc75]::dead::check_mod_deathness
  30:     0x7fd7826d86e7 - rustc_query_impl[b82009bdbcc4b375]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b82009bdbcc4b375]::query_impl::check_mod_deathness::dynamic_query::{closure#2}::{closure#0}, rustc_middle[45b09470b66e946b]::query::erase::Erased<[u8; 0usize]>>
  31:     0x7fd78281c76d - rustc_query_system[8095494ab80f3bc1]::query::plumbing::try_execute_query::<rustc_query_impl[b82009bdbcc4b375]::DynamicConfig<rustc_query_system[8095494ab80f3bc1]::query::caches::DefaultCache<rustc_span[e413bf6cc1fe2f31]::def_id::LocalModDefId, rustc_middle[45b09470b66e946b]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[b82009bdbcc4b375]::plumbing::QueryCtxt, false>
  32:     0x7fd7828183ff - rustc_query_impl[b82009bdbcc4b375]::query_impl::check_mod_deathness::get_query_non_incr::__rust_end_short_backtrace
  33:     0x7fd7828144cb - rustc_interface[8570b1b09719190c]::passes::analysis
  34:     0x7fd782813219 - rustc_query_impl[b82009bdbcc4b375]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b82009bdbcc4b375]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[45b09470b66e946b]::query::erase::Erased<[u8; 1usize]>>
  35:     0x7fd7829d4665 - rustc_query_system[8095494ab80f3bc1]::query::plumbing::try_execute_query::<rustc_query_impl[b82009bdbcc4b375]::DynamicConfig<rustc_query_system[8095494ab80f3bc1]::query::caches::SingleCache<rustc_middle[45b09470b66e946b]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[b82009bdbcc4b375]::plumbing::QueryCtxt, false>
  36:     0x7fd7829d43c9 - rustc_query_impl[b82009bdbcc4b375]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  37:     0x7fd782901816 - rustc_interface[8570b1b09719190c]::interface::run_compiler::<core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>, rustc_driver_impl[43b21fa76f9f6a29]::run_compiler::{closure#0}>::{closure#0}
  38:     0x7fd782bc37cd - std[98ba4a421780dced]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[8570b1b09719190c]::util::run_in_thread_with_globals<rustc_interface[8570b1b09719190c]::util::run_in_thread_pool_with_globals<rustc_interface[8570b1b09719190c]::interface::run_compiler<core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>, rustc_driver_impl[43b21fa76f9f6a29]::run_compiler::{closure#0}>::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>
  39:     0x7fd782bc35fa - <<std[98ba4a421780dced]::thread::Builder>::spawn_unchecked_<rustc_interface[8570b1b09719190c]::util::run_in_thread_with_globals<rustc_interface[8570b1b09719190c]::util::run_in_thread_pool_with_globals<rustc_interface[8570b1b09719190c]::interface::run_compiler<core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>, rustc_driver_impl[43b21fa76f9f6a29]::run_compiler::{closure#0}>::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#1} as core[661a54f044942911]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  40:     0x7fd77d999725 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd65baaf671f21b42
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/alloc/src/boxed.rs:2016:9
  41:     0x7fd77d999725 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h62863cb5d3d6dd44
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/alloc/src/boxed.rs:2016:9
  42:     0x7fd77d999725 - std::sys::pal::unix::thread::Thread::new::thread_start::h59a3dc623978ddf5
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys/pal/unix/thread.rs:108:17
  43:     0x7fd77d694ac3 - start_thread
                               at ./nptl/pthread_create.c:442:8
  44:     0x7fd77d726850 - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  45:                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 attach the file at `/home/gh-matthiaskrgr/im/rustc-ice-2024-02-22T16_09_14-2465108.txt` to your bug report

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
#2 [analysis] running analysis passes on this crate
end of query stack
thread 'rustc' panicked at compiler/rustc_lint/src/builtin.rs:252:18:
struct pattern type is not an ADT
stack backtrace:
   0:     0x7fd77d98caf6 - std::backtrace_rs::backtrace::libunwind::trace::h78343d613c85aaed
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7fd77d98caf6 - std::backtrace_rs::backtrace::trace_unsynchronized::hcb93ce9229fc04d1
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fd77d98caf6 - std::sys_common::backtrace::_print_fmt::hd1deae191b645ce3
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7fd77d98caf6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h70c1692dc58e0c3d
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fd77d9dda7c - core::fmt::rt::Argument::fmt::h3f3d607439a9453a
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/core/src/fmt/rt.rs:142:9
   5:     0x7fd77d9dda7c - core::fmt::write::hfd04ed51dd5b9740
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/core/src/fmt/mod.rs:1120:17
   6:     0x7fd77d98142f - std::io::Write::write_fmt::h61b6e15e92363464
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/io/mod.rs:1846:15
   7:     0x7fd77d98c8a4 - std::sys_common::backtrace::_print::h864105160a5448a9
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fd77d98c8a4 - std::sys_common::backtrace::print::ha7c3095d0e2711d4
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fd77d98f5eb - std::panicking::default_hook::{{closure}}::hea9282e63bea107d
  10:     0x7fd77d98f339 - std::panicking::default_hook::h7450394991cabc1f
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/panicking.rs:292:9
  11:     0x7fd78087122c - std[98ba4a421780dced]::panicking::update_hook::<alloc[d493190abddc557e]::boxed::Box<rustc_driver_impl[43b21fa76f9f6a29]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7fd77d98fd50 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hf5f4decde06499d8
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/alloc/src/boxed.rs:2030:9
  13:     0x7fd77d98fd50 - std::panicking::rust_panic_with_hook::h4f5747f949537183
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/panicking.rs:786:13
  14:     0x7fd77d98fa92 - std::panicking::begin_panic_handler::{{closure}}::h2bf422a8e9958832
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/panicking.rs:660:13
  15:     0x7fd77d98cfd6 - std::sys_common::backtrace::__rust_end_short_backtrace::hdd8f30de5eecf779
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7fd77d98f7c4 - rust_begin_unwind
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/panicking.rs:648:5
  17:     0x7fd77d9d9f95 - core::panicking::panic_fmt::h1acf842fb807f6d2
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/core/src/panicking.rs:72:14
  18:     0x7fd77d9da161 - core::panicking::panic_display::h849dd7a88e7c18d3
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/core/src/panicking.rs:196:5
  19:     0x7fd77d9d9d4b - core::panicking::panic_str::h32e8f6136e6a9754
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/core/src/panicking.rs:171:5
  20:     0x7fd77d9d9d4b - core::option::expect_failed::hd7b050aef2f2dc00
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/core/src/option.rs:1993:5
  21:     0x7fd781f414b2 - <rustc_lint[5f8b1185717f607]::late::LateContextAndPass<rustc_lint[5f8b1185717f607]::BuiltinCombinedModuleLateLintPass> as rustc_hir[8a1acb4dd3fb9914]::intravisit::Visitor>::visit_pat
  22:     0x7fd781e03919 - <rustc_lint[5f8b1185717f607]::late::LateContextAndPass<rustc_lint[5f8b1185717f607]::BuiltinCombinedModuleLateLintPass> as rustc_hir[8a1acb4dd3fb9914]::intravisit::Visitor>::visit_expr
  23:     0x7fd781e020fa - <rustc_lint[5f8b1185717f607]::late::LateContextAndPass<rustc_lint[5f8b1185717f607]::BuiltinCombinedModuleLateLintPass> as rustc_hir[8a1acb4dd3fb9914]::intravisit::Visitor>::visit_block
  24:     0x7fd781e02f73 - <rustc_lint[5f8b1185717f607]::late::LateContextAndPass<rustc_lint[5f8b1185717f607]::BuiltinCombinedModuleLateLintPass> as rustc_hir[8a1acb4dd3fb9914]::intravisit::Visitor>::visit_expr::{closure#0}
  25:     0x7fd781ffd211 - <rustc_lint[5f8b1185717f607]::late::LateContextAndPass<rustc_lint[5f8b1185717f607]::BuiltinCombinedModuleLateLintPass> as rustc_hir[8a1acb4dd3fb9914]::intravisit::Visitor>::visit_nested_body
  26:     0x7fd781fa86a5 - <rustc_lint[5f8b1185717f607]::late::LateContextAndPass<rustc_lint[5f8b1185717f607]::BuiltinCombinedModuleLateLintPass> as rustc_hir[8a1acb4dd3fb9914]::intravisit::Visitor>::visit_nested_item
  27:     0x7fd781fa6a7f - rustc_lint[5f8b1185717f607]::lint_mod
  28:     0x7fd781fa6867 - rustc_query_impl[b82009bdbcc4b375]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b82009bdbcc4b375]::query_impl::lint_mod::dynamic_query::{closure#2}::{closure#0}, rustc_middle[45b09470b66e946b]::query::erase::Erased<[u8; 0usize]>>
  29:     0x7fd78281c76d - rustc_query_system[8095494ab80f3bc1]::query::plumbing::try_execute_query::<rustc_query_impl[b82009bdbcc4b375]::DynamicConfig<rustc_query_system[8095494ab80f3bc1]::query::caches::DefaultCache<rustc_span[e413bf6cc1fe2f31]::def_id::LocalModDefId, rustc_middle[45b09470b66e946b]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[b82009bdbcc4b375]::plumbing::QueryCtxt, false>
  30:     0x7fd78281b07f - rustc_query_impl[b82009bdbcc4b375]::query_impl::lint_mod::get_query_non_incr::__rust_end_short_backtrace
  31:     0x7fd78281ac1f - rustc_lint[5f8b1185717f607]::late::check_crate::{closure#1}
  32:     0x7fd78281a61e - rustc_lint[5f8b1185717f607]::late::check_crate
  33:     0x7fd782814525 - rustc_interface[8570b1b09719190c]::passes::analysis
  34:     0x7fd782813219 - rustc_query_impl[b82009bdbcc4b375]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b82009bdbcc4b375]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[45b09470b66e946b]::query::erase::Erased<[u8; 1usize]>>
  35:     0x7fd7829d4665 - rustc_query_system[8095494ab80f3bc1]::query::plumbing::try_execute_query::<rustc_query_impl[b82009bdbcc4b375]::DynamicConfig<rustc_query_system[8095494ab80f3bc1]::query::caches::SingleCache<rustc_middle[45b09470b66e946b]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[b82009bdbcc4b375]::plumbing::QueryCtxt, false>
  36:     0x7fd7829d43c9 - rustc_query_impl[b82009bdbcc4b375]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  37:     0x7fd782901816 - rustc_interface[8570b1b09719190c]::interface::run_compiler::<core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>, rustc_driver_impl[43b21fa76f9f6a29]::run_compiler::{closure#0}>::{closure#0}
  38:     0x7fd782bc37cd - std[98ba4a421780dced]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[8570b1b09719190c]::util::run_in_thread_with_globals<rustc_interface[8570b1b09719190c]::util::run_in_thread_pool_with_globals<rustc_interface[8570b1b09719190c]::interface::run_compiler<core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>, rustc_driver_impl[43b21fa76f9f6a29]::run_compiler::{closure#0}>::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>
  39:     0x7fd782bc35fa - <<std[98ba4a421780dced]::thread::Builder>::spawn_unchecked_<rustc_interface[8570b1b09719190c]::util::run_in_thread_with_globals<rustc_interface[8570b1b09719190c]::util::run_in_thread_pool_with_globals<rustc_interface[8570b1b09719190c]::interface::run_compiler<core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>, rustc_driver_impl[43b21fa76f9f6a29]::run_compiler::{closure#0}>::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#1} as core[661a54f044942911]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  40:     0x7fd77d999725 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd65baaf671f21b42
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/alloc/src/boxed.rs:2016:9
  41:     0x7fd77d999725 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h62863cb5d3d6dd44
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/alloc/src/boxed.rs:2016:9
  42:     0x7fd77d999725 - std::sys::pal::unix::thread::Thread::new::thread_start::h59a3dc623978ddf5
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys/pal/unix/thread.rs:108:17
  43:     0x7fd77d694ac3 - start_thread
                               at ./nptl/pthread_create.c:442:8
  44:     0x7fd77d726850 - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  45:                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 attach the file at `/home/gh-matthiaskrgr/im/rustc-ice-2024-02-22T16_09_14-2465108.txt` to your bug report

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:991:72:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:     0x7fd77d98caf6 - std::backtrace_rs::backtrace::libunwind::trace::h78343d613c85aaed
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7fd77d98caf6 - std::backtrace_rs::backtrace::trace_unsynchronized::hcb93ce9229fc04d1
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fd77d98caf6 - std::sys_common::backtrace::_print_fmt::hd1deae191b645ce3
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7fd77d98caf6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h70c1692dc58e0c3d
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fd77d9dda7c - core::fmt::rt::Argument::fmt::h3f3d607439a9453a
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/core/src/fmt/rt.rs:142:9
   5:     0x7fd77d9dda7c - core::fmt::write::hfd04ed51dd5b9740
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/core/src/fmt/mod.rs:1120:17
   6:     0x7fd77d98142f - std::io::Write::write_fmt::h61b6e15e92363464
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/io/mod.rs:1846:15
   7:     0x7fd77d98c8a4 - std::sys_common::backtrace::_print::h864105160a5448a9
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fd77d98c8a4 - std::sys_common::backtrace::print::ha7c3095d0e2711d4
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fd77d98f5eb - std::panicking::default_hook::{{closure}}::hea9282e63bea107d
  10:     0x7fd77d98f339 - std::panicking::default_hook::h7450394991cabc1f
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/panicking.rs:292:9
  11:     0x7fd78087122c - std[98ba4a421780dced]::panicking::update_hook::<alloc[d493190abddc557e]::boxed::Box<rustc_driver_impl[43b21fa76f9f6a29]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7fd77d98fd50 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hf5f4decde06499d8
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/alloc/src/boxed.rs:2030:9
  13:     0x7fd77d98fd50 - std::panicking::rust_panic_with_hook::h4f5747f949537183
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/panicking.rs:786:13
  14:     0x7fd77d98fa59 - std::panicking::begin_panic_handler::{{closure}}::h2bf422a8e9958832
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/panicking.rs:652:13
  15:     0x7fd77d98cfd6 - std::sys_common::backtrace::__rust_end_short_backtrace::hdd8f30de5eecf779
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7fd77d98f7c4 - rust_begin_unwind
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/panicking.rs:648:5
  17:     0x7fd77d9d9f95 - core::panicking::panic_fmt::h1acf842fb807f6d2
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/core/src/panicking.rs:72:14
  18:     0x7fd77d9da053 - core::panicking::panic::h3862563359bfda52
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/core/src/panicking.rs:144:5
  19:     0x7fd77d9d9d26 - core::option::unwrap_failed::hd5db12df658732a1
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/core/src/option.rs:1983:5
  20:     0x7fd781c6a6ff - <rustc_privacy[af9ea50042ee2161]::NamePrivacyVisitor as rustc_hir[8a1acb4dd3fb9914]::intravisit::Visitor>::visit_expr
  21:     0x7fd781c69a15 - <rustc_privacy[af9ea50042ee2161]::NamePrivacyVisitor as rustc_hir[8a1acb4dd3fb9914]::intravisit::Visitor>::visit_block
  22:     0x7fd781c69ae2 - <rustc_privacy[af9ea50042ee2161]::NamePrivacyVisitor as rustc_hir[8a1acb4dd3fb9914]::intravisit::Visitor>::visit_expr
  23:     0x7fd7821c184e - rustc_privacy[af9ea50042ee2161]::check_mod_privacy
  24:     0x7fd7821c1633 - rustc_query_impl[b82009bdbcc4b375]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b82009bdbcc4b375]::query_impl::check_mod_privacy::dynamic_query::{closure#2}::{closure#0}, rustc_middle[45b09470b66e946b]::query::erase::Erased<[u8; 0usize]>>
  25:     0x7fd78281c76d - rustc_query_system[8095494ab80f3bc1]::query::plumbing::try_execute_query::<rustc_query_impl[b82009bdbcc4b375]::DynamicConfig<rustc_query_system[8095494ab80f3bc1]::query::caches::DefaultCache<rustc_span[e413bf6cc1fe2f31]::def_id::LocalModDefId, rustc_middle[45b09470b66e946b]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[b82009bdbcc4b375]::plumbing::QueryCtxt, false>
  26:     0x7fd78281823f - rustc_query_impl[b82009bdbcc4b375]::query_impl::check_mod_privacy::get_query_non_incr::__rust_end_short_backtrace
  27:     0x7fd78281463c - rustc_interface[8570b1b09719190c]::passes::analysis
  28:     0x7fd782813219 - rustc_query_impl[b82009bdbcc4b375]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b82009bdbcc4b375]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[45b09470b66e946b]::query::erase::Erased<[u8; 1usize]>>
  29:     0x7fd7829d4665 - rustc_query_system[8095494ab80f3bc1]::query::plumbing::try_execute_query::<rustc_query_impl[b82009bdbcc4b375]::DynamicConfig<rustc_query_system[8095494ab80f3bc1]::query::caches::SingleCache<rustc_middle[45b09470b66e946b]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[b82009bdbcc4b375]::plumbing::QueryCtxt, false>
  30:     0x7fd7829d43c9 - rustc_query_impl[b82009bdbcc4b375]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  31:     0x7fd782901816 - rustc_interface[8570b1b09719190c]::interface::run_compiler::<core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>, rustc_driver_impl[43b21fa76f9f6a29]::run_compiler::{closure#0}>::{closure#0}
  32:     0x7fd782bc37cd - std[98ba4a421780dced]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[8570b1b09719190c]::util::run_in_thread_with_globals<rustc_interface[8570b1b09719190c]::util::run_in_thread_pool_with_globals<rustc_interface[8570b1b09719190c]::interface::run_compiler<core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>, rustc_driver_impl[43b21fa76f9f6a29]::run_compiler::{closure#0}>::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>
  33:     0x7fd782bc35fa - <<std[98ba4a421780dced]::thread::Builder>::spawn_unchecked_<rustc_interface[8570b1b09719190c]::util::run_in_thread_with_globals<rustc_interface[8570b1b09719190c]::util::run_in_thread_pool_with_globals<rustc_interface[8570b1b09719190c]::interface::run_compiler<core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>, rustc_driver_impl[43b21fa76f9f6a29]::run_compiler::{closure#0}>::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[661a54f044942911]::result::Result<(), rustc_span[e413bf6cc1fe2f31]::ErrorGuaranteed>>::{closure#1} as core[661a54f044942911]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  34:     0x7fd77d999725 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd65baaf671f21b42
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/alloc/src/boxed.rs:2016:9
  35:     0x7fd77d999725 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h62863cb5d3d6dd44
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/alloc/src/boxed.rs:2016:9
  36:     0x7fd77d999725 - std::sys::pal::unix::thread::Thread::new::thread_start::h59a3dc623978ddf5
                               at /rustc/1bb3a9f67a2ff6bd49c513ca1b8954237298c4b3/library/std/src/sys/pal/unix/thread.rs:108:17
  37:     0x7fd77d694ac3 - start_thread
                               at ./nptl/pthread_create.c:442:8
  38:     0x7fd77d726850 - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  39:                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 attach the file at `/home/gh-matthiaskrgr/im/rustc-ice-2024-02-22T16_09_14-2465108.txt` to your bug report

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[E0433]: failed to resolve: use of undeclared type `E`
 --> 8B8ABEDF34D920D746BDE642A198548A323B94B40DDFECD48BC009BEC24F1745.rs:5:17
  |
5 |     let mut a = E::StructVar { boxed: Box::new(5_i32) };
  |                 ^
  |                 |
  |                 use of undeclared type `E`
  |                 help: a trait with a similar name exists: `Eq`

error[E0433]: failed to resolve: use of undeclared type `E`
 --> 8B8ABEDF34D920D746BDE642A198548A323B94B40DDFECD48BC009BEC24F1745.rs:7:9
  |
7 |         E::StructVar { box boxed } => { }
  |         ^
  |         |
  |         use of undeclared type `E`
  |         help: a trait with a similar name exists: `Eq`

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0433`.

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Feb 22, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 22, 2024
@jieyouxu jieyouxu added requires-nightly This issue requires a nightly compiler in some way. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 22, 2024
@jieyouxu jieyouxu added the F-box_patterns `#![feature(box_patterns)]` label Mar 8, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 21, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 22, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 22, 2024
@bors bors closed this as completed in 751f662 Apr 22, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Apr 22, 2024
Rollup merge of rust-lang#124240 - matthiaskrgr:tests_sunday, r=compiler-errors

add a couple tests for fixed ICEs.

Fixes rust-lang#121413
Fixes rust-lang#121463
Fixes rust-lang#114463
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-box_patterns `#![feature(box_patterns)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants