Skip to content

ICE: exhaustiveness-non-exhaustive.rs with -Zinstrument-coverage: sumup_counter_operand should have a value #79569

Closed
@matthiaskrgr

Description

@matthiaskrgr

Code

code from ./src/test/ui/or-patterns/exhaustiveness-non-exhaustive.rs

#![feature(or_patterns)]
#![deny(unreachable_patterns)]

// We wrap patterns in a tuple because top-level or-patterns were special-cased.
fn main() {
    match (0u8, 0u8) {
        //~^ ERROR non-exhaustive patterns: `(2_u8..=u8::MAX, _)`
        (0 | 1, 2 | 3) => {}
    }
    match ((0u8,),) {
        //~^ ERROR non-exhaustive patterns: `((4_u8..=u8::MAX))`
        ((0 | 1,) | (2 | 3,),) => {}
    }
    match (Some(0u8),) {
        //~^ ERROR non-exhaustive patterns: `(Some(2_u8..=u8::MAX))`
        (None | Some(0 | 1),) => {}
    }
}

Meta

rustc --version --verbose:

rustc 1.50.0-nightly (b7ebc6b0c 2020-11-30)
binary: rustc
commit-hash: b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18
commit-date: 2020-11-30
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly

Error output

error[E0004]: non-exhaustive patterns: `(2_u8..=u8::MAX, _)` not covered
 --> ./src/test/ui/or-patterns/exhaustiveness-non-exhaustive.rs:6:11
  |
