Rollup merge of #91993 - estebank:match-span-suggestion, r=oli-obk

Tweak output for non-exhaustive `match` expression

* Provide structured suggestion when missing `match` arms
* Move pointing at the missing variants *after* the main error

<img width="1164" alt="" src="https://user-images.githubusercontent.com/1606434/146312085-b57ef4a3-6e96-4f32-aa2a-803637d9eeba.png">
This commit is contained in:
Matthias Krüger 2022-03-08 11:04:49 +01:00 committed by GitHub
commit e3ea69f0ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
69 changed files with 2422 additions and 960 deletions

View File

@ -20,7 +20,7 @@ use rustc_session::lint::builtin::{
}; };
use rustc_session::Session; use rustc_session::Session;
use rustc_span::source_map::Spanned; use rustc_span::source_map::Spanned;
use rustc_span::{DesugaringKind, ExpnKind, Span}; use rustc_span::{DesugaringKind, ExpnKind, MultiSpan, Span};
crate fn check_match(tcx: TyCtxt<'_>, def_id: DefId) { crate fn check_match(tcx: TyCtxt<'_>, def_id: DefId) {
let body_id = match def_id.as_local() { let body_id = match def_id.as_local() {
@ -64,7 +64,9 @@ impl<'tcx> Visitor<'tcx> for MatchVisitor<'_, '_, 'tcx> {
fn visit_expr(&mut self, ex: &'tcx hir::Expr<'tcx>) { fn visit_expr(&mut self, ex: &'tcx hir::Expr<'tcx>) {
intravisit::walk_expr(self, ex); intravisit::walk_expr(self, ex);
match &ex.kind { match &ex.kind {
hir::ExprKind::Match(scrut, arms, source) => self.check_match(scrut, arms, *source), hir::ExprKind::Match(scrut, arms, source) => {
self.check_match(scrut, arms, *source, ex.span)
}
hir::ExprKind::Let(hir::Let { pat, init, span, .. }) => { hir::ExprKind::Let(hir::Let { pat, init, span, .. }) => {
self.check_let(pat, init, *span) self.check_let(pat, init, *span)
} }
@ -163,6 +165,7 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> {
scrut: &hir::Expr<'_>, scrut: &hir::Expr<'_>,
hir_arms: &'tcx [hir::Arm<'tcx>], hir_arms: &'tcx [hir::Arm<'tcx>],
source: hir::MatchSource, source: hir::MatchSource,
expr_span: Span,
) { ) {
let mut cx = self.new_cx(scrut.hir_id); let mut cx = self.new_cx(scrut.hir_id);
@ -208,7 +211,6 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> {
} }
// Check if the match is exhaustive. // Check if the match is exhaustive.
let is_empty_match = arms.is_empty();
let witnesses = report.non_exhaustiveness_witnesses; let witnesses = report.non_exhaustiveness_witnesses;
if !witnesses.is_empty() { if !witnesses.is_empty() {
if source == hir::MatchSource::ForLoopDesugar && hir_arms.len() == 2 { if source == hir::MatchSource::ForLoopDesugar && hir_arms.len() == 2 {
@ -216,7 +218,7 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> {
let pat = hir_arms[1].pat.for_loop_some().unwrap(); let pat = hir_arms[1].pat.for_loop_some().unwrap();
self.check_irrefutable(pat, "`for` loop binding", None); self.check_irrefutable(pat, "`for` loop binding", None);
} else { } else {
non_exhaustive_match(&cx, scrut_ty, scrut.span, witnesses, is_empty_match); non_exhaustive_match(&cx, scrut_ty, scrut.span, witnesses, hir_arms, expr_span);
} }
} }
} }
@ -334,7 +336,7 @@ fn check_for_bindings_named_same_as_variants(
let ty_path = cx.tcx.def_path_str(edef.did); let ty_path = cx.tcx.def_path_str(edef.did);
let mut err = lint.build(&format!( let mut err = lint.build(&format!(
"pattern binding `{}` is named the same as one \ "pattern binding `{}` is named the same as one \
of the variants of the type `{}`", of the variants of the type `{}`",
ident, ty_path ident, ty_path
)); ));
err.code(error_code!(E0170)); err.code(error_code!(E0170));
@ -494,8 +496,10 @@ fn non_exhaustive_match<'p, 'tcx>(
scrut_ty: Ty<'tcx>, scrut_ty: Ty<'tcx>,
sp: Span, sp: Span,
witnesses: Vec<DeconstructedPat<'p, 'tcx>>, witnesses: Vec<DeconstructedPat<'p, 'tcx>>,
is_empty_match: bool, arms: &[hir::Arm<'tcx>],
expr_span: Span,
) { ) {
let is_empty_match = arms.is_empty();
let non_empty_enum = match scrut_ty.kind() { let non_empty_enum = match scrut_ty.kind() {
ty::Adt(def, _) => def.is_enum() && !def.variants.is_empty(), ty::Adt(def, _) => def.is_enum() && !def.variants.is_empty(),
_ => false, _ => false,
@ -503,12 +507,15 @@ fn non_exhaustive_match<'p, 'tcx>(
// In the case of an empty match, replace the '`_` not covered' diagnostic with something more // In the case of an empty match, replace the '`_` not covered' diagnostic with something more
// informative. // informative.
let mut err; let mut err;
let pattern;
let mut patterns_len = 0;
if is_empty_match && !non_empty_enum { if is_empty_match && !non_empty_enum {
err = create_e0004( err = create_e0004(
cx.tcx.sess, cx.tcx.sess,
sp, sp,
format!("non-exhaustive patterns: type `{}` is non-empty", scrut_ty), format!("non-exhaustive patterns: type `{}` is non-empty", scrut_ty),
); );
pattern = "_".to_string();
} else { } else {
let joined_patterns = joined_uncovered_patterns(cx, &witnesses); let joined_patterns = joined_uncovered_patterns(cx, &witnesses);
err = create_e0004( err = create_e0004(
@ -517,6 +524,16 @@ fn non_exhaustive_match<'p, 'tcx>(
format!("non-exhaustive patterns: {} not covered", joined_patterns), format!("non-exhaustive patterns: {} not covered", joined_patterns),
); );
err.span_label(sp, pattern_not_covered_label(&witnesses, &joined_patterns)); err.span_label(sp, pattern_not_covered_label(&witnesses, &joined_patterns));
patterns_len = witnesses.len();
pattern = if witnesses.len() < 4 {
witnesses
.iter()
.map(|witness| witness.to_pat(cx).to_string())
.collect::<Vec<String>>()
.join(" | ")
} else {
"_".to_string()
};
}; };
let is_variant_list_non_exhaustive = match scrut_ty.kind() { let is_variant_list_non_exhaustive = match scrut_ty.kind() {
@ -525,10 +542,6 @@ fn non_exhaustive_match<'p, 'tcx>(
}; };
adt_defined_here(cx, &mut err, scrut_ty, &witnesses); adt_defined_here(cx, &mut err, scrut_ty, &witnesses);
err.help(
"ensure that all possible cases are being handled, \
possibly by adding wildcards or more match arms",
);
err.note(&format!( err.note(&format!(
"the matched value is of type `{}`{}", "the matched value is of type `{}`{}",
scrut_ty, scrut_ty,
@ -540,14 +553,14 @@ fn non_exhaustive_match<'p, 'tcx>(
&& matches!(witnesses[0].ctor(), Constructor::NonExhaustive) && matches!(witnesses[0].ctor(), Constructor::NonExhaustive)
{ {
err.note(&format!( err.note(&format!(
"`{}` does not have a fixed maximum value, \ "`{}` does not have a fixed maximum value, so a wildcard `_` is necessary to match \
so a wildcard `_` is necessary to match exhaustively", exhaustively",
scrut_ty, scrut_ty,
)); ));
if cx.tcx.sess.is_nightly_build() { if cx.tcx.sess.is_nightly_build() {
err.help(&format!( err.help(&format!(
"add `#![feature(precise_pointer_size_matching)]` \ "add `#![feature(precise_pointer_size_matching)]` to the crate attributes to \
to the crate attributes to enable precise `{}` matching", enable precise `{}` matching",
scrut_ty, scrut_ty,
)); ));
} }
@ -557,6 +570,84 @@ fn non_exhaustive_match<'p, 'tcx>(
err.note("references are always considered inhabited"); err.note("references are always considered inhabited");
} }
} }
let mut suggestion = None;
let sm = cx.tcx.sess.source_map();
match arms {
[] if sp.ctxt() == expr_span.ctxt() => {
// Get the span for the empty match body `{}`.
let (indentation, more) = if let Some(snippet) = sm.indentation_before(sp) {
(format!("\n{}", snippet), " ")
} else {
(" ".to_string(), "")
};
suggestion = Some((
sp.shrink_to_hi().with_hi(expr_span.hi()),
format!(
" {{{indentation}{more}{pattern} => todo!(),{indentation}}}",
indentation = indentation,
more = more,
pattern = pattern,
),
));
}
[only] => {
let pre_indentation = if let (Some(snippet), true) = (
sm.indentation_before(only.span),
sm.is_multiline(sp.shrink_to_hi().with_hi(only.span.lo())),
) {
format!("\n{}", snippet)
} else {
" ".to_string()
};
let comma = if matches!(only.body.kind, hir::ExprKind::Block(..)) { "" } else { "," };
suggestion = Some((
only.span.shrink_to_hi(),
format!("{}{}{} => todo!()", comma, pre_indentation, pattern),
));
}
[.., prev, last] if prev.span.ctxt() == last.span.ctxt() => {
if let Ok(snippet) = sm.span_to_snippet(prev.span.between(last.span)) {
let comma =
if matches!(last.body.kind, hir::ExprKind::Block(..)) { "" } else { "," };
suggestion = Some((
last.span.shrink_to_hi(),
format!(
"{}{}{} => todo!()",
comma,
snippet.strip_prefix(",").unwrap_or(&snippet),
pattern
),
));
}
}
_ => {}
}
let msg = format!(
"ensure that all possible cases are being handled by adding a match arm with a wildcard \
pattern{}{}",
if patterns_len > 1 && patterns_len < 4 && suggestion.is_some() {
", a match arm with multiple or-patterns"
} else {
// we are either not suggesting anything, or suggesting `_`
""
},
match patterns_len {
// non-exhaustive enum case
0 if suggestion.is_some() => " as shown",
0 => "",
1 if suggestion.is_some() => " or an explicit pattern as shown",
1 => " or an explicit pattern",
_ if suggestion.is_some() => " as shown, or multiple match arms",
_ => " or multiple match arms",
},
);
if let Some((span, sugg)) = suggestion {
err.span_suggestion_verbose(span, &msg, sugg, Applicability::HasPlaceholders);
} else {
err.help(&msg);
}
err.emit(); err.emit();
} }
@ -597,15 +688,27 @@ fn adt_defined_here<'p, 'tcx>(
) { ) {
let ty = ty.peel_refs(); let ty = ty.peel_refs();
if let ty::Adt(def, _) = ty.kind() { if let ty::Adt(def, _) = ty.kind() {
if let Some(sp) = cx.tcx.hir().span_if_local(def.did) { let mut spans = vec![];
err.span_label(sp, format!("`{}` defined here", ty)); if witnesses.len() < 5 {
}
if witnesses.len() < 4 {
for sp in maybe_point_at_variant(cx, def, witnesses.iter()) { for sp in maybe_point_at_variant(cx, def, witnesses.iter()) {
err.span_label(sp, "not covered"); spans.push(sp);
} }
} }
let def_span = cx
.tcx
.hir()
.get_if_local(def.did)
.and_then(|node| node.ident())
.map(|ident| ident.span)
.unwrap_or_else(|| cx.tcx.def_span(def.did));
let mut span: MultiSpan =
if spans.is_empty() { def_span.into() } else { spans.clone().into() };
span.push_span_label(def_span, String::new());
for pat in spans {
span.push_span_label(pat, "not covered".to_string());
}
err.span_note(span, &format!("`{}` defined here", ty));
} }
} }

View File

@ -1,26 +1,38 @@
error[E0004]: non-exhaustive patterns: `Opcode(0_u8)` and `Opcode(2_u8..=u8::MAX)` not covered error[E0004]: non-exhaustive patterns: `Opcode(0_u8)` and `Opcode(2_u8..=u8::MAX)` not covered
--> $DIR/issue-88331.rs:11:20 --> $DIR/issue-88331.rs:11:20
| |
LL | pub struct Opcode(pub u8);
| -------------------------- `Opcode` defined here
...
LL | move |i| match msg_type { LL | move |i| match msg_type {
| ^^^^^^^^ patterns `Opcode(0_u8)` and `Opcode(2_u8..=u8::MAX)` not covered | ^^^^^^^^ patterns `Opcode(0_u8)` and `Opcode(2_u8..=u8::MAX)` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Opcode` defined here
--> $DIR/issue-88331.rs:4:12
|
LL | pub struct Opcode(pub u8);
| ^^^^^^
= note: the matched value is of type `Opcode` = note: the matched value is of type `Opcode`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ Opcode::OP1 => unimplemented!(),
LL ~ Opcode(0_u8) | Opcode(2_u8..=u8::MAX) => todo!(),
|
error[E0004]: non-exhaustive patterns: `Opcode2(Opcode(0_u8))` and `Opcode2(Opcode(2_u8..=u8::MAX))` not covered error[E0004]: non-exhaustive patterns: `Opcode2(Opcode(0_u8))` and `Opcode2(Opcode(2_u8..=u8::MAX))` not covered
--> $DIR/issue-88331.rs:27:20 --> $DIR/issue-88331.rs:27:20
| |
LL | pub struct Opcode2(Opcode);
| --------------------------- `Opcode2` defined here
...
LL | move |i| match msg_type { LL | move |i| match msg_type {
| ^^^^^^^^ patterns `Opcode2(Opcode(0_u8))` and `Opcode2(Opcode(2_u8..=u8::MAX))` not covered | ^^^^^^^^ patterns `Opcode2(Opcode(0_u8))` and `Opcode2(Opcode(2_u8..=u8::MAX))` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Opcode2` defined here
--> $DIR/issue-88331.rs:18:12
|
LL | pub struct Opcode2(Opcode);
| ^^^^^^^
= note: the matched value is of type `Opcode2` = note: the matched value is of type `Opcode2`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ Opcode2::OP2=> unimplemented!(),
LL ~ Opcode2(Opcode(0_u8)) | Opcode2(Opcode(2_u8..=u8::MAX)) => todo!(),
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -1,17 +1,19 @@
error[E0004]: non-exhaustive patterns: `B` not covered error[E0004]: non-exhaustive patterns: `B` not covered
--> $DIR/non-exhaustive-match.rs:26:25 --> $DIR/non-exhaustive-match.rs:26:25
| |
LL | enum L1 { A, B }
| ----------------
| | |
| | not covered
| `L1` defined here
...
LL | let _b = || { match l1 { L1::A => () } }; LL | let _b = || { match l1 { L1::A => () } };
| ^^ pattern `B` not covered | ^^ pattern `B` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `L1` defined here
--> $DIR/non-exhaustive-match.rs:12:14
|
LL | enum L1 { A, B }
| -- ^ not covered
= note: the matched value is of type `L1` = note: the matched value is of type `L1`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL | let _b = || { match l1 { L1::A => (), B => todo!() } };
| ++++++++++++++
error[E0004]: non-exhaustive patterns: type `E1` is non-empty error[E0004]: non-exhaustive patterns: type `E1` is non-empty
--> $DIR/non-exhaustive-match.rs:37:25 --> $DIR/non-exhaustive-match.rs:37:25
@ -19,8 +21,18 @@ error[E0004]: non-exhaustive patterns: type `E1` is non-empty
LL | let _d = || { match e1 {} }; LL | let _d = || { match e1 {} };
| ^^ | ^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `E1` defined here
--> $DIR/auxiliary/match_non_exhaustive_lib.rs:2:1
|
LL | pub enum E1 {}
| ^^^^^^^^^^^^^^
= note: the matched value is of type `E1`, which is marked as non-exhaustive = note: the matched value is of type `E1`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ let _d = || { match e1 {
LL + _ => todo!(),
LL ~ } };
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/non-exhaustive-match.rs:39:25 --> $DIR/non-exhaustive-match.rs:39:25
@ -28,8 +40,16 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | let _e = || { match e2 { E2::A => (), E2::B => () } }; LL | let _e = || { match e2 { E2::A => (), E2::B => () } };
| ^^ pattern `_` not covered | ^^ pattern `_` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `E2` defined here
--> $DIR/auxiliary/match_non_exhaustive_lib.rs:5:1
|
LL | pub enum E2 { A, B }
| ^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `E2`, which is marked as non-exhaustive = note: the matched value is of type `E2`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL | let _e = || { match e2 { E2::A => (), E2::B => (), _ => todo!() } };
| ++++++++++++++
error[E0505]: cannot move out of `e3` because it is borrowed error[E0505]: cannot move out of `e3` because it is borrowed
--> $DIR/non-exhaustive-match.rs:46:22 --> $DIR/non-exhaustive-match.rs:46:22

View File

@ -4,8 +4,13 @@ error[E0004]: non-exhaustive patterns: type `u8` is non-empty
LL | let c1 = || match x { }; LL | let c1 = || match x { };
| ^ | ^
| |
= 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` = note: the matched value is of type `u8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ let c1 = || match x {
LL + _ => todo!(),
LL ~ };
|
error[E0381]: use of possibly-uninitialized variable: `x` error[E0381]: use of possibly-uninitialized variable: `x`
--> $DIR/pattern-matching-should-fail.rs:8:23 --> $DIR/pattern-matching-should-fail.rs:8:23

View File

@ -1,19 +1,18 @@
error[E0005]: refutable pattern in local binding: `T(_, _)` not covered error[E0005]: refutable pattern in local binding: `T(_, _)` not covered
--> $DIR/empty-never-array.rs:10:9 --> $DIR/empty-never-array.rs:10:9
| |
LL | / enum Helper<T, U> { LL | let Helper::U(u) = Helper::T(t, []);
LL | | T(T, [!; 0]), | ^^^^^^^^^^^^ pattern `T(_, _)` not covered
| | - not covered
LL | | #[allow(dead_code)]
LL | | U(U),
LL | | }
| |_- `Helper<T, U>` defined here
...
LL | let Helper::U(u) = Helper::T(t, []);
| ^^^^^^^^^^^^ pattern `T(_, _)` not covered
| |
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Helper<T, U>` defined here
--> $DIR/empty-never-array.rs:4:5
|
LL | enum Helper<T, U> {
| ------
LL | T(T, [!; 0]),
| ^ not covered
= note: the matched value is of type `Helper<T, U>` = note: the matched value is of type `Helper<T, U>`
help: you might want to use `if let` to ignore the variant that isn't matched help: you might want to use `if let` to ignore the variant that isn't matched
| |

View File

@ -4,16 +4,27 @@ error[E0004]: non-exhaustive patterns: `None` and `Some(_)` not covered
LL | match x { } LL | match x { }
| ^ patterns `None` and `Some(_)` not covered | ^ patterns `None` and `Some(_)` not covered
| |
::: $SRC_DIR/core/src/option.rs:LL:COL note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
| |
LL | None, LL | / pub enum Option<T> {
| ---- not covered LL | | /// No value.
... LL | | #[lang = "None"]
LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), LL | | #[stable(feature = "rust1", since = "1.0.0")]
| ---- not covered LL | | None,
| | | ^^^^ not covered
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms ... |
LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
| | ^^^^ not covered
LL | | }
| |_-
= note: the matched value is of type `Option<i32>` = note: the matched value is of type `Option<i32>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ match x {
LL + None | Some(_) => todo!(),
LL ~ }
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,18 +1,22 @@
error[E0004]: non-exhaustive patterns: `HastaLaVistaBaby` not covered error[E0004]: non-exhaustive patterns: `HastaLaVistaBaby` not covered
--> $DIR/E0004.rs:9:11 --> $DIR/E0004.rs:9:11
| |
LL | / enum Terminator { LL | match x {
LL | | HastaLaVistaBaby, | ^ pattern `HastaLaVistaBaby` not covered
| | ---------------- not covered
LL | | TalkToMyHand,
LL | | }
| |_- `Terminator` defined here
...
LL | match x {
| ^ pattern `HastaLaVistaBaby` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Terminator` defined here
--> $DIR/E0004.rs:2:5
|
LL | enum Terminator {
| ----------
LL | HastaLaVistaBaby,
| ^^^^^^^^^^^^^^^^ not covered
= note: the matched value is of type `Terminator` = note: the matched value is of type `Terminator`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ Terminator::TalkToMyHand => {}
LL + HastaLaVistaBaby => todo!()
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,13 +4,21 @@ error[E0005]: refutable pattern in local binding: `None` not covered
LL | let Some(y) = x; LL | let Some(y) = x;
| ^^^^^^^ pattern `None` not covered | ^^^^^^^ pattern `None` not covered
| |
::: $SRC_DIR/core/src/option.rs:LL:COL
|
LL | None,
| ---- not covered
|
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
LL | / pub enum Option<T> {
LL | | /// No value.
LL | | #[lang = "None"]
LL | | #[stable(feature = "rust1", since = "1.0.0")]
LL | | None,
| | ^^^^ not covered
... |
LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
LL | | }
| |_-
= note: the matched value is of type `Option<i32>` = note: the matched value is of type `Option<i32>`
help: you might want to use `if let` to ignore the variant that isn't matched help: you might want to use `if let` to ignore the variant that isn't matched
| |

View File

@ -4,11 +4,19 @@ error[E0005]: refutable pattern in `for` loop binding: `None` not covered
LL | for Some(x) in xs {} LL | for Some(x) in xs {}
| ^^^^^^^ pattern `None` not covered | ^^^^^^^ pattern `None` not covered
| |
::: $SRC_DIR/core/src/option.rs:LL:COL note: `Option<i32>` defined here
| --> $SRC_DIR/core/src/option.rs:LL:COL
LL | None,
| ---- not covered
| |
LL | / pub enum Option<T> {
LL | | /// No value.
LL | | #[lang = "None"]
LL | | #[stable(feature = "rust1", since = "1.0.0")]
LL | | None,
| | ^^^^ not covered
... |
LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
LL | | }
| |_-
= note: the matched value is of type `Option<i32>` = note: the matched value is of type `Option<i32>`
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,13 +4,20 @@ error[E0005]: refutable pattern in local binding: `Err(_)` not covered
LL | let Ok(_x) = foo(); LL | let Ok(_x) = foo();
| ^^^^^^ pattern `Err(_)` not covered | ^^^^^^ pattern `Err(_)` not covered
| |
::: $SRC_DIR/core/src/result.rs:LL:COL
|
LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
| --- not covered
|
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Result<u32, !>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
|
LL | / pub enum Result<T, E> {
LL | | /// Contains the success value
LL | | #[lang = "Ok"]
LL | | #[stable(feature = "rust1", since = "1.0.0")]
... |
LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
| | ^^^ not covered
LL | | }
| |_-
= note: the matched value is of type `Result<u32, !>` = note: the matched value is of type `Result<u32, !>`
help: you might want to use `if let` to ignore the variant that isn't matched help: you might want to use `if let` to ignore the variant that isn't matched
| |

View File

@ -4,10 +4,14 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match 0usize { LL | match 0usize {
| ^^^^^^ pattern `_` not covered | ^^^^^^ pattern `_` 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 `usize` = note: the matched value is of type `usize`
= note: `usize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively = note: `usize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ 0..=usize::MAX => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/feature-gate-precise_pointer_size_matching.rs:10:11 --> $DIR/feature-gate-precise_pointer_size_matching.rs:10:11
@ -15,10 +19,14 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match 0isize { LL | match 0isize {
| ^^^^^^ pattern `_` not covered | ^^^^^^ pattern `_` 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 `isize` = note: the matched value is of type `isize`
= note: `isize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively = note: `isize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ isize::MIN..=isize::MAX => {}
LL + _ => todo!()
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | m!(0f32, f32::NEG_INFINITY..); LL | m!(0f32, f32::NEG_INFINITY..);
| ^^^^ pattern `_` not covered | ^^^^ pattern `_` 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 `f32` = note: the matched value is of type `f32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ _ => todo!() }
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:17:8 --> $DIR/half-open-range-pats-exhaustive-fail.rs:17:8
@ -13,8 +17,12 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | m!(0f32, ..f32::INFINITY); LL | m!(0f32, ..f32::INFINITY);
| ^^^^ pattern `_` not covered | ^^^^ pattern `_` 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 `f32` = note: the matched value is of type `f32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ _ => todo!() }
|
error[E0004]: non-exhaustive patterns: `'\u{10ffff}'` not covered error[E0004]: non-exhaustive patterns: `'\u{10ffff}'` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:26:8 --> $DIR/half-open-range-pats-exhaustive-fail.rs:26:8
@ -22,8 +30,12 @@ error[E0004]: non-exhaustive patterns: `'\u{10ffff}'` not covered
LL | m!('a', ..core::char::MAX); LL | m!('a', ..core::char::MAX);
| ^^^ pattern `'\u{10ffff}'` not covered | ^^^ pattern `'\u{10ffff}'` 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 `char` = note: the matched value is of type `char`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ '\u{10ffff}' => todo!() }
|
error[E0004]: non-exhaustive patterns: `'\u{10fffe}'..='\u{10ffff}'` not covered error[E0004]: non-exhaustive patterns: `'\u{10fffe}'..='\u{10ffff}'` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:27:8 --> $DIR/half-open-range-pats-exhaustive-fail.rs:27:8
@ -31,8 +43,12 @@ error[E0004]: non-exhaustive patterns: `'\u{10fffe}'..='\u{10ffff}'` not covered
LL | m!('a', ..ALMOST_MAX); LL | m!('a', ..ALMOST_MAX);
| ^^^ pattern `'\u{10fffe}'..='\u{10ffff}'` not covered | ^^^ pattern `'\u{10fffe}'..='\u{10ffff}'` 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 `char` = note: the matched value is of type `char`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ '\u{10fffe}'..='\u{10ffff}' => todo!() }
|
error[E0004]: non-exhaustive patterns: `'\u{0}'` not covered error[E0004]: non-exhaustive patterns: `'\u{0}'` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:28:8 --> $DIR/half-open-range-pats-exhaustive-fail.rs:28:8
@ -40,8 +56,12 @@ error[E0004]: non-exhaustive patterns: `'\u{0}'` not covered
LL | m!('a', ALMOST_MIN..); LL | m!('a', ALMOST_MIN..);
| ^^^ pattern `'\u{0}'` not covered | ^^^ pattern `'\u{0}'` 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 `char` = note: the matched value is of type `char`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ '\u{0}' => todo!() }
|
error[E0004]: non-exhaustive patterns: `'\u{10ffff}'` not covered error[E0004]: non-exhaustive patterns: `'\u{10ffff}'` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:29:8 --> $DIR/half-open-range-pats-exhaustive-fail.rs:29:8
@ -49,8 +69,12 @@ error[E0004]: non-exhaustive patterns: `'\u{10ffff}'` not covered
LL | m!('a', ..=ALMOST_MAX); LL | m!('a', ..=ALMOST_MAX);
| ^^^ pattern `'\u{10ffff}'` not covered | ^^^ pattern `'\u{10ffff}'` 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 `char` = note: the matched value is of type `char`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ '\u{10ffff}' => todo!() }
|
error[E0004]: non-exhaustive patterns: `'b'` not covered error[E0004]: non-exhaustive patterns: `'b'` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:30:8 --> $DIR/half-open-range-pats-exhaustive-fail.rs:30:8
@ -58,8 +82,12 @@ error[E0004]: non-exhaustive patterns: `'b'` not covered
LL | m!('a', ..=VAL | VAL_2..); LL | m!('a', ..=VAL | VAL_2..);
| ^^^ pattern `'b'` not covered | ^^^ pattern `'b'` 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 `char` = note: the matched value is of type `char`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 'b' => todo!() }
|
error[E0004]: non-exhaustive patterns: `'b'` not covered error[E0004]: non-exhaustive patterns: `'b'` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:31:8 --> $DIR/half-open-range-pats-exhaustive-fail.rs:31:8
@ -67,8 +95,12 @@ error[E0004]: non-exhaustive patterns: `'b'` not covered
LL | m!('a', ..VAL_1 | VAL_2..); LL | m!('a', ..VAL_1 | VAL_2..);
| ^^^ pattern `'b'` not covered | ^^^ pattern `'b'` 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 `char` = note: the matched value is of type `char`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 'b' => todo!() }
|
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:41:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:41:12
@ -76,8 +108,12 @@ error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
LL | m!(0, ..u8::MAX); LL | m!(0, ..u8::MAX);
| ^ pattern `u8::MAX` not covered | ^ pattern `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` = note: the matched value is of type `u8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ u8::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `254_u8..=u8::MAX` not covered error[E0004]: non-exhaustive patterns: `254_u8..=u8::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:42:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:42:12
@ -85,8 +121,12 @@ error[E0004]: non-exhaustive patterns: `254_u8..=u8::MAX` not covered
LL | m!(0, ..ALMOST_MAX); LL | m!(0, ..ALMOST_MAX);
| ^ pattern `254_u8..=u8::MAX` not covered | ^ pattern `254_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` = note: the matched value is of type `u8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 254_u8..=u8::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `0_u8` not covered error[E0004]: non-exhaustive patterns: `0_u8` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:43:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:43:12
@ -94,8 +134,12 @@ error[E0004]: non-exhaustive patterns: `0_u8` not covered
LL | m!(0, ALMOST_MIN..); LL | m!(0, ALMOST_MIN..);
| ^ pattern `0_u8` not covered | ^ pattern `0_u8` 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` = note: the matched value is of type `u8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 0_u8 => todo!() }
|
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:44:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:44:12
@ -103,8 +147,12 @@ error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
LL | m!(0, ..=ALMOST_MAX); LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `u8::MAX` not covered | ^ pattern `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` = note: the matched value is of type `u8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ u8::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_u8` not covered error[E0004]: non-exhaustive patterns: `43_u8` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:45:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:45:12
@ -112,8 +160,12 @@ error[E0004]: non-exhaustive patterns: `43_u8` not covered
LL | m!(0, ..=VAL | VAL_2..); LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_u8` not covered | ^ pattern `43_u8` 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` = note: the matched value is of type `u8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_u8 => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_u8` not covered error[E0004]: non-exhaustive patterns: `43_u8` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:46:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:46:12
@ -121,8 +173,12 @@ error[E0004]: non-exhaustive patterns: `43_u8` not covered
LL | m!(0, ..VAL_1 | VAL_2..); LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_u8` not covered | ^ pattern `43_u8` 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` = note: the matched value is of type `u8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_u8 => todo!() }
|
error[E0004]: non-exhaustive patterns: `u16::MAX` not covered error[E0004]: non-exhaustive patterns: `u16::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:54:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:54:12
@ -130,8 +186,12 @@ error[E0004]: non-exhaustive patterns: `u16::MAX` not covered
LL | m!(0, ..u16::MAX); LL | m!(0, ..u16::MAX);
| ^ pattern `u16::MAX` not covered | ^ pattern `u16::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 `u16` = note: the matched value is of type `u16`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ u16::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `65534_u16..=u16::MAX` not covered error[E0004]: non-exhaustive patterns: `65534_u16..=u16::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:55:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:55:12
@ -139,8 +199,12 @@ error[E0004]: non-exhaustive patterns: `65534_u16..=u16::MAX` not covered
LL | m!(0, ..ALMOST_MAX); LL | m!(0, ..ALMOST_MAX);
| ^ pattern `65534_u16..=u16::MAX` not covered | ^ pattern `65534_u16..=u16::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 `u16` = note: the matched value is of type `u16`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 65534_u16..=u16::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `0_u16` not covered error[E0004]: non-exhaustive patterns: `0_u16` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:56:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:56:12
@ -148,8 +212,12 @@ error[E0004]: non-exhaustive patterns: `0_u16` not covered
LL | m!(0, ALMOST_MIN..); LL | m!(0, ALMOST_MIN..);
| ^ pattern `0_u16` not covered | ^ pattern `0_u16` 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 `u16` = note: the matched value is of type `u16`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 0_u16 => todo!() }
|
error[E0004]: non-exhaustive patterns: `u16::MAX` not covered error[E0004]: non-exhaustive patterns: `u16::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:57:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:57:12
@ -157,8 +225,12 @@ error[E0004]: non-exhaustive patterns: `u16::MAX` not covered
LL | m!(0, ..=ALMOST_MAX); LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `u16::MAX` not covered | ^ pattern `u16::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 `u16` = note: the matched value is of type `u16`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ u16::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_u16` not covered error[E0004]: non-exhaustive patterns: `43_u16` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:58:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:58:12
@ -166,8 +238,12 @@ error[E0004]: non-exhaustive patterns: `43_u16` not covered
LL | m!(0, ..=VAL | VAL_2..); LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_u16` not covered | ^ pattern `43_u16` 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 `u16` = note: the matched value is of type `u16`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_u16 => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_u16` not covered error[E0004]: non-exhaustive patterns: `43_u16` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:59:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:59:12
@ -175,8 +251,12 @@ error[E0004]: non-exhaustive patterns: `43_u16` not covered
LL | m!(0, ..VAL_1 | VAL_2..); LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_u16` not covered | ^ pattern `43_u16` 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 `u16` = note: the matched value is of type `u16`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_u16 => todo!() }
|
error[E0004]: non-exhaustive patterns: `u32::MAX` not covered error[E0004]: non-exhaustive patterns: `u32::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:67:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:67:12
@ -184,8 +264,12 @@ error[E0004]: non-exhaustive patterns: `u32::MAX` not covered
LL | m!(0, ..u32::MAX); LL | m!(0, ..u32::MAX);
| ^ pattern `u32::MAX` not covered | ^ pattern `u32::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 `u32` = note: the matched value is of type `u32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ u32::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `4294967294_u32..=u32::MAX` not covered error[E0004]: non-exhaustive patterns: `4294967294_u32..=u32::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:68:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:68:12
@ -193,8 +277,12 @@ error[E0004]: non-exhaustive patterns: `4294967294_u32..=u32::MAX` not covered
LL | m!(0, ..ALMOST_MAX); LL | m!(0, ..ALMOST_MAX);
| ^ pattern `4294967294_u32..=u32::MAX` not covered | ^ pattern `4294967294_u32..=u32::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 `u32` = note: the matched value is of type `u32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 4294967294_u32..=u32::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `0_u32` not covered error[E0004]: non-exhaustive patterns: `0_u32` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:69:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:69:12
@ -202,8 +290,12 @@ error[E0004]: non-exhaustive patterns: `0_u32` not covered
LL | m!(0, ALMOST_MIN..); LL | m!(0, ALMOST_MIN..);
| ^ pattern `0_u32` not covered | ^ pattern `0_u32` 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 `u32` = note: the matched value is of type `u32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 0_u32 => todo!() }
|
error[E0004]: non-exhaustive patterns: `u32::MAX` not covered error[E0004]: non-exhaustive patterns: `u32::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:70:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:70:12
@ -211,8 +303,12 @@ error[E0004]: non-exhaustive patterns: `u32::MAX` not covered
LL | m!(0, ..=ALMOST_MAX); LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `u32::MAX` not covered | ^ pattern `u32::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 `u32` = note: the matched value is of type `u32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ u32::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_u32` not covered error[E0004]: non-exhaustive patterns: `43_u32` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:71:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:71:12
@ -220,8 +316,12 @@ error[E0004]: non-exhaustive patterns: `43_u32` not covered
LL | m!(0, ..=VAL | VAL_2..); LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_u32` not covered | ^ pattern `43_u32` 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 `u32` = note: the matched value is of type `u32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_u32 => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_u32` not covered error[E0004]: non-exhaustive patterns: `43_u32` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:72:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:72:12
@ -229,8 +329,12 @@ error[E0004]: non-exhaustive patterns: `43_u32` not covered
LL | m!(0, ..VAL_1 | VAL_2..); LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_u32` not covered | ^ pattern `43_u32` 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 `u32` = note: the matched value is of type `u32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_u32 => todo!() }
|
error[E0004]: non-exhaustive patterns: `u64::MAX` not covered error[E0004]: non-exhaustive patterns: `u64::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:80:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:80:12
@ -238,8 +342,12 @@ error[E0004]: non-exhaustive patterns: `u64::MAX` not covered
LL | m!(0, ..u64::MAX); LL | m!(0, ..u64::MAX);
| ^ pattern `u64::MAX` not covered | ^ pattern `u64::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 `u64` = note: the matched value is of type `u64`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ u64::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `18446744073709551614_u64..=u64::MAX` not covered error[E0004]: non-exhaustive patterns: `18446744073709551614_u64..=u64::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:81:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:81:12
@ -247,8 +355,12 @@ error[E0004]: non-exhaustive patterns: `18446744073709551614_u64..=u64::MAX` not
LL | m!(0, ..ALMOST_MAX); LL | m!(0, ..ALMOST_MAX);
| ^ pattern `18446744073709551614_u64..=u64::MAX` not covered | ^ pattern `18446744073709551614_u64..=u64::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 `u64` = note: the matched value is of type `u64`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 18446744073709551614_u64..=u64::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `0_u64` not covered error[E0004]: non-exhaustive patterns: `0_u64` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:82:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:82:12
@ -256,8 +368,12 @@ error[E0004]: non-exhaustive patterns: `0_u64` not covered
LL | m!(0, ALMOST_MIN..); LL | m!(0, ALMOST_MIN..);
| ^ pattern `0_u64` not covered | ^ pattern `0_u64` 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 `u64` = note: the matched value is of type `u64`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 0_u64 => todo!() }
|
error[E0004]: non-exhaustive patterns: `u64::MAX` not covered error[E0004]: non-exhaustive patterns: `u64::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:83:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:83:12
@ -265,8 +381,12 @@ error[E0004]: non-exhaustive patterns: `u64::MAX` not covered
LL | m!(0, ..=ALMOST_MAX); LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `u64::MAX` not covered | ^ pattern `u64::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 `u64` = note: the matched value is of type `u64`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ u64::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_u64` not covered error[E0004]: non-exhaustive patterns: `43_u64` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:84:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:84:12
@ -274,8 +394,12 @@ error[E0004]: non-exhaustive patterns: `43_u64` not covered
LL | m!(0, ..=VAL | VAL_2..); LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_u64` not covered | ^ pattern `43_u64` 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 `u64` = note: the matched value is of type `u64`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_u64 => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_u64` not covered error[E0004]: non-exhaustive patterns: `43_u64` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:85:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:85:12
@ -283,8 +407,12 @@ error[E0004]: non-exhaustive patterns: `43_u64` not covered
LL | m!(0, ..VAL_1 | VAL_2..); LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_u64` not covered | ^ pattern `43_u64` 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 `u64` = note: the matched value is of type `u64`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_u64 => todo!() }
|
error[E0004]: non-exhaustive patterns: `u128::MAX` not covered error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:93:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:93:12
@ -292,8 +420,12 @@ error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
LL | m!(0, ..u128::MAX); LL | m!(0, ..u128::MAX);
| ^ pattern `u128::MAX` not covered | ^ pattern `u128::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 `u128` = note: the matched value is of type `u128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ u128::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `340282366920938463463374607431768211454_u128..=u128::MAX` not covered error[E0004]: non-exhaustive patterns: `340282366920938463463374607431768211454_u128..=u128::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:94:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:94:12
@ -301,8 +433,12 @@ error[E0004]: non-exhaustive patterns: `340282366920938463463374607431768211454_
LL | m!(0, ..ALMOST_MAX); LL | m!(0, ..ALMOST_MAX);
| ^ pattern `340282366920938463463374607431768211454_u128..=u128::MAX` not covered | ^ pattern `340282366920938463463374607431768211454_u128..=u128::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 `u128` = note: the matched value is of type `u128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 340282366920938463463374607431768211454_u128..=u128::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `0_u128` not covered error[E0004]: non-exhaustive patterns: `0_u128` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:95:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:95:12
@ -310,8 +446,12 @@ error[E0004]: non-exhaustive patterns: `0_u128` not covered
LL | m!(0, ALMOST_MIN..); LL | m!(0, ALMOST_MIN..);
| ^ pattern `0_u128` not covered | ^ pattern `0_u128` 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 `u128` = note: the matched value is of type `u128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 0_u128 => todo!() }
|
error[E0004]: non-exhaustive patterns: `u128::MAX` not covered error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:96:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:96:12
@ -319,8 +459,12 @@ error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
LL | m!(0, ..=ALMOST_MAX); LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `u128::MAX` not covered | ^ pattern `u128::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 `u128` = note: the matched value is of type `u128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ u128::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_u128` not covered error[E0004]: non-exhaustive patterns: `43_u128` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:97:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:97:12
@ -328,8 +472,12 @@ error[E0004]: non-exhaustive patterns: `43_u128` not covered
LL | m!(0, ..=VAL | VAL_2..); LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_u128` not covered | ^ pattern `43_u128` 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 `u128` = note: the matched value is of type `u128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_u128 => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_u128` not covered error[E0004]: non-exhaustive patterns: `43_u128` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:98:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:98:12
@ -337,8 +485,12 @@ error[E0004]: non-exhaustive patterns: `43_u128` not covered
LL | m!(0, ..VAL_1 | VAL_2..); LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_u128` not covered | ^ pattern `43_u128` 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 `u128` = note: the matched value is of type `u128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_u128 => todo!() }
|
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:109:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:109:12
@ -346,8 +498,12 @@ error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
LL | m!(0, ..i8::MAX); LL | m!(0, ..i8::MAX);
| ^ pattern `i8::MAX` not covered | ^ pattern `i8::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 `i8` = note: the matched value is of type `i8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i8::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `126_i8..=i8::MAX` not covered error[E0004]: non-exhaustive patterns: `126_i8..=i8::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:110:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:110:12
@ -355,8 +511,12 @@ error[E0004]: non-exhaustive patterns: `126_i8..=i8::MAX` not covered
LL | m!(0, ..ALMOST_MAX); LL | m!(0, ..ALMOST_MAX);
| ^ pattern `126_i8..=i8::MAX` not covered | ^ pattern `126_i8..=i8::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 `i8` = note: the matched value is of type `i8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 126_i8..=i8::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `i8::MIN` not covered error[E0004]: non-exhaustive patterns: `i8::MIN` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:111:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:111:12
@ -364,8 +524,12 @@ error[E0004]: non-exhaustive patterns: `i8::MIN` not covered
LL | m!(0, ALMOST_MIN..); LL | m!(0, ALMOST_MIN..);
| ^ pattern `i8::MIN` not covered | ^ pattern `i8::MIN` 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 `i8` = note: the matched value is of type `i8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i8::MIN => todo!() }
|
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:112:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:112:12
@ -373,8 +537,12 @@ error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
LL | m!(0, ..=ALMOST_MAX); LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `i8::MAX` not covered | ^ pattern `i8::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 `i8` = note: the matched value is of type `i8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i8::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_i8` not covered error[E0004]: non-exhaustive patterns: `43_i8` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:113:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:113:12
@ -382,8 +550,12 @@ error[E0004]: non-exhaustive patterns: `43_i8` not covered
LL | m!(0, ..=VAL | VAL_2..); LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_i8` not covered | ^ pattern `43_i8` 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 `i8` = note: the matched value is of type `i8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_i8 => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_i8` not covered error[E0004]: non-exhaustive patterns: `43_i8` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:114:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:114:12
@ -391,8 +563,12 @@ error[E0004]: non-exhaustive patterns: `43_i8` not covered
LL | m!(0, ..VAL_1 | VAL_2..); LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_i8` not covered | ^ pattern `43_i8` 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 `i8` = note: the matched value is of type `i8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_i8 => todo!() }
|
error[E0004]: non-exhaustive patterns: `i16::MAX` not covered error[E0004]: non-exhaustive patterns: `i16::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:122:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:122:12
@ -400,8 +576,12 @@ error[E0004]: non-exhaustive patterns: `i16::MAX` not covered
LL | m!(0, ..i16::MAX); LL | m!(0, ..i16::MAX);
| ^ pattern `i16::MAX` not covered | ^ pattern `i16::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 `i16` = note: the matched value is of type `i16`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i16::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `32766_i16..=i16::MAX` not covered error[E0004]: non-exhaustive patterns: `32766_i16..=i16::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:123:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:123:12
@ -409,8 +589,12 @@ error[E0004]: non-exhaustive patterns: `32766_i16..=i16::MAX` not covered
LL | m!(0, ..ALMOST_MAX); LL | m!(0, ..ALMOST_MAX);
| ^ pattern `32766_i16..=i16::MAX` not covered | ^ pattern `32766_i16..=i16::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 `i16` = note: the matched value is of type `i16`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 32766_i16..=i16::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `i16::MIN` not covered error[E0004]: non-exhaustive patterns: `i16::MIN` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:124:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:124:12
@ -418,8 +602,12 @@ error[E0004]: non-exhaustive patterns: `i16::MIN` not covered
LL | m!(0, ALMOST_MIN..); LL | m!(0, ALMOST_MIN..);
| ^ pattern `i16::MIN` not covered | ^ pattern `i16::MIN` 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 `i16` = note: the matched value is of type `i16`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i16::MIN => todo!() }
|
error[E0004]: non-exhaustive patterns: `i16::MAX` not covered error[E0004]: non-exhaustive patterns: `i16::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:125:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:125:12
@ -427,8 +615,12 @@ error[E0004]: non-exhaustive patterns: `i16::MAX` not covered
LL | m!(0, ..=ALMOST_MAX); LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `i16::MAX` not covered | ^ pattern `i16::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 `i16` = note: the matched value is of type `i16`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i16::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_i16` not covered error[E0004]: non-exhaustive patterns: `43_i16` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:126:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:126:12
@ -436,8 +628,12 @@ error[E0004]: non-exhaustive patterns: `43_i16` not covered
LL | m!(0, ..=VAL | VAL_2..); LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_i16` not covered | ^ pattern `43_i16` 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 `i16` = note: the matched value is of type `i16`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_i16 => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_i16` not covered error[E0004]: non-exhaustive patterns: `43_i16` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:127:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:127:12
@ -445,8 +641,12 @@ error[E0004]: non-exhaustive patterns: `43_i16` not covered
LL | m!(0, ..VAL_1 | VAL_2..); LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_i16` not covered | ^ pattern `43_i16` 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 `i16` = note: the matched value is of type `i16`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_i16 => todo!() }
|
error[E0004]: non-exhaustive patterns: `i32::MAX` not covered error[E0004]: non-exhaustive patterns: `i32::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:135:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:135:12
@ -454,8 +654,12 @@ error[E0004]: non-exhaustive patterns: `i32::MAX` not covered
LL | m!(0, ..i32::MAX); LL | m!(0, ..i32::MAX);
| ^ pattern `i32::MAX` not covered | ^ pattern `i32::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 `i32` = note: the matched value is of type `i32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i32::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `2147483646_i32..=i32::MAX` not covered error[E0004]: non-exhaustive patterns: `2147483646_i32..=i32::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:136:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:136:12
@ -463,8 +667,12 @@ error[E0004]: non-exhaustive patterns: `2147483646_i32..=i32::MAX` not covered
LL | m!(0, ..ALMOST_MAX); LL | m!(0, ..ALMOST_MAX);
| ^ pattern `2147483646_i32..=i32::MAX` not covered | ^ pattern `2147483646_i32..=i32::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 `i32` = note: the matched value is of type `i32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 2147483646_i32..=i32::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `i32::MIN` not covered error[E0004]: non-exhaustive patterns: `i32::MIN` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:137:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:137:12
@ -472,8 +680,12 @@ error[E0004]: non-exhaustive patterns: `i32::MIN` not covered
LL | m!(0, ALMOST_MIN..); LL | m!(0, ALMOST_MIN..);
| ^ pattern `i32::MIN` not covered | ^ pattern `i32::MIN` 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 `i32` = note: the matched value is of type `i32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i32::MIN => todo!() }
|
error[E0004]: non-exhaustive patterns: `i32::MAX` not covered error[E0004]: non-exhaustive patterns: `i32::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:138:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:138:12
@ -481,8 +693,12 @@ error[E0004]: non-exhaustive patterns: `i32::MAX` not covered
LL | m!(0, ..=ALMOST_MAX); LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `i32::MAX` not covered | ^ pattern `i32::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 `i32` = note: the matched value is of type `i32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i32::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_i32` not covered error[E0004]: non-exhaustive patterns: `43_i32` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:139:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:139:12
@ -490,8 +706,12 @@ error[E0004]: non-exhaustive patterns: `43_i32` not covered
LL | m!(0, ..=VAL | VAL_2..); LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_i32` not covered | ^ pattern `43_i32` 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 `i32` = note: the matched value is of type `i32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_i32 => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_i32` not covered error[E0004]: non-exhaustive patterns: `43_i32` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:140:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:140:12
@ -499,8 +719,12 @@ error[E0004]: non-exhaustive patterns: `43_i32` not covered
LL | m!(0, ..VAL_1 | VAL_2..); LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_i32` not covered | ^ pattern `43_i32` 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 `i32` = note: the matched value is of type `i32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_i32 => todo!() }
|
error[E0004]: non-exhaustive patterns: `i64::MAX` not covered error[E0004]: non-exhaustive patterns: `i64::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:148:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:148:12
@ -508,8 +732,12 @@ error[E0004]: non-exhaustive patterns: `i64::MAX` not covered
LL | m!(0, ..i64::MAX); LL | m!(0, ..i64::MAX);
| ^ pattern `i64::MAX` not covered | ^ pattern `i64::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 `i64` = note: the matched value is of type `i64`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i64::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `9223372036854775806_i64..=i64::MAX` not covered error[E0004]: non-exhaustive patterns: `9223372036854775806_i64..=i64::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:149:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:149:12
@ -517,8 +745,12 @@ error[E0004]: non-exhaustive patterns: `9223372036854775806_i64..=i64::MAX` not
LL | m!(0, ..ALMOST_MAX); LL | m!(0, ..ALMOST_MAX);
| ^ pattern `9223372036854775806_i64..=i64::MAX` not covered | ^ pattern `9223372036854775806_i64..=i64::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 `i64` = note: the matched value is of type `i64`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 9223372036854775806_i64..=i64::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `i64::MIN` not covered error[E0004]: non-exhaustive patterns: `i64::MIN` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:150:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:150:12
@ -526,8 +758,12 @@ error[E0004]: non-exhaustive patterns: `i64::MIN` not covered
LL | m!(0, ALMOST_MIN..); LL | m!(0, ALMOST_MIN..);
| ^ pattern `i64::MIN` not covered | ^ pattern `i64::MIN` 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 `i64` = note: the matched value is of type `i64`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i64::MIN => todo!() }
|
error[E0004]: non-exhaustive patterns: `i64::MAX` not covered error[E0004]: non-exhaustive patterns: `i64::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:151:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:151:12
@ -535,8 +771,12 @@ error[E0004]: non-exhaustive patterns: `i64::MAX` not covered
LL | m!(0, ..=ALMOST_MAX); LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `i64::MAX` not covered | ^ pattern `i64::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 `i64` = note: the matched value is of type `i64`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i64::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_i64` not covered error[E0004]: non-exhaustive patterns: `43_i64` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:152:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:152:12
@ -544,8 +784,12 @@ error[E0004]: non-exhaustive patterns: `43_i64` not covered
LL | m!(0, ..=VAL | VAL_2..); LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_i64` not covered | ^ pattern `43_i64` 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 `i64` = note: the matched value is of type `i64`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_i64 => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_i64` not covered error[E0004]: non-exhaustive patterns: `43_i64` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:153:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:153:12
@ -553,8 +797,12 @@ error[E0004]: non-exhaustive patterns: `43_i64` not covered
LL | m!(0, ..VAL_1 | VAL_2..); LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_i64` not covered | ^ pattern `43_i64` 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 `i64` = note: the matched value is of type `i64`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_i64 => todo!() }
|
error[E0004]: non-exhaustive patterns: `i128::MAX` not covered error[E0004]: non-exhaustive patterns: `i128::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:161:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:161:12
@ -562,8 +810,12 @@ error[E0004]: non-exhaustive patterns: `i128::MAX` not covered
LL | m!(0, ..i128::MAX); LL | m!(0, ..i128::MAX);
| ^ pattern `i128::MAX` not covered | ^ pattern `i128::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 `i128` = note: the matched value is of type `i128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i128::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `170141183460469231731687303715884105726_i128..=i128::MAX` not covered error[E0004]: non-exhaustive patterns: `170141183460469231731687303715884105726_i128..=i128::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:162:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:162:12
@ -571,8 +823,12 @@ error[E0004]: non-exhaustive patterns: `170141183460469231731687303715884105726_
LL | m!(0, ..ALMOST_MAX); LL | m!(0, ..ALMOST_MAX);
| ^ pattern `170141183460469231731687303715884105726_i128..=i128::MAX` not covered | ^ pattern `170141183460469231731687303715884105726_i128..=i128::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 `i128` = note: the matched value is of type `i128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 170141183460469231731687303715884105726_i128..=i128::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `i128::MIN` not covered error[E0004]: non-exhaustive patterns: `i128::MIN` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:163:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:163:12
@ -580,8 +836,12 @@ error[E0004]: non-exhaustive patterns: `i128::MIN` not covered
LL | m!(0, ALMOST_MIN..); LL | m!(0, ALMOST_MIN..);
| ^ pattern `i128::MIN` not covered | ^ pattern `i128::MIN` 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 `i128` = note: the matched value is of type `i128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i128::MIN => todo!() }
|
error[E0004]: non-exhaustive patterns: `i128::MAX` not covered error[E0004]: non-exhaustive patterns: `i128::MAX` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:164:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:164:12
@ -589,8 +849,12 @@ error[E0004]: non-exhaustive patterns: `i128::MAX` not covered
LL | m!(0, ..=ALMOST_MAX); LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `i128::MAX` not covered | ^ pattern `i128::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 `i128` = note: the matched value is of type `i128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i128::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_i128` not covered error[E0004]: non-exhaustive patterns: `43_i128` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:165:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:165:12
@ -598,8 +862,12 @@ error[E0004]: non-exhaustive patterns: `43_i128` not covered
LL | m!(0, ..=VAL | VAL_2..); LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_i128` not covered | ^ pattern `43_i128` 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 `i128` = note: the matched value is of type `i128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_i128 => todo!() }
|
error[E0004]: non-exhaustive patterns: `43_i128` not covered error[E0004]: non-exhaustive patterns: `43_i128` not covered
--> $DIR/half-open-range-pats-exhaustive-fail.rs:166:12 --> $DIR/half-open-range-pats-exhaustive-fail.rs:166:12
@ -607,8 +875,12 @@ error[E0004]: non-exhaustive patterns: `43_i128` not covered
LL | m!(0, ..VAL_1 | VAL_2..); LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_i128` not covered | ^ pattern `43_i128` 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 `i128` = note: the matched value is of type `i128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 43_i128 => todo!() }
|
error: aborting due to 68 previous errors error: aborting due to 68 previous errors

View File

@ -1,17 +1,19 @@
error[E0004]: non-exhaustive patterns: `B` not covered error[E0004]: non-exhaustive patterns: `B` not covered
--> $DIR/match_non_exhaustive.rs:23:11 --> $DIR/match_non_exhaustive.rs:23:11
| |
LL | enum L { A, B }
| ---------------
| | |
| | not covered
| `L` defined here
...
LL | match l { L::A => () }; LL | match l { L::A => () };
| ^ pattern `B` not covered | ^ pattern `B` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `L` defined here
--> $DIR/match_non_exhaustive.rs:10:13
|
LL | enum L { A, B }
| - ^ not covered
= note: the matched value is of type `L` = note: the matched value is of type `L`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL | match l { L::A => (), B => todo!() };
| ++++++++++++++
error[E0004]: non-exhaustive patterns: type `E1` is non-empty error[E0004]: non-exhaustive patterns: type `E1` is non-empty
--> $DIR/match_non_exhaustive.rs:28:11 --> $DIR/match_non_exhaustive.rs:28:11
@ -19,8 +21,18 @@ error[E0004]: non-exhaustive patterns: type `E1` is non-empty
LL | match e1 {}; LL | match e1 {};
| ^^ | ^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `E1` defined here
--> $DIR/auxiliary/match_non_exhaustive_lib.rs:2:1
|
LL | pub enum E1 {}
| ^^^^^^^^^^^^^^
= note: the matched value is of type `E1`, which is marked as non-exhaustive = note: the matched value is of type `E1`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match e1 {
LL + _ => todo!(),
LL ~ };
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/match_non_exhaustive.rs:30:11 --> $DIR/match_non_exhaustive.rs:30:11
@ -28,8 +40,16 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match e2 { E2::A => (), E2::B => () }; LL | match e2 { E2::A => (), E2::B => () };
| ^^ pattern `_` not covered | ^^ pattern `_` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `E2` defined here
--> $DIR/auxiliary/match_non_exhaustive_lib.rs:5:1
|
LL | pub enum E2 { A, B }
| ^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `E2`, which is marked as non-exhaustive = note: the matched value is of type `E2`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL | match e2 { E2::A => (), E2::B => (), _ => todo!() };
| ++++++++++++++
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `(2_u8..=u8::MAX, _)` not covered
LL | match (0u8, 0u8) { LL | match (0u8, 0u8) {
| ^^^^^^^^^^ pattern `(2_u8..=u8::MAX, _)` not covered | ^^^^^^^^^^ 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)` = note: the matched value is of type `(u8, u8)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ (0 | 1, 2 | 3) => {}
LL + (2_u8..=u8::MAX, _) => todo!()
|
error[E0004]: non-exhaustive patterns: `((4_u8..=u8::MAX))` not covered error[E0004]: non-exhaustive patterns: `((4_u8..=u8::MAX))` not covered
--> $DIR/exhaustiveness-non-exhaustive.rs:9:11 --> $DIR/exhaustiveness-non-exhaustive.rs:9:11
@ -13,8 +17,12 @@ error[E0004]: non-exhaustive patterns: `((4_u8..=u8::MAX))` not covered
LL | match ((0u8,),) { LL | match ((0u8,),) {
| ^^^^^^^^^ pattern `((4_u8..=u8::MAX))` not covered | ^^^^^^^^^ 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,),)` = note: the matched value is of type `((u8,),)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ ((0 | 1,) | (2 | 3,),) => {}
LL + ((4_u8..=u8::MAX)) => todo!()
|
error[E0004]: non-exhaustive patterns: `(Some(2_u8..=u8::MAX))` not covered error[E0004]: non-exhaustive patterns: `(Some(2_u8..=u8::MAX))` not covered
--> $DIR/exhaustiveness-non-exhaustive.rs:13:11 --> $DIR/exhaustiveness-non-exhaustive.rs:13:11
@ -22,8 +30,12 @@ error[E0004]: non-exhaustive patterns: `(Some(2_u8..=u8::MAX))` not covered
LL | match (Some(0u8),) { LL | match (Some(0u8),) {
| ^^^^^^^^^^^^ pattern `(Some(2_u8..=u8::MAX))` not covered | ^^^^^^^^^^^^ 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>,)` = note: the matched value is of type `(Option<u8>,)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ (None | Some(0 | 1),) => {}
LL + (Some(2_u8..=u8::MAX)) => todo!()
|
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -18,8 +18,12 @@ error[E0004]: non-exhaustive patterns: `i32::MIN..=-1_i32` and `3_i32..=i32::MAX
LL | match 0 { LL | match 0 {
| ^ patterns `i32::MIN..=-1_i32` and `3_i32..=i32::MAX` not covered | ^ patterns `i32::MIN..=-1_i32` and `3_i32..=i32::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 `i32` = note: the matched value is of type `i32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ 0 | (1 | 2) => {}
LL + i32::MIN..=-1_i32 | 3_i32..=i32::MAX => todo!()
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -4,23 +4,33 @@ error[E0004]: non-exhaustive patterns: type `&!` is non-empty
LL | match uninhab_ref() { LL | match uninhab_ref() {
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
= note: the matched value is of type `&!` = note: the matched value is of type `&!`
= note: references are always considered inhabited = note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match uninhab_ref() {
LL + _ => todo!(),
LL + }
|
error[E0004]: non-exhaustive patterns: type `Foo` is non-empty error[E0004]: non-exhaustive patterns: type `Foo` is non-empty
--> $DIR/always-inhabited-union-ref.rs:27:11 --> $DIR/always-inhabited-union-ref.rs:27:11
| |
LL | / pub union Foo { LL | match uninhab_union() {
LL | | foo: !, | ^^^^^^^^^^^^^^^
LL | | }
| |_- `Foo` defined here
...
LL | match uninhab_union() {
| ^^^^^^^^^^^^^^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Foo` defined here
--> $DIR/always-inhabited-union-ref.rs:10:11
|
LL | pub union Foo {
| ^^^
= note: the matched value is of type `Foo` = note: the matched value is of type `Foo`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match uninhab_union() {
LL + _ => todo!(),
LL + }
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -4,8 +4,22 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match Foo::A { LL | match Foo::A {
| ^^^^^^ pattern `_` not covered | ^^^^^^ pattern `_` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Foo` defined here
--> $DIR/auxiliary/hidden.rs:1:1
|
LL | / pub enum Foo {
LL | | A,
LL | | B,
LL | | #[doc(hidden)]
LL | | C,
LL | | }
| |_^
= note: the matched value is of type `Foo` = note: the matched value is of type `Foo`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ Foo::B => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `B` not covered error[E0004]: non-exhaustive patterns: `B` not covered
--> $DIR/doc-hidden-non-exhaustive.rs:14:11 --> $DIR/doc-hidden-non-exhaustive.rs:14:11
@ -13,13 +27,23 @@ error[E0004]: non-exhaustive patterns: `B` not covered
LL | match Foo::A { LL | match Foo::A {
| ^^^^^^ pattern `B` not covered | ^^^^^^ pattern `B` not covered
| |
::: $DIR/auxiliary/hidden.rs:3:5 note: `Foo` defined here
--> $DIR/auxiliary/hidden.rs:3:5
| |
LL | B, LL | / pub enum Foo {
| - not covered LL | | A,
| LL | | B,
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms | | ^ not covered
LL | | #[doc(hidden)]
LL | | C,
LL | | }
| |_-
= note: the matched value is of type `Foo` = note: the matched value is of type `Foo`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ Foo::C => {}
LL + B => todo!()
|
error[E0004]: non-exhaustive patterns: `B` and `_` not covered error[E0004]: non-exhaustive patterns: `B` and `_` not covered
--> $DIR/doc-hidden-non-exhaustive.rs:20:11 --> $DIR/doc-hidden-non-exhaustive.rs:20:11
@ -27,13 +51,23 @@ error[E0004]: non-exhaustive patterns: `B` and `_` not covered
LL | match Foo::A { LL | match Foo::A {
| ^^^^^^ patterns `B` and `_` not covered | ^^^^^^ patterns `B` and `_` not covered
| |
::: $DIR/auxiliary/hidden.rs:3:5 note: `Foo` defined here
--> $DIR/auxiliary/hidden.rs:3:5
| |
LL | B, LL | / pub enum Foo {
| - not covered LL | | A,
| LL | | B,
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms | | ^ not covered
LL | | #[doc(hidden)]
LL | | C,
LL | | }
| |_-
= note: the matched value is of type `Foo` = note: the matched value is of type `Foo`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ Foo::A => {}
LL + B | _ => todo!()
|
error[E0004]: non-exhaustive patterns: `Some(B)` and `Some(_)` not covered error[E0004]: non-exhaustive patterns: `Some(B)` and `Some(_)` not covered
--> $DIR/doc-hidden-non-exhaustive.rs:25:11 --> $DIR/doc-hidden-non-exhaustive.rs:25:11
@ -41,13 +75,24 @@ error[E0004]: non-exhaustive patterns: `Some(B)` and `Some(_)` not covered
LL | match None { LL | match None {
| ^^^^ patterns `Some(B)` and `Some(_)` not covered | ^^^^ patterns `Some(B)` and `Some(_)` not covered
| |
::: $SRC_DIR/core/src/option.rs:LL:COL note: `Option<Foo>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
| |
LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), LL | / pub enum Option<T> {
| ---- not covered LL | | /// No value.
| LL | | #[lang = "None"]
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms LL | | #[stable(feature = "rust1", since = "1.0.0")]
... |
LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
| | ^^^^ not covered
LL | | }
| |_-
= note: the matched value is of type `Option<Foo>` = note: the matched value is of type `Option<Foo>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ Some(Foo::A) => {}
LL + Some(B) | Some(_) => todo!()
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View File

@ -46,107 +46,112 @@ error[E0004]: non-exhaustive patterns: type `u8` is non-empty
LL | match_no_arms!(0u8); LL | match_no_arms!(0u8);
| ^^^ | ^^^
| |
= 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` = note: the matched value is of type `u8`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct1` is non-empty error[E0004]: non-exhaustive patterns: type `NonEmptyStruct1` is non-empty
--> $DIR/empty-match.rs:79:20 --> $DIR/empty-match.rs:79:20
| |
LL | struct NonEmptyStruct1;
| ----------------------- `NonEmptyStruct1` defined here
...
LL | match_no_arms!(NonEmptyStruct1); LL | match_no_arms!(NonEmptyStruct1);
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyStruct1` defined here
--> $DIR/empty-match.rs:14:8
|
LL | struct NonEmptyStruct1;
| ^^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyStruct1` = note: the matched value is of type `NonEmptyStruct1`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct2` is non-empty error[E0004]: non-exhaustive patterns: type `NonEmptyStruct2` is non-empty
--> $DIR/empty-match.rs:80:20 --> $DIR/empty-match.rs:80:20
| |
LL | struct NonEmptyStruct2(bool);
| ----------------------------- `NonEmptyStruct2` defined here
...
LL | match_no_arms!(NonEmptyStruct2(true)); LL | match_no_arms!(NonEmptyStruct2(true));
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyStruct2` defined here
--> $DIR/empty-match.rs:15:8
|
LL | struct NonEmptyStruct2(bool);
| ^^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyStruct2` = note: the matched value is of type `NonEmptyStruct2`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
--> $DIR/empty-match.rs:81:20 --> $DIR/empty-match.rs:81:20
| |
LL | / union NonEmptyUnion1 { LL | match_no_arms!((NonEmptyUnion1 { foo: () }));
LL | | foo: (), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | | }
| |_- `NonEmptyUnion1` defined here
...
LL | match_no_arms!((NonEmptyUnion1 { foo: () }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyUnion1` defined here
--> $DIR/empty-match.rs:16:7
|
LL | union NonEmptyUnion1 {
| ^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyUnion1` = note: the matched value is of type `NonEmptyUnion1`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
--> $DIR/empty-match.rs:82:20 --> $DIR/empty-match.rs:82:20
| |
LL | / union NonEmptyUnion2 { LL | match_no_arms!((NonEmptyUnion2 { foo: () }));
LL | | foo: (), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | | bar: (),
LL | | }
| |_- `NonEmptyUnion2` defined here
...
LL | match_no_arms!((NonEmptyUnion2 { foo: () }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyUnion2` defined here
--> $DIR/empty-match.rs:19:7
|
LL | union NonEmptyUnion2 {
| ^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyUnion2` = note: the matched value is of type `NonEmptyUnion2`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
--> $DIR/empty-match.rs:83:20 --> $DIR/empty-match.rs:83:20
| |
LL | / enum NonEmptyEnum1 { LL | match_no_arms!(NonEmptyEnum1::Foo(true));
LL | | Foo(bool), | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo(_)` not covered
| | --- not covered
LL | | }
| |_- `NonEmptyEnum1` defined here
...
LL | match_no_arms!(NonEmptyEnum1::Foo(true));
| ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo(_)` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyEnum1` defined here
--> $DIR/empty-match.rs:24:5
|
LL | enum NonEmptyEnum1 {
| -------------
LL | Foo(bool),
| ^^^ not covered
= note: the matched value is of type `NonEmptyEnum1` = note: the matched value is of type `NonEmptyEnum1`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
--> $DIR/empty-match.rs:84:20 --> $DIR/empty-match.rs:84:20
| |
LL | / enum NonEmptyEnum2 { LL | match_no_arms!(NonEmptyEnum2::Foo(true));
LL | | Foo(bool), | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `Foo(_)` and `Bar` not covered
| | --- not covered
LL | | Bar,
| | --- not covered
LL | | }
| |_- `NonEmptyEnum2` defined here
...
LL | match_no_arms!(NonEmptyEnum2::Foo(true));
| ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `Foo(_)` and `Bar` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyEnum2` defined here
--> $DIR/empty-match.rs:27:5
|
LL | enum NonEmptyEnum2 {
| -------------
LL | Foo(bool),
| ^^^ not covered
LL | Bar,
| ^^^ not covered
= note: the matched value is of type `NonEmptyEnum2` = note: the matched value is of type `NonEmptyEnum2`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
--> $DIR/empty-match.rs:85:20 --> $DIR/empty-match.rs:85:20
| |
LL | / enum NonEmptyEnum5 { LL | match_no_arms!(NonEmptyEnum5::V1);
LL | | V1, V2, V3, V4, V5, | ^^^^^^^^^^^^^^^^^ patterns `V1`, `V2`, `V3` and 2 more not covered
LL | | }
| |_- `NonEmptyEnum5` defined here
...
LL | match_no_arms!(NonEmptyEnum5::V1);
| ^^^^^^^^^^^^^^^^^ patterns `V1`, `V2`, `V3` and 2 more not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyEnum5` defined here
--> $DIR/empty-match.rs:30:6
|
LL | enum NonEmptyEnum5 {
| ^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyEnum5` = note: the matched value is of type `NonEmptyEnum5`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/empty-match.rs:87:24 --> $DIR/empty-match.rs:87:24
@ -154,107 +159,144 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match_guarded_arm!(0u8); LL | match_guarded_arm!(0u8);
| ^^^ pattern `_` not covered | ^^^ pattern `_` 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` = note: the matched value is of type `u8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered
--> $DIR/empty-match.rs:88:24 --> $DIR/empty-match.rs:88:24
| |
LL | struct NonEmptyStruct1;
| ----------------------- `NonEmptyStruct1` defined here
...
LL | match_guarded_arm!(NonEmptyStruct1); LL | match_guarded_arm!(NonEmptyStruct1);
| ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered | ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyStruct1` defined here
--> $DIR/empty-match.rs:14:8
|
LL | struct NonEmptyStruct1;
| ^^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyStruct1` = note: the matched value is of type `NonEmptyStruct1`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {}
LL + NonEmptyStruct1 => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered
--> $DIR/empty-match.rs:89:24 --> $DIR/empty-match.rs:89:24
| |
LL | struct NonEmptyStruct2(bool);
| ----------------------------- `NonEmptyStruct2` defined here
...
LL | match_guarded_arm!(NonEmptyStruct2(true)); LL | match_guarded_arm!(NonEmptyStruct2(true));
| ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered | ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyStruct2` defined here
--> $DIR/empty-match.rs:15:8
|
LL | struct NonEmptyStruct2(bool);
| ^^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyStruct2` = note: the matched value is of type `NonEmptyStruct2`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {}
LL + NonEmptyStruct2(_) => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
--> $DIR/empty-match.rs:90:24 --> $DIR/empty-match.rs:90:24
| |
LL | / union NonEmptyUnion1 { LL | match_guarded_arm!((NonEmptyUnion1 { foo: () }));
LL | | foo: (), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered
LL | | }
| |_- `NonEmptyUnion1` defined here
...
LL | match_guarded_arm!((NonEmptyUnion1 { foo: () }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyUnion1` defined here
--> $DIR/empty-match.rs:16:7
|
LL | union NonEmptyUnion1 {
| ^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyUnion1` = note: the matched value is of type `NonEmptyUnion1`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {}
LL + NonEmptyUnion1 { .. } => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
--> $DIR/empty-match.rs:91:24 --> $DIR/empty-match.rs:91:24
| |
LL | / union NonEmptyUnion2 { LL | match_guarded_arm!((NonEmptyUnion2 { foo: () }));
LL | | foo: (), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered
LL | | bar: (),
LL | | }
| |_- `NonEmptyUnion2` defined here
...
LL | match_guarded_arm!((NonEmptyUnion2 { foo: () }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyUnion2` defined here
--> $DIR/empty-match.rs:19:7
|
LL | union NonEmptyUnion2 {
| ^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyUnion2` = note: the matched value is of type `NonEmptyUnion2`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {}
LL + NonEmptyUnion2 { .. } => todo!()
|
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
--> $DIR/empty-match.rs:92:24 --> $DIR/empty-match.rs:92:24
| |
LL | / enum NonEmptyEnum1 { LL | match_guarded_arm!(NonEmptyEnum1::Foo(true));
LL | | Foo(bool), | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo(_)` not covered
| | --- not covered
LL | | }
| |_- `NonEmptyEnum1` defined here
...
LL | match_guarded_arm!(NonEmptyEnum1::Foo(true));
| ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo(_)` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyEnum1` defined here
--> $DIR/empty-match.rs:24:5
|
LL | enum NonEmptyEnum1 {
| -------------
LL | Foo(bool),
| ^^^ not covered
= note: the matched value is of type `NonEmptyEnum1` = note: the matched value is of type `NonEmptyEnum1`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {}
LL + Foo(_) => todo!()
|
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
--> $DIR/empty-match.rs:93:24 --> $DIR/empty-match.rs:93:24
| |
LL | / enum NonEmptyEnum2 { LL | match_guarded_arm!(NonEmptyEnum2::Foo(true));
LL | | Foo(bool), | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `Foo(_)` and `Bar` not covered
| | --- not covered
LL | | Bar,
| | --- not covered
LL | | }
| |_- `NonEmptyEnum2` defined here
...
LL | match_guarded_arm!(NonEmptyEnum2::Foo(true));
| ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `Foo(_)` and `Bar` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyEnum2` defined here
--> $DIR/empty-match.rs:27:5
|
LL | enum NonEmptyEnum2 {
| -------------
LL | Foo(bool),
| ^^^ not covered
LL | Bar,
| ^^^ not covered
= note: the matched value is of type `NonEmptyEnum2` = note: the matched value is of type `NonEmptyEnum2`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ _ if false => {}
LL + Foo(_) | Bar => todo!()
|
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
--> $DIR/empty-match.rs:94:24 --> $DIR/empty-match.rs:94:24
| |
LL | / enum NonEmptyEnum5 { LL | match_guarded_arm!(NonEmptyEnum5::V1);
LL | | V1, V2, V3, V4, V5, | ^^^^^^^^^^^^^^^^^ patterns `V1`, `V2`, `V3` and 2 more not covered
LL | | }
| |_- `NonEmptyEnum5` defined here
...
LL | match_guarded_arm!(NonEmptyEnum5::V1);
| ^^^^^^^^^^^^^^^^^ patterns `V1`, `V2`, `V3` and 2 more not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyEnum5` defined here
--> $DIR/empty-match.rs:30:6
|
LL | enum NonEmptyEnum5 {
| ^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyEnum5` = note: the matched value is of type `NonEmptyEnum5`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ _ if false => {}
LL + _ => todo!()
|
error: aborting due to 22 previous errors error: aborting due to 22 previous errors

View File

@ -46,107 +46,112 @@ error[E0004]: non-exhaustive patterns: type `u8` is non-empty
LL | match_no_arms!(0u8); LL | match_no_arms!(0u8);
| ^^^ | ^^^
| |
= 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` = note: the matched value is of type `u8`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct1` is non-empty error[E0004]: non-exhaustive patterns: type `NonEmptyStruct1` is non-empty
--> $DIR/empty-match.rs:79:20 --> $DIR/empty-match.rs:79:20
| |
LL | struct NonEmptyStruct1;
| ----------------------- `NonEmptyStruct1` defined here
...
LL | match_no_arms!(NonEmptyStruct1); LL | match_no_arms!(NonEmptyStruct1);
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyStruct1` defined here
--> $DIR/empty-match.rs:14:8
|
LL | struct NonEmptyStruct1;
| ^^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyStruct1` = note: the matched value is of type `NonEmptyStruct1`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct2` is non-empty error[E0004]: non-exhaustive patterns: type `NonEmptyStruct2` is non-empty
--> $DIR/empty-match.rs:80:20 --> $DIR/empty-match.rs:80:20
| |
LL | struct NonEmptyStruct2(bool);
| ----------------------------- `NonEmptyStruct2` defined here
...
LL | match_no_arms!(NonEmptyStruct2(true)); LL | match_no_arms!(NonEmptyStruct2(true));
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyStruct2` defined here
--> $DIR/empty-match.rs:15:8
|
LL | struct NonEmptyStruct2(bool);
| ^^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyStruct2` = note: the matched value is of type `NonEmptyStruct2`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
--> $DIR/empty-match.rs:81:20 --> $DIR/empty-match.rs:81:20
| |
LL | / union NonEmptyUnion1 { LL | match_no_arms!((NonEmptyUnion1 { foo: () }));
LL | | foo: (), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | | }
| |_- `NonEmptyUnion1` defined here
...
LL | match_no_arms!((NonEmptyUnion1 { foo: () }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyUnion1` defined here
--> $DIR/empty-match.rs:16:7
|
LL | union NonEmptyUnion1 {
| ^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyUnion1` = note: the matched value is of type `NonEmptyUnion1`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
--> $DIR/empty-match.rs:82:20 --> $DIR/empty-match.rs:82:20
| |
LL | / union NonEmptyUnion2 { LL | match_no_arms!((NonEmptyUnion2 { foo: () }));
LL | | foo: (), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | | bar: (),
LL | | }
| |_- `NonEmptyUnion2` defined here
...
LL | match_no_arms!((NonEmptyUnion2 { foo: () }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyUnion2` defined here
--> $DIR/empty-match.rs:19:7
|
LL | union NonEmptyUnion2 {
| ^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyUnion2` = note: the matched value is of type `NonEmptyUnion2`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
--> $DIR/empty-match.rs:83:20 --> $DIR/empty-match.rs:83:20
| |
LL | / enum NonEmptyEnum1 { LL | match_no_arms!(NonEmptyEnum1::Foo(true));
LL | | Foo(bool), | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo(_)` not covered
| | --- not covered
LL | | }
| |_- `NonEmptyEnum1` defined here
...
LL | match_no_arms!(NonEmptyEnum1::Foo(true));
| ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo(_)` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyEnum1` defined here
--> $DIR/empty-match.rs:24:5
|
LL | enum NonEmptyEnum1 {
| -------------
LL | Foo(bool),
| ^^^ not covered
= note: the matched value is of type `NonEmptyEnum1` = note: the matched value is of type `NonEmptyEnum1`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
--> $DIR/empty-match.rs:84:20 --> $DIR/empty-match.rs:84:20
| |
LL | / enum NonEmptyEnum2 { LL | match_no_arms!(NonEmptyEnum2::Foo(true));
LL | | Foo(bool), | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `Foo(_)` and `Bar` not covered
| | --- not covered
LL | | Bar,
| | --- not covered
LL | | }
| |_- `NonEmptyEnum2` defined here
...
LL | match_no_arms!(NonEmptyEnum2::Foo(true));
| ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `Foo(_)` and `Bar` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyEnum2` defined here
--> $DIR/empty-match.rs:27:5
|
LL | enum NonEmptyEnum2 {
| -------------
LL | Foo(bool),
| ^^^ not covered
LL | Bar,
| ^^^ not covered
= note: the matched value is of type `NonEmptyEnum2` = note: the matched value is of type `NonEmptyEnum2`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
--> $DIR/empty-match.rs:85:20 --> $DIR/empty-match.rs:85:20
| |
LL | / enum NonEmptyEnum5 { LL | match_no_arms!(NonEmptyEnum5::V1);
LL | | V1, V2, V3, V4, V5, | ^^^^^^^^^^^^^^^^^ patterns `V1`, `V2`, `V3` and 2 more not covered
LL | | }
| |_- `NonEmptyEnum5` defined here
...
LL | match_no_arms!(NonEmptyEnum5::V1);
| ^^^^^^^^^^^^^^^^^ patterns `V1`, `V2`, `V3` and 2 more not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyEnum5` defined here
--> $DIR/empty-match.rs:30:6
|
LL | enum NonEmptyEnum5 {
| ^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyEnum5` = note: the matched value is of type `NonEmptyEnum5`
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/empty-match.rs:87:24 --> $DIR/empty-match.rs:87:24
@ -154,107 +159,144 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match_guarded_arm!(0u8); LL | match_guarded_arm!(0u8);
| ^^^ pattern `_` not covered | ^^^ pattern `_` 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` = note: the matched value is of type `u8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered
--> $DIR/empty-match.rs:88:24 --> $DIR/empty-match.rs:88:24
| |
LL | struct NonEmptyStruct1;
| ----------------------- `NonEmptyStruct1` defined here
...
LL | match_guarded_arm!(NonEmptyStruct1); LL | match_guarded_arm!(NonEmptyStruct1);
| ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered | ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyStruct1` defined here
--> $DIR/empty-match.rs:14:8
|
LL | struct NonEmptyStruct1;
| ^^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyStruct1` = note: the matched value is of type `NonEmptyStruct1`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {}
LL + NonEmptyStruct1 => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered
--> $DIR/empty-match.rs:89:24 --> $DIR/empty-match.rs:89:24
| |
LL | struct NonEmptyStruct2(bool);
| ----------------------------- `NonEmptyStruct2` defined here
...
LL | match_guarded_arm!(NonEmptyStruct2(true)); LL | match_guarded_arm!(NonEmptyStruct2(true));
| ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered | ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyStruct2` defined here
--> $DIR/empty-match.rs:15:8
|
LL | struct NonEmptyStruct2(bool);
| ^^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyStruct2` = note: the matched value is of type `NonEmptyStruct2`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {}
LL + NonEmptyStruct2(_) => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
--> $DIR/empty-match.rs:90:24 --> $DIR/empty-match.rs:90:24
| |
LL | / union NonEmptyUnion1 { LL | match_guarded_arm!((NonEmptyUnion1 { foo: () }));
LL | | foo: (), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered
LL | | }
| |_- `NonEmptyUnion1` defined here
...
LL | match_guarded_arm!((NonEmptyUnion1 { foo: () }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyUnion1` defined here
--> $DIR/empty-match.rs:16:7
|
LL | union NonEmptyUnion1 {
| ^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyUnion1` = note: the matched value is of type `NonEmptyUnion1`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {}
LL + NonEmptyUnion1 { .. } => todo!()
|
error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
--> $DIR/empty-match.rs:91:24 --> $DIR/empty-match.rs:91:24
| |
LL | / union NonEmptyUnion2 { LL | match_guarded_arm!((NonEmptyUnion2 { foo: () }));
LL | | foo: (), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered
LL | | bar: (),
LL | | }
| |_- `NonEmptyUnion2` defined here
...
LL | match_guarded_arm!((NonEmptyUnion2 { foo: () }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyUnion2` defined here
--> $DIR/empty-match.rs:19:7
|
LL | union NonEmptyUnion2 {
| ^^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyUnion2` = note: the matched value is of type `NonEmptyUnion2`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {}
LL + NonEmptyUnion2 { .. } => todo!()
|
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
--> $DIR/empty-match.rs:92:24 --> $DIR/empty-match.rs:92:24
| |
LL | / enum NonEmptyEnum1 { LL | match_guarded_arm!(NonEmptyEnum1::Foo(true));
LL | | Foo(bool), | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo(_)` not covered
| | --- not covered
LL | | }
| |_- `NonEmptyEnum1` defined here
...
LL | match_guarded_arm!(NonEmptyEnum1::Foo(true));
| ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo(_)` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyEnum1` defined here
--> $DIR/empty-match.rs:24:5
|
LL | enum NonEmptyEnum1 {
| -------------
LL | Foo(bool),
| ^^^ not covered
= note: the matched value is of type `NonEmptyEnum1` = note: the matched value is of type `NonEmptyEnum1`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ _ if false => {}
LL + Foo(_) => todo!()
|
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
--> $DIR/empty-match.rs:93:24 --> $DIR/empty-match.rs:93:24
| |
LL | / enum NonEmptyEnum2 { LL | match_guarded_arm!(NonEmptyEnum2::Foo(true));
LL | | Foo(bool), | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `Foo(_)` and `Bar` not covered
| | --- not covered
LL | | Bar,
| | --- not covered
LL | | }
| |_- `NonEmptyEnum2` defined here
...
LL | match_guarded_arm!(NonEmptyEnum2::Foo(true));
| ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `Foo(_)` and `Bar` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyEnum2` defined here
--> $DIR/empty-match.rs:27:5
|
LL | enum NonEmptyEnum2 {
| -------------
LL | Foo(bool),
| ^^^ not covered
LL | Bar,
| ^^^ not covered
= note: the matched value is of type `NonEmptyEnum2` = note: the matched value is of type `NonEmptyEnum2`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ _ if false => {}
LL + Foo(_) | Bar => todo!()
|
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
--> $DIR/empty-match.rs:94:24 --> $DIR/empty-match.rs:94:24
| |
LL | / enum NonEmptyEnum5 { LL | match_guarded_arm!(NonEmptyEnum5::V1);
LL | | V1, V2, V3, V4, V5, | ^^^^^^^^^^^^^^^^^ patterns `V1`, `V2`, `V3` and 2 more not covered
LL | | }
| |_- `NonEmptyEnum5` defined here
...
LL | match_guarded_arm!(NonEmptyEnum5::V1);
| ^^^^^^^^^^^^^^^^^ patterns `V1`, `V2`, `V3` and 2 more not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonEmptyEnum5` defined here
--> $DIR/empty-match.rs:30:6
|
LL | enum NonEmptyEnum5 {
| ^^^^^^^^^^^^^
= note: the matched value is of type `NonEmptyEnum5` = note: the matched value is of type `NonEmptyEnum5`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ _ if false => {}
LL + _ => todo!()
|
error: aborting due to 22 previous errors error: aborting due to 22 previous errors

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match 0.0 { LL | match 0.0 {
| ^^^ pattern `_` not covered | ^^^ pattern `_` 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 `f64` = note: the matched value is of type `f64`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ 0.0..=1.0 => {}
LL + _ => todo!()
|
error: unreachable pattern error: unreachable pattern
--> $DIR/floats.rs:16:7 --> $DIR/floats.rs:16:7

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `128_u8..=u8::MAX` not covered
LL | match 0u8 { LL | match 0u8 {
| ^^^ pattern `128_u8..=u8::MAX` not covered | ^^^ pattern `128_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` = note: the matched value is of type `u8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ 128 ..= 255 if true => {}
LL + 128_u8..=u8::MAX => todo!()
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
LL | m!(0u8, 0..255); LL | m!(0u8, 0..255);
| ^^^ pattern `u8::MAX` not covered | ^^^ pattern `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` = note: the matched value is of type `u8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ u8::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
--> $DIR/exhaustiveness.rs:48:8 --> $DIR/exhaustiveness.rs:48:8
@ -13,8 +17,12 @@ error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
LL | m!(0u8, 0..=254); LL | m!(0u8, 0..=254);
| ^^^ pattern `u8::MAX` not covered | ^^^ pattern `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` = note: the matched value is of type `u8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ u8::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `0_u8` not covered error[E0004]: non-exhaustive patterns: `0_u8` not covered
--> $DIR/exhaustiveness.rs:49:8 --> $DIR/exhaustiveness.rs:49:8
@ -22,8 +30,12 @@ error[E0004]: non-exhaustive patterns: `0_u8` not covered
LL | m!(0u8, 1..=255); LL | m!(0u8, 1..=255);
| ^^^ pattern `0_u8` not covered | ^^^ pattern `0_u8` 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` = note: the matched value is of type `u8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 0_u8 => todo!() }
|
error[E0004]: non-exhaustive patterns: `42_u8` not covered error[E0004]: non-exhaustive patterns: `42_u8` not covered
--> $DIR/exhaustiveness.rs:50:8 --> $DIR/exhaustiveness.rs:50:8
@ -31,8 +43,12 @@ error[E0004]: non-exhaustive patterns: `42_u8` not covered
LL | m!(0u8, 0..42 | 43..=255); LL | m!(0u8, 0..42 | 43..=255);
| ^^^ pattern `42_u8` not covered | ^^^ pattern `42_u8` 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` = note: the matched value is of type `u8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 42_u8 => todo!() }
|
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
--> $DIR/exhaustiveness.rs:51:8 --> $DIR/exhaustiveness.rs:51:8
@ -40,8 +56,12 @@ error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
LL | m!(0i8, -128..127); LL | m!(0i8, -128..127);
| ^^^ pattern `i8::MAX` not covered | ^^^ pattern `i8::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 `i8` = note: the matched value is of type `i8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i8::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
--> $DIR/exhaustiveness.rs:52:8 --> $DIR/exhaustiveness.rs:52:8
@ -49,8 +69,12 @@ error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
LL | m!(0i8, -128..=126); LL | m!(0i8, -128..=126);
| ^^^ pattern `i8::MAX` not covered | ^^^ pattern `i8::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 `i8` = note: the matched value is of type `i8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i8::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `i8::MIN` not covered error[E0004]: non-exhaustive patterns: `i8::MIN` not covered
--> $DIR/exhaustiveness.rs:53:8 --> $DIR/exhaustiveness.rs:53:8
@ -58,8 +82,12 @@ error[E0004]: non-exhaustive patterns: `i8::MIN` not covered
LL | m!(0i8, -127..=127); LL | m!(0i8, -127..=127);
| ^^^ pattern `i8::MIN` not covered | ^^^ pattern `i8::MIN` 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 `i8` = note: the matched value is of type `i8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ i8::MIN => todo!() }
|
error[E0004]: non-exhaustive patterns: `0_i8` not covered error[E0004]: non-exhaustive patterns: `0_i8` not covered
--> $DIR/exhaustiveness.rs:54:11 --> $DIR/exhaustiveness.rs:54:11
@ -67,8 +95,12 @@ error[E0004]: non-exhaustive patterns: `0_i8` not covered
LL | match 0i8 { LL | match 0i8 {
| ^^^ pattern `0_i8` not covered | ^^^ pattern `0_i8` 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 `i8` = note: the matched value is of type `i8`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ 1 ..= i8::MAX => {}
LL + 0_i8 => todo!()
|
error[E0004]: non-exhaustive patterns: `u128::MAX` not covered error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
--> $DIR/exhaustiveness.rs:59:8 --> $DIR/exhaustiveness.rs:59:8
@ -76,8 +108,12 @@ error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
LL | m!(0u128, 0..=ALMOST_MAX); LL | m!(0u128, 0..=ALMOST_MAX);
| ^^^^^ pattern `u128::MAX` not covered | ^^^^^ pattern `u128::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 `u128` = note: the matched value is of type `u128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ u128::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `5_u128..=u128::MAX` not covered error[E0004]: non-exhaustive patterns: `5_u128..=u128::MAX` not covered
--> $DIR/exhaustiveness.rs:60:8 --> $DIR/exhaustiveness.rs:60:8
@ -85,8 +121,12 @@ error[E0004]: non-exhaustive patterns: `5_u128..=u128::MAX` not covered
LL | m!(0u128, 0..=4); LL | m!(0u128, 0..=4);
| ^^^^^ pattern `5_u128..=u128::MAX` not covered | ^^^^^ pattern `5_u128..=u128::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 `u128` = note: the matched value is of type `u128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 5_u128..=u128::MAX => todo!() }
|
error[E0004]: non-exhaustive patterns: `0_u128` not covered error[E0004]: non-exhaustive patterns: `0_u128` not covered
--> $DIR/exhaustiveness.rs:61:8 --> $DIR/exhaustiveness.rs:61:8
@ -94,8 +134,12 @@ error[E0004]: non-exhaustive patterns: `0_u128` not covered
LL | m!(0u128, 1..=u128::MAX); LL | m!(0u128, 1..=u128::MAX);
| ^^^^^ pattern `0_u128` not covered | ^^^^^ pattern `0_u128` 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 `u128` = note: the matched value is of type `u128`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ 0_u128 => todo!() }
|
error[E0004]: non-exhaustive patterns: `(126_u8..=127_u8, false)` not covered error[E0004]: non-exhaustive patterns: `(126_u8..=127_u8, false)` not covered
--> $DIR/exhaustiveness.rs:69:11 --> $DIR/exhaustiveness.rs:69:11
@ -103,8 +147,12 @@ error[E0004]: non-exhaustive patterns: `(126_u8..=127_u8, false)` not covered
LL | match (0u8, true) { LL | match (0u8, true) {
| ^^^^^^^^^^^ pattern `(126_u8..=127_u8, false)` not covered | ^^^^^^^^^^^ pattern `(126_u8..=127_u8, false)` 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, bool)` = note: the matched value is of type `(u8, bool)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ (0 ..= 255, true) => {}
LL + (126_u8..=127_u8, false) => todo!()
|
error: aborting due to 12 previous errors error: aborting due to 12 previous errors

View File

@ -4,8 +4,13 @@ error[E0004]: non-exhaustive patterns: type `usize` is non-empty
LL | match 7usize {} LL | match 7usize {}
| ^^^^^^ | ^^^^^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
= note: the matched value is of type `usize` = note: the matched value is of type `usize`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match 7usize {
LL + _ => todo!(),
LL + }
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,10 +4,14 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match 0usize { LL | match 0usize {
| ^^^^^^ pattern `_` not covered | ^^^^^^ pattern `_` 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 `usize` = note: the matched value is of type `usize`
= note: `usize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively = note: `usize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ 0 ..= usize::MAX => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/pointer-sized-int.rs:17:11 --> $DIR/pointer-sized-int.rs:17:11
@ -15,10 +19,14 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match 0isize { LL | match 0isize {
| ^^^^^^ pattern `_` not covered | ^^^^^^ pattern `_` 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 `isize` = note: the matched value is of type `isize`
= note: `isize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively = note: `isize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ isize::MIN ..= isize::MAX => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/pointer-sized-int.rs:22:8 --> $DIR/pointer-sized-int.rs:22:8
@ -26,10 +34,14 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | m!(0usize, 0..=usize::MAX); LL | m!(0usize, 0..=usize::MAX);
| ^^^^^^ pattern `_` not covered | ^^^^^^ pattern `_` 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 `usize` = note: the matched value is of type `usize`
= note: `usize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively = note: `usize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ _ => todo!() }
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/pointer-sized-int.rs:24:8 --> $DIR/pointer-sized-int.rs:24:8
@ -37,10 +49,14 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | m!(0usize, 0..5 | 5..=usize::MAX); LL | m!(0usize, 0..5 | 5..=usize::MAX);
| ^^^^^^ pattern `_` not covered | ^^^^^^ pattern `_` 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 `usize` = note: the matched value is of type `usize`
= note: `usize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively = note: `usize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ _ => todo!() }
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/pointer-sized-int.rs:26:8 --> $DIR/pointer-sized-int.rs:26:8
@ -48,10 +64,14 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | m!(0usize, 0..usize::MAX | usize::MAX); LL | m!(0usize, 0..usize::MAX | usize::MAX);
| ^^^^^^ pattern `_` not covered | ^^^^^^ pattern `_` 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 `usize` = note: the matched value is of type `usize`
= note: `usize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively = note: `usize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ _ => todo!() }
|
error[E0004]: non-exhaustive patterns: `(_, _)` not covered error[E0004]: non-exhaustive patterns: `(_, _)` not covered
--> $DIR/pointer-sized-int.rs:28:8 --> $DIR/pointer-sized-int.rs:28:8
@ -59,8 +79,12 @@ error[E0004]: non-exhaustive patterns: `(_, _)` not covered
LL | m!((0usize, true), (0..5, true) | (5..=usize::MAX, true) | (0..=usize::MAX, false)); LL | m!((0usize, true), (0..5, true) | (5..=usize::MAX, true) | (0..=usize::MAX, false));
| ^^^^^^^^^^^^^^ pattern `(_, _)` not covered | ^^^^^^^^^^^^^^ pattern `(_, _)` 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 `(usize, bool)` = note: the matched value is of type `(usize, bool)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ (_, _) => todo!() }
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/pointer-sized-int.rs:31:8 --> $DIR/pointer-sized-int.rs:31:8
@ -68,10 +92,14 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | m!(0isize, isize::MIN..=isize::MAX); LL | m!(0isize, isize::MIN..=isize::MAX);
| ^^^^^^ pattern `_` not covered | ^^^^^^ pattern `_` 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 `isize` = note: the matched value is of type `isize`
= note: `isize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively = note: `isize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ _ => todo!() }
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/pointer-sized-int.rs:33:8 --> $DIR/pointer-sized-int.rs:33:8
@ -79,10 +107,14 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | m!(0isize, isize::MIN..5 | 5..=isize::MAX); LL | m!(0isize, isize::MIN..5 | 5..=isize::MAX);
| ^^^^^^ pattern `_` not covered | ^^^^^^ pattern `_` 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 `isize` = note: the matched value is of type `isize`
= note: `isize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively = note: `isize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ _ => todo!() }
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/pointer-sized-int.rs:35:8 --> $DIR/pointer-sized-int.rs:35:8
@ -90,10 +122,14 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | m!(0isize, isize::MIN..isize::MAX | isize::MAX); LL | m!(0isize, isize::MIN..isize::MAX | isize::MAX);
| ^^^^^^ pattern `_` not covered | ^^^^^^ pattern `_` 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 `isize` = note: the matched value is of type `isize`
= note: `isize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively = note: `isize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ _ => todo!() }
|
error[E0004]: non-exhaustive patterns: `(_, _)` not covered error[E0004]: non-exhaustive patterns: `(_, _)` not covered
--> $DIR/pointer-sized-int.rs:37:8 --> $DIR/pointer-sized-int.rs:37:8
@ -101,8 +137,12 @@ error[E0004]: non-exhaustive patterns: `(_, _)` not covered
LL | m!((0isize, true), (isize::MIN..5, true) LL | m!((0isize, true), (isize::MIN..5, true)
| ^^^^^^^^^^^^^^ pattern `(_, _)` not covered | ^^^^^^^^^^^^^^ pattern `(_, _)` 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 `(isize, bool)` = note: the matched value is of type `(isize, bool)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match $s { $($t)+ => {}
LL ~ (_, _) => todo!() }
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/pointer-sized-int.rs:41:11 --> $DIR/pointer-sized-int.rs:41:11
@ -110,10 +150,14 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match 0isize { LL | match 0isize {
| ^^^^^^ pattern `_` not covered | ^^^^^^ pattern `_` 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 `isize` = note: the matched value is of type `isize`
= note: `isize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively = note: `isize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ 1 ..= isize::MAX => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: type `usize` is non-empty error[E0004]: non-exhaustive patterns: type `usize` is non-empty
--> $DIR/pointer-sized-int.rs:48:11 --> $DIR/pointer-sized-int.rs:48:11
@ -121,8 +165,13 @@ error[E0004]: non-exhaustive patterns: type `usize` is non-empty
LL | match 7usize {} LL | match 7usize {}
| ^^^^^^ | ^^^^^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
= note: the matched value is of type `usize` = note: the matched value is of type `usize`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match 7usize {
LL + _ => todo!(),
LL + }
|
error: aborting due to 12 previous errors error: aborting due to 12 previous errors

View File

@ -4,10 +4,14 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match 0usize { LL | match 0usize {
| ^^^^^^ pattern `_` not covered | ^^^^^^ pattern `_` 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 `usize` = note: the matched value is of type `usize`
= note: `usize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively = note: `usize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `usize` matching
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ 0..=usize::MAX => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/precise_pointer_matching-message.rs:11:11 --> $DIR/precise_pointer_matching-message.rs:11:11
@ -15,10 +19,14 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match 0isize { LL | match 0isize {
| ^^^^^^ pattern `_` not covered | ^^^^^^ pattern `_` 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 `isize` = note: the matched value is of type `isize`
= note: `isize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively = note: `isize` does not have a fixed maximum value, so a wildcard `_` is necessary to match exhaustively
= help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching = help: add `#![feature(precise_pointer_size_matching)]` to the crate attributes to enable precise `isize` matching
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ isize::MIN..=isize::MAX => {}
LL + _ => todo!()
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `(T1(()), V2(_))` and `(T2(()), V1(_))` n
LL | match (T::T1(()), V::V2(true)) { LL | match (T::T1(()), V::V2(true)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `(T1(()), V2(_))` and `(T2(()), V1(_))` not covered | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `(T1(()), V2(_))` and `(T2(()), V1(_))` 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 `(T, V)` = note: the matched value is of type `(T, V)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ (T::T2(()), V::V2(b)) => (),
LL ~ (T1(()), V2(_)) | (T2(()), V1(_)) => todo!(),
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `(None, None)` and `(Some(_), Some(_))` n
LL | match (a, b) { LL | match (a, b) {
| ^^^^^^ patterns `(None, None)` and `(Some(_), Some(_))` not covered | ^^^^^^ patterns `(None, None)` and `(Some(_), Some(_))` 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<usize>, Option<usize>)` = note: the matched value is of type `(Option<usize>, Option<usize>)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ (Some(_), None) | (None, Some(_)) => {}
LL + (None, None) | (Some(_), Some(_)) => todo!()
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `&_` not covered
LL | match "world" { LL | match "world" {
| ^^^^^^^ pattern `&_` not covered | ^^^^^^^ pattern `&_` 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 `&str` = note: the matched value is of type `&str`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ "hello" => {}
LL + &_ => todo!()
|
error[E0004]: non-exhaustive patterns: `&_` not covered error[E0004]: non-exhaustive patterns: `&_` not covered
--> $DIR/issue-30240.rs:6:11 --> $DIR/issue-30240.rs:6:11
@ -13,8 +17,12 @@ error[E0004]: non-exhaustive patterns: `&_` not covered
LL | match "world" { LL | match "world" {
| ^^^^^^^ pattern `&_` not covered | ^^^^^^^ pattern `&_` 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 `&str` = note: the matched value is of type `&str`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ "hello" => {}
LL + &_ => todo!()
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -4,8 +4,13 @@ error[E0004]: non-exhaustive patterns: type `()` is non-empty
LL | match () { } LL | match () { }
| ^^ | ^^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
= note: the matched value is of type `()` = note: the matched value is of type `()`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match () {
LL + _ => todo!(),
LL ~ }
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,13 @@ error[E0004]: non-exhaustive patterns: type `*const Bottom` is non-empty
LL | match x { } LL | match x { }
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
= note: the matched value is of type `*const Bottom` = note: the matched value is of type `*const Bottom`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,20 +1,21 @@
error[E0005]: refutable pattern in local binding: `Bar` and `Baz` not covered error[E0005]: refutable pattern in local binding: `Bar` and `Baz` not covered
--> $DIR/issue-31561.rs:8:9 --> $DIR/issue-31561.rs:8:9
| |
LL | / enum Thing { LL | let Thing::Foo(y) = Thing::Foo(1);
LL | | Foo(u8), | ^^^^^^^^^^^^^ patterns `Bar` and `Baz` not covered
LL | | Bar,
| | --- not covered
LL | | Baz
| | --- not covered
LL | | }
| |_- `Thing` defined here
...
LL | let Thing::Foo(y) = Thing::Foo(1);
| ^^^^^^^^^^^^^ patterns `Bar` and `Baz` not covered
| |
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Thing` defined here
--> $DIR/issue-31561.rs:3:5
|
LL | enum Thing {
| -----
LL | Foo(u8),
LL | Bar,
| ^^^ not covered
LL | Baz
| ^^^ not covered
= note: the matched value is of type `Thing` = note: the matched value is of type `Thing`
help: you might want to use `if let` to ignore the variant that isn't matched help: you might want to use `if let` to ignore the variant that isn't matched
| |

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `(B, _)`, `(C, _)`, `(D, _)` and 2 more n
LL | match (A, ()) { LL | match (A, ()) {
| ^^^^^^^ patterns `(B, _)`, `(C, _)`, `(D, _)` and 2 more not covered | ^^^^^^^ patterns `(B, _)`, `(C, _)`, `(D, _)` and 2 more 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 `(Enum, ())` = note: the matched value is of type `(Enum, ())`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ (A, _) => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `(_, B)`, `(_, C)`, `(_, D)` and 2 more not covered error[E0004]: non-exhaustive patterns: `(_, B)`, `(_, C)`, `(_, D)` and 2 more not covered
--> $DIR/issue-35609.rs:14:11 --> $DIR/issue-35609.rs:14:11
@ -13,8 +17,12 @@ error[E0004]: non-exhaustive patterns: `(_, B)`, `(_, C)`, `(_, D)` and 2 more n
LL | match (A, A) { LL | match (A, A) {
| ^^^^^^ patterns `(_, B)`, `(_, C)`, `(_, D)` and 2 more not covered | ^^^^^^ patterns `(_, B)`, `(_, C)`, `(_, D)` and 2 more 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 `(Enum, Enum)` = note: the matched value is of type `(Enum, Enum)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ (_, A) => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
--> $DIR/issue-35609.rs:18:11 --> $DIR/issue-35609.rs:18:11
@ -22,8 +30,12 @@ error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _
LL | match ((A, ()), ()) { LL | match ((A, ()), ()) {
| ^^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered | ^^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more 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 `((Enum, ()), ())` = note: the matched value is of type `((Enum, ()), ())`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ ((A, ()), _) => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
--> $DIR/issue-35609.rs:22:11 --> $DIR/issue-35609.rs:22:11
@ -31,8 +43,12 @@ error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _
LL | match ((A, ()), A) { LL | match ((A, ()), A) {
| ^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered | ^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more 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 `((Enum, ()), Enum)` = note: the matched value is of type `((Enum, ()), Enum)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ ((A, ()), _) => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
--> $DIR/issue-35609.rs:26:11 --> $DIR/issue-35609.rs:26:11
@ -40,32 +56,48 @@ error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _
LL | match ((A, ()), ()) { LL | match ((A, ()), ()) {
| ^^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered | ^^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more 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 `((Enum, ()), ())` = note: the matched value is of type `((Enum, ()), ())`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ ((A, _), _) => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `S(B, _)`, `S(C, _)`, `S(D, _)` and 2 more not covered error[E0004]: non-exhaustive patterns: `S(B, _)`, `S(C, _)`, `S(D, _)` and 2 more not covered
--> $DIR/issue-35609.rs:31:11 --> $DIR/issue-35609.rs:31:11
| |
LL | struct S(Enum, ());
| ------------------- `S` defined here
...
LL | match S(A, ()) { LL | match S(A, ()) {
| ^^^^^^^^ patterns `S(B, _)`, `S(C, _)`, `S(D, _)` and 2 more not covered | ^^^^^^^^ patterns `S(B, _)`, `S(C, _)`, `S(D, _)` and 2 more not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `S` defined here
--> $DIR/issue-35609.rs:6:8
|
LL | struct S(Enum, ());
| ^
= note: the matched value is of type `S` = note: the matched value is of type `S`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ S(A, _) => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `Sd { x: B, .. }`, `Sd { x: C, .. }`, `Sd { x: D, .. }` and 2 more not covered error[E0004]: non-exhaustive patterns: `Sd { x: B, .. }`, `Sd { x: C, .. }`, `Sd { x: D, .. }` and 2 more not covered
--> $DIR/issue-35609.rs:35:11 --> $DIR/issue-35609.rs:35:11
| |
LL | struct Sd { x: Enum, y: () }
| ---------------------------- `Sd` defined here
...
LL | match (Sd { x: A, y: () }) { LL | match (Sd { x: A, y: () }) {
| ^^^^^^^^^^^^^^^^^^^^ patterns `Sd { x: B, .. }`, `Sd { x: C, .. }`, `Sd { x: D, .. }` and 2 more not covered | ^^^^^^^^^^^^^^^^^^^^ patterns `Sd { x: B, .. }`, `Sd { x: C, .. }`, `Sd { x: D, .. }` and 2 more not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Sd` defined here
--> $DIR/issue-35609.rs:7:8
|
LL | struct Sd { x: Enum, y: () }
| ^^
= note: the matched value is of type `Sd` = note: the matched value is of type `Sd`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ Sd { x: A, y: _ } => {}
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered error[E0004]: non-exhaustive patterns: `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered
--> $DIR/issue-35609.rs:39:11 --> $DIR/issue-35609.rs:39:11
@ -73,8 +105,23 @@ error[E0004]: non-exhaustive patterns: `Some(B)`, `Some(C)`, `Some(D)` and 2 mor
LL | match Some(A) { LL | match Some(A) {
| ^^^^^^^ patterns `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered | ^^^^^^^ patterns `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Option<Enum>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
|
LL | / pub enum Option<T> {
LL | | /// No value.
LL | | #[lang = "None"]
LL | | #[stable(feature = "rust1", since = "1.0.0")]
... |
LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
LL | | }
| |_^
= note: the matched value is of type `Option<Enum>` = note: the matched value is of type `Option<Enum>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ None => (),
LL + _ => todo!()
|
error: aborting due to 8 previous errors error: aborting due to 8 previous errors

View File

@ -4,8 +4,20 @@ error[E0004]: non-exhaustive patterns: `box _` not covered
LL | box NodeKind::Element(ed) => match ed.kind { LL | box NodeKind::Element(ed) => match ed.kind {
| ^^^^^^^ pattern `box _` not covered | ^^^^^^^ pattern `box _` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Box<ElementKind>` defined here
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
LL | / pub struct Box<
LL | | T: ?Sized,
LL | | #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
LL | | >(Unique<T>, A);
| |________________^
= note: the matched value is of type `Box<ElementKind>` = note: the matched value is of type `Box<ElementKind>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ box ElementKind::HTMLImageElement(ref d) if d.image.is_some() => { true }
LL + box _ => todo!()
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,16 +1,22 @@
error[E0004]: non-exhaustive patterns: `Bar { bar: C, .. }`, `Bar { bar: D, .. }`, `Bar { bar: E, .. }` and 1 more not covered error[E0004]: non-exhaustive patterns: `Bar { bar: C, .. }`, `Bar { bar: D, .. }`, `Bar { bar: E, .. }` and 1 more not covered
--> $DIR/issue-39362.rs:10:11 --> $DIR/issue-39362.rs:10:11
| |
LL | / enum Foo { LL | match f {
LL | | Bar { bar: Bar, id: usize } | ^ patterns `Bar { bar: C, .. }`, `Bar { bar: D, .. }`, `Bar { bar: E, .. }` and 1 more not covered
LL | | }
| |_- `Foo` defined here
...
LL | match f {
| ^ patterns `Bar { bar: C, .. }`, `Bar { bar: D, .. }`, `Bar { bar: E, .. }` and 1 more not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Foo` defined here
--> $DIR/issue-39362.rs:2:5
|
LL | enum Foo {
| ---
LL | Bar { bar: Bar, id: usize }
| ^^^ not covered
= note: the matched value is of type `Foo` = note: the matched value is of type `Foo`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ Foo::Bar { bar: Bar::B, .. } => (),
LL ~ _ => todo!(),
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,17 +1,22 @@
error[E0004]: non-exhaustive patterns: `C(QA)` not covered error[E0004]: non-exhaustive patterns: `C(QA)` not covered
--> $DIR/issue-40221.rs:11:11 --> $DIR/issue-40221.rs:11:11
| |
LL | / enum P { LL | match proto {
LL | | C(PC), | ^^^^^ pattern `C(QA)` not covered
| | - not covered
LL | | }
| |_- `P` defined here
...
LL | match proto {
| ^^^^^ pattern `C(QA)` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `P` defined here
--> $DIR/issue-40221.rs:2:5
|
LL | enum P {
| -
LL | C(PC),
| ^ not covered
= note: the matched value is of type `P` = note: the matched value is of type `P`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ P::C(PC::Q) => (),
LL ~ C(QA) => todo!(),
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `(true, false)` not covered
LL | println!("foo {:}", match tup { LL | println!("foo {:}", match tup {
| ^^^ pattern `(true, false)` not covered | ^^^ pattern `(true, false)` 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 `(bool, bool)` = note: the matched value is of type `(bool, bool)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ (true, true) => "baz",
LL + (true, false) => todo!()
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,14 +1,20 @@
error[E0004]: non-exhaustive patterns: `Tag(Exif, _)` not covered error[E0004]: non-exhaustive patterns: `Tag(Exif, _)` not covered
--> $DIR/issue-50900.rs:15:11 --> $DIR/issue-50900.rs:15:11
| |
LL | pub struct Tag(pub Context, pub u16);
| ------------------------------------- `Tag` defined here
...
LL | match Tag::ExifIFDPointer { LL | match Tag::ExifIFDPointer {
| ^^^^^^^^^^^^^^^^^^^ pattern `Tag(Exif, _)` not covered | ^^^^^^^^^^^^^^^^^^^ pattern `Tag(Exif, _)` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Tag` defined here
--> $DIR/issue-50900.rs:2:12
|
LL | pub struct Tag(pub Context, pub u16);
| ^^^
= note: the matched value is of type `Tag` = note: the matched value is of type `Tag`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ Tag::ExifIFDPointer => {}
LL + Tag(Exif, _) => todo!()
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,21 +1,26 @@
error[E0004]: non-exhaustive patterns: `A(false)`, `B(false)` and `C(false)` not covered error[E0004]: non-exhaustive patterns: `A(false)`, `B(false)` and `C(false)` not covered
--> $DIR/issue-56379.rs:8:11 --> $DIR/issue-56379.rs:8:11
| |
LL | / enum Foo { LL | match Foo::A(true) {
LL | | A(bool), | ^^^^^^^^^^^^ patterns `A(false)`, `B(false)` and `C(false)` not covered
| | - not covered
LL | | B(bool),
| | - not covered
LL | | C(bool),
| | - not covered
LL | | }
| |_- `Foo` defined here
...
LL | match Foo::A(true) {
| ^^^^^^^^^^^^ patterns `A(false)`, `B(false)` and `C(false)` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Foo` defined here
--> $DIR/issue-56379.rs:2:5
|
LL | enum Foo {
| ---
LL | A(bool),
| ^ not covered
LL | B(bool),
| ^ not covered
LL | C(bool),
| ^ not covered
= note: the matched value is of type `Foo` = note: the matched value is of type `Foo`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ Foo::C(true) => {}
LL + A(false) | B(false) | C(false) => todo!()
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `(A, Some(A))`, `(A, Some(B))`, `(B, Some
LL | match (x, y) { LL | match (x, y) {
| ^^^^^^ patterns `(A, Some(A))`, `(A, Some(B))`, `(B, Some(B))` and 2 more not covered | ^^^^^^ patterns `(A, Some(A))`, `(A, Some(B))`, `(B, Some(B))` and 2 more 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 `(X, Option<X>)` = note: the matched value is of type `(X, Option<X>)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ (X::A, Some(X::C)) | (X::C, Some(X::A)) => false,
LL ~ _ => todo!(),
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,5 +1,6 @@
enum A {} enum A {}
//~^ NOTE `A` defined here //~^ NOTE `A` defined here
//~| NOTE
fn f(a: &A) { fn f(a: &A) {
match a {} match a {}

View File

@ -1,15 +1,22 @@
error[E0004]: non-exhaustive patterns: type `&A` is non-empty error[E0004]: non-exhaustive patterns: type `&A` is non-empty
--> $DIR/issue-78123-non-exhaustive-reference.rs:5:11 --> $DIR/issue-78123-non-exhaustive-reference.rs:6:11
| |
LL | enum A {}
| --------- `A` defined here
...
LL | match a {} LL | match a {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `A` defined here
--> $DIR/issue-78123-non-exhaustive-reference.rs:1:6
|
LL | enum A {}
| ^
= note: the matched value is of type `&A` = note: the matched value is of type `&A`
= note: references are always considered inhabited = note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match a {
LL + _ => todo!(),
LL + }
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `(true, false)` not covered
LL | match (true, false) { LL | match (true, false) {
| ^^^^^^^^^^^^^ pattern `(true, false)` not covered | ^^^^^^^^^^^^^ pattern `(true, false)` 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 `(bool, bool)` = note: the matched value is of type `(bool, bool)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ (false, true) => (),
LL + (true, false) => todo!()
|
error[E0004]: non-exhaustive patterns: `Some(Some(West))` not covered error[E0004]: non-exhaustive patterns: `Some(Some(West))` not covered
--> $DIR/match-arm-statics-2.rs:29:11 --> $DIR/match-arm-statics-2.rs:29:11
@ -13,31 +17,45 @@ error[E0004]: non-exhaustive patterns: `Some(Some(West))` not covered
LL | match Some(Some(North)) { LL | match Some(Some(North)) {
| ^^^^^^^^^^^^^^^^^ pattern `Some(Some(West))` not covered | ^^^^^^^^^^^^^^^^^ pattern `Some(Some(West))` not covered
| |
::: $SRC_DIR/core/src/option.rs:LL:COL note: `Option<Option<Direction>>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
| |
LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), LL | / pub enum Option<T> {
| ---- LL | | /// No value.
| | LL | | #[lang = "None"]
| not covered LL | | #[stable(feature = "rust1", since = "1.0.0")]
| not covered ... |
| LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms | | ^^^^
| | |
| | not covered
| | not covered
LL | | }
| |_-
= note: the matched value is of type `Option<Option<Direction>>` = note: the matched value is of type `Option<Option<Direction>>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ None => (),
LL + Some(Some(West)) => todo!()
|
error[E0004]: non-exhaustive patterns: `Foo { bar: Some(North), baz: NewBool(true) }` not covered error[E0004]: non-exhaustive patterns: `Foo { bar: Some(North), baz: NewBool(true) }` not covered
--> $DIR/match-arm-statics-2.rs:48:11 --> $DIR/match-arm-statics-2.rs:48:11
| |
LL | / struct Foo { LL | match (Foo { bar: Some(North), baz: NewBool(true) }) {
LL | | bar: Option<Direction>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo { bar: Some(North), baz: NewBool(true) }` not covered
LL | | baz: NewBool
LL | | }
| |_- `Foo` defined here
...
LL | match (Foo { bar: Some(North), baz: NewBool(true) }) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo { bar: Some(North), baz: NewBool(true) }` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Foo` defined here
--> $DIR/match-arm-statics-2.rs:40:8
|
LL | struct Foo {
| ^^^
= note: the matched value is of type `Foo` = note: the matched value is of type `Foo`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ Foo { bar: Some(EAST), .. } => (),
LL + Foo { bar: Some(North), baz: NewBool(true) } => todo!()
|
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `&[0_u8..=64_u8, _, _, _]` and `&[66_u8..
LL | match buf { LL | match buf {
| ^^^ patterns `&[0_u8..=64_u8, _, _, _]` and `&[66_u8..=u8::MAX, _, _, _]` not covered | ^^^ patterns `&[0_u8..=64_u8, _, _, _]` and `&[66_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; 4]` = note: the matched value is of type `&[u8; 4]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ b"AAAA" => {}
LL + &[0_u8..=64_u8, _, _, _] | &[66_u8..=u8::MAX, _, _, _] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[]`, `&[_]`, `&[_, _]` and 2 more not covered error[E0004]: non-exhaustive patterns: `&[]`, `&[_]`, `&[_, _]` and 2 more not covered
--> $DIR/match-byte-array-patterns-2.rs:10:11 --> $DIR/match-byte-array-patterns-2.rs:10:11
@ -13,8 +17,12 @@ error[E0004]: non-exhaustive patterns: `&[]`, `&[_]`, `&[_, _]` and 2 more not c
LL | match buf { LL | match buf {
| ^^^ patterns `&[]`, `&[_]`, `&[_, _]` and 2 more not covered | ^^^ patterns `&[]`, `&[_]`, `&[_, _]` and 2 more 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]` = note: the matched value is of type `&[u8]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ b"AAAA" => {}
LL + _ => todo!()
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -4,8 +4,11 @@ error[E0004]: non-exhaustive patterns: `i32::MIN..=0_i32` and `2_i32..=i32::MAX`
LL | match 0 { 1 => () } LL | match 0 { 1 => () }
| ^ patterns `i32::MIN..=0_i32` and `2_i32..=i32::MAX` not covered | ^ patterns `i32::MIN..=0_i32` and `2_i32..=i32::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 `i32` = note: the matched value is of type `i32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL | match 0 { 1 => (), i32::MIN..=0_i32 | 2_i32..=i32::MAX => todo!() }
| ++++++++++++++++++++++++++++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/match-non-exhaustive.rs:3:11 --> $DIR/match-non-exhaustive.rs:3:11
@ -13,8 +16,11 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match 0 { 0 if false => () } LL | match 0 { 0 if false => () }
| ^ pattern `_` not covered | ^ pattern `_` 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 `i32` = note: the matched value is of type `i32`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL | match 0 { 0 if false => (), _ => todo!() }
| ++++++++++++++
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -4,13 +4,24 @@ error[E0004]: non-exhaustive patterns: `Some(Private { misc: true, .. })` not co
LL | match private::DATA { LL | match private::DATA {
| ^^^^^^^^^^^^^ pattern `Some(Private { misc: true, .. })` not covered | ^^^^^^^^^^^^^ pattern `Some(Private { misc: true, .. })` not covered
| |
::: $SRC_DIR/core/src/option.rs:LL:COL note: `Option<Private>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
| |
LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), LL | / pub enum Option<T> {
| ---- not covered LL | | /// No value.
| LL | | #[lang = "None"]
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms LL | | #[stable(feature = "rust1", since = "1.0.0")]
... |
LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
| | ^^^^ not covered
LL | | }
| |_-
= note: the matched value is of type `Option<Private>` = note: the matched value is of type `Option<Private>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ }) => {}
LL + Some(Private { misc: true, .. }) => todo!()
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `&[_, Some(_), .., None, _]` not covered
LL | match list { LL | match list {
| ^^^^ pattern `&[_, Some(_), .., None, _]` not covered | ^^^^ pattern `&[_, Some(_), .., None, _]` 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<()>]` = note: the matched value is of type `&[Option<()>]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ &[.., Some(_), _] => {}
LL ~ &[_, Some(_), .., None, _] => todo!(),
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,20 +4,26 @@
#[derive(Clone)] #[derive(Clone)]
enum E { enum E {
//~^ `E` defined here //~^ NOTE
//~| `E` defined here //~| NOTE
//~| `E` defined here //~| NOTE
//~| `E` defined here //~| NOTE
//~| `E` defined here //~| NOTE
//~| `E` defined here //~| NOTE
A, A,
B, B,
//~^ not covered //~^ NOTE `E` defined here
//~| not covered //~| NOTE `E` defined here
//~| not covered //~| NOTE `E` defined here
//~| not covered //~| NOTE `E` defined here
//~| not covered //~| NOTE `E` defined here
//~| not covered //~| NOTE `E` defined here
//~| NOTE not covered
//~| NOTE not covered
//~| NOTE not covered
//~| NOTE not covered
//~| NOTE not covered
//~| NOTE not covered
C C
//~^ not covered //~^ not covered
//~| not covered //~| not covered
@ -30,43 +36,70 @@ enum E {
fn by_val(e: E) { fn by_val(e: E) {
let e1 = e.clone(); let e1 = e.clone();
match e1 { //~ ERROR non-exhaustive patterns: `B` and `C` not covered match e1 { //~ ERROR non-exhaustive patterns: `B` and `C` not covered
//~^ NOTE patterns `B` and `C` not covered
//~| NOTE the matched value is of type `E`
E::A => {} E::A => {}
} }
let E::A = e; //~ ERROR refutable pattern in local binding: `B` and `C` not covered let E::A = e; //~ ERROR refutable pattern in local binding: `B` and `C` not covered
//~^ NOTE patterns `B` and `C` not covered
//~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with
//~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
//~| NOTE the matched value is of type `E`
} }
fn by_ref_once(e: &E) { fn by_ref_once(e: &E) {
match e { //~ ERROR non-exhaustive patterns: `&B` and `&C` not covered match e { //~ ERROR non-exhaustive patterns: `&B` and `&C` not covered
//~^ NOTE patterns `&B` and `&C` not covered
//~| NOTE the matched value is of type `&E`
E::A => {} E::A => {}
} }
let E::A = e; //~ ERROR refutable pattern in local binding: `&B` and `&C` not covered let E::A = e; //~ ERROR refutable pattern in local binding: `&B` and `&C` not covered
//~^ NOTE patterns `&B` and `&C` not covered
//~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with
//~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
//~| NOTE the matched value is of type `&E`
} }
fn by_ref_thrice(e: & &mut &E) { fn by_ref_thrice(e: & &mut &E) {
match e { //~ ERROR non-exhaustive patterns: `&&mut &B` and `&&mut &C` not covered match e { //~ ERROR non-exhaustive patterns: `&&mut &B` and `&&mut &C` not covered
//~^ NOTE patterns `&&mut &B` and `&&mut &C` not covered
//~| NOTE the matched value is of type `&&mut &E`
E::A => {} E::A => {}
} }
let E::A = e; let E::A = e;
//~^ ERROR refutable pattern in local binding: `&&mut &B` and `&&mut &C` not covered //~^ ERROR refutable pattern in local binding: `&&mut &B` and `&&mut &C` not covered
//~| NOTE patterns `&&mut &B` and `&&mut &C` not covered
//~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with
//~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
//~| NOTE the matched value is of type `&&mut &E`
} }
enum Opt { enum Opt {
//~^ `Opt` defined here //~^ NOTE
//~| `Opt` defined here //~| NOTE
Some(u8), Some(u8),
None, None,
//~^ not covered //~^ NOTE `Opt` defined here
//~| NOTE `Opt` defined here
//~| NOTE not covered
//~| NOTE not covered
} }
fn ref_pat(e: Opt) { fn ref_pat(e: Opt) {
match e {//~ ERROR non-exhaustive patterns: `None` not covered match e {//~ ERROR non-exhaustive patterns: `None` not covered
//~^ NOTE pattern `None` not covered
//~| NOTE the matched value is of type `Opt`
Opt::Some(ref _x) => {} Opt::Some(ref _x) => {}
} }
let Opt::Some(ref _x) = e; //~ ERROR refutable pattern in local binding: `None` not covered let Opt::Some(ref _x) = e; //~ ERROR refutable pattern in local binding: `None` not covered
//~^ NOTE the matched value is of type `Opt`
//~| NOTE pattern `None` not covered
//~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with
//~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
} }
fn main() {} fn main() {}

View File

@ -1,50 +1,46 @@
error[E0004]: non-exhaustive patterns: `B` and `C` not covered error[E0004]: non-exhaustive patterns: `B` and `C` not covered
--> $DIR/non-exhaustive-defined-here.rs:32:11 --> $DIR/non-exhaustive-defined-here.rs:38:11
| |
LL | / enum E { LL | match e1 {
LL | | | ^^ patterns `B` and `C` not covered
LL | | |
LL | | note: `E` defined here
... | --> $DIR/non-exhaustive-defined-here.rs:14:5
LL | | B, |
| | - not covered LL | enum E {
... | | -
LL | | C
| | - not covered
... |
LL | |
LL | | }
| |_- `E` defined here
... ...
LL | match e1 { LL | B,
| ^^ patterns `B` and `C` not covered | ^ not covered
| ...
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms LL | C
| ^ not covered
= note: the matched value is of type `E` = note: the matched value is of type `E`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ E::A => {}
LL + B | C => todo!()
|
error[E0005]: refutable pattern in local binding: `B` and `C` not covered error[E0005]: refutable pattern in local binding: `B` and `C` not covered
--> $DIR/non-exhaustive-defined-here.rs:36:9 --> $DIR/non-exhaustive-defined-here.rs:44:9
| |
LL | / enum E { LL | let E::A = e;
LL | | | ^^^^ patterns `B` and `C` not covered
LL | |
LL | |
... |
LL | | B,
| | - not covered
... |
LL | | C
| | - not covered
... |
LL | |
LL | | }
| |_- `E` defined here
...
LL | let E::A = e;
| ^^^^ patterns `B` and `C` not covered
| |
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `E` defined here
--> $DIR/non-exhaustive-defined-here.rs:14:5
|
LL | enum E {
| -
...
LL | B,
| ^ not covered
...
LL | C
| ^ not covered
= note: the matched value is of type `E` = note: the matched value is of type `E`
help: you might want to use `if let` to ignore the variant that isn't matched help: you might want to use `if let` to ignore the variant that isn't matched
| |
@ -52,52 +48,48 @@ LL | if let E::A = e { /* */ }
| ~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0004]: non-exhaustive patterns: `&B` and `&C` not covered error[E0004]: non-exhaustive patterns: `&B` and `&C` not covered
--> $DIR/non-exhaustive-defined-here.rs:40:11 --> $DIR/non-exhaustive-defined-here.rs:52:11
| |
LL | / enum E { LL | match e {
LL | | | ^ patterns `&B` and `&C` not covered
LL | | |
LL | | note: `E` defined here
... | --> $DIR/non-exhaustive-defined-here.rs:14:5
LL | | B, |
| | - not covered LL | enum E {
... | | -
LL | | C
| | - not covered
... |
LL | |
LL | | }
| |_- `E` defined here
... ...
LL | match e { LL | B,
| ^ patterns `&B` and `&C` not covered | ^ not covered
| ...
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms LL | C
| ^ not covered
= note: the matched value is of type `&E` = note: the matched value is of type `&E`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ E::A => {}
LL + &B | &C => todo!()
|
error[E0005]: refutable pattern in local binding: `&B` and `&C` not covered error[E0005]: refutable pattern in local binding: `&B` and `&C` not covered
--> $DIR/non-exhaustive-defined-here.rs:44:9 --> $DIR/non-exhaustive-defined-here.rs:58:9
| |
LL | / enum E { LL | let E::A = e;
LL | | | ^^^^ patterns `&B` and `&C` not covered
LL | |
LL | |
... |
LL | | B,
| | - not covered
... |
LL | | C
| | - not covered
... |
LL | |
LL | | }
| |_- `E` defined here
...
LL | let E::A = e;
| ^^^^ patterns `&B` and `&C` not covered
| |
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `E` defined here
--> $DIR/non-exhaustive-defined-here.rs:14:5
|
LL | enum E {
| -
...
LL | B,
| ^ not covered
...
LL | C
| ^ not covered
= note: the matched value is of type `&E` = note: the matched value is of type `&E`
help: you might want to use `if let` to ignore the variant that isn't matched help: you might want to use `if let` to ignore the variant that isn't matched
| |
@ -105,52 +97,48 @@ LL | if let E::A = e { /* */ }
| ~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0004]: non-exhaustive patterns: `&&mut &B` and `&&mut &C` not covered error[E0004]: non-exhaustive patterns: `&&mut &B` and `&&mut &C` not covered
--> $DIR/non-exhaustive-defined-here.rs:48:11 --> $DIR/non-exhaustive-defined-here.rs:66:11
| |
LL | / enum E { LL | match e {
LL | | | ^ patterns `&&mut &B` and `&&mut &C` not covered
LL | | |
LL | | note: `E` defined here
... | --> $DIR/non-exhaustive-defined-here.rs:14:5
LL | | B, |
| | - not covered LL | enum E {
... | | -
LL | | C
| | - not covered
... |
LL | |
LL | | }
| |_- `E` defined here
... ...
LL | match e { LL | B,
| ^ patterns `&&mut &B` and `&&mut &C` not covered | ^ not covered
| ...
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms LL | C
| ^ not covered
= note: the matched value is of type `&&mut &E` = note: the matched value is of type `&&mut &E`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ E::A => {}
LL + &&mut &B | &&mut &C => todo!()
|
error[E0005]: refutable pattern in local binding: `&&mut &B` and `&&mut &C` not covered error[E0005]: refutable pattern in local binding: `&&mut &B` and `&&mut &C` not covered
--> $DIR/non-exhaustive-defined-here.rs:52:9 --> $DIR/non-exhaustive-defined-here.rs:72:9
| |
LL | / enum E { LL | let E::A = e;
LL | | | ^^^^ patterns `&&mut &B` and `&&mut &C` not covered
LL | |
LL | |
... |
LL | | B,
| | - not covered
... |
LL | | C
| | - not covered
... |
LL | |
LL | | }
| |_- `E` defined here
...
LL | let E::A = e;
| ^^^^ patterns `&&mut &B` and `&&mut &C` not covered
| |
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `E` defined here
--> $DIR/non-exhaustive-defined-here.rs:14:5
|
LL | enum E {
| -
...
LL | B,
| ^ not covered
...
LL | C
| ^ not covered
= note: the matched value is of type `&&mut &E` = note: the matched value is of type `&&mut &E`
help: you might want to use `if let` to ignore the variant that isn't matched help: you might want to use `if let` to ignore the variant that isn't matched
| |
@ -158,42 +146,42 @@ LL | if let E::A = e { /* */ }
| |
error[E0004]: non-exhaustive patterns: `None` not covered error[E0004]: non-exhaustive patterns: `None` not covered
--> $DIR/non-exhaustive-defined-here.rs:65:11 --> $DIR/non-exhaustive-defined-here.rs:92:11
| |
LL | / enum Opt { LL | match e {
LL | | | ^ pattern `None` not covered
LL | | |
LL | | Some(u8), note: `Opt` defined here
LL | | None, --> $DIR/non-exhaustive-defined-here.rs:84:5
| | ---- not covered |
LL | | LL | enum Opt {
LL | | } | ---
| |_- `Opt` defined here
... ...
LL | match e { LL | None,
| ^ pattern `None` not covered | ^^^^ 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 `Opt` = note: the matched value is of type `Opt`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ Opt::Some(ref _x) => {}
LL + None => todo!()
|
error[E0005]: refutable pattern in local binding: `None` not covered error[E0005]: refutable pattern in local binding: `None` not covered
--> $DIR/non-exhaustive-defined-here.rs:69:9 --> $DIR/non-exhaustive-defined-here.rs:98:9
| |
LL | / enum Opt { LL | let Opt::Some(ref _x) = e;
LL | | | ^^^^^^^^^^^^^^^^^ pattern `None` not covered
LL | |
LL | | Some(u8),
LL | | None,
| | ---- not covered
LL | |
LL | | }
| |_- `Opt` defined here
...
LL | let Opt::Some(ref _x) = e;
| ^^^^^^^^^^^^^^^^^ pattern `None` not covered
| |
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Opt` defined here
--> $DIR/non-exhaustive-defined-here.rs:84:5
|
LL | enum Opt {
| ---
...
LL | None,
| ^^^^ not covered
= note: the matched value is of type `Opt` = note: the matched value is of type `Opt`
help: you might want to use `if let` to ignore the variant that isn't matched help: you might want to use `if let` to ignore the variant that isn't matched
| |

View File

@ -4,23 +4,30 @@ error[E0004]: non-exhaustive patterns: `(Some(&[]), Err(_))` not covered
LL | match (l1, l2) { LL | match (l1, l2) {
| ^^^^^^^^ pattern `(Some(&[]), Err(_))` not covered | ^^^^^^^^ pattern `(Some(&[]), Err(_))` 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<&[T]>, Result<&[T], ()>)` = note: the matched value is of type `(Option<&[T]>, Result<&[T], ()>)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ (None, Ok(&[_, _, ..])) => "None, Ok(at least two elements)",
LL + (Some(&[]), Err(_)) => todo!()
|
error[E0004]: non-exhaustive patterns: `A(C)` not covered error[E0004]: non-exhaustive patterns: `A(C)` not covered
--> $DIR/non-exhaustive-match-nested.rs:15:11 --> $DIR/non-exhaustive-match-nested.rs:15:11
| |
LL | enum T { A(U), B }
| ------------------
| | |
| | not covered
| `T` defined here
...
LL | match x { LL | match x {
| ^ pattern `A(C)` not covered | ^ pattern `A(C)` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `T` defined here
--> $DIR/non-exhaustive-match-nested.rs:1:10
|
LL | enum T { A(U), B }
| - ^ not covered
= note: the matched value is of type `T` = note: the matched value is of type `T`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ T::B => { panic!("goodbye"); }
LL + A(C) => todo!()
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -1,17 +1,19 @@
error[E0004]: non-exhaustive patterns: `A` not covered error[E0004]: non-exhaustive patterns: `A` not covered
--> $DIR/non-exhaustive-match.rs:7:11 --> $DIR/non-exhaustive-match.rs:7:11
| |
LL | enum T { A, B }
| ---------------
| | |
| | not covered
| `T` defined here
...
LL | match x { T::B => { } } LL | match x { T::B => { } }
| ^ pattern `A` not covered | ^ pattern `A` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `T` defined here
--> $DIR/non-exhaustive-match.rs:3:10
|
LL | enum T { A, B }
| - ^ not covered
= note: the matched value is of type `T` = note: the matched value is of type `T`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL | match x { T::B => { } A => todo!() }
| ++++++++++++
error[E0004]: non-exhaustive patterns: `false` not covered error[E0004]: non-exhaustive patterns: `false` not covered
--> $DIR/non-exhaustive-match.rs:8:11 --> $DIR/non-exhaustive-match.rs:8:11
@ -19,8 +21,12 @@ error[E0004]: non-exhaustive patterns: `false` not covered
LL | match true { LL | match true {
| ^^^^ pattern `false` not covered | ^^^^ pattern `false` 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 `bool` = note: the matched value is of type `bool`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ true => {}
LL + false => todo!()
|
error[E0004]: non-exhaustive patterns: `Some(_)` not covered error[E0004]: non-exhaustive patterns: `Some(_)` not covered
--> $DIR/non-exhaustive-match.rs:11:11 --> $DIR/non-exhaustive-match.rs:11:11
@ -28,13 +34,24 @@ error[E0004]: non-exhaustive patterns: `Some(_)` not covered
LL | match Some(10) { LL | match Some(10) {
| ^^^^^^^^ pattern `Some(_)` not covered | ^^^^^^^^ pattern `Some(_)` not covered
| |
::: $SRC_DIR/core/src/option.rs:LL:COL note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
| |
LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), LL | / pub enum Option<T> {
| ---- not covered LL | | /// No value.
| LL | | #[lang = "None"]
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms LL | | #[stable(feature = "rust1", since = "1.0.0")]
... |
LL | | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
| | ^^^^ not covered
LL | | }
| |_-
= note: the matched value is of type `Option<i32>` = note: the matched value is of type `Option<i32>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ None => {}
LL + Some(_) => todo!()
|
error[E0004]: non-exhaustive patterns: `(_, _, i32::MIN..=3_i32)` and `(_, _, 5_i32..=i32::MAX)` not covered error[E0004]: non-exhaustive patterns: `(_, _, i32::MIN..=3_i32)` and `(_, _, 5_i32..=i32::MAX)` not covered
--> $DIR/non-exhaustive-match.rs:14:11 --> $DIR/non-exhaustive-match.rs:14:11
@ -42,8 +59,12 @@ error[E0004]: non-exhaustive patterns: `(_, _, i32::MIN..=3_i32)` and `(_, _, 5_
LL | match (2, 3, 4) { LL | match (2, 3, 4) {
| ^^^^^^^^^ patterns `(_, _, i32::MIN..=3_i32)` and `(_, _, 5_i32..=i32::MAX)` not covered | ^^^^^^^^^ patterns `(_, _, i32::MIN..=3_i32)` and `(_, _, 5_i32..=i32::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 `(i32, i32, i32)` = note: the matched value is of type `(i32, i32, i32)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ (_, _, 4) => {}
LL + (_, _, i32::MIN..=3_i32) | (_, _, 5_i32..=i32::MAX) => todo!()
|
error[E0004]: non-exhaustive patterns: `(A, A)` and `(B, B)` not covered error[E0004]: non-exhaustive patterns: `(A, A)` and `(B, B)` not covered
--> $DIR/non-exhaustive-match.rs:18:11 --> $DIR/non-exhaustive-match.rs:18:11
@ -51,23 +72,30 @@ error[E0004]: non-exhaustive patterns: `(A, A)` and `(B, B)` not covered
LL | match (T::A, T::A) { LL | match (T::A, T::A) {
| ^^^^^^^^^^^^ patterns `(A, A)` and `(B, B)` not covered | ^^^^^^^^^^^^ patterns `(A, A)` and `(B, B)` 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 `(T, T)` = note: the matched value is of type `(T, T)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ (T::B, T::A) => {}
LL + (A, A) | (B, B) => todo!()
|
error[E0004]: non-exhaustive patterns: `B` not covered error[E0004]: non-exhaustive patterns: `B` not covered
--> $DIR/non-exhaustive-match.rs:22:11 --> $DIR/non-exhaustive-match.rs:22:11
| |
LL | enum T { A, B }
| ---------------
| | |
| | not covered
| `T` defined here
...
LL | match T::A { LL | match T::A {
| ^^^^ pattern `B` not covered | ^^^^ pattern `B` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `T` defined here
--> $DIR/non-exhaustive-match.rs:3:13
|
LL | enum T { A, B }
| - ^ not covered
= note: the matched value is of type `T` = note: the matched value is of type `T`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ T::A => {}
LL + B => todo!()
|
error[E0004]: non-exhaustive patterns: `[]` not covered error[E0004]: non-exhaustive patterns: `[]` not covered
--> $DIR/non-exhaustive-match.rs:33:11 --> $DIR/non-exhaustive-match.rs:33:11
@ -75,8 +103,12 @@ error[E0004]: non-exhaustive patterns: `[]` not covered
LL | match *vec { LL | match *vec {
| ^^^^ pattern `[]` not covered | ^^^^ pattern `[]` 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<isize>]` = note: the matched value is of type `[Option<isize>]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [None] => {}
LL + [] => todo!()
|
error[E0004]: non-exhaustive patterns: `[_, _, _, _, ..]` not covered error[E0004]: non-exhaustive patterns: `[_, _, _, _, ..]` not covered
--> $DIR/non-exhaustive-match.rs:46:11 --> $DIR/non-exhaustive-match.rs:46:11
@ -84,8 +116,12 @@ error[E0004]: non-exhaustive patterns: `[_, _, _, _, ..]` not covered
LL | match *vec { LL | match *vec {
| ^^^^ pattern `[_, _, _, _, ..]` not covered | ^^^^ pattern `[_, _, _, _, ..]` 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 `[f32]` = note: the matched value is of type `[f32]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [] => (),
LL + [_, _, _, _, ..] => todo!()
|
error: aborting due to 8 previous errors error: aborting due to 8 previous errors

View File

@ -1,83 +1,102 @@
error[E0004]: non-exhaustive patterns: `Foo { first: false, second: Some([_, _, _, _]) }` not covered error[E0004]: non-exhaustive patterns: `Foo { first: false, second: Some([_, _, _, _]) }` not covered
--> $DIR/non-exhaustive-pattern-witness.rs:7:11 --> $DIR/non-exhaustive-pattern-witness.rs:7:11
| |
LL | / struct Foo { LL | match (Foo { first: true, second: None }) {
LL | | first: bool, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo { first: false, second: Some([_, _, _, _]) }` not covered
LL | | second: Option<[usize; 4]>
LL | | }
| |_- `Foo` defined here
...
LL | match (Foo { first: true, second: None }) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo { first: false, second: Some([_, _, _, _]) }` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Foo` defined here
--> $DIR/non-exhaustive-pattern-witness.rs:1:8
|
LL | struct Foo {
| ^^^
= note: the matched value is of type `Foo` = note: the matched value is of type `Foo`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ Foo { first: false, second: Some([1, 2, 3, 4]) } => (),
LL + Foo { first: false, second: Some([_, _, _, _]) } => todo!()
|
error[E0004]: non-exhaustive patterns: `Red` not covered error[E0004]: non-exhaustive patterns: `Red` not covered
--> $DIR/non-exhaustive-pattern-witness.rs:23:11 --> $DIR/non-exhaustive-pattern-witness.rs:23:11
| |
LL | / enum Color { LL | match Color::Red {
LL | | Red, | ^^^^^^^^^^ pattern `Red` not covered
| | --- not covered
LL | | Green,
LL | | CustomRGBA { a: bool, r: u8, g: u8, b: u8 }
LL | | }
| |_- `Color` defined here
...
LL | match Color::Red {
| ^^^^^^^^^^ pattern `Red` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Color` defined here
--> $DIR/non-exhaustive-pattern-witness.rs:17:5
|
LL | enum Color {
| -----
LL | Red,
| ^^^ not covered
= note: the matched value is of type `Color` = note: the matched value is of type `Color`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ Color::Green => (),
LL + Red => todo!()
|
error[E0004]: non-exhaustive patterns: `East`, `South` and `West` not covered error[E0004]: non-exhaustive patterns: `East`, `South` and `West` not covered
--> $DIR/non-exhaustive-pattern-witness.rs:35:11 --> $DIR/non-exhaustive-pattern-witness.rs:35:11
| |
LL | / enum Direction { LL | match Direction::North {
LL | | North, East, South, West | ^^^^^^^^^^^^^^^^ patterns `East`, `South` and `West` not covered
| | ---- ----- ---- not covered
| | | |
| | | not covered
| | not covered
LL | | }
| |_- `Direction` defined here
...
LL | match Direction::North {
| ^^^^^^^^^^^^^^^^ patterns `East`, `South` and `West` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Direction` defined here
--> $DIR/non-exhaustive-pattern-witness.rs:31:12
|
LL | enum Direction {
| ---------
LL | North, East, South, West
| ^^^^ ^^^^^ ^^^^ not covered
| | |
| | not covered
| not covered
= note: the matched value is of type `Direction` = note: the matched value is of type `Direction`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ Direction::North => (),
LL + East | South | West => todo!()
|
error[E0004]: non-exhaustive patterns: `Second`, `Third`, `Fourth` and 8 more not covered error[E0004]: non-exhaustive patterns: `Second`, `Third`, `Fourth` and 8 more not covered
--> $DIR/non-exhaustive-pattern-witness.rs:46:11 --> $DIR/non-exhaustive-pattern-witness.rs:46:11
| |
LL | / enum ExcessiveEnum { LL | match ExcessiveEnum::First {
LL | | First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth, Eleventh, Twelfth | ^^^^^^^^^^^^^^^^^^^^ patterns `Second`, `Third`, `Fourth` and 8 more not covered
LL | | }
| |_- `ExcessiveEnum` defined here
...
LL | match ExcessiveEnum::First {
| ^^^^^^^^^^^^^^^^^^^^ patterns `Second`, `Third`, `Fourth` and 8 more not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `ExcessiveEnum` defined here
--> $DIR/non-exhaustive-pattern-witness.rs:41:6
|
LL | enum ExcessiveEnum {
| ^^^^^^^^^^^^^
= note: the matched value is of type `ExcessiveEnum` = note: the matched value is of type `ExcessiveEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ ExcessiveEnum::First => (),
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `CustomRGBA { a: true, .. }` not covered error[E0004]: non-exhaustive patterns: `CustomRGBA { a: true, .. }` not covered
--> $DIR/non-exhaustive-pattern-witness.rs:54:11 --> $DIR/non-exhaustive-pattern-witness.rs:54:11
| |
LL | / enum Color { LL | match Color::Red {
LL | | Red, | ^^^^^^^^^^ pattern `CustomRGBA { a: true, .. }` not covered
LL | | Green,
LL | | CustomRGBA { a: bool, r: u8, g: u8, b: u8 }
| | ---------- not covered
LL | | }
| |_- `Color` defined here
...
LL | match Color::Red {
| ^^^^^^^^^^ pattern `CustomRGBA { a: true, .. }` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Color` defined here
--> $DIR/non-exhaustive-pattern-witness.rs:19:5
|
LL | enum Color {
| -----
...
LL | CustomRGBA { a: bool, r: u8, g: u8, b: u8 }
| ^^^^^^^^^^ not covered
= note: the matched value is of type `Color` = note: the matched value is of type `Color`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ Color::CustomRGBA { a: false, r: _, g: _, b: _ } => (),
LL + CustomRGBA { a: true, .. } => todo!()
|
error[E0004]: non-exhaustive patterns: `[Second(true), Second(false)]` not covered error[E0004]: non-exhaustive patterns: `[Second(true), Second(false)]` not covered
--> $DIR/non-exhaustive-pattern-witness.rs:70:11 --> $DIR/non-exhaustive-pattern-witness.rs:70:11
@ -85,8 +104,12 @@ error[E0004]: non-exhaustive patterns: `[Second(true), Second(false)]` not cover
LL | match *x { LL | match *x {
| ^^ pattern `[Second(true), Second(false)]` not covered | ^^ pattern `[Second(true), Second(false)]` 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 `[Enum]` = note: the matched value is of type `[Enum]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [_, _, ref tail @ .., _] => (),
LL + [Second(true), Second(false)] => todo!()
|
error[E0004]: non-exhaustive patterns: `((), false)` not covered error[E0004]: non-exhaustive patterns: `((), false)` not covered
--> $DIR/non-exhaustive-pattern-witness.rs:83:11 --> $DIR/non-exhaustive-pattern-witness.rs:83:11
@ -94,8 +117,12 @@ error[E0004]: non-exhaustive patterns: `((), false)` not covered
LL | match ((), false) { LL | match ((), false) {
| ^^^^^^^^^^^ pattern `((), false)` not covered | ^^^^^^^^^^^ pattern `((), false)` 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 `((), bool)` = note: the matched value is of type `((), bool)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ ((), true) => (),
LL + ((), false) => todo!()
|
error: aborting due to 7 previous errors error: aborting due to 7 previous errors

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `&[false, _]` not covered
LL | match s2 { LL | match s2 {
| ^^ pattern `&[false, _]` not covered | ^^ pattern `&[false, _]` 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 `&[bool; 2]` = note: the matched value is of type `&[bool; 2]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [true, .., true] => {}
LL + &[false, _] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[false, ..]` not covered error[E0004]: non-exhaustive patterns: `&[false, ..]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:12:11 --> $DIR/slice-patterns-exhaustiveness.rs:12:11
@ -13,8 +17,12 @@ error[E0004]: non-exhaustive patterns: `&[false, ..]` not covered
LL | match s3 { LL | match s3 {
| ^^ pattern `&[false, ..]` not covered | ^^ pattern `&[false, ..]` 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 `&[bool; 3]` = note: the matched value is of type `&[bool; 3]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [true, .., true] => {}
LL + &[false, ..] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[false, ..]` not covered error[E0004]: non-exhaustive patterns: `&[false, ..]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:16:11 --> $DIR/slice-patterns-exhaustiveness.rs:16:11
@ -22,8 +30,12 @@ error[E0004]: non-exhaustive patterns: `&[false, ..]` not covered
LL | match s10 { LL | match s10 {
| ^^^ pattern `&[false, ..]` not covered | ^^^ pattern `&[false, ..]` 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 `&[bool; 10]` = note: the matched value is of type `&[bool; 10]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [true, .., true] => {}
LL + &[false, ..] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[false, true]` not covered error[E0004]: non-exhaustive patterns: `&[false, true]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:25:11 --> $DIR/slice-patterns-exhaustiveness.rs:25:11
@ -31,8 +43,12 @@ error[E0004]: non-exhaustive patterns: `&[false, true]` not covered
LL | match s2 { LL | match s2 {
| ^^ pattern `&[false, true]` not covered | ^^ pattern `&[false, true]` 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 `&[bool; 2]` = note: the matched value is of type `&[bool; 2]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [.., false] => {}
LL + &[false, true] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[false, .., true]` not covered error[E0004]: non-exhaustive patterns: `&[false, .., true]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:30:11 --> $DIR/slice-patterns-exhaustiveness.rs:30:11
@ -40,8 +56,12 @@ error[E0004]: non-exhaustive patterns: `&[false, .., true]` not covered
LL | match s3 { LL | match s3 {
| ^^ pattern `&[false, .., true]` not covered | ^^ pattern `&[false, .., true]` 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 `&[bool; 3]` = note: the matched value is of type `&[bool; 3]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [.., false] => {}
LL + &[false, .., true] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[false, .., true]` not covered error[E0004]: non-exhaustive patterns: `&[false, .., true]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:35:11 --> $DIR/slice-patterns-exhaustiveness.rs:35:11
@ -49,8 +69,12 @@ error[E0004]: non-exhaustive patterns: `&[false, .., true]` not covered
LL | match s { LL | match s {
| ^ pattern `&[false, .., true]` not covered | ^ pattern `&[false, .., true]` 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 `&[bool]` = note: the matched value is of type `&[bool]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [.., false] => {}
LL + &[false, .., true] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:42:11 --> $DIR/slice-patterns-exhaustiveness.rs:42:11
@ -58,8 +82,12 @@ error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
LL | match s { LL | match s {
| ^ pattern `&[_, ..]` not covered | ^ pattern `&[_, ..]` 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 `&[bool]` = note: the matched value is of type `&[bool]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [] => {}
LL + &[_, ..] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[_, _, ..]` not covered error[E0004]: non-exhaustive patterns: `&[_, _, ..]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:46:11 --> $DIR/slice-patterns-exhaustiveness.rs:46:11
@ -67,8 +95,12 @@ error[E0004]: non-exhaustive patterns: `&[_, _, ..]` not covered
LL | match s { LL | match s {
| ^ pattern `&[_, _, ..]` not covered | ^ pattern `&[_, _, ..]` 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 `&[bool]` = note: the matched value is of type `&[bool]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [_] => {}
LL + &[_, _, ..] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[false, ..]` not covered error[E0004]: non-exhaustive patterns: `&[false, ..]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:51:11 --> $DIR/slice-patterns-exhaustiveness.rs:51:11
@ -76,8 +108,12 @@ error[E0004]: non-exhaustive patterns: `&[false, ..]` not covered
LL | match s { LL | match s {
| ^ pattern `&[false, ..]` not covered | ^ pattern `&[false, ..]` 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 `&[bool]` = note: the matched value is of type `&[bool]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [true, ..] => {}
LL + &[false, ..] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[false, _, ..]` not covered error[E0004]: non-exhaustive patterns: `&[false, _, ..]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:56:11 --> $DIR/slice-patterns-exhaustiveness.rs:56:11
@ -85,8 +121,12 @@ error[E0004]: non-exhaustive patterns: `&[false, _, ..]` not covered
LL | match s { LL | match s {
| ^ pattern `&[false, _, ..]` not covered | ^ pattern `&[false, _, ..]` 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 `&[bool]` = note: the matched value is of type `&[bool]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [true, ..] => {}
LL + &[false, _, ..] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[_, .., false]` not covered error[E0004]: non-exhaustive patterns: `&[_, .., false]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:62:11 --> $DIR/slice-patterns-exhaustiveness.rs:62:11
@ -94,8 +134,12 @@ error[E0004]: non-exhaustive patterns: `&[_, .., false]` not covered
LL | match s { LL | match s {
| ^ pattern `&[_, .., false]` not covered | ^ pattern `&[_, .., false]` 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 `&[bool]` = note: the matched value is of type `&[bool]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [.., true] => {}
LL + &[_, .., false] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[_, _, .., true]` not covered error[E0004]: non-exhaustive patterns: `&[_, _, .., true]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:69:11 --> $DIR/slice-patterns-exhaustiveness.rs:69:11
@ -103,8 +147,12 @@ error[E0004]: non-exhaustive patterns: `&[_, _, .., true]` not covered
LL | match s { LL | match s {
| ^ pattern `&[_, _, .., true]` not covered | ^ pattern `&[_, _, .., true]` 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 `&[bool]` = note: the matched value is of type `&[bool]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [.., false] => {}
LL + &[_, _, .., true] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[true, _, .., _]` not covered error[E0004]: non-exhaustive patterns: `&[true, _, .., _]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:76:11 --> $DIR/slice-patterns-exhaustiveness.rs:76:11
@ -112,8 +160,12 @@ error[E0004]: non-exhaustive patterns: `&[true, _, .., _]` not covered
LL | match s { LL | match s {
| ^ pattern `&[true, _, .., _]` not covered | ^ pattern `&[true, _, .., _]` 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 `&[bool]` = note: the matched value is of type `&[bool]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [false, .., false] => {}
LL + &[true, _, .., _] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:85:11 --> $DIR/slice-patterns-exhaustiveness.rs:85:11
@ -121,8 +173,12 @@ error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
LL | match s { LL | match s {
| ^ patterns `&[]` and `&[_, _, ..]` not covered | ^ patterns `&[]` and `&[_, _, ..]` 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 `&[bool]` = note: the matched value is of type `&[bool]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ &[true] => {}
LL + &[] | &[_, _, ..] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:89:11 --> $DIR/slice-patterns-exhaustiveness.rs:89:11
@ -130,8 +186,12 @@ error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
LL | match s { LL | match s {
| ^ patterns `&[]` and `&[_, _, ..]` not covered | ^ patterns `&[]` and `&[_, _, ..]` 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 `&[bool]` = note: the matched value is of type `&[bool]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ CONST => {}
LL + &[] | &[_, _, ..] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:93:11 --> $DIR/slice-patterns-exhaustiveness.rs:93:11
@ -139,8 +199,12 @@ error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
LL | match s { LL | match s {
| ^ patterns `&[]` and `&[_, _, ..]` not covered | ^ patterns `&[]` and `&[_, _, ..]` 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 `&[bool]` = note: the matched value is of type `&[bool]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ &[false] => {}
LL + &[] | &[_, _, ..] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:98:11 --> $DIR/slice-patterns-exhaustiveness.rs:98:11
@ -148,8 +212,12 @@ error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
LL | match s { LL | match s {
| ^ patterns `&[]` and `&[_, _, ..]` not covered | ^ patterns `&[]` and `&[_, _, ..]` 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 `&[bool]` = note: the matched value is of type `&[bool]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ CONST => {}
LL + &[] | &[_, _, ..] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[_, _, ..]` not covered error[E0004]: non-exhaustive patterns: `&[_, _, ..]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:103:11 --> $DIR/slice-patterns-exhaustiveness.rs:103:11
@ -157,8 +225,12 @@ error[E0004]: non-exhaustive patterns: `&[_, _, ..]` not covered
LL | match s { LL | match s {
| ^ pattern `&[_, _, ..]` not covered | ^ pattern `&[_, _, ..]` 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 `&[bool]` = note: the matched value is of type `&[bool]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ CONST => {}
LL + &[_, _, ..] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[false]` not covered error[E0004]: non-exhaustive patterns: `&[false]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:108:11 --> $DIR/slice-patterns-exhaustiveness.rs:108:11
@ -166,8 +238,12 @@ error[E0004]: non-exhaustive patterns: `&[false]` not covered
LL | match s { LL | match s {
| ^ pattern `&[false]` not covered | ^ pattern `&[false]` 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 `&[bool]` = note: the matched value is of type `&[bool]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ &[_, _, ..] => {}
LL + &[false] => todo!()
|
error[E0004]: non-exhaustive patterns: `&[false]` not covered error[E0004]: non-exhaustive patterns: `&[false]` not covered
--> $DIR/slice-patterns-exhaustiveness.rs:121:11 --> $DIR/slice-patterns-exhaustiveness.rs:121:11
@ -175,8 +251,12 @@ error[E0004]: non-exhaustive patterns: `&[false]` not covered
LL | match s1 { LL | match s1 {
| ^^ pattern `&[false]` not covered | ^^ pattern `&[false]` 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 `&[bool; 1]` = note: the matched value is of type `&[bool; 1]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ CONST1 => {}
LL + &[false] => todo!()
|
error: aborting due to 20 previous errors error: aborting due to 20 previous errors

View File

@ -4,13 +4,25 @@ error[E0004]: non-exhaustive patterns: `Stable2` and `_` not covered
LL | match Foo::Stable { LL | match Foo::Stable {
| ^^^^^^^^^^^ patterns `Stable2` and `_` not covered | ^^^^^^^^^^^ patterns `Stable2` and `_` not covered
| |
::: $DIR/auxiliary/unstable.rs:9:5 note: `Foo` defined here
--> $DIR/auxiliary/unstable.rs:9:5
| |
LL | Stable2, LL | / pub enum Foo {
| ------- not covered LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")]
| LL | | Stable,
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")]
LL | | Stable2,
| | ^^^^^^^ not covered
LL | | #[unstable(feature = "unstable_test_feature", issue = "none")]
LL | | Unstable,
LL | | }
| |_-
= note: the matched value is of type `Foo` = note: the matched value is of type `Foo`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ Foo::Stable => {}
LL + Stable2 | _ => todo!()
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/stable-gated-patterns.rs:13:11 --> $DIR/stable-gated-patterns.rs:13:11
@ -18,8 +30,23 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match Foo::Stable { LL | match Foo::Stable {
| ^^^^^^^^^^^ pattern `_` not covered | ^^^^^^^^^^^ pattern `_` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Foo` defined here
--> $DIR/auxiliary/unstable.rs:5:1
|
LL | / pub enum Foo {
LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")]
LL | | Stable,
LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")]
... |
LL | | Unstable,
LL | | }
| |_^
= note: the matched value is of type `Foo` = note: the matched value is of type `Foo`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ Foo::Stable2 => {}
LL + _ => todo!()
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -1,18 +1,22 @@
error[E0004]: non-exhaustive patterns: `B { x: Some(_) }` not covered error[E0004]: non-exhaustive patterns: `B { x: Some(_) }` not covered
--> $DIR/struct-like-enum-nonexhaustive.rs:8:11 --> $DIR/struct-like-enum-nonexhaustive.rs:8:11
| |
LL | / enum A { LL | match x {
LL | | B { x: Option<isize> }, | ^ pattern `B { x: Some(_) }` not covered
| | - not covered
LL | | C
LL | | }
| |_- `A` defined here
...
LL | match x {
| ^ pattern `B { x: Some(_) }` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `A` defined here
--> $DIR/struct-like-enum-nonexhaustive.rs:2:5
|
LL | enum A {
| -
LL | B { x: Option<isize> },
| ^ not covered
= note: the matched value is of type `A` = note: the matched value is of type `A`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ A::B { x: None } => {}
LL + B { x: Some(_) } => todo!()
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -1,14 +1,20 @@
error[E0004]: non-exhaustive patterns: `Foo(_, _)` not covered error[E0004]: non-exhaustive patterns: `Foo(_, _)` not covered
--> $DIR/tuple-struct-nonexhaustive.rs:5:11 --> $DIR/tuple-struct-nonexhaustive.rs:5:11
| |
LL | struct Foo(isize, isize);
| ------------------------- `Foo` defined here
...
LL | match x { LL | match x {
| ^ pattern `Foo(_, _)` not covered | ^ pattern `Foo(_, _)` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Foo` defined here
--> $DIR/tuple-struct-nonexhaustive.rs:1:8
|
LL | struct Foo(isize, isize);
| ^^^
= note: the matched value is of type `Foo` = note: the matched value is of type `Foo`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ Foo(2, b) => println!("{}", b)
LL + Foo(_, _) => todo!()
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
LL | match data { LL | match data {
| ^^^^ pattern `&[_, ..]` not covered | ^^^^ pattern `&[_, ..]` 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]` = note: the matched value is of type `&[u8]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ b"" => 1,
LL ~ &[_, ..] => todo!(),
|
error[E0004]: non-exhaustive patterns: `&[]`, `&[_]`, `&[_, _]` and 1 more not covered error[E0004]: non-exhaustive patterns: `&[]`, `&[_]`, `&[_, _]` and 1 more not covered
--> $DIR/type_polymorphic_byte_str_literals.rs:23:11 --> $DIR/type_polymorphic_byte_str_literals.rs:23:11
@ -13,8 +17,12 @@ error[E0004]: non-exhaustive patterns: `&[]`, `&[_]`, `&[_, _]` and 1 more not c
LL | match data { LL | match data {
| ^^^^ patterns `&[]`, `&[_]`, `&[_, _]` and 1 more not covered | ^^^^ patterns `&[]`, `&[_]`, `&[_, _]` and 1 more 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]` = note: the matched value is of type `&[u8]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
LL ~ [_, _, _] => 1,
LL ~ _ => todo!(),
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View File

@ -4,13 +4,24 @@ error[E0004]: non-exhaustive patterns: `Unstable` not covered
LL | match Foo::Stable { LL | match Foo::Stable {
| ^^^^^^^^^^^ pattern `Unstable` not covered | ^^^^^^^^^^^ pattern `Unstable` not covered
| |
::: $DIR/auxiliary/unstable.rs:11:5 note: `Foo` defined here
--> $DIR/auxiliary/unstable.rs:11:5
| |
LL | Unstable, LL | / pub enum Foo {
| -------- not covered LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")]
| LL | | Stable,
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms LL | | #[stable(feature = "stable_test_feature", since = "1.0.0")]
... |
LL | | Unstable,
| | ^^^^^^^^ not covered
LL | | }
| |_-
= note: the matched value is of type `Foo` = note: the matched value is of type `Foo`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ Foo::Stable2 => {}
LL + Unstable => todo!()
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,13 +4,20 @@ error[E0005]: refutable pattern in local binding: `Err(_)` not covered
LL | let Ok(x) = res; LL | let Ok(x) = res;
| ^^^^^ pattern `Err(_)` not covered | ^^^^^ pattern `Err(_)` not covered
| |
::: $SRC_DIR/core/src/result.rs:LL:COL
|
LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
| --- not covered
|
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Result<u32, &R>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
|
LL | / pub enum Result<T, E> {
LL | | /// Contains the success value
LL | | #[lang = "Ok"]
LL | | #[stable(feature = "rust1", since = "1.0.0")]
... |
LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
| | ^^^ not covered
LL | | }
| |_-
= note: the matched value is of type `Result<u32, &R>` = note: the matched value is of type `Result<u32, &R>`
help: you might want to use `if let` to ignore the variant that isn't matched help: you might want to use `if let` to ignore the variant that isn't matched
| |

View File

@ -4,8 +4,12 @@ error[E0004]: non-exhaustive patterns: `&[]` not covered
LL | match sl { LL | match sl {
| ^^ pattern `&[]` not covered | ^^ pattern `&[]` 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]` = note: the matched value is of type `&[u8]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ [first, remainder @ ..] => {}
LL ~ &[] => todo!(),
|
error: aborting due to previous error error: aborting due to previous error

View File

@ -4,8 +4,18 @@ error[E0004]: non-exhaustive patterns: type `EmptyNonExhaustiveEnum` is non-empt
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `EmptyNonExhaustiveEnum` defined here
--> $DIR/auxiliary/enums.rs:18:1
|
LL | pub enum EmptyNonExhaustiveEnum {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `EmptyNonExhaustiveEnum`, which is marked as non-exhaustive = note: the matched value is of type `EmptyNonExhaustiveEnum`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/enum.rs:16:11 --> $DIR/enum.rs:16:11
@ -13,8 +23,21 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match enum_unit { LL | match enum_unit {
| ^^^^^^^^^ pattern `_` not covered | ^^^^^^^^^ pattern `_` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonExhaustiveEnum` defined here
--> $DIR/auxiliary/enums.rs:4:1
|
LL | / pub enum NonExhaustiveEnum {
LL | | Unit,
LL | | Tuple(u32),
LL | | Struct { field: u32 },
LL | | }
| |_^
= note: the matched value is of type `NonExhaustiveEnum`, which is marked as non-exhaustive = note: the matched value is of type `NonExhaustiveEnum`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ NonExhaustiveEnum::Struct { .. } => "third",
LL + _ => todo!()
|
error[E0004]: non-exhaustive patterns: `_` not covered error[E0004]: non-exhaustive patterns: `_` not covered
--> $DIR/enum.rs:23:11 --> $DIR/enum.rs:23:11
@ -22,8 +45,22 @@ error[E0004]: non-exhaustive patterns: `_` not covered
LL | match enum_unit {}; LL | match enum_unit {};
| ^^^^^^^^^ pattern `_` not covered | ^^^^^^^^^ pattern `_` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonExhaustiveEnum` defined here
--> $DIR/auxiliary/enums.rs:4:1
|
LL | / pub enum NonExhaustiveEnum {
LL | | Unit,
LL | | Tuple(u32),
LL | | Struct { field: u32 },
LL | | }
| |_^
= note: the matched value is of type `NonExhaustiveEnum`, which is marked as non-exhaustive = note: the matched value is of type `NonExhaustiveEnum`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ match enum_unit {
LL + _ => todo!(),
LL ~ };
|
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -13,46 +13,56 @@ LL | #![deny(unreachable_patterns)]
error[E0004]: non-exhaustive patterns: `Unit`, `Tuple(_)` and `Struct { .. }` not covered error[E0004]: non-exhaustive patterns: `Unit`, `Tuple(_)` and `Struct { .. }` not covered
--> $DIR/enum_same_crate_empty_match.rs:33:11 --> $DIR/enum_same_crate_empty_match.rs:33:11
| |
LL | / pub enum NonExhaustiveEnum { LL | match NonExhaustiveEnum::Unit {}
LL | | Unit, | ^^^^^^^^^^^^^^^^^^^^^^^ patterns `Unit`, `Tuple(_)` and `Struct { .. }` not covered
| | ---- not covered
LL | |
LL | | Tuple(u32),
| | ----- not covered
LL | |
LL | | Struct { field: u32 }
| | ------ not covered
LL | |
LL | | }
| |_- `NonExhaustiveEnum` defined here
...
LL | match NonExhaustiveEnum::Unit {}
| ^^^^^^^^^^^^^^^^^^^^^^^ patterns `Unit`, `Tuple(_)` and `Struct { .. }` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NonExhaustiveEnum` defined here
--> $DIR/enum_same_crate_empty_match.rs:5:5
|
LL | pub enum NonExhaustiveEnum {
| -----------------
LL | Unit,
| ^^^^ not covered
LL |
LL | Tuple(u32),
| ^^^^^ not covered
LL |
LL | Struct { field: u32 }
| ^^^^^^ not covered
= note: the matched value is of type `NonExhaustiveEnum` = note: the matched value is of type `NonExhaustiveEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ match NonExhaustiveEnum::Unit {
LL + Unit | Tuple(_) | Struct { .. } => todo!(),
LL + }
|
error[E0004]: non-exhaustive patterns: `Unit`, `Tuple(_)` and `Struct { .. }` not covered error[E0004]: non-exhaustive patterns: `Unit`, `Tuple(_)` and `Struct { .. }` not covered
--> $DIR/enum_same_crate_empty_match.rs:35:11 --> $DIR/enum_same_crate_empty_match.rs:35:11
| |
LL | / pub enum NormalEnum { LL | match NormalEnum::Unit {}
LL | | Unit, | ^^^^^^^^^^^^^^^^ patterns `Unit`, `Tuple(_)` and `Struct { .. }` not covered
| | ---- not covered
LL | |
LL | | Tuple(u32),
| | ----- not covered
LL | |
LL | | Struct { field: u32 }
| | ------ not covered
LL | |
LL | | }
| |_- `NormalEnum` defined here
...
LL | match NormalEnum::Unit {}
| ^^^^^^^^^^^^^^^^ patterns `Unit`, `Tuple(_)` and `Struct { .. }` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `NormalEnum` defined here
--> $DIR/enum_same_crate_empty_match.rs:14:5
|
LL | pub enum NormalEnum {
| ----------
LL | Unit,
| ^^^^ not covered
LL |
LL | Tuple(u32),
| ^^^^^ not covered
LL |
LL | Struct { field: u32 }
| ^^^^^^ not covered
= note: the matched value is of type `NormalEnum` = note: the matched value is of type `NormalEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ match NormalEnum::Unit {
LL + Unit | Tuple(_) | Struct { .. } => todo!(),
LL + }
|
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -4,8 +4,18 @@ error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedEnum` is non-emp
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `IndirectUninhabitedEnum` defined here
--> $DIR/auxiliary/uninhabited.rs:26:1
|
LL | pub struct IndirectUninhabitedEnum(UninhabitedEnum);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedEnum` = note: the matched value is of type `IndirectUninhabitedEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedStruct` is non-empty error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedStruct` is non-empty
--> $DIR/indirect_match.rs:23:11 --> $DIR/indirect_match.rs:23:11
@ -13,8 +23,18 @@ error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedStruct` is non-e
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `IndirectUninhabitedStruct` defined here
--> $DIR/auxiliary/uninhabited.rs:28:1
|
LL | pub struct IndirectUninhabitedStruct(UninhabitedStruct);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedStruct` = note: the matched value is of type `IndirectUninhabitedStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedTupleStruct` is non-empty error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedTupleStruct` is non-empty
--> $DIR/indirect_match.rs:27:11 --> $DIR/indirect_match.rs:27:11
@ -22,8 +42,18 @@ error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedTupleStruct` is
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `IndirectUninhabitedTupleStruct` defined here
--> $DIR/auxiliary/uninhabited.rs:30:1
|
LL | pub struct IndirectUninhabitedTupleStruct(UninhabitedTupleStruct);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedTupleStruct` = note: the matched value is of type `IndirectUninhabitedTupleStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedVariants` is non-empty error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedVariants` is non-empty
--> $DIR/indirect_match.rs:33:11 --> $DIR/indirect_match.rs:33:11
@ -31,8 +61,18 @@ error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedVariants` is non
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `IndirectUninhabitedVariants` defined here
--> $DIR/auxiliary/uninhabited.rs:32:1
|
LL | pub struct IndirectUninhabitedVariants(UninhabitedVariants);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedVariants` = note: the matched value is of type `IndirectUninhabitedVariants`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View File

@ -1,50 +1,78 @@
error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedEnum` is non-empty error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedEnum` is non-empty
--> $DIR/indirect_match_same_crate.rs:34:11 --> $DIR/indirect_match_same_crate.rs:34:11
| |
LL | pub struct IndirectUninhabitedEnum(UninhabitedEnum);
| ---------------------------------------------------- `IndirectUninhabitedEnum` defined here
...
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `IndirectUninhabitedEnum` defined here
--> $DIR/indirect_match_same_crate.rs:20:12
|
LL | pub struct IndirectUninhabitedEnum(UninhabitedEnum);
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedEnum` = note: the matched value is of type `IndirectUninhabitedEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedStruct` is non-empty error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedStruct` is non-empty
--> $DIR/indirect_match_same_crate.rs:38:11 --> $DIR/indirect_match_same_crate.rs:38:11
| |
LL | pub struct IndirectUninhabitedStruct(UninhabitedStruct);
| -------------------------------------------------------- `IndirectUninhabitedStruct` defined here
...
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `IndirectUninhabitedStruct` defined here
--> $DIR/indirect_match_same_crate.rs:22:12
|
LL | pub struct IndirectUninhabitedStruct(UninhabitedStruct);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedStruct` = note: the matched value is of type `IndirectUninhabitedStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedTupleStruct` is non-empty error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedTupleStruct` is non-empty
--> $DIR/indirect_match_same_crate.rs:42:11 --> $DIR/indirect_match_same_crate.rs:42:11
| |
LL | pub struct IndirectUninhabitedTupleStruct(UninhabitedTupleStruct);
| ------------------------------------------------------------------ `IndirectUninhabitedTupleStruct` defined here
...
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `IndirectUninhabitedTupleStruct` defined here
--> $DIR/indirect_match_same_crate.rs:24:12
|
LL | pub struct IndirectUninhabitedTupleStruct(UninhabitedTupleStruct);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedTupleStruct` = note: the matched value is of type `IndirectUninhabitedTupleStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedVariants` is non-empty error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedVariants` is non-empty
--> $DIR/indirect_match_same_crate.rs:48:11 --> $DIR/indirect_match_same_crate.rs:48:11
| |
LL | pub struct IndirectUninhabitedVariants(UninhabitedVariants);
| ------------------------------------------------------------ `IndirectUninhabitedVariants` defined here
...
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `IndirectUninhabitedVariants` defined here
--> $DIR/indirect_match_same_crate.rs:26:12
|
LL | pub struct IndirectUninhabitedVariants(UninhabitedVariants);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedVariants` = note: the matched value is of type `IndirectUninhabitedVariants`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View File

@ -4,8 +4,18 @@ error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedEnum` is non-emp
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `IndirectUninhabitedEnum` defined here
--> $DIR/auxiliary/uninhabited.rs:26:1
|
LL | pub struct IndirectUninhabitedEnum(UninhabitedEnum);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedEnum` = note: the matched value is of type `IndirectUninhabitedEnum`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedStruct` is non-empty error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedStruct` is non-empty
--> $DIR/indirect_match_with_exhaustive_patterns.rs:27:11 --> $DIR/indirect_match_with_exhaustive_patterns.rs:27:11
@ -13,8 +23,18 @@ error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedStruct` is non-e
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `IndirectUninhabitedStruct` defined here
--> $DIR/auxiliary/uninhabited.rs:28:1
|
LL | pub struct IndirectUninhabitedStruct(UninhabitedStruct);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedStruct` = note: the matched value is of type `IndirectUninhabitedStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedTupleStruct` is non-empty error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedTupleStruct` is non-empty
--> $DIR/indirect_match_with_exhaustive_patterns.rs:31:11 --> $DIR/indirect_match_with_exhaustive_patterns.rs:31:11
@ -22,8 +42,18 @@ error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedTupleStruct` is
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `IndirectUninhabitedTupleStruct` defined here
--> $DIR/auxiliary/uninhabited.rs:30:1
|
LL | pub struct IndirectUninhabitedTupleStruct(UninhabitedTupleStruct);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedTupleStruct` = note: the matched value is of type `IndirectUninhabitedTupleStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedVariants` is non-empty error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedVariants` is non-empty
--> $DIR/indirect_match_with_exhaustive_patterns.rs:37:11 --> $DIR/indirect_match_with_exhaustive_patterns.rs:37:11
@ -31,8 +61,18 @@ error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedVariants` is non
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `IndirectUninhabitedVariants` defined here
--> $DIR/auxiliary/uninhabited.rs:32:1
|
LL | pub struct IndirectUninhabitedVariants(UninhabitedVariants);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `IndirectUninhabitedVariants` = note: the matched value is of type `IndirectUninhabitedVariants`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View File

@ -4,8 +4,19 @@ error[E0004]: non-exhaustive patterns: type `UninhabitedEnum` is non-empty
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `UninhabitedEnum` defined here
--> $DIR/auxiliary/uninhabited.rs:5:1
|
LL | / pub enum UninhabitedEnum {
LL | | }
| |_^
= note: the matched value is of type `UninhabitedEnum`, which is marked as non-exhaustive = note: the matched value is of type `UninhabitedEnum`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `UninhabitedStruct` is non-empty error[E0004]: non-exhaustive patterns: type `UninhabitedStruct` is non-empty
--> $DIR/match.rs:23:11 --> $DIR/match.rs:23:11
@ -13,8 +24,20 @@ error[E0004]: non-exhaustive patterns: type `UninhabitedStruct` is non-empty
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `UninhabitedStruct` defined here
--> $DIR/auxiliary/uninhabited.rs:9:1
|
LL | / pub struct UninhabitedStruct {
LL | | _priv: !,
LL | | }
| |_^
= note: the matched value is of type `UninhabitedStruct` = note: the matched value is of type `UninhabitedStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `UninhabitedTupleStruct` is non-empty error[E0004]: non-exhaustive patterns: type `UninhabitedTupleStruct` is non-empty
--> $DIR/match.rs:27:11 --> $DIR/match.rs:27:11
@ -22,8 +45,18 @@ error[E0004]: non-exhaustive patterns: type `UninhabitedTupleStruct` is non-empt
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `UninhabitedTupleStruct` defined here
--> $DIR/auxiliary/uninhabited.rs:14:1
|
LL | pub struct UninhabitedTupleStruct(!);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `UninhabitedTupleStruct` = note: the matched value is of type `UninhabitedTupleStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covered error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covered
--> $DIR/match.rs:31:11 --> $DIR/match.rs:31:11
@ -31,15 +64,23 @@ error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covere
LL | match x {} LL | match x {}
| ^ patterns `Tuple(_)` and `Struct { .. }` not covered | ^ patterns `Tuple(_)` and `Struct { .. }` not covered
| |
::: $DIR/auxiliary/uninhabited.rs:17:23 note: `UninhabitedVariants` defined here
--> $DIR/auxiliary/uninhabited.rs:17:23
| |
LL | #[non_exhaustive] Tuple(!), LL | / pub enum UninhabitedVariants {
| ----- not covered LL | | #[non_exhaustive] Tuple(!),
LL | #[non_exhaustive] Struct { x: ! } | | ^^^^^ not covered
| ------ not covered LL | | #[non_exhaustive] Struct { x: ! }
| | | ^^^^^^ not covered
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms LL | | }
| |_-
= note: the matched value is of type `UninhabitedVariants` = note: the matched value is of type `UninhabitedVariants`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ match x {
LL + Tuple(_) | Struct { .. } => todo!(),
LL ~ }
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View File

@ -1,45 +1,63 @@
error[E0004]: non-exhaustive patterns: type `UninhabitedStruct` is non-empty error[E0004]: non-exhaustive patterns: type `UninhabitedStruct` is non-empty
--> $DIR/match_same_crate.rs:30:11 --> $DIR/match_same_crate.rs:30:11
| |
LL | / pub struct UninhabitedStruct { LL | match x {}
LL | | _priv: !, | ^
LL | | }
| |_- `UninhabitedStruct` defined here
...
LL | match x {}
| ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `UninhabitedStruct` defined here
--> $DIR/match_same_crate.rs:8:12
|
LL | pub struct UninhabitedStruct {
| ^^^^^^^^^^^^^^^^^
= note: the matched value is of type `UninhabitedStruct` = note: the matched value is of type `UninhabitedStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `UninhabitedTupleStruct` is non-empty error[E0004]: non-exhaustive patterns: type `UninhabitedTupleStruct` is non-empty
--> $DIR/match_same_crate.rs:34:11 --> $DIR/match_same_crate.rs:34:11
| |
LL | pub struct UninhabitedTupleStruct(!);
| ------------------------------------- `UninhabitedTupleStruct` defined here
...
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `UninhabitedTupleStruct` defined here
--> $DIR/match_same_crate.rs:13:12
|
LL | pub struct UninhabitedTupleStruct(!);
| ^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `UninhabitedTupleStruct` = note: the matched value is of type `UninhabitedTupleStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covered error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covered
--> $DIR/match_same_crate.rs:38:11 --> $DIR/match_same_crate.rs:38:11
| |
LL | / pub enum UninhabitedVariants { LL | match x {}
LL | | #[non_exhaustive] Tuple(!), | ^ patterns `Tuple(_)` and `Struct { .. }` not covered
| | ----- not covered
LL | | #[non_exhaustive] Struct { x: ! }
| | ------ not covered
LL | | }
| |_- `UninhabitedVariants` defined here
...
LL | match x {}
| ^ patterns `Tuple(_)` and `Struct { .. }` not covered
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `UninhabitedVariants` defined here
--> $DIR/match_same_crate.rs:16:23
|
LL | pub enum UninhabitedVariants {
| -------------------
LL | #[non_exhaustive] Tuple(!),
| ^^^^^ not covered
LL | #[non_exhaustive] Struct { x: ! }
| ^^^^^^ not covered
= note: the matched value is of type `UninhabitedVariants` = note: the matched value is of type `UninhabitedVariants`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ match x {
LL + Tuple(_) | Struct { .. } => todo!(),
LL ~ }
|
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View File

@ -4,8 +4,19 @@ error[E0004]: non-exhaustive patterns: type `UninhabitedEnum` is non-empty
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `UninhabitedEnum` defined here
--> $DIR/auxiliary/uninhabited.rs:5:1
|
LL | / pub enum UninhabitedEnum {
LL | | }
| |_^
= note: the matched value is of type `UninhabitedEnum`, which is marked as non-exhaustive = note: the matched value is of type `UninhabitedEnum`, which is marked as non-exhaustive
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `UninhabitedStruct` is non-empty error[E0004]: non-exhaustive patterns: type `UninhabitedStruct` is non-empty
--> $DIR/match_with_exhaustive_patterns.rs:26:11 --> $DIR/match_with_exhaustive_patterns.rs:26:11
@ -13,8 +24,20 @@ error[E0004]: non-exhaustive patterns: type `UninhabitedStruct` is non-empty
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `UninhabitedStruct` defined here
--> $DIR/auxiliary/uninhabited.rs:9:1
|
LL | / pub struct UninhabitedStruct {
LL | | _priv: !,
LL | | }
| |_^
= note: the matched value is of type `UninhabitedStruct` = note: the matched value is of type `UninhabitedStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: type `UninhabitedTupleStruct` is non-empty error[E0004]: non-exhaustive patterns: type `UninhabitedTupleStruct` is non-empty
--> $DIR/match_with_exhaustive_patterns.rs:30:11 --> $DIR/match_with_exhaustive_patterns.rs:30:11
@ -22,8 +45,18 @@ error[E0004]: non-exhaustive patterns: type `UninhabitedTupleStruct` is non-empt
LL | match x {} LL | match x {}
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `UninhabitedTupleStruct` defined here
--> $DIR/auxiliary/uninhabited.rs:14:1
|
LL | pub struct UninhabitedTupleStruct(!);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the matched value is of type `UninhabitedTupleStruct` = note: the matched value is of type `UninhabitedTupleStruct`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ match x {
LL + _ => todo!(),
LL ~ }
|
error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covered error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covered
--> $DIR/match_with_exhaustive_patterns.rs:34:11 --> $DIR/match_with_exhaustive_patterns.rs:34:11
@ -31,15 +64,23 @@ error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covere
LL | match x {} LL | match x {}
| ^ patterns `Tuple(_)` and `Struct { .. }` not covered | ^ patterns `Tuple(_)` and `Struct { .. }` not covered
| |
::: $DIR/auxiliary/uninhabited.rs:17:23 note: `UninhabitedVariants` defined here
--> $DIR/auxiliary/uninhabited.rs:17:23
| |
LL | #[non_exhaustive] Tuple(!), LL | / pub enum UninhabitedVariants {
| ----- not covered LL | | #[non_exhaustive] Tuple(!),
LL | #[non_exhaustive] Struct { x: ! } | | ^^^^^ not covered
| ------ not covered LL | | #[non_exhaustive] Struct { x: ! }
| | | ^^^^^^ not covered
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms LL | | }
| |_-
= note: the matched value is of type `UninhabitedVariants` = note: the matched value is of type `UninhabitedVariants`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
LL ~ match x {
LL + Tuple(_) | Struct { .. } => todo!(),
LL ~ }
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View File

@ -1,20 +1,18 @@
error[E0005]: refutable pattern in local binding: `A(_)` not covered error[E0005]: refutable pattern in local binding: `A(_)` not covered
--> $DIR/uninhabited-irrefutable.rs:27:9 --> $DIR/uninhabited-irrefutable.rs:27:9
| |
LL | / enum Foo { LL | let Foo::D(_y) = x;
LL | | A(foo::SecretlyEmpty), | ^^^^^^^^^^ pattern `A(_)` not covered
| | - not covered
LL | | B(foo::NotSoSecretlyEmpty),
LL | | C(NotSoSecretlyEmpty),
LL | | D(u32),
LL | | }
| |_- `Foo` defined here
...
LL | let Foo::D(_y) = x;
| ^^^^^^^^^^ pattern `A(_)` not covered
| |
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Foo` defined here
--> $DIR/uninhabited-irrefutable.rs:19:5
|
LL | enum Foo {
| ---
LL | A(foo::SecretlyEmpty),
| ^ not covered
= note: the matched value is of type `Foo` = note: the matched value is of type `Foo`
help: you might want to use `if let` to ignore the variant that isn't matched help: you might want to use `if let` to ignore the variant that isn't matched
| |

View File

@ -4,26 +4,44 @@ error[E0004]: non-exhaustive patterns: `Err(_)` not covered
LL | let _ = match x { LL | let _ = match x {
| ^ pattern `Err(_)` not covered | ^ pattern `Err(_)` not covered
| |
::: $SRC_DIR/core/src/result.rs:LL:COL note: `Result<u32, &Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
| |
LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), LL | / pub enum Result<T, E> {
| --- not covered LL | | /// Contains the success value
| LL | | #[lang = "Ok"]
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms LL | | #[stable(feature = "rust1", since = "1.0.0")]
... |
LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
| | ^^^ not covered
LL | | }
| |_-
= note: the matched value is of type `Result<u32, &Void>` = note: the matched value is of type `Result<u32, &Void>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ Ok(n) => n,
LL ~ Err(_) => todo!(),
|
error[E0004]: non-exhaustive patterns: type `&Void` is non-empty error[E0004]: non-exhaustive patterns: type `&Void` is non-empty
--> $DIR/uninhabited-matches-feature-gated.rs:15:19 --> $DIR/uninhabited-matches-feature-gated.rs:15:19
| |
LL | enum Void {}
| ------------ `Void` defined here
...
LL | let _ = match x {}; LL | let _ = match x {};
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms note: `Void` defined here
--> $DIR/uninhabited-matches-feature-gated.rs:2:6
|
LL | enum Void {}
| ^^^^
= note: the matched value is of type `&Void` = note: the matched value is of type `&Void`
= note: references are always considered inhabited = note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ let _ = match x {
LL + _ => todo!(),
LL ~ };
|
error[E0004]: non-exhaustive patterns: type `(Void,)` is non-empty error[E0004]: non-exhaustive patterns: type `(Void,)` is non-empty
--> $DIR/uninhabited-matches-feature-gated.rs:18:19 --> $DIR/uninhabited-matches-feature-gated.rs:18:19
@ -31,8 +49,13 @@ error[E0004]: non-exhaustive patterns: type `(Void,)` is non-empty
LL | let _ = match x {}; LL | let _ = match x {};
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
= note: the matched value is of type `(Void,)` = note: the matched value is of type `(Void,)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ let _ = match x {
LL + _ => todo!(),
LL ~ };
|
error[E0004]: non-exhaustive patterns: type `[Void; 1]` is non-empty error[E0004]: non-exhaustive patterns: type `[Void; 1]` is non-empty
--> $DIR/uninhabited-matches-feature-gated.rs:21:19 --> $DIR/uninhabited-matches-feature-gated.rs:21:19
@ -40,8 +63,13 @@ error[E0004]: non-exhaustive patterns: type `[Void; 1]` is non-empty
LL | let _ = match x {}; LL | let _ = match x {};
| ^ | ^
| |
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
= note: the matched value is of type `[Void; 1]` = note: the matched value is of type `[Void; 1]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
|
LL ~ let _ = match x {
LL + _ => todo!(),
LL ~ };
|
error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
--> $DIR/uninhabited-matches-feature-gated.rs:24:19 --> $DIR/uninhabited-matches-feature-gated.rs:24:19
@ -49,8 +77,12 @@ error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
LL | let _ = match x { LL | let _ = match x {
| ^ pattern `&[_, ..]` not covered | ^ pattern `&[_, ..]` 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 `&[Void]` = note: the matched value is of type `&[Void]`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ &[] => (),
LL ~ &[_, ..] => todo!(),
|
error[E0004]: non-exhaustive patterns: `Err(_)` not covered error[E0004]: non-exhaustive patterns: `Err(_)` not covered
--> $DIR/uninhabited-matches-feature-gated.rs:32:19 --> $DIR/uninhabited-matches-feature-gated.rs:32:19
@ -58,13 +90,24 @@ error[E0004]: non-exhaustive patterns: `Err(_)` not covered
LL | let _ = match x { LL | let _ = match x {
| ^ pattern `Err(_)` not covered | ^ pattern `Err(_)` not covered
| |
::: $SRC_DIR/core/src/result.rs:LL:COL note: `Result<u32, Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
| |
LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), LL | / pub enum Result<T, E> {
| --- not covered LL | | /// Contains the success value
| LL | | #[lang = "Ok"]
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms LL | | #[stable(feature = "rust1", since = "1.0.0")]
... |
LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
| | ^^^ not covered
LL | | }
| |_-
= note: the matched value is of type `Result<u32, Void>` = note: the matched value is of type `Result<u32, Void>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
LL ~ Ok(x) => x,
LL ~ Err(_) => todo!(),
|
error[E0005]: refutable pattern in local binding: `Err(_)` not covered error[E0005]: refutable pattern in local binding: `Err(_)` not covered
--> $DIR/uninhabited-matches-feature-gated.rs:37:9 --> $DIR/uninhabited-matches-feature-gated.rs:37:9
@ -72,13 +115,20 @@ error[E0005]: refutable pattern in local binding: `Err(_)` not covered
LL | let Ok(x) = x; LL | let Ok(x) = x;
| ^^^^^ pattern `Err(_)` not covered | ^^^^^ pattern `Err(_)` not covered
| |
::: $SRC_DIR/core/src/result.rs:LL:COL
|
LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
| --- not covered
|
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Result<u32, Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
|
LL | / pub enum Result<T, E> {
LL | | /// Contains the success value
LL | | #[lang = "Ok"]
LL | | #[stable(feature = "rust1", since = "1.0.0")]
... |
LL | | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
| | ^^^ not covered
LL | | }
| |_-
= note: the matched value is of type `Result<u32, Void>` = note: the matched value is of type `Result<u32, Void>`
help: you might want to use `if let` to ignore the variant that isn't matched help: you might want to use `if let` to ignore the variant that isn't matched
| |