diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-02-28 17:17:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-28 17:17:28 +0100 |
| commit | a245221497aa03553b983e2d2bcb1c7ee80bb477 (patch) | |
| tree | 98d6ce459a4067cc654297d6263946f5d7556062 /src/test/ui/pattern | |
| parent | 3828fa2852bf5e622267b24c4eda74e4fa6cb5f9 (diff) | |
| parent | d234e131b8651ccf4bf8df05c9182e1085fa48fa (diff) | |
| download | rust-a245221497aa03553b983e2d2bcb1c7ee80bb477.tar.gz rust-a245221497aa03553b983e2d2bcb1c7ee80bb477.zip | |
Rollup merge of #69452 - Centril:typeck-pat, r=estebank
typeck: use `Pattern` obligation cause more for better diagnostics r? @estebank
Diffstat (limited to 'src/test/ui/pattern')
| -rw-r--r-- | src/test/ui/pattern/pat-tuple-bad-type.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/pattern/pat-tuple-overfield.stderr | 5 | ||||
| -rw-r--r-- | src/test/ui/pattern/pattern-ident-path-generics.stderr | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/pattern/pat-tuple-bad-type.stderr b/src/test/ui/pattern/pat-tuple-bad-type.stderr index 95cca38f7de..598b6a3794e 100644 --- a/src/test/ui/pattern/pat-tuple-bad-type.stderr +++ b/src/test/ui/pattern/pat-tuple-bad-type.stderr @@ -12,6 +12,8 @@ LL | (..) => {} error[E0308]: mismatched types --> $DIR/pat-tuple-bad-type.rs:10:9 | +LL | match 0u8 { + | --- this expression has type `u8` LL | (..) => {} | ^^^^ expected `u8`, found `()` diff --git a/src/test/ui/pattern/pat-tuple-overfield.stderr b/src/test/ui/pattern/pat-tuple-overfield.stderr index 25d02b8627c..45b6fd1b4d4 100644 --- a/src/test/ui/pattern/pat-tuple-overfield.stderr +++ b/src/test/ui/pattern/pat-tuple-overfield.stderr @@ -1,6 +1,8 @@ error[E0308]: mismatched types --> $DIR/pat-tuple-overfield.rs:5:9 | +LL | match (1, 2, 3) { + | --------- this expression has type `({integer}, {integer}, {integer})` LL | (1, 2, 3, 4) => {} | ^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements | @@ -10,6 +12,9 @@ LL | (1, 2, 3, 4) => {} error[E0308]: mismatched types --> $DIR/pat-tuple-overfield.rs:6:9 | +LL | match (1, 2, 3) { + | --------- this expression has type `({integer}, {integer}, {integer})` +LL | (1, 2, 3, 4) => {} LL | (1, 2, .., 3, 4) => {} | ^^^^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements | diff --git a/src/test/ui/pattern/pattern-ident-path-generics.stderr b/src/test/ui/pattern/pattern-ident-path-generics.stderr index 338eb6ff0c8..24b5cdf98d5 100644 --- a/src/test/ui/pattern/pattern-ident-path-generics.stderr +++ b/src/test/ui/pattern/pattern-ident-path-generics.stderr @@ -1,6 +1,8 @@ error[E0308]: mismatched types --> $DIR/pattern-ident-path-generics.rs:3:9 | +LL | match Some("foo") { + | ----------- this expression has type `std::option::Option<&str>` LL | None::<isize> => {} | ^^^^^^^^^^^^^ expected `&str`, found `isize` | |