6 |     match (0u8, 0u8) {
  |           ^^^^^^^^^^ pattern `(2_u8..=u8::MAX, _)` not covered
  |
  = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
  = note: the matched value is of type `(u8, u8)`

error[E0004]: non-exhaustive patterns: `((4_u8..=u8::MAX))` not covered
  --> ./src/test/ui/or-patterns/exhaustiveness-non-exhaustive.rs:10:11
   |
10 |     match ((0u8,),) {
   |           ^^^^^^^^^ pattern `((4_u8..=u8::MAX))` not covered
   |
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = note: the matched value is of type `((u8,),)`

error[E0004]: non-exhaustive patterns: `(Some(2_u8..=u8::MAX))` not covered
  --> ./src/test/ui/or-patterns/exhaustiveness-non-exhaustive.rs:14:11
   |
14 |     match (Some(0u8),) {
   |           ^^^^^^^^^^^^ pattern `(Some(2_u8..=u8::MAX))` not covered
   |
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = note: the matched value is of type `(Option<u8>,)`

thread 'rustc' panicked at 'sumup_counter_operand should have a value', compiler/rustc_mir/src/transform/coverage/counters.rs:274:40
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.50.0-nightly (b7ebc6b0c 2020-11-30) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z instrument-coverage

query stack during panic:
#0 [mir_promoted] processing `main`
#1 [mir_borrowck] borrow-checking `main`
end of query stack
error: aborting due to 3 previous errors

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

thread 'rustc' panicked at 'sumup_counter_operand should have a value', compiler/rustc_mir/src/transform/coverage/counters.rs:274:40
stack backtrace:
   0:     0x7f4456b2ee00 - std::backtrace_rs::backtrace::libunwind::trace::h746c3e9529d524bc
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7f4456b2ee00 - std::backtrace_rs::backtrace::trace_unsynchronized::h86340908ff889faa
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f4456b2ee00 - std::sys_common::backtrace::_print_fmt::h43f85f9b18230404
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f4456b2ee00 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc132ae1a5b5aa7cd
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f4456ba1b9c - core::fmt::write::hdf023a0036d2a25f
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/core/src/fmt/mod.rs:1078:17
   5:     0x7f4456b20972 - std::io::Write::write_fmt::h8580846154bcb66a
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/std/src/io/mod.rs:1519:15
   6:     0x7f4456b32a65 - std::sys_common::backtrace::_print::h7ee55fed88d107a3
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f4456b32a65 - std::sys_common::backtrace::print::h54a7d3e52a524177
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f4456b32a65 - std::panicking::default_hook::{{closure}}::h60921e857bf55a40
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/std/src/panicking.rs:208:50
   9:     0x7f4456b325ba - std::panicking::default_hook::hf0f9afb1017317fc
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/std/src/panicking.rs:225:9
  10:     0x7f44573c4428 - rustc_driver::report_ice::ha25ae86a5858acc3
  11:     0x7f4456b33366 - std::panicking::rust_panic_with_hook::h8d66bf42b407aaea
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/std/src/panicking.rs:595:17
  12:     0x7f4456b32e87 - std::panicking::begin_panic_handler::{{closure}}::hde71edcd925d0c5e
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/std/src/panicking.rs:497:13
  13:     0x7f4456b2f2bc - std::sys_common::backtrace::__rust_end_short_backtrace::h8a3c7d6cea578919
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/std/src/sys_common/backtrace.rs:141:18
  14:     0x7f4456b32de9 - rust_begin_unwind
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/std/src/panicking.rs:493:5
  15:     0x7f4456b9dfb1 - core::panicking::panic_fmt::h20225113c4a2f8fd
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/core/src/panicking.rs:92:14
  16:     0x7f4456b9db93 - core::option::expect_failed::h8be1ca96ca0d69ca
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/core/src/option.rs:1260:5
  17:     0x7f44589b0cc9 - rustc_mir::transform::coverage::counters::CoverageCounters::make_bcb_counters::h09189a1663c71aa0
  18:     0x7f4458cba418 - <rustc_mir::transform::coverage::InstrumentCoverage as rustc_mir::transform::MirPass>::run_pass::h63163fe939ee6941
  19:     0x7f4458c221ad - rustc_mir::transform::run_passes::hde85252c218e451d
  20:     0x7f4458c22ff9 - rustc_mir::transform::mir_promoted::hbf030df47a64ef91
  21:     0x7f4458c739b1 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_promoted>::compute::hd22b0a9058b7bb65
  22:     0x7f4458aa1b53 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task::hff3904454383c89e
  23:     0x7f4458b487c8 - rustc_data_structures::stack::ensure_sufficient_stack::he581a4f69947db11
  24:     0x7f4458883be1 - rustc_query_system::query::plumbing::get_query_impl::h20d9617555a285f4
  25:     0x7f4458ca9024 - rustc_mir::borrow_check::mir_borrowck::h8fcfde9d3bc3965f
  26:     0x7f4458c7b845 - core::ops::function::FnOnce::call_once::hda8d7f4d3e0163df
  27:     0x7f445761192e - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_borrowck>::compute::hd320f4ca41a47c0c
  28:     0x7f44575d08e0 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hbff93ce2cea26122
  29:     0x7f4457614bfb - rustc_data_structures::stack::ensure_sufficient_stack::he17b7629a75337fd
  30:     0x7f44575ad5a4 - rustc_query_system::query::plumbing::get_query_impl::hc38aca5d51d5691a
  31:     0x7f44575b5719 - rustc_query_system::query::plumbing::ensure_query_impl::h474c3afdd9b59c6e
  32:     0x7f44575ee999 - rustc_session::utils::<impl rustc_session::session::Session>::time::hd10f52cc7be7a8fd
  33:     0x7f4457622542 - rustc_interface::passes::analysis::h342855b4d8ce9897
  34:     0x7f4457380f2b - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute::h95ff81a8a73eaff3
  35:     0x7f4457411c06 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_eval_always_task::h71fd6f4f43205659
  36:     0x7f4457420ee6 - rustc_data_structures::stack::ensure_sufficient_stack::h426420634e295fa0
  37:     0x7f44573aeb44 - rustc_query_system::query::plumbing::get_query_impl::h59cb47161047ab66
  38:     0x7f44573835fb - rustc_interface::passes::QueryContext::enter::heace2ac35bf577de
  39:     0x7f445741ea65 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::hcfd2504bb4e8d292
  40:     0x7f44573ecd37 - rustc_span::with_source_map::hdf17fa3a4d8fe35b
  41:     0x7f445741ae8c - scoped_tls::ScopedKey<T>::set::h5dca480b178bbfab
  42:     0x7f4457421fa5 - std::sys_common::backtrace::__rust_begin_short_backtrace::ha4cbf96baa7e4912
  43:     0x7f445738ab4a - core::ops::function::FnOnce::call_once{{vtable.shim}}::he2d69591c700ddc8
  44:     0x7f4456b4262a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hea1090dbdcecbf5a
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/alloc/src/boxed.rs:1327:9
  45:     0x7f4456b4262a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8d5723d3912bd325
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/alloc/src/boxed.rs:1327:9
  46:     0x7f4456b4262a - std::sys::unix::thread::Thread::new::thread_start::hc17a425ca2995724
                               at /rustc/b7ebc6b0c1ba3c27ebb17c0b496ece778ef11e18/library/std/src/sys/unix/thread.rs:71:17
  47:     0x7f4456a383e9 - start_thread
  48:     0x7f4456955293 - __GI___clone
  49:                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.50.0-nightly (b7ebc6b0c 2020-11-30) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z instrument-coverage

query stack during panic:
#0 [mir_promoted] processing `main`
#1 [mir_borrowck] borrow-checking `main`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions