Rollup merge of #69452 - Centril:typeck-pat, r=estebank
typeck: use `Pattern` obligation cause more for better diagnostics r? @estebank
This commit is contained in:
commit
a245221497
28 changed files with 284 additions and 102 deletions
|
|
@ -12,6 +12,9 @@ LL | Some(k) => match k {
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-12552.rs:9:5
|
||||
|
|
||||
LL | match t {
|
||||
| - this expression has type `std::result::Result<_, {integer}>`
|
||||
...
|
||||
LL | None => ()
|
||||
| ^^^^ expected enum `std::result::Result`, found enum `std::option::Option`
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-37026.rs:6:9
|
||||
|
|
||||
LL | let empty_struct::XEmpty2 = ();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `empty_struct::XEmpty2`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ -- this expression has type `()`
|
||||
| |
|
||||
| expected `()`, found struct `empty_struct::XEmpty2`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-37026.rs:7:9
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-5100.rs:8:9
|
||||
|
|
||||
LL | match (true, false) {
|
||||
| ------------- this expression has type `(bool, bool)`
|
||||
LL | A::B => (),
|
||||
| ^^^^ expected tuple, found enum `A`
|
||||
|
|
||||
|
|
@ -10,6 +12,8 @@ LL | A::B => (),
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-5100.rs:17:9
|
||||
|
|
||||
LL | match (true, false) {
|
||||
| ------------- this expression has type `(bool, bool)`
|
||||
LL | (true, false, false) => ()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ expected a tuple with 2 elements, found one with 3 elements
|
||||
|
|
||||
|
|
@ -19,6 +23,8 @@ LL | (true, false, false) => ()
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-5100.rs:25:9
|
||||
|
|
||||
LL | match (true, false) {
|
||||
| ------------- this expression has type `(bool, bool)`
|
||||
LL | (true, false, false) => ()
|
||||
| ^^^^^^^^^^^^^^^^^^^^ expected a tuple with 2 elements, found one with 3 elements
|
||||
|
|
||||
|
|
@ -39,6 +45,8 @@ LL | box (true, false) => ()
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-5100.rs:40:9
|
||||
|
|
||||
LL | match (true, false) {
|
||||
| ------------- this expression has type `(bool, bool)`
|
||||
LL | &(true, false) => ()
|
||||
| ^^^^^^^^^^^^^^ expected tuple, found reference
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-7867.rs:7:9
|
||||
|
|
||||
LL | match (true, false) {
|
||||
| ------------- this expression has type `(bool, bool)`
|
||||
LL | A::B => (),
|
||||
| ^^^^ expected tuple, found enum `A`
|
||||
|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue