Point at the match discriminant when arm pattern has a type mismatch
This commit is contained in:
parent
c2d381d39d
commit
a873337f21
27 changed files with 183 additions and 77 deletions
|
|
@ -21,6 +21,8 @@ LL | A::B(_, _, _) => (), //~ ERROR this pattern has 3 fields, but
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/pattern-error-continue.rs:22:9
|
||||
|
|
||||
LL | match 'c' {
|
||||
| --- this match expression evaluates to `char`
|
||||
LL | S { .. } => (),
|
||||
| ^^^^^^^^ expected char, found struct `S`
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/pattern-tyvar.rs:5:18
|
||||
|
|
||||
LL | match t {
|
||||
| - this match expression evaluates to `std::option::Option<std::vec::Vec<isize>>`
|
||||
LL | Bar::T1(_, Some::<isize>(x)) => { //~ ERROR mismatched types
|
||||
| ^^^^^^^^^^^^^^^^ expected struct `std::vec::Vec`, found isize
|
||||
|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue