Skip to content

incremental ICE: slice-pattern-const.rs聽#83085

Description

@matthiaskrgr

Code

code is reduced from ./src/test/ui/pattern/usefulness/slice-pattern-const.rs

fn main() {
    const BOO: &[u8; 0] = &[];
    match &[] {
        BOO => (),
        b"" => (),
        _ => (), 
    }
}

Meta

rustc --version --verbose:

rustc 1.52.0-nightly (b3e19a221 2021-03-12)
binary: rustc
commit-hash: b3e19a221e63dcffdef87e12eadf1f36a8b90295
commit-date: 2021-03-12
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 12.0.0

Error output

rustc ./src/test/ui/pattern/usefulness/slice-pattern-const.rs -Cincremental=/tmp/a -Zincremental-verify-ich=yes

thread 'rustc' panicked at 'forcing query with already existing `DepNode`
- query-key: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: Const { ty: &[u8; 0], val: Value(Scalar(alloc4)) } }
- dep-node: deref_const(425d79d9606e812c-e24fed75a464eb8f)', /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/compiler/rustc_query_system/src/query/plumbing.rs:605:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: 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: rustc 1.52.0-nightly (b3e19a221 2021-03-12) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z incremental-verify-ich=yes -C incremental

query stack during panic:
#0 [check_match] match-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack
Backtrace

