summaryrefslogtreecommitdiffstats
path: root/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr')
-rw-r--r--tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr88
1 files changed, 88 insertions, 0 deletions
diff --git a/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr b/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr
new file mode 100644
index 000000000..ad061d93c
--- /dev/null
+++ b/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr
@@ -0,0 +1,88 @@
+error[E0004]: non-exhaustive patterns: type `u8` is non-empty
+ --> $DIR/pattern-matching-should-fail.rs:67:23
+ |
+LL | let c1 = || match x { };
+ | ^
+ |
+ = 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]: used binding `x` isn't initialized
+ --> $DIR/pattern-matching-should-fail.rs:8:23
+ |
+LL | let x: !;
+ | - binding declared here but left uninitialized
+LL | let c1 = || match x { };
+ | ^ `x` used here but it isn't initialized
+
+error[E0381]: used binding `x` isn't initialized
+ --> $DIR/pattern-matching-should-fail.rs:15:14
+ |
+LL | let x: !;
+ | - binding declared here but left uninitialized
+LL | let c2 = || match x { _ => () };
+ | ^^ - borrow occurs due to use in closure
+ | |
+ | `x` used here but it isn't initialized
+
+error[E0381]: used binding `variant` isn't initialized
+ --> $DIR/pattern-matching-should-fail.rs:27:13
+ |
+LL | let variant: !;
+ | ------- binding declared here but left uninitialized
+LL | let c = || {
+ | ^^ `variant` used here but it isn't initialized
+LL |
+LL | match variant {
+ | ------- borrow occurs due to use in closure
+
+error[E0381]: used binding `variant` isn't initialized
+ --> $DIR/pattern-matching-should-fail.rs:39:13
+ |
+LL | let variant: !;
+ | ------- binding declared here but left uninitialized
+LL | let c = || {
+ | ^^ `variant` used here but it isn't initialized
+LL | match variant {
+ | ------- borrow occurs due to use in closure
+
+error[E0381]: used binding `g` isn't initialized
+ --> $DIR/pattern-matching-should-fail.rs:54:15
+ |
+LL | let g: !;
+ | - binding declared here but left uninitialized
+...
+LL | match g { };
+ | ^ `g` used here but it isn't initialized
+
+error[E0381]: used binding `t` isn't initialized
+ --> $DIR/pattern-matching-should-fail.rs:56:19
+ |
+LL | let t: !;
+ | - binding declared here but left uninitialized
+...
+LL | match t { };
+ | ^ `t` used here but it isn't initialized
+
+error[E0381]: used binding `x` isn't initialized
+ --> $DIR/pattern-matching-should-fail.rs:67:23
+ |
+LL | let x: u8;
+ | - binding declared here but left uninitialized
+LL | let c1 = || match x { };
+ | ^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: u8 = 0;
+ | +++
+
+error: aborting due to 8 previous errors
+
+Some errors have detailed explanations: E0004, E0381.
+For more information about an error, try `rustc --explain E0004`.