From 1c77a049b9595bbc857317ff8a7713c76ddbd8af Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 2 Dec 2019 16:35:10 +0000 Subject: [PATCH] Fix erroneous comment --- .../usefulness/match-empty-exhaustive_patterns.rs | 1 - .../match-empty-exhaustive_patterns.stderr | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.rs b/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.rs index 0a8194253a3c..3d01c31f0364 100644 --- a/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.rs +++ b/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.rs @@ -23,7 +23,6 @@ fn foo(x: Foo) { } fn main() { - // `exhaustive_patterns` is not on, so uninhabited branches are not detected as unreachable. match None:: { None => {} Some(_) => {} //~ ERROR unreachable pattern diff --git a/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.stderr b/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.stderr index 8d143494026d..19c16dba0002 100644 --- a/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.stderr +++ b/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.stderr @@ -11,19 +11,19 @@ LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/match-empty-exhaustive_patterns.rs:29:9 + --> $DIR/match-empty-exhaustive_patterns.rs:28:9 | LL | Some(_) => {} | ^^^^^^^ error: unreachable pattern - --> $DIR/match-empty-exhaustive_patterns.rs:33:9 + --> $DIR/match-empty-exhaustive_patterns.rs:32:9 | LL | Some(_) => {} | ^^^^^^^ error[E0004]: non-exhaustive patterns: type `u8` is non-empty - --> $DIR/match-empty-exhaustive_patterns.rs:36:11 + --> $DIR/match-empty-exhaustive_patterns.rs:35:11 | LL | match 0u8 {} | ^^^ @@ -31,7 +31,7 @@ LL | match 0u8 {} = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms error[E0004]: non-exhaustive patterns: type `NonEmptyStruct` is non-empty - --> $DIR/match-empty-exhaustive_patterns.rs:38:11 + --> $DIR/match-empty-exhaustive_patterns.rs:37:11 | LL | match NonEmptyStruct(true) {} | ^^^^^^^^^^^^^^^^^^^^ @@ -39,7 +39,7 @@ LL | match NonEmptyStruct(true) {} = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms error[E0004]: non-exhaustive patterns: type `NonEmptyEnum1` is non-empty - --> $DIR/match-empty-exhaustive_patterns.rs:40:11 + --> $DIR/match-empty-exhaustive_patterns.rs:39:11 | LL | match NonEmptyEnum1::Foo(true) {} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -47,7 +47,7 @@ LL | match NonEmptyEnum1::Foo(true) {} = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms error[E0004]: non-exhaustive patterns: type `NonEmptyEnum2` is non-empty - --> $DIR/match-empty-exhaustive_patterns.rs:42:11 + --> $DIR/match-empty-exhaustive_patterns.rs:41:11 | LL | match NonEmptyEnum2::Foo(true) {} | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -55,7 +55,7 @@ LL | match NonEmptyEnum2::Foo(true) {} = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms error[E0004]: non-exhaustive patterns: type `NonEmptyEnum5` is non-empty - --> $DIR/match-empty-exhaustive_patterns.rs:44:11 + --> $DIR/match-empty-exhaustive_patterns.rs:43:11 | LL | match NonEmptyEnum5::V1 {} | ^^^^^^^^^^^^^^^^^