Move the "matches no value" note to be a span label

This commit is contained in:
Nadrieril 2024-08-20 21:42:48 +02:00
parent 36eced444e
commit f30392a985
16 changed files with 149 additions and 294 deletions

View File

@ -333,7 +333,7 @@ mir_build_unreachable_matches_same_values = matches some of the same values
mir_build_unreachable_pattern = unreachable pattern
.label = no value can reach this
.unreachable_matches_no_values = matches no values because `{$ty}` is uninhabited
.unreachable_matches_no_values = matches no values because `{$matches_no_values_ty}` is uninhabited
.unreachable_uninhabited_note = to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
.unreachable_covered_by_catchall = matches any value
.unreachable_covered_by_one = matches all the relevant values

View File

@ -586,8 +586,9 @@ pub(crate) struct NonConstPath {
pub(crate) struct UnreachablePattern<'tcx> {
#[label]
pub(crate) span: Option<Span>,
#[subdiagnostic]
pub(crate) matches_no_values: Option<UnreachableMatchesNoValues<'tcx>>,
#[label(mir_build_unreachable_matches_no_values)]
pub(crate) matches_no_values: Option<Span>,
pub(crate) matches_no_values_ty: Ty<'tcx>,
#[note(mir_build_unreachable_uninhabited_note)]
pub(crate) uninhabited_note: Option<()>,
#[label(mir_build_unreachable_covered_by_catchall)]
@ -599,12 +600,6 @@ pub(crate) struct UnreachablePattern<'tcx> {
pub(crate) covered_by_many_n_more_count: usize,
}
#[derive(Subdiagnostic)]
#[note(mir_build_unreachable_matches_no_values)]
pub(crate) struct UnreachableMatchesNoValues<'tcx> {
pub(crate) ty: Ty<'tcx>,
}
#[derive(Diagnostic)]
#[diag(mir_build_const_pattern_depends_on_generic_parameter, code = E0158)]
pub(crate) struct ConstPatternDependsOnGenericParameter {

View File

@ -922,6 +922,7 @@ fn report_unreachable_pattern<'p, 'tcx>(
let mut lint = UnreachablePattern {
span: Some(pat_span),
matches_no_values: None,
matches_no_values_ty: **pat.ty(),
uninhabited_note: None,
covered_by_catchall: None,
covered_by_one: None,
@ -933,10 +934,11 @@ fn report_unreachable_pattern<'p, 'tcx>(
// Empty pattern; we report the uninhabited type that caused the emptiness.
lint.span = None; // Don't label the pattern itself
lint.uninhabited_note = Some(()); // Give a link about empty types
lint.matches_no_values = Some(pat_span);
pat.walk(&mut |subpat| {
let ty = **subpat.ty();
if cx.is_uninhabited(ty) {
lint.matches_no_values = Some(UnreachableMatchesNoValues { ty });
lint.matches_no_values_ty = ty;
false // No need to dig further.
} else if matches!(subpat.ctor(), Constructor::Ref | Constructor::UnionField) {
false // Don't explore further since they are not by-value.

View File

@ -2,9 +2,8 @@ error: unreachable pattern
--> $DIR/empty-match-check-notes.rs:17:9
|
LL | _ => {}
| ^
| ^ matches no values because `EmptyEnum` is uninhabited
|
= note: matches no values because `EmptyEnum` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
note: the lint level is defined here
--> $DIR/empty-match-check-notes.rs:7:9
@ -16,27 +15,24 @@ error: unreachable pattern
--> $DIR/empty-match-check-notes.rs:22:9
|
LL | _ if false => {}
| ^
| ^ matches no values because `EmptyEnum` is uninhabited
|
= note: matches no values because `EmptyEnum` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-match-check-notes.rs:31:9
|
LL | _ => {}
| ^
| ^ matches no values because `EmptyForeignEnum` is uninhabited
|
= note: matches no values because `EmptyForeignEnum` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-match-check-notes.rs:36:9
|
LL | _ if false => {}
| ^
| ^ matches no values because `EmptyForeignEnum` is uninhabited
|
= note: matches no values because `EmptyForeignEnum` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0005]: refutable pattern in local binding

View File

@ -2,9 +2,8 @@ error: unreachable pattern
--> $DIR/empty-match-check-notes.rs:17:9
|
LL | _ => {}
| ^
| ^ matches no values because `EmptyEnum` is uninhabited
|
= note: matches no values because `EmptyEnum` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
note: the lint level is defined here
--> $DIR/empty-match-check-notes.rs:7:9
@ -16,27 +15,24 @@ error: unreachable pattern
--> $DIR/empty-match-check-notes.rs:22:9
|
LL | _ if false => {}
| ^
| ^ matches no values because `EmptyEnum` is uninhabited
|
= note: matches no values because `EmptyEnum` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-match-check-notes.rs:31:9
|
LL | _ => {}
| ^
| ^ matches no values because `EmptyForeignEnum` is uninhabited
|
= note: matches no values because `EmptyForeignEnum` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-match-check-notes.rs:36:9
|
LL | _ if false => {}
| ^
| ^ matches no values because `EmptyForeignEnum` is uninhabited
|
= note: matches no values because `EmptyForeignEnum` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0005]: refutable pattern in local binding

View File

@ -2,9 +2,8 @@ error: unreachable pattern
--> $DIR/empty-types.rs:49:9
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
note: the lint level is defined here
--> $DIR/empty-types.rs:15:9
@ -16,9 +15,8 @@ error: unreachable pattern
--> $DIR/empty-types.rs:52:9
|
LL | _x => {}
| ^^
| ^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: type `&!` is non-empty
@ -40,36 +38,32 @@ error: unreachable pattern
--> $DIR/empty-types.rs:70:9
|
LL | (_, _) => {}
| ^^^^^^
| ^^^^^^ matches no values because `(u32, !)` is uninhabited
|
= note: matches no values because `(u32, !)` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:76:9
|
LL | _ => {}
| ^
| ^ matches no values because `(!, !)` is uninhabited
|
= note: matches no values because `(!, !)` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:79:9
|
LL | (_, _) => {}
| ^^^^^^
| ^^^^^^ matches no values because `(!, !)` is uninhabited
|
= note: matches no values because `(!, !)` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:83:9
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: `Ok(_)` not covered
@ -95,18 +89,16 @@ error: unreachable pattern
--> $DIR/empty-types.rs:94:9
|
LL | Err(_) => {}
| ^^^^^^
| ^^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:99:9
|
LL | Err(_) => {}
| ^^^^^^
| ^^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered
@ -145,81 +137,72 @@ error: unreachable pattern
--> $DIR/empty-types.rs:112:9
|
LL | _ => {}
| ^
| ^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:115:9
|
LL | Ok(_) => {}
| ^^^^^
| ^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:118:9
|
LL | Ok(_) => {}
| ^^^^^
| ^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:119:9
|
LL | _ => {}
| ^
| ^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:122:9
|
LL | Ok(_) => {}
| ^^^^^
| ^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:123:9
|
LL | Err(_) => {}
| ^^^^^^
| ^^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:132:13
|
LL | _ => {}
| ^
| ^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:135:13
|
LL | _ if false => {}
| ^
| ^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:143:13
|
LL | Some(_) => {}
| ^^^^^^^
| ^^^^^^^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
@ -234,81 +217,72 @@ error: unreachable pattern
--> $DIR/empty-types.rs:199:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:204:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:209:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:214:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:220:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:281:9
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:284:9
|
LL | (_, _) => {}
| ^^^^^^
| ^^^^^^ matches no values because `(!, !)` is uninhabited
|
= note: matches no values because `(!, !)` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:287:9
|
LL | Ok(_) => {}
| ^^^^^
| ^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:288:9
|
LL | Err(_) => {}
| ^^^^^^
| ^^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: type `&[!]` is non-empty
@ -370,27 +344,24 @@ error: unreachable pattern
--> $DIR/empty-types.rs:368:9
|
LL | _ => {}
| ^
| ^ matches no values because `[!; 3]` is uninhabited
|
= note: matches no values because `[!; 3]` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:371:9
|
LL | [_, _, _] => {}
| ^^^^^^^^^
| ^^^^^^^^^ matches no values because `[!; 3]` is uninhabited
|
= note: matches no values because `[!; 3]` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:374:9
|
LL | [_, ..] => {}
| ^^^^^^^
| ^^^^^^^ matches no values because `[!; 3]` is uninhabited
|
= note: matches no values because `[!; 3]` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty
@ -433,18 +404,16 @@ error: unreachable pattern
--> $DIR/empty-types.rs:416:9
|
LL | Some(_) => {}
| ^^^^^^^
| ^^^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:421:9
|
LL | Some(_a) => {}
| ^^^^^^^^
| ^^^^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
@ -469,36 +438,32 @@ error: unreachable pattern
--> $DIR/empty-types.rs:603:9
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:606:9
|
LL | _x => {}
| ^^
| ^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:609:9
|
LL | _ if false => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:612:9
|
LL | _x if false => {}
| ^^
| ^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: aborting due to 49 previous errors

View File

@ -11,9 +11,8 @@ error: unreachable pattern
--> $DIR/empty-types.rs:49:9
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
note: the lint level is defined here
--> $DIR/empty-types.rs:15:9
@ -25,9 +24,8 @@ error: unreachable pattern
--> $DIR/empty-types.rs:52:9
|
LL | _x => {}
| ^^
| ^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: type `&!` is non-empty
@ -49,36 +47,32 @@ error: unreachable pattern
--> $DIR/empty-types.rs:70:9
|
LL | (_, _) => {}
| ^^^^^^
| ^^^^^^ matches no values because `(u32, !)` is uninhabited
|
= note: matches no values because `(u32, !)` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:76:9
|
LL | _ => {}
| ^
| ^ matches no values because `(!, !)` is uninhabited
|
= note: matches no values because `(!, !)` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:79:9
|
LL | (_, _) => {}
| ^^^^^^
| ^^^^^^ matches no values because `(!, !)` is uninhabited
|
= note: matches no values because `(!, !)` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:83:9
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: `Ok(_)` not covered
@ -104,18 +98,16 @@ error: unreachable pattern
--> $DIR/empty-types.rs:94:9
|
LL | Err(_) => {}
| ^^^^^^
| ^^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:99:9
|
LL | Err(_) => {}
| ^^^^^^
| ^^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered
@ -168,81 +160,72 @@ error: unreachable pattern
--> $DIR/empty-types.rs:112:9
|
LL | _ => {}
| ^
| ^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:115:9
|
LL | Ok(_) => {}
| ^^^^^
| ^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:118:9
|
LL | Ok(_) => {}
| ^^^^^
| ^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:119:9
|
LL | _ => {}
| ^
| ^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:122:9
|
LL | Ok(_) => {}
| ^^^^^
| ^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:123:9
|
LL | Err(_) => {}
| ^^^^^^
| ^^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:132:13
|
LL | _ => {}
| ^
| ^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:135:13
|
LL | _ if false => {}
| ^
| ^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:143:13
|
LL | Some(_) => {}
| ^^^^^^^
| ^^^^^^^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
@ -276,81 +259,72 @@ error: unreachable pattern
--> $DIR/empty-types.rs:199:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:204:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:209:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:214:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:220:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:281:9
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:284:9
|
LL | (_, _) => {}
| ^^^^^^
| ^^^^^^ matches no values because `(!, !)` is uninhabited
|
= note: matches no values because `(!, !)` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:287:9
|
LL | Ok(_) => {}
| ^^^^^
| ^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:288:9
|
LL | Err(_) => {}
| ^^^^^^
| ^^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0005]: refutable pattern in local binding
@ -504,27 +478,24 @@ error: unreachable pattern
--> $DIR/empty-types.rs:368:9
|
LL | _ => {}
| ^
| ^ matches no values because `[!; 3]` is uninhabited
|
= note: matches no values because `[!; 3]` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:371:9
|
LL | [_, _, _] => {}
| ^^^^^^^^^
| ^^^^^^^^^ matches no values because `[!; 3]` is uninhabited
|
= note: matches no values because `[!; 3]` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:374:9
|
LL | [_, ..] => {}
| ^^^^^^^
| ^^^^^^^ matches no values because `[!; 3]` is uninhabited
|
= note: matches no values because `[!; 3]` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty
@ -567,18 +538,16 @@ error: unreachable pattern
--> $DIR/empty-types.rs:416:9
|
LL | Some(_) => {}
| ^^^^^^^
| ^^^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:421:9
|
LL | Some(_a) => {}
| ^^^^^^^^
| ^^^^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
@ -693,36 +662,32 @@ error: unreachable pattern
--> $DIR/empty-types.rs:603:9
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:606:9
|
LL | _x => {}
| ^^
| ^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:609:9
|
LL | _ if false => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:612:9
|
LL | _x if false => {}
| ^^
| ^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: `&!` not covered

View File

@ -2,9 +2,8 @@ error: unreachable pattern
--> $DIR/empty-types.rs:49:9
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
note: the lint level is defined here
--> $DIR/empty-types.rs:15:9
@ -16,9 +15,8 @@ error: unreachable pattern
--> $DIR/empty-types.rs:52:9
|
LL | _x => {}
| ^^
| ^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: type `&!` is non-empty
@ -40,36 +38,32 @@ error: unreachable pattern
--> $DIR/empty-types.rs:70:9
|
LL | (_, _) => {}
| ^^^^^^
| ^^^^^^ matches no values because `(u32, !)` is uninhabited
|
= note: matches no values because `(u32, !)` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:76:9
|
LL | _ => {}
| ^
| ^ matches no values because `(!, !)` is uninhabited
|
= note: matches no values because `(!, !)` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:79:9
|
LL | (_, _) => {}
| ^^^^^^
| ^^^^^^ matches no values because `(!, !)` is uninhabited
|
= note: matches no values because `(!, !)` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:83:9
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: `Ok(_)` not covered
@ -95,18 +89,16 @@ error: unreachable pattern
--> $DIR/empty-types.rs:94:9
|
LL | Err(_) => {}
| ^^^^^^
| ^^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:99:9
|
LL | Err(_) => {}
| ^^^^^^
| ^^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered
@ -159,81 +151,72 @@ error: unreachable pattern
--> $DIR/empty-types.rs:112:9
|
LL | _ => {}
| ^
| ^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:115:9
|
LL | Ok(_) => {}
| ^^^^^
| ^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:118:9
|
LL | Ok(_) => {}
| ^^^^^
| ^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:119:9
|
LL | _ => {}
| ^
| ^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:122:9
|
LL | Ok(_) => {}
| ^^^^^
| ^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:123:9
|
LL | Err(_) => {}
| ^^^^^^
| ^^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:132:13
|
LL | _ => {}
| ^
| ^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:135:13
|
LL | _ if false => {}
| ^
| ^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:143:13
|
LL | Some(_) => {}
| ^^^^^^^
| ^^^^^^^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
@ -267,81 +250,72 @@ error: unreachable pattern
--> $DIR/empty-types.rs:199:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:204:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:209:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:214:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:220:13
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:281:9
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:284:9
|
LL | (_, _) => {}
| ^^^^^^
| ^^^^^^ matches no values because `(!, !)` is uninhabited
|
= note: matches no values because `(!, !)` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:287:9
|
LL | Ok(_) => {}
| ^^^^^
| ^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:288:9
|
LL | Err(_) => {}
| ^^^^^^
| ^^^^^^ matches no values because `Result<!, !>` is uninhabited
|
= note: matches no values because `Result<!, !>` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0005]: refutable pattern in local binding
@ -495,27 +469,24 @@ error: unreachable pattern
--> $DIR/empty-types.rs:368:9
|
LL | _ => {}
| ^
| ^ matches no values because `[!; 3]` is uninhabited
|
= note: matches no values because `[!; 3]` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:371:9
|
LL | [_, _, _] => {}
| ^^^^^^^^^
| ^^^^^^^^^ matches no values because `[!; 3]` is uninhabited
|
= note: matches no values because `[!; 3]` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:374:9
|
LL | [_, ..] => {}
| ^^^^^^^
| ^^^^^^^ matches no values because `[!; 3]` is uninhabited
|
= note: matches no values because `[!; 3]` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty
@ -558,18 +529,16 @@ error: unreachable pattern
--> $DIR/empty-types.rs:416:9
|
LL | Some(_) => {}
| ^^^^^^^
| ^^^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:421:9
|
LL | Some(_a) => {}
| ^^^^^^^^
| ^^^^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
@ -684,36 +653,32 @@ error: unreachable pattern
--> $DIR/empty-types.rs:603:9
|
LL | _ => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:606:9
|
LL | _x => {}
| ^^
| ^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:609:9
|
LL | _ if false => {}
| ^
| ^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/empty-types.rs:612:9
|
LL | _x if false => {}
| ^^
| ^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: `&_` not covered

View File

@ -59,27 +59,24 @@ error: unreachable pattern
--> $DIR/explain-unreachable-pats.rs:51:9
|
LL | Err(_) => {}
| ^^^^^^
| ^^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/explain-unreachable-pats.rs:65:9
|
LL | (Err(_), Err(_)) => {}
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ matches no values because `Void2` is uninhabited
|
= note: matches no values because `Void2` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/explain-unreachable-pats.rs:72:9
|
LL | (Err(_), Err(_)) => {}
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ matches no values because `Void1` is uninhabited
|
= note: matches no values because `Void1` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern

View File

@ -2,9 +2,8 @@ error: unreachable pattern
--> $DIR/impl-trait.rs:16:13
|
LL | _ => {}
| ^
| ^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
note: the lint level is defined here
--> $DIR/impl-trait.rs:4:9
@ -16,18 +15,16 @@ error: unreachable pattern
--> $DIR/impl-trait.rs:30:13
|
LL | _ => {}
| ^
| ^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/impl-trait.rs:44:13
|
LL | Some(_) => {}
| ^^^^^^^
| ^^^^^^^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
@ -42,9 +39,8 @@ error: unreachable pattern
--> $DIR/impl-trait.rs:58:13
|
LL | Some(_) => {}
| ^^^^^^^
| ^^^^^^^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
@ -59,9 +55,8 @@ error: unreachable pattern
--> $DIR/impl-trait.rs:75:9
|
LL | _ => {}
| ^
| ^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
@ -76,9 +71,8 @@ error: unreachable pattern
--> $DIR/impl-trait.rs:93:13
|
LL | _ => {}
| ^
| ^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
@ -101,18 +95,16 @@ error: unreachable pattern
--> $DIR/impl-trait.rs:137:13
|
LL | _ => {}
| ^
| ^ matches no values because `SecretelyVoid` is uninhabited
|
= note: matches no values because `SecretelyVoid` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/impl-trait.rs:150:13
|
LL | _ => {}
| ^
| ^ matches no values because `SecretelyDoubleVoid` is uninhabited
|
= note: matches no values because `SecretelyDoubleVoid` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error[E0004]: non-exhaustive patterns: type `impl Copy` is non-empty

View File

@ -2,9 +2,8 @@ error: unreachable pattern
--> $DIR/unreachable-loop-patterns.rs:16:9
|
LL | for _ in unimplemented!() as Void {}
| ^
| ^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
note: the lint level is defined here
--> $DIR/unreachable-loop-patterns.rs:3:9

View File

@ -17,9 +17,8 @@ warning: unreachable pattern
--> $DIR/unreachable-try-pattern.rs:19:24
|
LL | let y = (match x { Ok(n) => Ok(n as u32), Err(e) => Err(e) })?;
| ^^^^^
| ^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
note: the lint level is defined here
--> $DIR/unreachable-try-pattern.rs:4:9
@ -31,9 +30,8 @@ warning: unreachable pattern
--> $DIR/unreachable-try-pattern.rs:30:40
|
LL | let y = (match x { Ok(n) => Ok(n), Err(e) => Err(e) })?;
| ^^^^^^
| ^^^^^^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
warning: 3 warnings emitted

View File

@ -2,9 +2,8 @@ error: unreachable pattern
--> $DIR/unreachable.rs:14:9
|
LL | Err(!),
| ^^^^^^
| ^^^^^^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
note: the lint level is defined here
--> $DIR/unreachable.rs:4:9
@ -16,45 +15,40 @@ error: unreachable pattern
--> $DIR/unreachable.rs:17:19
|
LL | let (Ok(_x) | Err(!)) = res_void;
| ^^^^^^
| ^^^^^^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/unreachable.rs:19:12
|
LL | if let Err(!) = res_void {}
| ^^^^^^
| ^^^^^^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/unreachable.rs:21:24
|
LL | if let (Ok(true) | Err(!)) = res_void {}
| ^^^^^^
| ^^^^^^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/unreachable.rs:23:23
|
LL | for (Ok(mut _x) | Err(!)) in [res_void] {}
| ^^^^^^
| ^^^^^^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/unreachable.rs:27:18
|
LL | fn foo((Ok(_x) | Err(!)): Result<bool, Void>) {}
| ^^^^^^
| ^^^^^^ matches no values because `Void` is uninhabited
|
= note: matches no values because `Void` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: aborting due to 6 previous errors

View File

@ -2,9 +2,8 @@ error: unreachable pattern
--> $DIR/enum_same_crate_empty_match.rs:28:9
|
LL | _ => {}
| ^
| ^ matches no values because `EmptyNonExhaustiveEnum` is uninhabited
|
= note: matches no values because `EmptyNonExhaustiveEnum` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
note: the lint level is defined here
--> $DIR/enum_same_crate_empty_match.rs:1:9

View File

@ -2,9 +2,8 @@ error: unreachable pattern
--> $DIR/patterns_same_crate.rs:51:9
|
LL | Some(_x) => (),
| ^^^^^^^^
| ^^^^^^^^ matches no values because `UninhabitedEnum` is uninhabited
|
= note: matches no values because `UninhabitedEnum` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
note: the lint level is defined here
--> $DIR/patterns_same_crate.rs:1:9
@ -16,36 +15,32 @@ error: unreachable pattern
--> $DIR/patterns_same_crate.rs:56:9
|
LL | Some(_x) => (),
| ^^^^^^^^
| ^^^^^^^^ matches no values because `UninhabitedVariants` is uninhabited
|
= note: matches no values because `UninhabitedVariants` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/patterns_same_crate.rs:60:15
|
LL | while let PartiallyInhabitedVariants::Struct { x } = partially_inhabited_variant() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ matches no values because `!` is uninhabited
|
= note: matches no values because `!` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/patterns_same_crate.rs:64:15
|
LL | while let Some(_x) = uninhabited_struct() {
| ^^^^^^^^
| ^^^^^^^^ matches no values because `UninhabitedStruct` is uninhabited
|
= note: matches no values because `UninhabitedStruct` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/patterns_same_crate.rs:67:15
|
LL | while let Some(_x) = uninhabited_tuple_struct() {
| ^^^^^^^^
| ^^^^^^^^ matches no values because `UninhabitedTupleStruct` is uninhabited
|
= note: matches no values because `UninhabitedTupleStruct` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: aborting due to 5 previous errors

View File

@ -2,9 +2,8 @@ error: unreachable pattern
--> $DIR/uninhabited-patterns.rs:29:9
|
LL | Ok(box _) => (),
| ^^^^^^^^^
| ^^^^^^^^^ matches no values because `NotSoSecretlyEmpty` is uninhabited
|
= note: matches no values because `NotSoSecretlyEmpty` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
note: the lint level is defined here
--> $DIR/uninhabited-patterns.rs:3:9
@ -16,18 +15,16 @@ error: unreachable pattern
--> $DIR/uninhabited-patterns.rs:38:9
|
LL | Err(Ok(_y)) => (),
| ^^^^^^^^^^^
| ^^^^^^^^^^^ matches no values because `NotSoSecretlyEmpty` is uninhabited
|
= note: matches no values because `NotSoSecretlyEmpty` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: unreachable pattern
--> $DIR/uninhabited-patterns.rs:41:15
|
LL | while let Some(_y) = foo() {
| ^^^^^^^^
| ^^^^^^^^ matches no values because `NotSoSecretlyEmpty` is uninhabited
|
= note: matches no values because `NotSoSecretlyEmpty` is uninhabited
= note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
error: aborting due to 3 previous errors