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 in debug when matching two constants to the same reference #105173

Closed
hashworks opened this issue Dec 2, 2022 · 2 comments
Closed

ICE in debug when matching two constants to the same reference #105173

hashworks opened this issue Dec 2, 2022 · 2 comments
Labels
C-bug Category: This is a bug. 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.

Comments

@hashworks
Copy link

hashworks commented Dec 2, 2022

Code

When one creates two constants to the same reference and matches both, a cargo +nightly build debug compile runs into an ICE.

const A: &char = &'A';
const ALSOA: &char = &'A';

fn main() {
    match &'A' {
        A => 0,
        ALSOA => 0,
        _ => 0,
    };
}

With cargo +nightly build --release this builds just fine.

One can also use two match arms for a more reasonable usage:

const A: &char = &'A';
const ALSOA: &char = &'A';

fn main() {
    match &'A' {
        A => 0,
        _ => 0,
    };

    match &'B' {
        ALSOA => 0,
        _ => 0,
    };
}

This happens in both stable and nightly.

I'm not sure how to trigger this with rustc. A simple cargo project created with cargo new works though.

Meta

rustc --version --verbose:

rustc 1.67.0-nightly (c090c6880 2022-12-01)
binary: rustc
commit-hash: c090c6880c0183ba248bde4a16e29ba29ac4fbba
commit-date: 2022-12-01
host: x86_64-unknown-linux-gnu
release: 1.67.0-nightly
LLVM version: 15.0.4

cargo +nightly --version:

cargo 1.67.0-nightly (e027c4b5d 2022-11-25)

Error output

   Compiling const-ref-match-bug v0.1.0 (/home/hashworks/Documents/Projects/Rust/const-ref-match-bug)
