about summary refs log tree commit diff
path: root/src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-03-27 22:39:39 +0100
committerGitHub <noreply@github.com>2020-03-27 22:39:39 +0100
commit23d3fa266cc107ffceced3c5580eb6327662c605 (patch)
treecbfbf1df9f0bb057bbb00e8eb09ee085c34d7ba8 /src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr
parentcfe1e330b5a5632f311bb4b45619b1a8d02878ec (diff)
parentc858593ed013127ab35c7d5777156fe9f24a3717 (diff)
downloadrust-23d3fa266cc107ffceced3c5580eb6327662c605.tar.gz
rust-23d3fa266cc107ffceced3c5580eb6327662c605.zip
Rollup merge of #70457 - Centril:non-exhaustive-scrutinee-type, r=estebank
non-exhastive diagnostic: add note re. scrutinee type

This fixes https://github.com/rust-lang/rust/issues/67259 by adding a note:
```
    = note: the matched value is of type &[i32]
```
to non-exhaustive pattern matching errors.

r? @varkor @estebank
Diffstat (limited to 'src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr')
-rw-r--r--src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr b/src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr
index 0cf5d9cd5f1..f5895c01599 100644
--- a/src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr
+++ b/src/test/ui/pattern/usefulness/refutable-pattern-errors.stderr
@@ -3,6 +3,8 @@ error[E0005]: refutable pattern in function argument: `(_, _)` not covered
    |
 LL | fn func((1, (Some(1), 2..=3)): (isize, (Option<isize>, isize))) { }
    |         ^^^^^^^^^^^^^^^^^^^^^ pattern `(_, _)` not covered
+   |
+   = note: the matched value is of type `(isize, (std::option::Option<isize>, isize))`
 
 error[E0005]: refutable pattern in local binding: `(std::i32::MIN..=0i32, _)` and `(2i32..=std::i32::MAX, _)` not covered
   --> $DIR/refutable-pattern-errors.rs:7:9
@@ -12,6 +14,7 @@ LL |     let (1, (Some(1), 2..=3)) = (1, (None, 2));
    |
    = 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: the matched value is of type `(i32, (std::option::Option<i32>, i32))`
 help: you might want to use `if let` to ignore the variant that isn't matched
    |
 LL |     if let (1, (Some(1), 2..=3)) = (1, (None, 2)) { /* */ }