]> git.lizzy.rs Git - rust.git/commitdiff
Point (again) to more expressions with their type, even if not fully resolved
authorEsteban Kuber <esteban@kuber.com.ar>
Wed, 15 Dec 2021 23:16:21 +0000 (23:16 +0000)
committerEsteban Kuber <esteban@kuber.com.ar>
Sun, 27 Mar 2022 02:20:17 +0000 (02:20 +0000)
30 files changed:
compiler/rustc_infer/src/infer/error_reporting/mod.rs
src/test/ui/async-await/issue-61076.rs
src/test/ui/async-await/issue-61076.stderr
src/test/ui/async-await/suggest-missing-await.stderr
src/test/ui/blind/blind-item-block-middle.stderr
src/test/ui/destructuring-assignment/default-match-bindings-forbidden.stderr
src/test/ui/destructuring-assignment/tuple_destructure_fail.stderr
src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.stderr
src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.stderr
src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr
src/test/ui/half-open-range-patterns/pat-tuple-5.stderr
src/test/ui/issues/issue-11844.stderr
src/test/ui/issues/issue-12552.stderr
src/test/ui/issues/issue-13466.stderr
src/test/ui/issues/issue-33504.stderr
src/test/ui/issues/issue-3680.stderr
src/test/ui/issues/issue-4968.stderr
src/test/ui/issues/issue-72574-1.stderr
src/test/ui/keyword/keyword-false-as-identifier.stderr
src/test/ui/keyword/keyword-true-as-identifier.stderr
src/test/ui/match/match-range-fail.stderr
src/test/ui/mismatched_types/E0409.stderr
src/test/ui/mut/mut-pattern-mismatched.stderr
src/test/ui/or-patterns/already-bound-name.stderr
src/test/ui/or-patterns/inconsistent-modes.stderr
src/test/ui/parser/recover-range-pats.stderr
src/test/ui/pattern/issue-74702.stderr
src/test/ui/pattern/pat-tuple-overfield.stderr
src/test/ui/slightly-nice-generic-literal-messages.stderr
src/test/ui/structs/structure-constructor-type-mismatch.stderr