thread '<unnamed>' panicked at 'forcing query with already existing `DepNode`
- query-key: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing, constness: NotConst }, value: Val(Scalar(alloc6), &char) }
- dep-node: deref_mir_constant(fde8d4e96c9678c3-5625764330578e40)', /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/compiler/rustc_query_system/src/dep_graph/graph.rs:316:9
stack backtrace:
   0:     0x7f6d6a96661a - std::backtrace_rs::backtrace::libunwind::trace::hec1c9a33ec35a782
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f6d6a96661a - std::backtrace_rs::backtrace::trace_unsynchronized::hef44794102f9589c
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f6d6a96661a - std::sys_common::backtrace::_print_fmt::h3d085ebafa3ff4d4
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f6d6a96661a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1dc483ce0b0acc38
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f6d6a9c920e - core::fmt::write::hdde74b1f9f025400
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f6d6a956b35 - std::io::Write::write_fmt::h93bb2bce537087eb
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/io/mod.rs:1682:15
   6:     0x7f6d6a9663e5 - std::sys_common::backtrace::_print::hffbee7406e6f5871
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f6d6a9663e5 - std::sys_common::backtrace::print::ha3e39199dd4aff7e
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f6d6a96912f - std::panicking::default_hook::{{closure}}::h9d3052b99dbdb269
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/panicking.rs:267:22
   9:     0x7f6d6a968e6b - std::panicking::default_hook::hf85cde60e828679e
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/panicking.rs:286:9
  10:     0x7f6d6a96994c - std::panicking::rust_panic_with_hook::h7bb6b938bd4ce622
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/panicking.rs:688:13
  11:     0x7f6d6a9696e9 - std::panicking::begin_panic_handler::{{closure}}::h894513d3c9ea77f1
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/panicking.rs:579:13
  12:     0x7f6d6a966acc - std::sys_common::backtrace::__rust_end_short_backtrace::h478da9df1dc8d9c3
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x7f6d6a9693f2 - rust_begin_unwind
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/panicking.rs:575:5
  14:     0x7f6d6a9c5c23 - core::panicking::panic_fmt::h0f7f0682c1639601
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/core/src/panicking.rs:65:14
  15:     0x7f6d6d396813 - <rustc_query_system[81284d9f3abc9bae]::dep_graph::graph::DepGraph<rustc_middle[46c205e3f9247fc2]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[46c205e3f9247fc2]::ty::context::TyCtxt, rustc_middle[46c205e3f9247fc2]::ty::ParamEnvAnd<rustc_middle[46c205e3f9247fc2]::mir::ConstantKind>, rustc_middle[46c205e3f9247fc2]::mir::ConstantKind>
  16:     0x7f6d6d394eff - rustc_query_system[81284d9f3abc9bae]::query::plumbing::try_execute_query::<rustc_query_impl[8e5827c450177fda]::plumbing::QueryCtxt, rustc_query_system[81284d9f3abc9bae]::query::caches::DefaultCache<rustc_middle[46c205e3f9247fc2]::ty::ParamEnvAnd<rustc_middle[46c205e3f9247fc2]::mir::ConstantKind>, rustc_middle[46c205e3f9247fc2]::mir::ConstantKind>>
  17:     0x7f6d6d3943e2 - rustc_query_system[81284d9f3abc9bae]::query::plumbing::get_query::<rustc_query_impl[8e5827c450177fda]::queries::deref_mir_constant, rustc_query_impl[8e5827c450177fda]::plumbing::QueryCtxt>
  18:     0x7f6d6d3942e7 - <rustc_query_impl[8e5827c450177fda]::Queries as rustc_middle[46c205e3f9247fc2]::ty::query::QueryEngine>::deref_mir_constant
  19:     0x7f6d6c0939da - <rustc_mir_build[cc372544a685ce91]::thir::pattern::const_to_pat::ConstToPat>::recur
  20:     0x7f6d6c090ec6 - <rustc_mir_build[cc372544a685ce91]::thir::pattern::const_to_pat::ConstToPat>::to_pat
  21:     0x7f6d6c090a4e - <rustc_mir_build[cc372544a685ce91]::thir::pattern::PatCtxt>::const_to_pat
  22:     0x7f6d6c08f481 - <rustc_mir_build[cc372544a685ce91]::thir::pattern::PatCtxt>::lower_path
  23:     0x7f6d6c08b56b - <rustc_mir_build[cc372544a685ce91]::thir::pattern::PatCtxt>::lower_pattern
  24:     0x7f6d6bff5fe6 - <rustc_mir_build[cc372544a685ce91]::thir::pattern::check_match::MatchVisitor>::check_match
  25:     0x7f6d6bff5272 - <rustc_mir_build[cc372544a685ce91]::thir::pattern::check_match::MatchVisitor as rustc_hir[8087fa9ceaba5c65]::intravisit::Visitor>::visit_expr
  26:     0x7f6d6c6e166f - rustc_mir_build[cc372544a685ce91]::thir::pattern::check_match::check_match
  27:     0x7f6d6c36561f - <rustc_query_system[81284d9f3abc9bae]::dep_graph::graph::DepGraph<rustc_middle[46c205e3f9247fc2]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[46c205e3f9247fc2]::ty::context::TyCtxt, rustc_span[e9db05e073d6ae0e]::def_id::DefId, ()>
  28:     0x7f6d6c364435 - rustc_query_system[81284d9f3abc9bae]::query::plumbing::try_execute_query::<rustc_query_impl[8e5827c450177fda]::plumbing::QueryCtxt, rustc_query_system[81284d9f3abc9bae]::query::caches::DefaultCache<rustc_span[e9db05e073d6ae0e]::def_id::DefId, ()>>
  29:     0x7f6d6d3cfc05 - rustc_data_structures[59f892ce3f414ea5]::sync::par_for_each_in::<&[rustc_span[e9db05e073d6ae0e]::def_id::LocalDefId], <rustc_middle[46c205e3f9247fc2]::hir::map::Map>::par_body_owners<rustc_interface[163ae487477d9c3c]::passes::analysis::{closure#1}::{closure#0}::{closure#0}::{closure#0}>::{closure#0}>
  30:     0x7f6d6d3cf743 - <rustc_session[72ee2d53e3941d51]::session::Session>::time::<(), rustc_interface[163ae487477d9c3c]::passes::analysis::{closure#1}::{closure#0}::{closure#0}>
  31:     0x7f6d6c068b3b - <rustc_session[72ee2d53e3941d51]::session::Session>::time::<(), rustc_interface[163ae487477d9c3c]::passes::analysis::{closure#1}>
  32:     0x7f6d6c067210 - rustc_interface[163ae487477d9c3c]::passes::analysis
  33:     0x7f6d6d3f60ef - <rustc_query_system[81284d9f3abc9bae]::dep_graph::graph::DepGraph<rustc_middle[46c205e3f9247fc2]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[46c205e3f9247fc2]::ty::context::TyCtxt, (), core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>
  34:     0x7f6d6d3f4d97 - rustc_query_system[81284d9f3abc9bae]::query::plumbing::try_execute_query::<rustc_query_impl[8e5827c450177fda]::plumbing::QueryCtxt, rustc_query_system[81284d9f3abc9bae]::query::caches::DefaultCache<(), core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>>
  35:     0x7f6d6d3f47f0 - rustc_query_system[81284d9f3abc9bae]::query::plumbing::get_query::<rustc_query_impl[8e5827c450177fda]::queries::analysis, rustc_query_impl[8e5827c450177fda]::plumbing::QueryCtxt>
  36:     0x7f6d6cefa47b - <rustc_interface[163ae487477d9c3c]::passes::QueryContext>::enter::<rustc_driver[daadfd6292eb5d9f]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>
  37:     0x7f6d6cef2a0e - <rustc_interface[163ae487477d9c3c]::interface::Compiler>::enter::<rustc_driver[daadfd6292eb5d9f]::run_compiler::{closure#1}::{closure#2}, core[e5d1a7e8c6989fb6]::result::Result<core[e5d1a7e8c6989fb6]::option::Option<rustc_interface[163ae487477d9c3c]::queries::Linker>, rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>
  38:     0x7f6d6ceeda28 - rustc_span[e9db05e073d6ae0e]::with_source_map::<core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>, rustc_interface[163ae487477d9c3c]::interface::run_compiler<core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>, rustc_driver[daadfd6292eb5d9f]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  39:     0x7f6d6ceed515 - <scoped_tls[e75e6c3262949904]::ScopedKey<rustc_span[e9db05e073d6ae0e]::SessionGlobals>>::set::<rustc_interface[163ae487477d9c3c]::interface::run_compiler<core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>, rustc_driver[daadfd6292eb5d9f]::run_compiler::{closure#1}>::{closure#0}, core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>
  40:     0x7f6d6ceecb02 - std[819d5ca3b5620c33]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[163ae487477d9c3c]::util::run_in_thread_pool_with_globals<rustc_interface[163ae487477d9c3c]::interface::run_compiler<core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>, rustc_driver[daadfd6292eb5d9f]::run_compiler::{closure#1}>::{closure#0}, core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>
  41:     0x7f6d6ceec818 - <<std[819d5ca3b5620c33]::thread::Builder>::spawn_unchecked_<rustc_interface[163ae487477d9c3c]::util::run_in_thread_pool_with_globals<rustc_interface[163ae487477d9c3c]::interface::run_compiler<core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>, rustc_driver[daadfd6292eb5d9f]::run_compiler::{closure#1}>::{closure#0}, core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>::{closure#1} as core[e5d1a7e8c6989fb6]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  42:     0x7f6d6ea8c8d3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd0b2a5e0dbe3c403
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/alloc/src/boxed.rs:2000:9
  43:     0x7f6d6ea8c8d3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h082e01feb1661ff6
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/alloc/src/boxed.rs:2000:9
  44:     0x7f6d6ea8c8d3 - std::sys::unix::thread::Thread::new::thread_start::hf94610e63e426d69
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/sys/unix/thread.rs:108:17
  45:     0x7f6d6a7068fd - <unknown>
  46:     0x7f6d6a788a60 - <unknown>
  47:                0x0 - <unknown>
error: could not compile `const-ref-match-bug`

Backtrace

   Compiling const-ref-match-bug v0.1.0 (/home/hashworks/Documents/Projects/Rust/const-ref-match-bug)
thread '<unnamed>' panicked at 'forcing query with already existing `DepNode`
- query-key: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing, constness: NotConst }, value: Val(Scalar(alloc6), &char) }
- dep-node: deref_mir_constant(fde8d4e96c9678c3-5625764330578e40)', /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/compiler/rustc_query_system/src/dep_graph/graph.rs:316:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/core/src/panicking.rs:65:14
   2: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::ConstantKind>, rustc_middle::mir::ConstantKind>
   3: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::mir::ConstantKind>, rustc_middle::mir::ConstantKind>>
   4: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::deref_mir_constant, rustc_query_impl::plumbing::QueryCtxt>
   5: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::deref_mir_constant
   6: <rustc_mir_build::thir::pattern::const_to_pat::ConstToPat>::recur
   7: <rustc_mir_build::thir::pattern::const_to_pat::ConstToPat>::to_pat
   8: <rustc_mir_build::thir::pattern::PatCtxt>::const_to_pat
   9: <rustc_mir_build::thir::pattern::PatCtxt>::lower_path
  10: <rustc_mir_build::thir::pattern::PatCtxt>::lower_pattern
  11: <rustc_mir_build::thir::pattern::check_match::MatchVisitor>::check_match
  12: <rustc_mir_build::thir::pattern::check_match::MatchVisitor as rustc_hir::intravisit::Visitor>::visit_expr
  13: rustc_mir_build::thir::pattern::check_match::check_match
  14: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId, ()>
  15: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, ()>>
  16: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_interface::passes::analysis::{closure#1}::{closure#0}::{closure#0}::{closure#0}>::{closure#0}>
  17: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#1}::{closure#0}::{closure#0}>
  18: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#1}>
  19: rustc_interface::passes::analysis
  20: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  21: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorGuaranteed>>>
  22: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  23: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#2}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  24: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
  25: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  26: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: could not compile `const-ref-match-bug`
sion::Session>::time::<(), rustc_interface::passes::analysis::{closure#1}>
  19: rustc_interface::passes::analysis
  20: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  21: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorGuaranteed>>>
  22: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  23: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#2}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  24: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
  25: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  26: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: could not compile `const-ref-match-bug`

Backtrace Full

   Compiling const-ref-match-bug v0.1.0 (/home/hashworks/Documents/Projects/Rust/const-ref-match-bug)
thread '<unnamed>' panicked at 'forcing query with already existing `DepNode`
- query-key: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing, constness: NotConst }, value: Val(Scalar(alloc6), &char) }
- dep-node: deref_mir_constant(fde8d4e96c9678c3-5625764330578e40)', /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/compiler/rustc_query_system/src/dep_graph/graph.rs:316:9
stack backtrace:
   0:     0x7fb445b6661a - std::backtrace_rs::backtrace::libunwind::trace::hec1c9a33ec35a782
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fb445b6661a - std::backtrace_rs::backtrace::trace_unsynchronized::hef44794102f9589c
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fb445b6661a - std::sys_common::backtrace::_print_fmt::h3d085ebafa3ff4d4
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fb445b6661a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1dc483ce0b0acc38
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fb445bc920e - core::fmt::write::hdde74b1f9f025400
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/core/src/fmt/mod.rs:1208:17
   5:     0x7fb445b56b35 - std::io::Write::write_fmt::h93bb2bce537087eb
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/io/mod.rs:1682:15
   6:     0x7fb445b663e5 - std::sys_common::backtrace::_print::hffbee7406e6f5871
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7fb445b663e5 - std::sys_common::backtrace::print::ha3e39199dd4aff7e
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7fb445b6912f - std::panicking::default_hook::{{closure}}::h9d3052b99dbdb269
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/panicking.rs:267:22
   9:     0x7fb445b68e6b - std::panicking::default_hook::hf85cde60e828679e
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/panicking.rs:286:9
  10:     0x7fb445b6994c - std::panicking::rust_panic_with_hook::h7bb6b938bd4ce622
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/panicking.rs:688:13
  11:     0x7fb445b696e9 - std::panicking::begin_panic_handler::{{closure}}::h894513d3c9ea77f1
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/panicking.rs:579:13
  12:     0x7fb445b66acc - std::sys_common::backtrace::__rust_end_short_backtrace::h478da9df1dc8d9c3
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x7fb445b693f2 - rust_begin_unwind
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/panicking.rs:575:5
  14:     0x7fb445bc5c23 - core::panicking::panic_fmt::h0f7f0682c1639601
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/core/src/panicking.rs:65:14
  15:     0x7fb448596813 - <rustc_query_system[81284d9f3abc9bae]::dep_graph::graph::DepGraph<rustc_middle[46c205e3f9247fc2]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[46c205e3f9247fc2]::ty::context::TyCtxt, rustc_middle[46c205e3f9247fc2]::ty::ParamEnvAnd<rustc_middle[46c205e3f9247fc2]::mir::ConstantKind>, rustc_middle[46c205e3f9247fc2]::mir::ConstantKind>
  16:     0x7fb448594eff - rustc_query_system[81284d9f3abc9bae]::query::plumbing::try_execute_query::<rustc_query_impl[8e5827c450177fda]::plumbing::QueryCtxt, rustc_query_system[81284d9f3abc9bae]::query::caches::DefaultCache<rustc_middle[46c205e3f9247fc2]::ty::ParamEnvAnd<rustc_middle[46c205e3f9247fc2]::mir::ConstantKind>, rustc_middle[46c205e3f9247fc2]::mir::ConstantKind>>
  17:     0x7fb4485943e2 - rustc_query_system[81284d9f3abc9bae]::query::plumbing::get_query::<rustc_query_impl[8e5827c450177fda]::queries::deref_mir_constant, rustc_query_impl[8e5827c450177fda]::plumbing::QueryCtxt>
  18:     0x7fb4485942e7 - <rustc_query_impl[8e5827c450177fda]::Queries as rustc_middle[46c205e3f9247fc2]::ty::query::QueryEngine>::deref_mir_constant
  19:     0x7fb4472939da - <rustc_mir_build[cc372544a685ce91]::thir::pattern::const_to_pat::ConstToPat>::recur
  20:     0x7fb447290ec6 - <rustc_mir_build[cc372544a685ce91]::thir::pattern::const_to_pat::ConstToPat>::to_pat
  21:     0x7fb447290a4e - <rustc_mir_build[cc372544a685ce91]::thir::pattern::PatCtxt>::const_to_pat
  22:     0x7fb44728f481 - <rustc_mir_build[cc372544a685ce91]::thir::pattern::PatCtxt>::lower_path
  23:     0x7fb44728b56b - <rustc_mir_build[cc372544a685ce91]::thir::pattern::PatCtxt>::lower_pattern
  24:     0x7fb4471f5fe6 - <rustc_mir_build[cc372544a685ce91]::thir::pattern::check_match::MatchVisitor>::check_match
  25:     0x7fb4471f5272 - <rustc_mir_build[cc372544a685ce91]::thir::pattern::check_match::MatchVisitor as rustc_hir[8087fa9ceaba5c65]::intravisit::Visitor>::visit_expr
  26:     0x7fb4478e166f - rustc_mir_build[cc372544a685ce91]::thir::pattern::check_match::check_match
  27:     0x7fb44756561f - <rustc_query_system[81284d9f3abc9bae]::dep_graph::graph::DepGraph<rustc_middle[46c205e3f9247fc2]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[46c205e3f9247fc2]::ty::context::TyCtxt, rustc_span[e9db05e073d6ae0e]::def_id::DefId, ()>
  28:     0x7fb447564435 - rustc_query_system[81284d9f3abc9bae]::query::plumbing::try_execute_query::<rustc_query_impl[8e5827c450177fda]::plumbing::QueryCtxt, rustc_query_system[81284d9f3abc9bae]::query::caches::DefaultCache<rustc_span[e9db05e073d6ae0e]::def_id::DefId, ()>>
  29:     0x7fb4485cfc05 - rustc_data_structures[59f892ce3f414ea5]::sync::par_for_each_in::<&[rustc_span[e9db05e073d6ae0e]::def_id::LocalDefId], <rustc_middle[46c205e3f9247fc2]::hir::map::Map>::par_body_owners<rustc_interface[163ae487477d9c3c]::passes::analysis::{closure#1}::{closure#0}::{closure#0}::{closure#0}>::{closure#0}>
  30:     0x7fb4485cf743 - <rustc_session[72ee2d53e3941d51]::session::Session>::time::<(), rustc_interface[163ae487477d9c3c]::passes::analysis::{closure#1}::{closure#0}::{closure#0}>
  31:     0x7fb447268b3b - <rustc_session[72ee2d53e3941d51]::session::Session>::time::<(), rustc_interface[163ae487477d9c3c]::passes::analysis::{closure#1}>
  32:     0x7fb447267210 - rustc_interface[163ae487477d9c3c]::passes::analysis
  33:     0x7fb4485f60ef - <rustc_query_system[81284d9f3abc9bae]::dep_graph::graph::DepGraph<rustc_middle[46c205e3f9247fc2]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[46c205e3f9247fc2]::ty::context::TyCtxt, (), core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>
  34:     0x7fb4485f4d97 - rustc_query_system[81284d9f3abc9bae]::query::plumbing::try_execute_query::<rustc_query_impl[8e5827c450177fda]::plumbing::QueryCtxt, rustc_query_system[81284d9f3abc9bae]::query::caches::DefaultCache<(), core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>>
  35:     0x7fb4485f47f0 - rustc_query_system[81284d9f3abc9bae]::query::plumbing::get_query::<rustc_query_impl[8e5827c450177fda]::queries::analysis, rustc_query_impl[8e5827c450177fda]::plumbing::QueryCtxt>
  36:     0x7fb4480fa47b - <rustc_interface[163ae487477d9c3c]::passes::QueryContext>::enter::<rustc_driver[daadfd6292eb5d9f]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>
  37:     0x7fb4480f2a0e - <rustc_interface[163ae487477d9c3c]::interface::Compiler>::enter::<rustc_driver[daadfd6292eb5d9f]::run_compiler::{closure#1}::{closure#2}, core[e5d1a7e8c6989fb6]::result::Result<core[e5d1a7e8c6989fb6]::option::Option<rustc_interface[163ae487477d9c3c]::queries::Linker>, rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>
  38:     0x7fb4480eda28 - rustc_span[e9db05e073d6ae0e]::with_source_map::<core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>, rustc_interface[163ae487477d9c3c]::interface::run_compiler<core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>, rustc_driver[daadfd6292eb5d9f]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  39:     0x7fb4480ed515 - <scoped_tls[e75e6c3262949904]::ScopedKey<rustc_span[e9db05e073d6ae0e]::SessionGlobals>>::set::<rustc_interface[163ae487477d9c3c]::interface::run_compiler<core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>, rustc_driver[daadfd6292eb5d9f]::run_compiler::{closure#1}>::{closure#0}, core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>
  40:     0x7fb4480ecb02 - std[819d5ca3b5620c33]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[163ae487477d9c3c]::util::run_in_thread_pool_with_globals<rustc_interface[163ae487477d9c3c]::interface::run_compiler<core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>, rustc_driver[daadfd6292eb5d9f]::run_compiler::{closure#1}>::{closure#0}, core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>
  41:     0x7fb4480ec818 - <<std[819d5ca3b5620c33]::thread::Builder>::spawn_unchecked_<rustc_interface[163ae487477d9c3c]::util::run_in_thread_pool_with_globals<rustc_interface[163ae487477d9c3c]::interface::run_compiler<core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>, rustc_driver[daadfd6292eb5d9f]::run_compiler::{closure#1}>::{closure#0}, core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e5d1a7e8c6989fb6]::result::Result<(), rustc_errors[7f7a26e842223f7b]::ErrorGuaranteed>>::{closure#1} as core[e5d1a7e8c6989fb6]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  42:     0x7fb449c8c8d3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd0b2a5e0dbe3c403
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/alloc/src/boxed.rs:2000:9
  43:     0x7fb449c8c8d3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h082e01feb1661ff6
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/alloc/src/boxed.rs:2000:9
  44:     0x7fb449c8c8d3 - std::sys::unix::thread::Thread::new::thread_start::hf94610e63e426d69
                               at /rustc/c090c6880c0183ba248bde4a16e29ba29ac4fbba/library/std/src/sys/unix/thread.rs:108:17
  45:     0x7fb4459068fd - <unknown>
  46:     0x7fb445988a60 - <unknown>
  47:                0x0 - <unknown>
error: could not compile `const-ref-match-bug`

@hashworks hashworks added C-bug Category: This is a bug. 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. labels Dec 2, 2022
@matthiaskrgr
Copy link
Member

probably duplicate of #83085

@apiraino
Copy link
Contributor

Closing in favor of #83085 (has a patch for fixing the issue in progress)

@apiraino apiraino closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2022
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. 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.
Projects
None yet
Development

No branches or pull requests

3 participants