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:
commit
23d3fa266c
64 changed files with 265 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 { /* */ }
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue