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
This commit is contained in:
Mazdak Farrokhzad 2020-03-27 22:39:39 +01:00 committed by GitHub
commit 23d3fa266c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
64 changed files with 265 additions and 0 deletions

View file

@ -13,6 +13,7 @@ LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
| ---- 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 `std::option::Option<i32>`
error: aborting due to previous error

View file

@ -12,6 +12,7 @@ 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: the matched value is of type `Terminator`
error: aborting due to previous error

View file

@ -11,6 +11,7 @@ LL | None,
|
= 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 `std::option::Option<i32>`
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let Some(y) = x { /* */ }

View file

@ -8,6 +8,8 @@ LL | for Some(x) in xs {}
|
LL | None,
| ---- not covered
|
= note: the matched value is of type `std::option::Option<i32>`
error: aborting due to previous error