index abc25d51776f396ff54c43b1626e44d8b57ff9de..f1c21f5923926ab422908491cdb49694d10e4c1e 100644 (file)
@@ -602,7 +602,8 @@ fn note_error_origin(
         match *cause.code() {
             ObligationCauseCode::Pattern { origin_expr: true, span: Some(span), root_ty } => {
                 let ty = self.resolve_vars_if_possible(root_ty);
-                if ty.is_suggestable() {
+                if !matches!(ty.kind(), ty::Infer(ty::InferTy::TyVar(_) | ty::InferTy::FreshTy(_)))
+                {
                     // don't show type `_`
                     err.span_label(span, format!("this expression has type `{}`", ty));
                 }
index a94136cfea1fc44f162f9246256c1fd9c3e29db3..750fad8393bbf1bac8308303eb3da8f4f5d7083d 100644 (file)
@@ -87,6 +87,7 @@ async fn baz() -> Result<(), ()> {
 
 async fn match_() {
     match tuple() { //~ HELP consider `await`ing on the `Future`
+        //~^ NOTE this expression has type `impl Future<Output = Tuple>`
         Tuple(_) => {} //~ ERROR mismatched types
         //~^ NOTE expected opaque type, found struct `Tuple`
         //~| NOTE expected opaque type `impl Future<Output = Tuple>`
index 65c0bc695bfbc12732750ce08004c4027d6e705f..33839ea59392d111fb98292cfef63ddf1346563f 100644 (file)
@@ -56,8 +56,11 @@ LL |     struct_().await.method();
    |               ++++++
 
 error[E0308]: mismatched types
-  --> $DIR/issue-61076.rs:90:9
+  --> $DIR/issue-61076.rs:91:9
    |
+LL |     match tuple() {
+   |           ------- this expression has type `impl Future<Output = Tuple>`
+LL |
 LL |         Tuple(_) => {}
    |         ^^^^^^^^ expected opaque type, found struct `Tuple`
    |
index 3cca9616a358a34d7489d0efbd75aca2c185c2ba..76073c4c879967d48a99ac596fc71ef10eb60665 100644 (file)
@@ -91,6 +91,8 @@ LL ~         1 => dummy().await,
 error[E0308]: mismatched types
   --> $DIR/suggest-missing-await.rs:53:9
    |
+LL |     let _x = match dummy() {
+   |                    ------- this expression has type `impl Future<Output = ()>`
 LL |         () => {}
    |         ^^ expected opaque type, found `()`
    |
@@ -109,6 +111,9 @@ LL |     let _x = match dummy().await {
 error[E0308]: mismatched types
   --> $DIR/suggest-missing-await.rs:67:9
    |
+LL |     match dummy_result() {
+   |           -------------- this expression has type `impl Future<Output = Result<(), ()>>`
+...
 LL |         Ok(_) => {}
    |         ^^^^^ expected opaque type, found enum `Result`
    |
@@ -127,6 +132,9 @@ LL |     match dummy_result().await {
 error[E0308]: mismatched types
   --> $DIR/suggest-missing-await.rs:69:9
    |
+LL |     match dummy_result() {
+   |           -------------- this expression has type `impl Future<Output = Result<(), ()>>`
+...
 LL |         Err(_) => {}
    |         ^^^^^^ expected opaque type, found enum `Result`
    |
index 9db11cf1590e85baaa846c8247907f8e2e7763af..dd83f6edf62a43e6269af258c25f2e1227c1e2d8 100644 (file)
@@ -5,7 +5,7 @@ LL | mod foo { pub struct bar; }
    |           --------------- unit struct defined here
 ...
 LL |     let bar = 5;
-   |         ^^^
+   |         ^^^   - this expression has type `{integer}`
    |         |
    |         expected integer, found struct `bar`
    |         `bar` is interpreted as a unit struct, not a new binding
index 2250f561b54a5998bcd843b7123123f335bdb0a4..3d472bf63094d90db1d3c17e423876b8b0406690 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/default-match-bindings-forbidden.rs:4:5
    |
 LL |     (x, y) = &(1, 2);
-   |     ^^^^^^ expected reference, found tuple
+   |     ^^^^^^   ------- this expression has type `&({integer}, {integer})`
+   |     |
+   |     expected reference, found tuple
    |
    = note: expected type `&({integer}, {integer})`
              found tuple `(_, _)`
index 184b3ea6da82b6249af572c819aa312706148438..55b08b74af0620a0edd598c7aded9e46d23825f1 100644 (file)
@@ -10,7 +10,9 @@ error[E0308]: mismatched types
   --> $DIR/tuple_destructure_fail.rs:6:5
    |
 LL |     (a, a, b) = (1, 2);
-   |     ^^^^^^^^^ expected a tuple with 2 elements, found one with 3 elements
+   |     ^^^^^^^^^   ------ this expression has type `({integer}, {integer})`
+   |     |
+   |     expected a tuple with 2 elements, found one with 3 elements
    |
    = note: expected type `({integer}, {integer})`
              found tuple `(_, _, _)`
@@ -27,7 +29,9 @@ error[E0308]: mismatched types
   --> $DIR/tuple_destructure_fail.rs:8:5
    |
 LL |     (_,) = (1, 2);
-   |     ^^^^ expected a tuple with 2 elements, found one with 1 element
+   |     ^^^^   ------ this expression has type `({integer}, {integer})`
+   |     |
+   |     expected a tuple with 2 elements, found one with 1 element
    |
    = note: expected type `({integer}, {integer})`
              found tuple `(_,)`
index 241485db49bc9ad35e4353ed47b0f3f79a6809d1..a6f8563a047851e8a0ea337d02ca329895a881d5 100644 (file)
@@ -1,6 +1,8 @@
 error[E0308]: mismatched types
   --> $DIR/exclusive_range_pattern_syntax_collision.rs:6:13
    |
+LL |     match [5..4, 99..105, 43..44] {
+   |           ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
 LL |         [_, 99.., _] => {},
    |             ^^ expected struct `std::ops::Range`, found integer
    |
index 777d029d7dd7b392302af9c8a8114b4c31d61a84..4e0102c930da82b7ab86b7bac25a73033f2fe8f6 100644 (file)
@@ -7,6 +7,8 @@ LL |         [_, 99..] => {},
 error[E0308]: mismatched types
   --> $DIR/exclusive_range_pattern_syntax_collision2.rs:6:13
    |
+LL |     match [5..4, 99..105, 43..44] {
+   |           ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
 LL |         [_, 99..] => {},
    |             ^^ expected struct `std::ops::Range`, found integer
    |
index 6119733a7d84bda8b514709ccc0f4b9271d35c7a..665eef2fcb96c80ea7aff1c1f8ae0dbb3e0b5eb6 100644 (file)
@@ -1,6 +1,8 @@
 error[E0308]: mismatched types
   --> $DIR/exclusive_range_pattern_syntax_collision3.rs:6:12
    |
+LL |     match [5..4, 99..105, 43..44] {
+   |           ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
 LL |         [..9, 99..100, _] => {},
    |            ^ expected struct `std::ops::Range`, found integer
    |
@@ -10,6 +12,8 @@ LL |         [..9, 99..100, _] => {},
 error[E0308]: mismatched types
   --> $DIR/exclusive_range_pattern_syntax_collision3.rs:6:15
    |
+LL |     match [5..4, 99..105, 43..44] {
+   |           ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
 LL |         [..9, 99..100, _] => {},
    |               ^^  --- this is of type `{integer}`
    |               |
@@ -21,6 +25,8 @@ LL |         [..9, 99..100, _] => {},
 error[E0308]: mismatched types
   --> $DIR/exclusive_range_pattern_syntax_collision3.rs:6:19
    |
+LL |     match [5..4, 99..105, 43..44] {
+   |           ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
 LL |         [..9, 99..100, _] => {},
    |               --  ^^^ expected struct `std::ops::Range`, found integer
    |               |
index 31ea3a17871a56b9f3deb58c29b224394e38fe24..307ad711b74d9f58c988b557ef799556ed6a1482 100644 (file)
@@ -1,6 +1,8 @@
 error[E0308]: mismatched types
   --> $DIR/pat-tuple-5.rs:8:10
    |
+LL |     match (0, 1) {
+   |           ------ this expression has type `({integer}, {integer})`
 LL |         (PAT ..) => {}
    |          ^^^ expected tuple, found `u8`
    |
index ecab1074a295f742cacdffb1d71eb4c71899da74..9d7470e7af9aa9c557edc551e87a9647494c9fc7 100644 (file)
@@ -1,6 +1,8 @@
 error[E0308]: mismatched types
   --> $DIR/issue-11844.rs:6:9
    |
+LL |     match a {
+   |           - this expression has type `Option<Box<{integer}>>`
 LL |         Ok(a) =>
    |         ^^^^^ expected enum `Option`, found enum `Result`
    |
index 1ba6852b17c06a4068a18f3ed333828202c721d8..3d8852ca748af6c296119c129b3d520db51ed72b 100644 (file)
@@ -1,6 +1,8 @@
 error[E0308]: mismatched types
   --> $DIR/issue-12552.rs:6:5
    |
+LL |   match t {
+   |         - this expression has type `Result<_, {integer}>`
 LL |     Some(k) => match k {
    |     ^^^^^^^ expected enum `Result`, found enum `Option`
    |
@@ -10,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 `Result<_, {integer}>`
+...
 LL |     None => ()
    |     ^^^^ expected enum `Result`, found enum `Option`
    |
index 15ee49a5fdd25f48f17324b976d6bc990b1c1d4f..c78466f4e8ce1c03322bf9e144b57a4f11ea1ded 100644 (file)
@@ -1,6 +1,8 @@
 error[E0308]: mismatched types
   --> $DIR/issue-13466.rs:8:9
    |
+LL |     let _x: usize = match Some(1) {
+   |                           ------- this expression has type `Option<{integer}>`
 LL |         Ok(u) => u,
    |         ^^^^^ expected enum `Option`, found enum `Result`
    |
@@ -10,6 +12,9 @@ LL |         Ok(u) => u,
 error[E0308]: mismatched types
   --> $DIR/issue-13466.rs:14:9
    |
+LL |     let _x: usize = match Some(1) {
+   |                           ------- this expression has type `Option<{integer}>`
+...
 LL |         Err(e) => panic!(e)
    |         ^^^^^^ expected enum `Option`, found enum `Result`
    |
index 1e61178f42edbca6727c7e20d382f088a3c806d8..ec15525ed0601ee8220ab6b08b9cf96e8f2b42ee 100644 (file)
@@ -5,7 +5,7 @@ LL | struct Test;
    | ------------ unit struct defined here
 ...
 LL |         let Test = 1;
-   |             ^^^^
+   |             ^^^^   - this expression has type `{integer}`
    |             |
    |             expected integer, found struct `Test`
    |             `Test` is interpreted as a unit struct, not a new binding
index 8dc0dfa2356f4cf6606d8b7d762164b24c615fb6..e8fafa76b919bbc5d5860ac5075b338f1663f121 100644 (file)
@@ -1,6 +1,8 @@
 error[E0308]: mismatched types
   --> $DIR/issue-3680.rs:3:9
    |
+LL |     match None {
+   |           ---- this expression has type `Option<_>`
 LL |         Err(_) => ()
    |         ^^^^^^ expected enum `Option`, found enum `Result`
    |
index 5451cf423559ed14d681785ac1f503ac07b81a4d..57ff7fe09e5b951ce4d5e24a167befd2e327f1c8 100644 (file)
@@ -5,11 +5,12 @@ LL | const A: (isize,isize) = (4,2);
    | ------------------------------- constant defined here
 LL | fn main() {
 LL |     match 42 { A => () }
-   |                ^
-   |                |
-   |                expected integer, found tuple
-   |                `A` is interpreted as a constant, not a new binding
-   |                help: introduce a new binding instead: `other_a`
+   |           --   ^
+   |           |    |
+   |           |    expected integer, found tuple
+   |           |    `A` is interpreted as a constant, not a new binding
+   |           |    help: introduce a new binding instead: `other_a`
+   |           this expression has type `{integer}`
    |
    = note: expected type `{integer}`
              found tuple `(isize, isize)`
index 5d3d390a95dedfe0aa94e02cf2d3d6246b6d3ca6..653869a237d88b5d70def281be3e4aec317cad64 100644 (file)
@@ -21,6 +21,8 @@ LL |         (_a, _x @ ..) => {}
 error[E0308]: mismatched types
   --> $DIR/issue-72574-1.rs:4:9
    |
+LL |     match x {
+   |           - this expression has type `({integer}, {integer}, {integer})`
 LL |         (_a, _x @ ..) => {}
    |         ^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 2 elements
    |
index fcc3006401816101163bef97744ac2f894ac55db..6dcfa3a48116126ea782e63b0eedc134c3c73ffe 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/keyword-false-as-identifier.rs:2:9
    |
 LL |     let false = 22;
-   |         ^^^^^ expected integer, found `bool`
+   |         ^^^^^   -- this expression has type `{integer}`
+   |         |
+   |         expected integer, found `bool`
 
 error: aborting due to previous error
 
index b8cc2ffd2a826fad4e8465b6bc784d95167cd529..86f6e00064f7da6def4fc493e064808489416ceb 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/keyword-true-as-identifier.rs:2:9
    |
 LL |     let true = 22;
-   |         ^^^^ expected integer, found `bool`
+   |         ^^^^   -- this expression has type `{integer}`
+   |         |
+   |         expected integer, found `bool`
 
 error: aborting due to previous error
 
index 938c05ac7324c8c02295977068cdb824c516b739..65db92df19f795b95173bacbd687df575f3ff69c 100644 (file)
@@ -27,6 +27,8 @@ LL |         true ..= "what" => {}
 error[E0308]: mismatched types
   --> $DIR/match-range-fail.rs:18:9
    |
+LL |     match 5 {
+   |           - this expression has type `{integer}`
 LL |         'c' ..= 100 => { }
    |         ^^^     --- this is of type `{integer}`
    |         |
index eb884bcc6226fef462095aeda83c2ca69e0a6e10..ef03b67b1b0b19db03bec5b038bdc717c315cb8b 100644 (file)
@@ -9,6 +9,8 @@ LL |         (0, ref y) | (y, 0) => {}
 error[E0308]: mismatched types
   --> $DIR/E0409.rs:5:23
    |
+LL |     match x {
+   |           - this expression has type `({integer}, {integer})`
 LL |         (0, ref y) | (y, 0) => {}
    |             -----     ^ expected `&{integer}`, found integer
    |             |
index ccc8ac1278c63576c2ed2d253c653f312e9f8338..cad1cef5155d5f1ba54e81808a613ebbaa467129 100644 (file)
@@ -3,6 +3,9 @@ error[E0308]: mismatched types
    |
 LL |      let &_
    |          ^^ types differ in mutability
+...
+LL |         = foo;
+   |           --- this expression has type `&mut {integer}`
    |
    = note: expected mutable reference `&mut {integer}`
                       found reference `&_`
@@ -12,6 +15,9 @@ error[E0308]: mismatched types
    |
 LL |     let &mut _
    |         ^^^^^^ types differ in mutability
+...
+LL |          = bar;
+   |            --- this expression has type `&{integer}`
    |
    = note:      expected reference `&{integer}`
            found mutable reference `&mut _`
index 92416a0d5cbf086d739ef3e5df92d4b9cae3d084..66112165622b95ff35a27d74a4fdf908cf172567 100644 (file)
@@ -86,8 +86,9 @@ error[E0308]: mismatched types
   --> $DIR/already-bound-name.rs:30:32
    |
 LL |     let (B(A(a, _) | B(a)) | A(a, A(a, _) | B(a))) = B(B(1));
-   |              -                 ^ expected integer, found enum `E`
-   |              |
+   |              -                 ^                     ------- this expression has type `E<E<{integer}>>`
+   |              |                 |
+   |              |                 expected integer, found enum `E`
    |              first introduced with type `{integer}` here
    |
    = note: expected type `{integer}`
index 95e8618808c08e392f294200cf5e43c4fe57e5fa..dae6bb41e74e296b67127be90a874cbcde098403 100644 (file)
@@ -65,8 +65,9 @@ error[E0308]: mismatched types
   --> $DIR/inconsistent-modes.rs:13:32
    |
 LL |     let (Ok((ref a, b)) | Err((ref mut a, ref b))) = Ok((0, &0));
-   |              -----             ^^^^^^^^^ types differ in mutability
-   |              |
+   |              -----             ^^^^^^^^^             ----------- this expression has type `Result<({integer}, &{integer}), (_, _)>`
+   |              |                 |
+   |              |                 types differ in mutability
    |              first introduced with type `&{integer}` here
    |
    = note: expected type `&{integer}`
index 9296ad2e335f1727532e0bbea9ac857fb0866611..8063ba8e9f7bdaf80fb202df86c230b8c4ddd41e 100644 (file)
@@ -303,8 +303,9 @@ error[E0308]: mismatched types
   --> $DIR/recover-range-pats.rs:22:12
    |
 LL |     if let .0..Y = 0 {}
-   |            ^^  - this is of type `u8`
-   |            |
+   |            ^^  -   - this expression has type `{integer}`
+   |            |   |
+   |            |   this is of type `u8`
    |            expected integer, found floating-point number
 
 error[E0308]: mismatched types
@@ -336,8 +337,9 @@ error[E0308]: mismatched types
   --> $DIR/recover-range-pats.rs:35:12
    |
 LL |     if let .0..=Y = 0 {}
-   |            ^^   - this is of type `u8`
-   |            |
+   |            ^^   -   - this expression has type `{integer}`
+   |            |    |
+   |            |    this is of type `u8`
    |            expected integer, found floating-point number
 
 error[E0308]: mismatched types
@@ -369,8 +371,9 @@ error[E0308]: mismatched types
   --> $DIR/recover-range-pats.rs:60:12
    |
 LL |     if let .0...Y = 0 {}
-   |            ^^   - this is of type `u8`
-   |            |
+   |            ^^   -   - this expression has type `{integer}`
+   |            |    |
+   |            |    this is of type `u8`
    |            expected integer, found floating-point number
 
 error[E0308]: mismatched types
@@ -392,7 +395,9 @@ error[E0308]: mismatched types
   --> $DIR/recover-range-pats.rs:75:12
    |
 LL |     if let .0.. = 0 {}
-   |            ^^ expected integer, found floating-point number
+   |            ^^     - this expression has type `{integer}`
+   |            |
+   |            expected integer, found floating-point number
 
 error[E0029]: only `char` and numeric types are allowed in range patterns
   --> $DIR/recover-range-pats.rs:83:12
@@ -404,7 +409,9 @@ error[E0308]: mismatched types
   --> $DIR/recover-range-pats.rs:85:12
    |
 LL |     if let .0..= = 0 {}
-   |            ^^ expected integer, found floating-point number
+   |            ^^      - this expression has type `{integer}`
+   |            |
+   |            expected integer, found floating-point number
 
 error[E0029]: only `char` and numeric types are allowed in range patterns
   --> $DIR/recover-range-pats.rs:93:12
@@ -416,7 +423,9 @@ error[E0308]: mismatched types
   --> $DIR/recover-range-pats.rs:95:12
    |
 LL |     if let .0... = 0 {}
-   |            ^^ expected integer, found floating-point number
+   |            ^^      - this expression has type `{integer}`
+   |            |
+   |            expected integer, found floating-point number
 
 error[E0029]: only `char` and numeric types are allowed in range patterns
   --> $DIR/recover-range-pats.rs:103:14
@@ -428,7 +437,9 @@ error[E0308]: mismatched types
   --> $DIR/recover-range-pats.rs:105:15
    |
 LL |     if let .. .0 = 0 {}
-   |               ^^ expected integer, found floating-point number
+   |               ^^   - this expression has type `{integer}`
+   |               |
+   |               expected integer, found floating-point number
 
 error[E0029]: only `char` and numeric types are allowed in range patterns
   --> $DIR/recover-range-pats.rs:113:15
@@ -440,7 +451,9 @@ error[E0308]: mismatched types
   --> $DIR/recover-range-pats.rs:115:15
    |
 LL |     if let ..=.0 = 0 {}
-   |               ^^ expected integer, found floating-point number
+   |               ^^   - this expression has type `{integer}`
+   |               |
+   |               expected integer, found floating-point number
 
 error[E0029]: only `char` and numeric types are allowed in range patterns
   --> $DIR/recover-range-pats.rs:125:15
@@ -452,7 +465,9 @@ error[E0308]: mismatched types
   --> $DIR/recover-range-pats.rs:128:15
    |
 LL |     if let ....3 = 0 {}
-   |               ^^ expected integer, found floating-point number
+   |               ^^   - this expression has type `{integer}`
+   |               |
+   |               expected integer, found floating-point number
 
 error: aborting due to 60 previous errors
 
index 53dcf97f81c6a4d765577e4c39525b9a16948f88..f2e2c8f021badac2c2a555395adb7c74c33c7e19 100644 (file)
@@ -22,7 +22,9 @@ error[E0308]: mismatched types
   --> $DIR/issue-74702.rs:2:9
    |
 LL |     let (foo @ ..,) = (0, 0);
-   |         ^^^^^^^^^^^ expected a tuple with 2 elements, found one with 1 element
+   |         ^^^^^^^^^^^   ------ this expression has type `({integer}, {integer})`
+   |         |
+   |         expected a tuple with 2 elements, found one with 1 element
    |
    = note: expected tuple `({integer}, {integer})`
               found tuple `(_,)`
index 64b6e5eec5562565ee52e6ae1dbac996574b0cad..1c44f7e5f6f1fa8e1015628fc662c57ffa388a10 100644 (file)
@@ -150,6 +150,8 @@ LL |         E1::Z0 => {}
 error[E0308]: mismatched types
   --> $DIR/pat-tuple-overfield.rs:19: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
    |
@@ -159,6 +161,9 @@ LL |         (1, 2, 3, 4) => {}
 error[E0308]: mismatched types
   --> $DIR/pat-tuple-overfield.rs:20: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
    |
index 61eabed950423834089b6d0a9dd8289d0200c1eb..14f01f0ebdf7386055fcdec842f0ddce5d53b26c 100644 (file)
@@ -1,6 +1,8 @@
 error[E0308]: mismatched types
   --> $DIR/slightly-nice-generic-literal-messages.rs:7:9
    |
+LL |     match Foo(1.1, marker::PhantomData) {
+   |           ----------------------------- this expression has type `Foo<{float}, _>`
 LL |         1 => {}
    |         ^ expected struct `Foo`, found integer
    |
index 98972a121599655cae0f36351dd2aa84dae2c516..3d64fc601df988f32052207bbcddca2a85ebed28 100644 (file)
@@ -101,6 +101,8 @@ LL | type PointF = Point<f32>;
 error[E0308]: mismatched types
   --> $DIR/structure-constructor-type-mismatch.rs:54:9
    |
+LL |     match (Point { x: 1, y: 2 }) {
+   |           ---------------------- this expression has type `Point<{integer}>`
 LL |         PointF::<u32> { .. } => {}
    |         ^^^^^^^^^^^^^^^^^^^^ expected integer, found `f32`
    |
@@ -110,6 +112,8 @@ LL |         PointF::<u32> { .. } => {}
 error[E0308]: mismatched types
   --> $DIR/structure-constructor-type-mismatch.rs:59:9
    |
+LL |     match (Point { x: 1, y: 2 }) {
+   |           ---------------------- this expression has type `Point<{integer}>`
 LL |         PointF { .. } => {}
    |         ^^^^^^^^^^^^^ expected integer, found `f32`
    |
@@ -119,6 +123,8 @@ LL |         PointF { .. } => {}
 error[E0308]: mismatched types
   --> $DIR/structure-constructor-type-mismatch.rs:67:9
    |
+LL |     match (Pair { x: 1, y: 2 }) {
+   |           --------------------- this expression has type `Pair<{integer}, {integer}>`
 LL |         PairF::<u32> { .. } => {}
    |         ^^^^^^^^^^^^^^^^^^^ expected integer, found `f32`
    |