thread 'rustc' panicked at 'forcing query with already existing `DepNode`
- query-key: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: Const { ty: &[u8; 0], val: Value(Scalar(alloc4)) } }
- dep-node: deref_const(425d79d9606e812c-e24fed75a464eb8f)', /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/compiler/rustc_query_system/src/query/plumbing.rs:605:5
stack backtrace:
   0:     0x7f125f2a5930 - std::backtrace_rs::backtrace::libunwind::trace::hfe3b1cace85e87d8
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7f125f2a5930 - std::backtrace_rs::backtrace::trace_unsynchronized::h542330af06479043
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f125f2a5930 - std::sys_common::backtrace::_print_fmt::h6b88726367858985
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f125f2a5930 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hcd76ce6b485adbea
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f125f313b6f - core::fmt::write::h127419eb46f2ecc9
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/core/src/fmt/mod.rs:1092:17
   5:     0x7f125f299a42 - std::io::Write::write_fmt::h0facb64ef2e7f5d8
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/io/mod.rs:1567:15
   6:     0x7f125f2a9675 - std::sys_common::backtrace::_print::h7bf1633ea5421f7b
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f125f2a9675 - std::sys_common::backtrace::print::h5cc4d09049928ba5
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f125f2a9675 - std::panicking::default_hook::{{closure}}::h9e84dc005bfc9fc7
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/panicking.rs:208:50
   9:     0x7f125f2a91d3 - std::panicking::default_hook::h123278a03b1f796b
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/panicking.rs:225:9
  10:     0x7f125fa92d4b - rustc_driver::report_ice::h036d06dbb7c2c24c
  11:     0x7f125f2a9de0 - std::panicking::rust_panic_with_hook::h4040631aa6c7bc27
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/panicking.rs:595:17
  12:     0x7f125f2a9957 - std::panicking::begin_panic_handler::{{closure}}::h02a17b22ac092d08
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/panicking.rs:497:13
  13:     0x7f125f2a5dec - std::sys_common::backtrace::__rust_end_short_backtrace::h6063b024443b5852
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/sys_common/backtrace.rs:141:18
  14:     0x7f125f2a98b9 - rust_begin_unwind
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/panicking.rs:493:5
  15:     0x7f125f26e03b - std::panicking::begin_panic_fmt::h10b51f96d6207ff1
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/panicking.rs:435:5
  16:     0x7f1261c47da8 - rustc_query_system::query::plumbing::force_query_with_job::he0f620158da8d803
  17:     0x7f1261beb287 - rustc_query_system::query::plumbing::get_query_impl::h5ba77d45521abab0
  18:     0x7f1261d11e49 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::deref_const::hd9f581011854b940
  19:     0x7f12612caff6 - rustc_mir_build::thir::pattern::const_to_pat::ConstToPat::recur::h20f1a06016ab4591
  20:     0x7f12612c8e76 - rustc_mir_build::thir::pattern::const_to_pat::ConstToPat::to_pat::h027d34b801cda3ca
  21:     0x7f126129f449 - rustc_infer::infer::InferCtxtBuilder::enter::hb716717d19b47fc3
  22:     0x7f12612aa49f - rustc_mir_build::thir::pattern::const_to_pat::<impl rustc_mir_build::thir::pattern::PatCtxt>::const_to_pat::h7f756f11508cf237
  23:     0x7f12612a962f - rustc_mir_build::thir::pattern::PatCtxt::lower_lit::h2f85917bbfe176c4
  24:     0x7f12612a7523 - rustc_mir_build::thir::pattern::PatCtxt::lower_pattern::h8c1f2b4cac0de295
  25:     0x7f12612d249e - rustc_mir_build::thir::pattern::check_match::MatchVisitor::lower_pattern::hbfd7ad67af9d1b7b
  26:     0x7f12612b62c5 - <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter::hf1613ec32b2be86b
  27:     0x7f12612d18fc - <rustc_mir_build::thir::pattern::check_match::MatchVisitor as rustc_hir::intravisit::Visitor>::visit_expr::h7d8d6d6c0aea7f2d
  28:     0x7f12612d170c - <rustc_mir_build::thir::pattern::check_match::MatchVisitor as rustc_hir::intravisit::Visitor>::visit_expr::h7d8d6d6c0aea7f2d
  29:     0x7f12612d133e - rustc_mir_build::thir::pattern::check_match::check_match::hd138e73ddabdea33
  30:     0x7f1261d352d5 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::ha56d3193e9b0a359
  31:     0x7f12611bdc79 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h97b34b421882c18c
  32:     0x7f1261179219 - rustc_query_system::query::plumbing::force_query_with_job::h3de7e20808f5a4ea
  33:     0x7f1261155991 - rustc_query_system::query::plumbing::get_query_impl::h7c789892a2cbbbf6
  34:     0x7f12611cdcdc - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::check_match::h4d058915c0f72337
  35:     0x7f1260e64ed4 - rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::par_body_owners::h4e8afbfc856b57be
  36:     0x7f12618537e6 - rustc_session::utils::<impl rustc_session::session::Session>::time::hbda29d4d07c62a8f
  37:     0x7f1261860b57 - rustc_interface::passes::analysis::h98b4a9527b987636
  38:     0x7f126031bdda - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h30b34c9dcb235b07
  39:     0x7f1261ceeec0 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h8d236d21d15844b7
  40:     0x7f1261c795d7 - rustc_data_structures::stack::ensure_sufficient_stack::h481edf0a8747b17d
  41:     0x7f1261c472e1 - rustc_query_system::query::plumbing::force_query_with_job::hdbdc575a4c5075f8
  42:     0x7f1261bdcb74 - rustc_query_system::query::plumbing::get_query_impl::h212b99521679522b
  43:     0x7f1261d0fb3f - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis::h202822fb7a810e61
  44:     0x7f126184e3d0 - rustc_interface::passes::QueryContext::enter::h1dff05902f17c58a
  45:     0x7f1261820ecd - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h8ab0a704bae2634f
  46:     0x7f126181b5b4 - rustc_span::with_source_map::h512fd197bcd2b7c3
  47:     0x7f12618206a3 - scoped_tls::ScopedKey<T>::set::hd407f010a973eb63
  48:     0x7f1261821eb1 - std::sys_common::backtrace::__rust_begin_short_backtrace::h3c42279179caa5db
  49:     0x7f126183d285 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hd56f564efc764ea1
  50:     0x7f125f2b9258 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd8ea7ada17dfa868
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/alloc/src/boxed.rs:1546:9
  51:     0x7f125f2b9258 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h91ce3a636c58b978
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/alloc/src/boxed.rs:1546:9
  52:     0x7f125f2b9258 - std::sys::unix::thread::Thread::new::thread_start::h2e193c2e23720fdf
                               at /rustc/b3e19a221e63dcffdef87e12eadf1f36a8b90295/library/std/src/sys/unix/thread.rs:71:17
  53:     0x7f125f1c2299 - start_thread
  54:     0x7f125f0d7053 - clone
  55:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: 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: rustc 1.52.0-nightly (b3e19a221 2021-03-12) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z incremental-verify-ich=yes -C incremental

query stack during panic:
#0 [check_match] match-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)A-incr-compArea: Incremental compilationA-valtreeArea: Value trees or fixed by value treesC-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) 鉂勶笍P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions