Skip to content

check_match and slice bugginess #30240

Closed
Closed
@Stebalien

Description

@Stebalien

I'm guessing these bugs are all related so I put them in one place.

Errors:

let & ref a =  &[0i32] as &[_]; // slice

With:

tmp.rs:5:9: 5:16 error: refutable pattern in local binding: `[]` not covered [E0005]
tmp.rs:5     let & ref a =  &[0i32] as &[_];

Panics:

let & ref a = "test";

With:

thread 'rustc' panicked at 'assertion failed: rows.iter().all(|r| r.len() == v.len())', ../src/librustc/middle/check_match.rs:653
stack backtrace:
   1:      0x328f56aa250 - sys::backtrace::tracing::imp::write::h2121cc3fd481a5bfxXt
   2:      0x328f56b0ed5 - panicking::log_panic::_<closure>::closure.41181
   3:      0x328f56b096f - panicking::log_panic::h274f0982d2d31f5d62x
   4:      0x328f5679823 - sys_common::unwind::begin_unwind_inner::ha197e3d3bf39738b4Ps
   5:      0x328f2fa39bf - sys_common::unwind::begin_unwind::begin_unwind::h3566019691569981035
   6:      0x328f2ff32aa - middle::check_match::is_useful::h109f9568fb97479esoj
   7:      0x328f30109ec - middle::check_match::is_useful_specialized::h1f87c7f149d4e543xxj
   8:      0x328f300f7a9 - middle::check_match::is_useful::_<closure>::closure.77994
   9:      0x328f300f4bc - option::_<impl>::map::map::h17883384761112421825
  10:      0x328f2ff3d1c - middle::check_match::is_useful::h109f9568fb97479esoj
  11:      0x328f3014715 - middle::check_match::check_irrefutable::he5695f1d8986f9aeGVj
  12:      0x328f2ff0171 - middle::check_match::check_local::h567799c10f5ef66byTj
  13:      0x328f2ff03a7 - middle::check_match::check_fn::h249cab818f405babpUj
  14:      0x328f2ff0605 - middle::check_match::check_crate::hfb67876efbdaaa5e6Ki
  15:      0x328f5bb4549 - driver::phase_3_run_analysis_passes::_<closure>::closure.25658
  16:      0x328f5b96773 - middle::ty::context::_<impl>::create_and_enter::create_and_enter::h17232051925259053486
  17:      0x328f5b91b2b - driver::phase_3_run_analysis_passes::h15745222629392362635
  18:      0x328f5b63659 - driver::compile_input::h999faf1b9f4a31e5hca
  19:      0x328f5b5575b - run_compiler::h6e3d729b9b1fcaeeLwc
  20:      0x328f5b52416 - sys_common::unwind::try::try_fn::try_fn::h16856740087359761980
  21:      0x328f56a7ee8 - __rust_try
  22:      0x328f569f7eb - sys_common::unwind::try::inner_try::ha6777f044d5d5f33CMs
  23:      0x328f5b52770 - boxed::_<impl>::call_box::call_box::h2933931519396885595
  24:      0x328f56af3f3 - sys::thread::_<impl>::new::thread_start::h552e7664d60f3aa2I5w
  25:      0x328ee9004a3 - start_thread
  26:      0x328f533e13c - clone
  27:                0x0 - <unknown>

May be related to #26510 but doesn't involve slice patterns.

-- edit: last 2 cases moved to separate bug reports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-DSTsArea: Dynamically-sized types (DSTs)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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions