]> git.lizzy.rs Git - rust.git/commitdiff
Point at type in `let` assignment on type errors
authorEsteban Küber <esteban@kuber.com.ar>
Tue, 19 Nov 2019 05:00:24 +0000 (21:00 -0800)
committerEsteban Küber <esteban@kuber.com.ar>
Fri, 22 Nov 2019 03:24:31 +0000 (19:24 -0800)
101 files changed:
src/librustc_typeck/check/demand.rs
src/test/rustdoc-ui/failed-doctest-missing-codes.stdout
src/test/ui/array-not-vector.stderr
src/test/ui/associated-types/associated-types-eq-3.stderr
src/test/ui/associated-types/associated-types-path-2.stderr
src/test/ui/c-variadic/variadic-ffi-1.stderr
src/test/ui/closures/closure-no-fn-1.stderr
src/test/ui/closures/closure-no-fn-2.stderr
src/test/ui/coercion/coerce-to-bang.stderr
src/test/ui/coercion/coercion-slice.stderr
src/test/ui/const-generics/fn-const-param-infer.stderr
src/test/ui/const-generics/raw-ptr-const-param.stderr
src/test/ui/const-generics/slice-const-param-mismatch.stderr
src/test/ui/const-generics/types-mismatch-const-args.stderr
src/test/ui/conversion-methods.stderr
src/test/ui/cross/cross-borrow-trait.stderr
src/test/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr
src/test/ui/did_you_mean/recursion_limit_deref.stderr
src/test/ui/dst/dst-bad-coerce1.stderr
src/test/ui/dst/dst-bad-coerce2.stderr
src/test/ui/dst/dst-bad-coerce4.stderr
src/test/ui/dst/dst-bad-coercions.stderr
src/test/ui/float-literal-inference-restrictions.stderr
src/test/ui/fn/fn-trait-formatting.stderr
src/test/ui/generic/generic-type-params-name-repr.stderr
src/test/ui/hrtb/hrtb-exists-forall-fn.stderr
src/test/ui/impl-trait/equality2.stderr
src/test/ui/include-macros/mismatched-types.stderr
src/test/ui/issues/issue-1362.stderr
src/test/ui/issues/issue-22684.stderr
src/test/ui/issues/issue-24322.stderr
src/test/ui/issues/issue-27042.stderr
src/test/ui/issues/issue-3477.stderr
src/test/ui/issues/issue-37665.stderr
src/test/ui/issues/issue-38940.stderr
src/test/ui/issues/issue-5100.stderr
src/test/ui/issues/issue-53692.stderr
src/test/ui/issues/issue-56943.stderr
src/test/ui/json-bom-plus-crlf-multifile.stderr
src/test/ui/json-bom-plus-crlf.stderr
src/test/ui/meta-expected-error-correct-rev.a.stderr
src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr
src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
src/test/ui/mir-unpretty.stderr
src/test/ui/mismatched_types/main.stderr
src/test/ui/never_type/never-assign-wrong-type.stderr
src/test/ui/noexporttypeexe.stderr
src/test/ui/numeric/const-scope.stderr
src/test/ui/numeric/numeric-cast-2.stderr
src/test/ui/or-patterns/issue-64879-trailing-before-guard.stderr
src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr
src/test/ui/parser/lex-bad-char-literals-6.stderr
src/test/ui/parser/numeric-lifetime.stderr
src/test/ui/parser/recover-from-homoglyph.stderr
src/test/ui/parser/recover-missing-semi.stderr
src/test/ui/parser/recover-tuple.stderr
src/test/ui/parser/unclosed-delimiter-in-dep.stderr
src/test/ui/proc-macro/attribute-spans-preserved.stderr
src/test/ui/proc-macro/attribute-with-error.stderr
src/test/ui/proc-macro/nested-item-spans.stderr
src/test/ui/proc-macro/span-preservation.stderr
src/test/ui/ptr-coercion.stderr
src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr
src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr
src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr
src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr
src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr
src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr
src/test/ui/reify-intrinsic.stderr
src/test/ui/resolve/privacy-enum-ctor.stderr
src/test/ui/shift-various-bad-types.stderr
src/test/ui/slice-mut.stderr
src/test/ui/span/coerce-suggestions.stderr
src/test/ui/span/move-closure.stderr
src/test/ui/str/str-array-assignment.stderr
src/test/ui/str/str-lit-type-mismatch.stderr
src/test/ui/struct-literal-variant-in-if.stderr
src/test/ui/substs-ppaux.normal.stderr
src/test/ui/substs-ppaux.verbose.stderr
src/test/ui/suggestions/as-ref.stderr
src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr
src/test/ui/suggestions/format-borrow.stderr
src/test/ui/suggestions/issue-59819.stderr
src/test/ui/suggestions/mismatched-types-numeric-from.stderr
src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr
src/test/ui/suggestions/suggest-box.stderr
src/test/ui/tag-that-dare-not-speak-its-name.stderr
src/test/ui/terminal-width/non-whitespace-trimming-2.stderr
src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr
src/test/ui/terminal-width/non-whitespace-trimming.stderr
src/test/ui/terminal-width/whitespace-trimming.stderr
src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr
src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr
src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr
src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr
src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr
src/test/ui/type/type-check/assignment-expected-bool.stderr
src/test/ui/type/type-mismatch-multiple.stderr
src/test/ui/type/type-shadow.stderr
src/test/ui/typeck/typeck_type_placeholder_mismatch.stderr
src/test/ui/wrong-mul-method-signature.stderr

index 5d9b3a8fba4d77e613f63ee23cdd65145ef265b4..6a7cf4dd328785278d69e38df2f5254aec65e377 100644 (file)
@@ -102,12 +102,13 @@ pub fn demand_coerce(&self,
     // N.B., this code relies on `self.diverges` to be accurate. In
     // particular, assignments to `!` will be permitted if the
     // diverges flag is currently "always".
-    pub fn demand_coerce_diag(&self,
-                              expr: &hir::Expr,
-                              checked_ty: Ty<'tcx>,
-                              expected: Ty<'tcx>,
-                              allow_two_phase: AllowTwoPhase)
-                              -> (Ty<'tcx>, Option<DiagnosticBuilder<'tcx>>) {
+    pub fn demand_coerce_diag(
+        &self,
+        expr: &hir::Expr,
+        checked_ty: Ty<'tcx>,
+        expected: Ty<'tcx>,
+        allow_two_phase: AllowTwoPhase,
+    ) -> (Ty<'tcx>, Option<DiagnosticBuilder<'tcx>>) {
         let expected = self.resolve_vars_with_obligations(expected);
 
         let e = match self.try_coerce(expr, checked_ty, expected, allow_two_phase) {
@@ -126,6 +127,7 @@ pub fn demand_coerce_diag(&self,
             return (expected, None)
         }
 
+        self.annotate_expected_due_to_let_ty(&mut err, expr);
         self.suggest_compatible_variants(&mut err, expr, expected, expr_ty);
         self.suggest_ref_or_into(&mut err, expr, expected, expr_ty);
         self.suggest_boxing_when_appropriate(&mut err, expr, expected, expr_ty);
@@ -134,6 +136,20 @@ pub fn demand_coerce_diag(&self,
         (expected, Some(err))
     }
 
+    fn annotate_expected_due_to_let_ty(&self, err: &mut DiagnosticBuilder<'_>, expr: &hir::Expr) {
+        let parent = self.tcx.hir().get_parent_node(expr.hir_id);
+        if let Some(hir::Node::Local(hir::Local {
+            ty: Some(ty),
+            init: Some(init),
+            ..
+        })) = self.tcx.hir().find(parent) {
+            if init.hir_id == expr.hir_id {
+                // Point at `let` assignment type.
+                err.span_label(ty.span, "expected due to this");
+            }
+        }
+    }
+
     /// Returns whether the expected type is `bool` and the expression is `x = y`.
     pub fn is_assign_to_bool(&self, expr: &hir::Expr, expected: Ty<'tcx>) -> bool {
         if let hir::ExprKind::Assign(..) = expr.kind {
index 9d486d0a661e975f3f80adcf9fd4b4f826ec1755..e4ed4622322322dc41c1262a28d6c4a3ec6b47db 100644 (file)
@@ -9,7 +9,9 @@ error[E0308]: mismatched types
   --> $DIR/failed-doctest-missing-codes.rs:9:13
    |
 LL | let x: () = 5i32;
-   |             ^^^^ expected `()`, found `i32`
+   |        --   ^^^^ expected `()`, found `i32`
+   |        |
+   |        expected due to this
 
 error: aborting due to previous error
 
index 412a8ae846124879eb9afdf1647e3e7e945876b0..0e187d9072a8a512a51cf0cb439d7c1f4284b9e5 100644 (file)
@@ -2,13 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/array-not-vector.rs:2:19
    |
 LL |     let _x: i32 = [1, 2, 3];
-   |                   ^^^^^^^^^ expected `i32`, found array `[{integer}; 3]`
+   |             ---   ^^^^^^^^^ expected `i32`, found array `[{integer}; 3]`
+   |             |
+   |             expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/array-not-vector.rs:7:20
    |
 LL |     let _y: &i32 = x;
-   |                    ^ expected `i32`, found slice `[i32]`
+   |             ----   ^ expected `i32`, found slice `[i32]`
+   |             |
+   |             expected due to this
    |
    = note: expected reference `&i32`
               found reference `&[i32]`
index 24c830d8b5bbb2e254bd5abb7b144f3b2e1cbd79..d4e6bed82321b92ad1f5c9f92b2fe51f6b354aab 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/associated-types-eq-3.rs:23:18
    |
 LL |     let _: Bar = x.boo();
-   |                  ^^^^^^^ expected struct `Bar`, found associated type
+   |            ---   ^^^^^^^ expected struct `Bar`, found associated type
+   |            |
+   |            expected due to this
    |
    = note:       expected struct `Bar`
            found associated type `<I as Foo>::A`
index f1b7798262403736a9c54b94dfc4982d9a3302c8..ec24260ec7548f8c6c9dcc8008578f1d6a8dc049 100644 (file)
@@ -43,7 +43,9 @@ error[E0308]: mismatched types
   --> $DIR/associated-types-path-2.rs:41:18
    |
 LL |     let _: i32 = f2(2i32);
-   |                  ^^^^^^^^ expected `i32`, found `u32`
+   |            ---   ^^^^^^^^ expected `i32`, found `u32`
+   |            |
+   |            expected due to this
    |
 help: you can convert an `u32` to `i32` and panic if the converted value wouldn't fit
    |
index 3d1710648daa26b3ec84c7cf02bae3d3ffa88708..39217cc89c81a0999a8fa6f78a25d77f4f479d64 100644 (file)
@@ -26,7 +26,9 @@ error[E0308]: mismatched types
   --> $DIR/variadic-ffi-1.rs:19:56
    |
 LL |         let x: unsafe extern "C" fn(f: isize, x: u8) = foo;
-   |                                                        ^^^ expected non-variadic fn, found variadic function
+   |                -------------------------------------   ^^^ expected non-variadic fn, found variadic function
+   |                |
+   |                expected due to this
    |
    = note: expected fn pointer `unsafe extern "C" fn(isize, u8)`
                  found fn item `unsafe extern "C" fn(isize, u8, ...) {foo}`
@@ -35,7 +37,9 @@ error[E0308]: mismatched types
   --> $DIR/variadic-ffi-1.rs:20:54
    |
 LL |         let y: extern "C" fn(f: isize, x: u8, ...) = bar;
-   |                                                      ^^^ expected variadic fn, found non-variadic function
+   |                -----------------------------------   ^^^ expected variadic fn, found non-variadic function
+   |                |
+   |                expected due to this
    |
    = note: expected fn pointer `extern "C" fn(isize, u8, ...)`
                  found fn item `extern "C" fn(isize, u8) {bar}`
index 9945530a5a7fe9fd4fffb1f0d9f0dfbdd8eed442..5e76ee5a9a56dcc01897738bc2742a52696e22ba 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/closure-no-fn-1.rs:6:29
    |
 LL |     let foo: fn(u8) -> u8 = |v: u8| { a += v; a };
-   |                             ^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found closure
+   |              ------------   ^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found closure
+   |              |
+   |              expected due to this
    |
    = note: expected fn pointer `fn(u8) -> u8`
                  found closure `[closure@$DIR/closure-no-fn-1.rs:6:29: 6:50 a:_]`
index f3b0d155dd9fe86c936a57cef4f27115fa0e0189..07ffd6e5c9931f0373903faf6f896c54996f3d9e 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/closure-no-fn-2.rs:6:27
    |
 LL |     let bar: fn() -> u8 = || { b };
-   |                           ^^^^^^^^ expected fn pointer, found closure
+   |              ----------   ^^^^^^^^ expected fn pointer, found closure
+   |              |
+   |              expected due to this
    |
    = note: expected fn pointer `fn() -> u8`
                  found closure `[closure@$DIR/closure-no-fn-2.rs:6:27: 6:35 b:_]`
index 9629a247e016d29dd3644b01e463e7fa8ec58f77..ca4270597375099949b590b121e1212345e059e9 100644 (file)
@@ -47,7 +47,9 @@ error[E0308]: mismatched types
   --> $DIR/coerce-to-bang.rs:48:21
    |
 LL |     let x: [!; 2] = [return, 22];
-   |                     ^^^^^^^^^^^^ expected `!`, found integer
+   |            ------   ^^^^^^^^^^^^ expected `!`, found integer
+   |            |
+   |            expected due to this
    |
    = note: expected array `[!; 2]`
               found array `[{integer}; 2]`
index 0e7fc06a9b720b7f78790d17fa1bdb53c4805e0c..42dc954ffd5e7c454d7b6e810fb94a1cd4b48efc 100644 (file)
@@ -2,10 +2,11 @@ error[E0308]: mismatched types
   --> $DIR/coercion-slice.rs:4:21
    |
 LL |     let _: &[i32] = [0];
-   |                     ^^^
-   |                     |
-   |                     expected `&[i32]`, found array `[{integer}; 1]`
-   |                     help: consider borrowing here: `&[0]`
+   |            ------   ^^^
+   |            |        |
+   |            |        expected `&[i32]`, found array `[{integer}; 1]`
+   |            |        help: consider borrowing here: `&[0]`
+   |            expected due to this
 
 error: aborting due to previous error
 
index 8f61e35e492cf0c98fa4faeff172791872ec171a..3f53b91541cb1bbb38a44a39670ba6aaa8a689c9 100644 (file)
@@ -10,7 +10,9 @@ error[E0308]: mismatched types
   --> $DIR/fn-const-param-infer.rs:16:31
    |
 LL |     let _: Checked<not_one> = Checked::<not_two>;
-   |                               ^^^^^^^^^^^^^^^^^^ expected `not_one`, found `not_two`
+   |            ----------------   ^^^^^^^^^^^^^^^^^^ expected `not_one`, found `not_two`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `Checked<not_one>`
               found struct `Checked<not_two>`
@@ -34,7 +36,9 @@ error[E0308]: mismatched types
   --> $DIR/fn-const-param-infer.rs:25:40
    |
 LL |     let _: Checked<{generic::<u32>}> = Checked::<{generic::<u16>}>;
-   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `generic::<u32>`, found `generic::<u16>`
+   |            -------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `generic::<u32>`, found `generic::<u16>`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `Checked<generic::<u32>>`
               found struct `Checked<generic::<u16>>`
index ff5c59fa375fffb86a040eaef510720dd65693e6..9cd39b61dc9367accff286bf3b9ef31cfb0f7444 100644 (file)
@@ -10,7 +10,9 @@ error[E0308]: mismatched types
   --> $DIR/raw-ptr-const-param.rs:7:38
    |
 LL |     let _: Const<{15 as *const _}> = Const::<{10 as *const _}>;
-   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{pointer}`, found `{pointer}`
+   |            -----------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{pointer}`, found `{pointer}`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `Const<{pointer}>`
               found struct `Const<{pointer}>`
index 9d11da13315857a435509ec80ac774de3c1bdfea..a588d82318b94934fbc70083cb5b3afc4bee3f4e 100644 (file)
@@ -10,7 +10,9 @@ error[E0308]: mismatched types
   --> $DIR/slice-const-param-mismatch.rs:9:35
    |
 LL |     let _: ConstString<"Hello"> = ConstString::<"World">;
-   |                                   ^^^^^^^^^^^^^^^^^^^^^^ expected `"Hello"`, found `"World"`
+   |            --------------------   ^^^^^^^^^^^^^^^^^^^^^^ expected `"Hello"`, found `"World"`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `ConstString<"Hello">`
               found struct `ConstString<"World">`
@@ -19,7 +21,9 @@ error[E0308]: mismatched types
   --> $DIR/slice-const-param-mismatch.rs:11:33
    |
 LL |     let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↥">;
-   |                                  ^^^^^^^^^^^^^^^^^^^^^ expected `"ℇ㇈↦"`, found `"ℇ㇈↥"`
+   |            -------------------   ^^^^^^^^^^^^^^^^^^^^^ expected `"ℇ㇈↦"`, found `"ℇ㇈↥"`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `ConstString<"ℇ㇈↦">`
               found struct `ConstString<"ℇ㇈↥">`
@@ -28,7 +32,9 @@ error[E0308]: mismatched types
   --> $DIR/slice-const-param-mismatch.rs:13:33
    |
 LL |     let _: ConstBytes<b"AAA"> = ConstBytes::<b"BBB">;
-   |                                 ^^^^^^^^^^^^^^^^^^^^ expected `b"AAA"`, found `b"BBB"`
+   |            ------------------   ^^^^^^^^^^^^^^^^^^^^ expected `b"AAA"`, found `b"BBB"`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `ConstBytes<b"AAA">`
               found struct `ConstBytes<b"BBB">`
index 0ce98f1455c9957f78eb5ec33bbe50762078291d..4266fd250b0570214a37a6732299c05c410e48a3 100644 (file)
@@ -10,7 +10,9 @@ error[E0308]: mismatched types
   --> $DIR/types-mismatch-const-args.rs:13:41
    |
 LL |     let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {4u32}, {3u32}> { data: PhantomData };
-   |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2u32`, found `4u32`
+   |            --------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2u32`, found `4u32`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `A<'_, _, 2u32, _>`
               found struct `A<'_, _, 4u32, _>`
@@ -19,7 +21,9 @@ error[E0308]: mismatched types
   --> $DIR/types-mismatch-const-args.rs:15:41
    |
 LL |     let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData };
-   |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32`
+   |            --------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `A<'a, u16, _, _>`
               found struct `A<'b, u32, _, _>`
index 1aca37a6fb82ee6b630d75eace760fd6059ccab8..b3621a27acb716e2666691dee71e8ba6a5d7c14a 100644 (file)
@@ -2,37 +2,41 @@ error[E0308]: mismatched types
   --> $DIR/conversion-methods.rs:5:41
    |
 LL |     let _tis_an_instants_play: String = "'Tis a fond Ambush—";
-   |                                         ^^^^^^^^^^^^^^^^^^^^^
-   |                                         |
-   |                                         expected struct `std::string::String`, found `&str`
-   |                                         help: try using a conversion method: `"'Tis a fond Ambush—".to_string()`
+   |                                ------   ^^^^^^^^^^^^^^^^^^^^^
+   |                                |        |
+   |                                |        expected struct `std::string::String`, found `&str`
+   |                                |        help: try using a conversion method: `"'Tis a fond Ambush—".to_string()`
+   |                                expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/conversion-methods.rs:6:40
    |
 LL |     let _just_to_make_bliss: PathBuf = Path::new("/ern/her/own/surprise");
-   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                                        |
-   |                                        expected struct `std::path::PathBuf`, found `&std::path::Path`
-   |                                        help: try using a conversion method: `Path::new("/ern/her/own/surprise").to_path_buf()`
+   |                              -------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                              |         |
+   |                              |         expected struct `std::path::PathBuf`, found `&std::path::Path`
+   |                              |         help: try using a conversion method: `Path::new("/ern/her/own/surprise").to_path_buf()`
+   |                              expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/conversion-methods.rs:9:40
    |
 LL |     let _but_should_the_play: String = 2; // Perhaps surprisingly, we suggest .to_string() here
-   |                                        ^
-   |                                        |
-   |                                        expected struct `std::string::String`, found integer
-   |                                        help: try using a conversion method: `2.to_string()`
+   |                               ------   ^
+   |                               |        |
+   |                               |        expected struct `std::string::String`, found integer
+   |                               |        help: try using a conversion method: `2.to_string()`
+   |                               expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/conversion-methods.rs:12:47
    |
 LL |     let _prove_piercing_earnest: Vec<usize> = &[1, 2, 3];
-   |                                               ^^^^^^^^^^
-   |                                               |
-   |                                               expected struct `std::vec::Vec`, found `&[{integer}; 3]`
-   |                                               help: try using a conversion method: `(&[1, 2, 3]).to_vec()`
+   |                                  ----------   ^^^^^^^^^^
+   |                                  |            |
+   |                                  |            expected struct `std::vec::Vec`, found `&[{integer}; 3]`
+   |                                  |            help: try using a conversion method: `(&[1, 2, 3]).to_vec()`
+   |                                  expected due to this
    |
    = note: expected struct `std::vec::Vec<usize>`
            found reference `&[{integer}; 3]`
index 9bffa6bd111a610ee670a215ccec9ccb567725e8..618f6595d41d02f3f98374fdfb0dbff9b2d5e9d2 100644 (file)
@@ -2,10 +2,11 @@ error[E0308]: mismatched types
   --> $DIR/cross-borrow-trait.rs:10:26
    |
 LL |     let _y: &dyn Trait = x;
-   |                          ^
-   |                          |
-   |                          expected `&dyn Trait`, found struct `std::boxed::Box`
-   |                          help: consider borrowing here: `&x`
+   |             ----------   ^
+   |             |            |
+   |             |            expected `&dyn Trait`, found struct `std::boxed::Box`
+   |             |            help: consider borrowing here: `&x`
+   |             expected due to this
    |
    = note: expected reference `&dyn Trait`
                  found struct `std::boxed::Box<dyn Trait>`
index e2c3c08a8d914ce476c7421b017847e6dc2f9e09..6f853ccab378ae7ee33dcde1fc531616c033b4c9 100644 (file)
@@ -2,40 +2,47 @@ error[E0308]: mismatched types
   --> $DIR/issue-53280-expected-float-found-integer-literal.rs:2:24
    |
 LL |     let sixteen: f32 = 16;
-   |                        ^^
-   |                        |
-   |                        expected `f32`, found integer
-   |                        help: use a float literal: `16.0`
+   |                  ---   ^^
+   |                  |     |
+   |                  |     expected `f32`, found integer
+   |                  |     help: use a float literal: `16.0`
+   |                  expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/issue-53280-expected-float-found-integer-literal.rs:5:38
    |
 LL |     let a_million_and_seventy: f64 = 1_000_070;
-   |                                      ^^^^^^^^^
-   |                                      |
-   |                                      expected `f64`, found integer
-   |                                      help: use a float literal: `1_000_070.0`
+   |                                ---   ^^^^^^^^^
+   |                                |     |
+   |                                |     expected `f64`, found integer
+   |                                |     help: use a float literal: `1_000_070.0`
+   |                                expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/issue-53280-expected-float-found-integer-literal.rs:8:30
    |
 LL |     let negative_nine: f32 = -9;
-   |                              ^^
-   |                              |
-   |                              expected `f32`, found integer
-   |                              help: use a float literal: `-9.0`
+   |                        ---   ^^
+   |                        |     |
+   |                        |     expected `f32`, found integer
+   |                        |     help: use a float literal: `-9.0`
+   |                        expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/issue-53280-expected-float-found-integer-literal.rs:15:30
    |
 LL |     let sixteen_again: f64 = 0x10;
-   |                              ^^^^ expected `f64`, found integer
+   |                        ---   ^^^^ expected `f64`, found integer
+   |                        |
+   |                        expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/issue-53280-expected-float-found-integer-literal.rs:17:30
    |
 LL |     let and_once_more: f32 = 0o20;
-   |                              ^^^^ expected `f32`, found integer
+   |                        ---   ^^^^ expected `f32`, found integer
+   |                        |
+   |                        expected due to this
 
 error: aborting due to 5 previous errors
 
index 233474e5fe689f6553ec1f99bd9a24dd532aaf09..fdbb5af9b3243614c229b5a826d0be5b93c52303 100644 (file)
@@ -10,7 +10,9 @@ error[E0308]: mismatched types
   --> $DIR/recursion_limit_deref.rs:50:22
    |
 LL |     let x: &Bottom = &t;
-   |                      ^^ expected struct `Bottom`, found struct `Top`
+   |            -------   ^^ expected struct `Bottom`, found struct `Top`
+   |            |
+   |            expected due to this
    |
    = note: expected reference `&Bottom`
               found reference `&Top`
index 3eb16663e13e1258dd6579cf475a245c3c69901e..121c76a01a5de19b83e5ae4dd8644d45cbed8431 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coerce1.rs:16:29
    |
 LL |     let f3: &Fat<[usize]> = f2;
-   |                             ^^ expected slice `[usize]`, found array `[isize; 3]`
+   |             -------------   ^^ expected slice `[usize]`, found array `[isize; 3]`
+   |             |
+   |             expected due to this
    |
    = note: expected reference `&Fat<[usize]>`
               found reference `&Fat<[isize; 3]>`
@@ -19,7 +21,9 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coerce1.rs:28:27
    |
 LL |     let f3: &([usize],) = f2;
-   |                           ^^ expected slice `[usize]`, found array `[isize; 3]`
+   |             -----------   ^^ expected slice `[usize]`, found array `[isize; 3]`
+   |             |
+   |             expected due to this
    |
    = note: expected reference `&([usize],)`
               found reference `&([isize; 3],)`
index e76fcb5f72d596961c8b539ac4d6c9c9ce701a52..3ded96cfb61486d2ccf1e6a26df9db39bb8c984d 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coerce2.rs:15:33
    |
 LL |     let f3: &mut Fat<[isize]> = f2;
-   |                                 ^^ types differ in mutability
+   |             -----------------   ^^ types differ in mutability
+   |             |
+   |             expected due to this
    |
    = note: expected mutable reference `&mut Fat<[isize]>`
                       found reference `&Fat<[isize; 3]>`
@@ -11,7 +13,9 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coerce2.rs:20:33
    |
 LL |     let f3: &mut Fat<dyn Bar> = f2;
-   |                                 ^^ types differ in mutability
+   |             -----------------   ^^ types differ in mutability
+   |             |
+   |             expected due to this
    |
    = note: expected mutable reference `&mut Fat<dyn Bar>`
                       found reference `&Fat<Foo>`
@@ -20,7 +24,9 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coerce2.rs:25:31
    |
 LL |     let f3: &mut ([isize],) = f2;
-   |                               ^^ types differ in mutability
+   |             ---------------   ^^ types differ in mutability
+   |             |
+   |             expected due to this
    |
    = note: expected mutable reference `&mut ([isize],)`
                       found reference `&([isize; 3],)`
@@ -29,7 +35,9 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coerce2.rs:30:31
    |
 LL |     let f3: &mut (dyn Bar,) = f2;
-   |                               ^^ types differ in mutability
+   |             ---------------   ^^ types differ in mutability
+   |             |
+   |             expected due to this
    |
    = note: expected mutable reference `&mut (dyn Bar,)`
                       found reference `&(Foo,)`
index e85d354e4680d32468d84004230094ac7f393d88..4c9954f35208bf87152daf65a4e1ca5a6d658c92 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coerce4.rs:12:32
    |
 LL |     let f2: &Fat<[isize; 3]> = f1;
-   |                                ^^ expected array `[isize; 3]`, found slice `[isize]`
+   |             ----------------   ^^ expected array `[isize; 3]`, found slice `[isize]`
+   |             |
+   |             expected due to this
    |
    = note: expected reference `&Fat<[isize; 3]>`
               found reference `&Fat<[isize]>`
@@ -11,7 +13,9 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coerce4.rs:20:30
    |
 LL |     let f2: &([isize; 3],) = f1;
-   |                              ^^ expected array `[isize; 3]`, found slice `[isize]`
+   |             --------------   ^^ expected array `[isize; 3]`, found slice `[isize]`
+   |             |
+   |             expected due to this
    |
    = note: expected reference `&([isize; 3],)`
               found reference `&([isize],)`
index 6058594d64dedaf0167239a7ba1aee5113f20c51..3e23c5f5c7443f96e0a9ca9a1d60f9a09c6a9d44 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coercions.rs:14:17
    |
 LL |     let y: &S = x;
-   |                 ^ expected `&S`, found *-ptr
+   |            --   ^ expected `&S`, found *-ptr
+   |            |
+   |            expected due to this
    |
    = note: expected reference `&S`
             found raw pointer `*const S`
@@ -11,10 +13,11 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coercions.rs:15:21
    |
 LL |     let y: &dyn T = x;
-   |                     ^
-   |                     |
-   |                     expected `&dyn T`, found *-ptr
-   |                     help: consider borrowing here: `&x`
+   |            ------   ^
+   |            |        |
+   |            |        expected `&dyn T`, found *-ptr
+   |            |        help: consider borrowing here: `&x`
+   |            expected due to this
    |
    = note: expected reference `&dyn T`
             found raw pointer `*const S`
@@ -23,7 +26,9 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coercions.rs:19:17
    |
 LL |     let y: &S = x;
-   |                 ^ expected `&S`, found *-ptr
+   |            --   ^ expected `&S`, found *-ptr
+   |            |
+   |            expected due to this
    |
    = note: expected reference `&S`
             found raw pointer `*mut S`
@@ -32,10 +37,11 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coercions.rs:20:21
    |
 LL |     let y: &dyn T = x;
-   |                     ^
-   |                     |
-   |                     expected `&dyn T`, found *-ptr
-   |                     help: consider borrowing here: `&x`
+   |            ------   ^
+   |            |        |
+   |            |        expected `&dyn T`, found *-ptr
+   |            |        help: consider borrowing here: `&x`
+   |            expected due to this
    |
    = note: expected reference `&dyn T`
             found raw pointer `*mut S`
@@ -44,7 +50,9 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coercions.rs:23:25
    |
 LL |     let x: &mut dyn T = &S;
-   |                         ^^ types differ in mutability
+   |            ----------   ^^ types differ in mutability
+   |            |
+   |            expected due to this
    |
    = note: expected mutable reference `&mut dyn T`
                       found reference `&S`
@@ -53,7 +61,9 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coercions.rs:24:25
    |
 LL |     let x: *mut dyn T = &S;
-   |                         ^^ types differ in mutability
+   |            ----------   ^^ types differ in mutability
+   |            |
+   |            expected due to this
    |
    = note: expected raw pointer `*mut dyn T`
                 found reference `&S`
@@ -62,7 +72,9 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coercions.rs:25:21
    |
 LL |     let x: *mut S = &S;
-   |                     ^^ types differ in mutability
+   |            ------   ^^ types differ in mutability
+   |            |
+   |            expected due to this
    |
    = note: expected raw pointer `*mut S`
                 found reference `&S`
index e6f84f4f354275ccf0a6236d61ee27246f93071d..62ca8dc77294b446fe6fc0f583df9f46ce02d80a 100644 (file)
@@ -2,16 +2,19 @@ error[E0308]: mismatched types
   --> $DIR/float-literal-inference-restrictions.rs:2:18
    |
 LL |     let x: f32 = 1;
-   |                  ^
-   |                  |
-   |                  expected `f32`, found integer
-   |                  help: use a float literal: `1.0`
+   |            ---   ^
+   |            |     |
+   |            |     expected `f32`, found integer
+   |            |     help: use a float literal: `1.0`
+   |            expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/float-literal-inference-restrictions.rs:3:18
    |
 LL |     let y: f32 = 1f64;
-   |                  ^^^^ expected `f32`, found `f64`
+   |            ---   ^^^^ expected `f32`, found `f64`
+   |            |
+   |            expected due to this
    |
 help: change the type of the numeric literal from `f64` to `f32`
    |
index 5e7d6ad9534def74a8264b68f543d5f2a06afade..7d4de63759b8881cbe615f394613245d6ebb91b3 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/fn-trait-formatting.rs:6:17
    |
 LL |     let _: () = (box |_: isize| {}) as Box<dyn FnOnce(isize)>;
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `std::boxed::Box`
+   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `std::boxed::Box`
+   |            |
+   |            expected due to this
    |
    = note: expected unit type `()`
                  found struct `std::boxed::Box<dyn std::ops::FnOnce(isize)>`
@@ -11,7 +13,9 @@ error[E0308]: mismatched types
   --> $DIR/fn-trait-formatting.rs:10:17
    |
 LL |     let _: () = (box |_: isize, isize| {}) as Box<dyn Fn(isize, isize)>;
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `std::boxed::Box`
+   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `std::boxed::Box`
+   |            |
+   |            expected due to this
    |
    = note: expected unit type `()`
                  found struct `std::boxed::Box<dyn std::ops::Fn(isize, isize)>`
@@ -20,7 +24,9 @@ error[E0308]: mismatched types
   --> $DIR/fn-trait-formatting.rs:14:17
    |
 LL |     let _: () = (box || -> isize { unimplemented!() }) as Box<dyn FnMut() -> isize>;
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `std::boxed::Box`
+   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `std::boxed::Box`
+   |            |
+   |            expected due to this
    |
    = note: expected unit type `()`
                  found struct `std::boxed::Box<dyn std::ops::FnMut() -> isize>`
index f20bd1846d758796a1c0773ea86ecc88fb66eb41..141807661199e80971d32fec7ed7942ffcaa1e88 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/generic-type-params-name-repr.rs:13:25
    |
 LL |     let _: Foo<isize> = ();
-   |                         ^^ expected struct `Foo`, found `()`
+   |            ----------   ^^ expected struct `Foo`, found `()`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `Foo<isize>`
            found unit type `()`
@@ -11,7 +13,9 @@ error[E0308]: mismatched types
   --> $DIR/generic-type-params-name-repr.rs:20:31
    |
 LL |     let _: Foo<isize, B, C> = ();
-   |                               ^^ expected struct `Foo`, found `()`
+   |            ----------------   ^^ expected struct `Foo`, found `()`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `Foo<isize>`
            found unit type `()`
@@ -20,7 +24,9 @@ error[E0308]: mismatched types
   --> $DIR/generic-type-params-name-repr.rs:27:37
    |
 LL |     let _: HashMap<String, isize> = ();
-   |                                     ^^ expected struct `HashMap`, found `()`
+   |            ----------------------   ^^ expected struct `HashMap`, found `()`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `HashMap<std::string::String, isize>`
            found unit type `()`
@@ -29,7 +35,9 @@ error[E0308]: mismatched types
   --> $DIR/generic-type-params-name-repr.rs:32:51
    |
 LL |     let _: HashMap<String, isize, Hash<String>> = ();
-   |                                                   ^^ expected struct `HashMap`, found `()`
+   |            ------------------------------------   ^^ expected struct `HashMap`, found `()`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `HashMap<std::string::String, isize>`
            found unit type `()`
@@ -38,7 +46,9 @@ error[E0308]: mismatched types
   --> $DIR/generic-type-params-name-repr.rs:39:31
    |
 LL |     let _: Foo<A, isize, C> = ();
-   |                               ^^ expected struct `Foo`, found `()`
+   |            ----------------   ^^ expected struct `Foo`, found `()`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `Foo<A, isize>`
            found unit type `()`
@@ -47,7 +57,9 @@ error[E0308]: mismatched types
   --> $DIR/generic-type-params-name-repr.rs:46:27
    |
 LL |     let _: Foo<A, B, C> = ();
-   |                           ^^ expected struct `Foo`, found `()`
+   |            ------------   ^^ expected struct `Foo`, found `()`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `Foo`
            found unit type `()`
index 8534ee99c1fa7d6e2b36cfc92e767a01221c67dd..328e98657effb179aa1f90cc61ec76274c533b00 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/hrtb-exists-forall-fn.rs:17:34
    |
 LL |     let _: for<'b> fn(&'b u32) = foo();
-   |                                  ^^^^^ expected concrete lifetime, found bound lifetime parameter 'b
+   |            -------------------   ^^^^^ expected concrete lifetime, found bound lifetime parameter 'b
+   |            |
+   |            expected due to this
    |
    = note: expected fn pointer `for<'b> fn(&'b u32)`
               found fn pointer `fn(&u32)`
index 7a656fca28b58557a0159fc1bb3f5e59e814c879..312976b72d20e26d29e055b5d9bcea2624cd177b 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/equality2.rs:25:18
    |
 LL |     let _: u32 = hide(0_u32);
-   |                  ^^^^^^^^^^^ expected `u32`, found opaque type
+   |            ---   ^^^^^^^^^^^ expected `u32`, found opaque type
+   |            |
+   |            expected due to this
    |
    = note:     expected type `u32`
            found opaque type `impl Foo`
@@ -11,7 +13,9 @@ error[E0308]: mismatched types
   --> $DIR/equality2.rs:31:18
    |
 LL |     let _: i32 = Leak::leak(hide(0_i32));
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found associated type
+   |            ---   ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found associated type
+   |            |
+   |            expected due to this
    |
    = note:         expected type `i32`
            found associated type `<impl Foo as Leak>::T`
index 33daf372f986b7d2bce2cfae81b2a11ee42e5a5b..efe1f58a6f43dd04eb71ae9eb894c749b69c1a2e 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/mismatched-types.rs:2:20
    |
 LL |     let b: &[u8] = include_str!("file.txt");
-   |                    ^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[u8]`, found `str`
+   |            -----   ^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[u8]`, found `str`
+   |            |
+   |            expected due to this
    |
    = note: expected reference `&[u8]`
               found reference `&'static str`
@@ -11,7 +13,9 @@ error[E0308]: mismatched types
   --> $DIR/mismatched-types.rs:3:19
    |
 LL |     let s: &str = include_bytes!("file.txt");
-   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `str`, found array `[u8; 0]`
+   |            ----   ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `str`, found array `[u8; 0]`
+   |            |
+   |            expected due to this
    |
    = note: expected reference `&str`
               found reference `&'static [u8; 0]`
index de67a72a639803d8ed080d20afbd2ddcf30c0056..6fc2b99a11a4de3c2ee75c2facdf9279930ead39 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/issue-1362.rs:4:16
    |
 LL |   let x: u32 = 20i32;
-   |                ^^^^^ expected `u32`, found `i32`
+   |          ---   ^^^^^ expected `u32`, found `i32`
+   |          |
+   |          expected due to this
    |
 help: change the type of the numeric literal from `i32` to `u32`
    |
index 46524bc2c18e103d19d13e5265541df6804fa0bb..2407ece5e4f7d1f6e0c77e64d7f1d1860b5774ee 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/issue-22684.rs:17:17
    |
 LL |     let _: () = foo::Foo.bar();
-   |                 ^^^^^^^^^^^^^^ expected `()`, found `bool`
+   |            --   ^^^^^^^^^^^^^^ expected `()`, found `bool`
+   |            |
+   |            expected due to this
 
 error: aborting due to previous error
 
index fb0c7a0d80904989a8c5a9a6847227e0f85e0c77..1a4fab165405d88dc39158cb3e7e342e57c396a4 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/issue-24322.rs:8:29
    |
 LL |     let x: &fn(&B) -> u32 = &B::func;
-   |                             ^^^^^^^^ expected fn pointer, found fn item
+   |            --------------   ^^^^^^^^ expected fn pointer, found fn item
+   |            |
+   |            expected due to this
    |
    = note: expected reference `&for<'r> fn(&'r B) -> u32`
               found reference `&for<'r> fn(&'r B) -> u32 {B::func}`
index 71e4d7850143b7a8755de2a3bfaa1add375ed167..69c452b88f315409196034ce69f682b7ef973e31 100644 (file)
@@ -20,6 +20,8 @@ LL |         loop { break };
 error[E0308]: mismatched types
   --> $DIR/issue-27042.rs:8:9
    |
+LL |       let _: i32 =
+   |              --- expected due to this
 LL | /         'b:
 LL | |
 LL | |         while true { break }; // but here we cite the whole loop
@@ -35,6 +37,8 @@ LL | |         for _ in None { break }; // but here we cite the whole loop
 error[E0308]: mismatched types
   --> $DIR/issue-27042.rs:15:9
    |
+LL |       let _: i32 =
+   |              --- expected due to this
 LL | /         'd:
 LL | |         while let Some(_) = None { break };
    | |__________________________________________^ expected `i32`, found `()`
index 6510c215fcf1fc3e9d88dbdb6133dcbc6f363fa0..fd5f7dcf6e66a5ef9cd39e3749eaea6a4abcee64 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/issue-3477.rs:2:20
    |
 LL |     let _p: char = 100;
-   |                    ^^^ expected `char`, found `u8`
+   |             ----   ^^^ expected `char`, found `u8`
+   |             |
+   |             expected due to this
 
 error: aborting due to previous error
 
index 8a9529a68b7fa5ec64dc61eabf44f5165a9d018e..1e191a620af02525bd1ffdc28e7c80e70a52501d 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/issue-37665.rs:10:17
    |
 LL |     let x: () = 0;
-   |                 ^ expected `()`, found integer
+   |            --   ^ expected `()`, found integer
+   |            |
+   |            expected due to this
 
 error: aborting due to previous error
 
index 707fcc7e919cd2d911bc4f7e7725cd49220520aa..f60387f841aed9766c50f78d3fac3815fc70a04b 100644 (file)
@@ -10,7 +10,9 @@ error[E0308]: mismatched types
   --> $DIR/issue-38940.rs:43:22
    |
 LL |     let x: &Bottom = &t;
-   |                      ^^ expected struct `Bottom`, found struct `Top`
+   |            -------   ^^ expected struct `Bottom`, found struct `Top`
+   |            |
+   |            expected due to this
    |
    = note: expected reference `&Bottom`
               found reference `&Top`
index bcbcefef3b11a6ebdff978549e671cc756224b2b..9e1011496c45dc7c16d19551ad3832f78988a634 100644 (file)
@@ -57,7 +57,9 @@ error[E0308]: mismatched types
   --> $DIR/issue-5100.rs:55:19
    |
 LL |     let x: char = true;
-   |                   ^^^^ expected `char`, found `bool`
+   |            ----   ^^^^ expected `char`, found `bool`
+   |            |
+   |            expected due to this
 
 error: aborting due to 7 previous errors
 
index 50a202d148948062595a53fa1a78ec1bcb38c5a9..b83fb346b14ef503cd831b93c2128787bd2495c9 100644 (file)
@@ -2,10 +2,11 @@ error[E0308]: mismatched types
   --> $DIR/issue-53692.rs:4:37
    |
 LL |         let items_clone: Vec<i32> = ref_items.clone();
-   |                                     ^^^^^^^^^^^^^^^^^
-   |                                     |
-   |                                     expected struct `std::vec::Vec`, found `&[i32]`
-   |                                     help: try using a conversion method: `ref_items.to_vec()`
+   |                          --------   ^^^^^^^^^^^^^^^^^
+   |                          |          |
+   |                          |          expected struct `std::vec::Vec`, found `&[i32]`
+   |                          |          help: try using a conversion method: `ref_items.to_vec()`
+   |                          expected due to this
    |
    = note: expected struct `std::vec::Vec<i32>`
            found reference `&[i32]`
@@ -14,10 +15,11 @@ error[E0308]: mismatched types
   --> $DIR/issue-53692.rs:11:30
    |
 LL |         let string: String = s.clone();
-   |                              ^^^^^^^^^
-   |                              |
-   |                              expected struct `std::string::String`, found `&str`
-   |                              help: try using a conversion method: `s.to_string()`
+   |                     ------   ^^^^^^^^^
+   |                     |        |
+   |                     |        expected struct `std::string::String`, found `&str`
+   |                     |        help: try using a conversion method: `s.to_string()`
+   |                     expected due to this
 
 error: aborting due to 2 previous errors
 
index 7fd124046dc618a07c6ee4e2f5ced599648e4c21..6caf974809e761f7fb786bb64197c5f85aa02b27 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/issue-56943.rs:6:29
    |
 LL |     let _: issue_56943::S = issue_56943::S2;
-   |                             ^^^^^^^^^^^^^^^ expected struct `issue_56943::S`, found struct `issue_56943::S2`
+   |            --------------   ^^^^^^^^^^^^^^^ expected struct `issue_56943::S`, found struct `issue_56943::S2`
+   |            |
+   |            expected due to this
 
 error: aborting due to previous error
 
index 494bbd7f284f193f665124554faae6625e915d66..ab0feb3c451adb4b0497b7f51705213c99017188 100644 (file)
@@ -15,7 +15,7 @@ let x: i32 = \"I am not a number!\";
 //      |
 //    type `i32` assigned to variable `x`
 ```
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":612,"byte_end":618,"line_start":17,"line_end":17,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types
 "}
 {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a
 variable. It can occur for several cases, the most common of which is a
@@ -34,7 +34,7 @@ let x: i32 = \"I am not a number!\";
 //      |
 //    type `i32` assigned to variable `x`
 ```
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":672,"byte_end":678,"line_start":19,"line_end":19,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types
 "}
 {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a
 variable. It can occur for several cases, the most common of which is a
@@ -53,7 +53,7 @@ let x: i32 = \"I am not a number!\";
 //      |
 //    type `i32` assigned to variable `x`
 ```
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":735,"byte_end":741,"line_start":22,"line_end":22,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types
 "}
 {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a
 variable. It can occur for several cases, the most common of which is a
@@ -72,7 +72,7 @@ let x: i32 = \"I am not a number!\";
 //      |
 //    type `i32` assigned to variable `x`
 ```
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":"    let s : String = (","highlight_start":22,"highlight_end":23},{"text":"    );  // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":"    let s : String = (","highlight_start":22,"highlight_end":23},{"text":"    );  // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":792,"byte_end":798,"line_start":25,"line_end":25,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types
 "}
 {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors
 "}
index ea21a6b896141682c7bd01ddf61c7b76d2e96bb5..a6217f86879f6a3ff11dafab4dd0b6d2fa944573 100644 (file)
@@ -15,7 +15,7 @@ let x: i32 = \"I am not a number!\";
 //      |
 //    type `i32` assigned to variable `x`
 ```
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:17:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":612,"byte_end":618,"line_start":17,"line_end":17,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:17:22: error[E0308]: mismatched types
 "}
 {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a
 variable. It can occur for several cases, the most common of which is a
@@ -34,7 +34,7 @@ let x: i32 = \"I am not a number!\";
 //      |
 //    type `i32` assigned to variable `x`
 ```
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:19:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":672,"byte_end":678,"line_start":19,"line_end":19,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:19:22: error[E0308]: mismatched types
 "}
 {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a
 variable. It can occur for several cases, the most common of which is a
@@ -53,7 +53,7 @@ let x: i32 = \"I am not a number!\";
 //      |
 //    type `i32` assigned to variable `x`
 ```
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:23:1: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":735,"byte_end":741,"line_start":22,"line_end":22,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:23:1: error[E0308]: mismatched types
 "}
 {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a
 variable. It can occur for several cases, the most common of which is a
@@ -72,7 +72,7 @@ let x: i32 = \"I am not a number!\";
 //      |
 //    type `i32` assigned to variable `x`
 ```
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":"    let s : String = (","highlight_start":22,"highlight_end":23},{"text":"    );  // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:25:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":"    let s : String = (","highlight_start":22,"highlight_end":23},{"text":"    );  // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":792,"byte_end":798,"line_start":25,"line_end":25,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:25:22: error[E0308]: mismatched types
 "}
 {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors
 "}
index 535dbde612c03c693ff9647a637c6e2a12410e56..5e6980a9dd1f7aec72b98ad585900638a22725fe 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/meta-expected-error-correct-rev.rs:7:18
    |
 LL |     let x: u32 = 22_usize;
-   |                  ^^^^^^^^ expected `u32`, found `usize`
+   |            ---   ^^^^^^^^ expected `u32`, found `usize`
+   |            |
+   |            expected due to this
    |
 help: change the type of the numeric literal from `usize` to `u32`
    |
index 87e95c240803793751066f914e228b34f65c5c0f..fcd976475686f2bb102a3cf530888849acfb5a16 100644 (file)
@@ -10,7 +10,9 @@ error[E0308]: mismatched types
   --> $DIR/method-ambig-one-trait-unknown-int-type.rs:33:20
    |
 LL |     let y: usize = x.foo();
-   |                    ^^^^^^^ expected `usize`, found `isize`
+   |            -----   ^^^^^^^ expected `usize`, found `isize`
+   |            |
+   |            expected due to this
    |
 help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit
    |
index bfec363eb997ac7e3c33fc86f09b847520f39dab..c9d7da84e09f421b3c85c8b6a958938aae03f0b2 100644 (file)
@@ -2,13 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:85:24
    |
 LL |     let _seetype: () = z;
-   |                        ^ expected `()`, found `u32`
+   |                   --   ^ expected `()`, found `u32`
+   |                   |
+   |                   expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:102:24
    |
 LL |     let _seetype: () = z;
-   |                        ^ expected `()`, found `u64`
+   |                   --   ^ expected `()`, found `u64`
+   |                   |
+   |                   expected due to this
 
 error[E0034]: multiple applicable items in scope
   --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:120:15
@@ -39,19 +43,25 @@ error[E0308]: mismatched types
   --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:137:24
    |
 LL |     let _seetype: () = z;
-   |                        ^ expected `()`, found `u8`
+   |                   --   ^ expected `()`, found `u8`
+   |                   |
+   |                   expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:155:24
    |
 LL |     let _seetype: () = z;
-   |                        ^ expected `()`, found `u32`
+   |                   --   ^ expected `()`, found `u32`
+   |                   |
+   |                   expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:172:24
    |
 LL |     let _seetype: () = z;
-   |                        ^ expected `()`, found `u32`
+   |                   --   ^ expected `()`, found `u32`
+   |                   |
+   |                   expected due to this
 
 error: aborting due to 6 previous errors
 
index 5384dedb65a49df2d343cd2b099b935829901916..3808f8583b8362b4552b347b96a81b4116dd2ff7 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/mir-unpretty.rs:4:17
    |
 LL |     let x: () = 0;
-   |                 ^ expected `()`, found integer
+   |            --   ^ expected `()`, found integer
+   |            |
+   |            expected due to this
 
 error: aborting due to previous error
 
index 51c8e5f5d4ad131228a4011f8b659fbd7a49e7c2..a662741afcd9cea5d79fed2048c3dbdfac7e72a2 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/main.rs:2:18
    |
 LL |       let x: u32 = (
-   |  __________________^
+   |  ____________---___^
+   | |            |
+   | |            expected due to this
 LL | |     );
    | |_____^ expected `u32`, found `()`
 
index d4b1f0973ccef8d8aa8c2398e79aa014281be8ee..4349d98029eaf13800d728110c1975c9eef46e94 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/never-assign-wrong-type.rs:6:16
    |
 LL |     let x: ! = "hello";
-   |                ^^^^^^^ expected `!`, found `&str`
+   |            -   ^^^^^^^ expected `!`, found `&str`
+   |            |
+   |            expected due to this
    |
    = note:   expected type `!`
            found reference `&'static str`
index 18fb1755eb11fe19672eccb2b5525ab776af7539..e80fcd13685b658f26ad7bb97b754a27da675ec3 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/noexporttypeexe.rs:10:18
    |
 LL |   let x: isize = noexporttypelib::foo();
-   |                  ^^^^^^^^^^^^^^^^^^^^^^ expected `isize`, found enum `std::option::Option`
+   |          -----   ^^^^^^^^^^^^^^^^^^^^^^ expected `isize`, found enum `std::option::Option`
+   |          |
+   |          expected due to this
    |
    = note: expected type `isize`
               found enum `std::option::Option<isize>`
index c6ddb35ddf5f295060978e3e1de544b333b94beb..6e1990e3a722255b1c7da020713f219942944c2c 100644 (file)
@@ -14,19 +14,25 @@ error[E0308]: mismatched types
   --> $DIR/const-scope.rs:5:18
    |
 LL |     let c: i32 = 1i8;
-   |                  ^^^ expected `i32`, found `i8`
+   |            ---   ^^^ expected `i32`, found `i8`
+   |            |
+   |            expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/const-scope.rs:6:17
    |
 LL |     let d: i8 = c;
-   |                 ^ expected `i8`, found `i32`
+   |            --   ^ expected `i8`, found `i32`
+   |            |
+   |            expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/const-scope.rs:10:18
    |
 LL |     let c: i32 = 1i8;
-   |                  ^^^ expected `i32`, found `i8`
+   |            ---   ^^^ expected `i32`, found `i8`
+   |            |
+   |            expected due to this
    |
 help: change the type of the numeric literal from `i8` to `i32`
    |
@@ -37,7 +43,9 @@ error[E0308]: mismatched types
   --> $DIR/const-scope.rs:11:17
    |
 LL |     let d: i8 = c;
-   |                 ^ expected `i8`, found `i32`
+   |            --   ^ expected `i8`, found `i32`
+   |            |
+   |            expected due to this
    |
 help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit
    |
index 133db19780c34e7c6ce2bf3713faf2f6d8198e05..465b507b788fd96d53f8adb9f4811b9b1208bb44 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast-2.rs:5:18
    |
 LL |     let x: u16 = foo();
-   |                  ^^^^^ expected `u16`, found `i32`
+   |            ---   ^^^^^ expected `u16`, found `i32`
+   |            |
+   |            expected due to this
    |
 help: you can convert an `i32` to `u16` and panic if the converted value wouldn't fit
    |
@@ -13,7 +15,9 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast-2.rs:7:18
    |
 LL |     let y: i64 = x + x;
-   |                  ^^^^^ expected `i64`, found `u16`
+   |            ---   ^^^^^ expected `i64`, found `u16`
+   |            |
+   |            expected due to this
    |
 help: you can convert an `u16` to `i64` and panic if the converted value wouldn't fit
    |
@@ -24,7 +28,9 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast-2.rs:9:18
    |
 LL |     let z: i32 = x + x;
-   |                  ^^^^^ expected `i32`, found `u16`
+   |            ---   ^^^^^ expected `i32`, found `u16`
+   |            |
+   |            expected due to this
    |
 help: you can convert an `u16` to `i32` and panic if the converted value wouldn't fit
    |
index 94435f2118b8a8e8fc992d25c4ebd5199a32fe47..9b827794f5be52f5cfba4de60ab878ac4d23fb02 100644 (file)
@@ -10,7 +10,9 @@ error[E0308]: mismatched types
   --> $DIR/issue-64879-trailing-before-guard.rs:12:42
    |
 LL |             let recovery_witness: bool = 0;
-   |                                          ^ expected `bool`, found integer
+   |                                   ----   ^ expected `bool`, found integer
+   |                                   |
+   |                                   expected due to this
 
 error: aborting due to 2 previous errors
 
index 7e4cf0d14e1f8fa42c3277272e0f32022fe24759..b6ff39d64d6dbb4997820db24725350e0f54eb99 100644 (file)
@@ -118,10 +118,11 @@ error[E0308]: mismatched types
   --> $DIR/or-patterns-syntactic-fail.rs:52:36
    |
 LL |     let recovery_witness: String = 0;
-   |                                    ^
-   |                                    |
-   |                                    expected struct `std::string::String`, found integer
-   |                                    help: try using a conversion method: `0.to_string()`
+   |                           ------   ^
+   |                           |        |
+   |                           |        expected struct `std::string::String`, found integer
+   |                           |        help: try using a conversion method: `0.to_string()`
+   |                           expected due to this
 
 error: aborting due to 16 previous errors
 
index 8f304bdf7131ba571203cacc408b25e503191fac..82c46ad82c7e427d94907ee170523628c356baed 100644 (file)
@@ -43,7 +43,9 @@ error[E0308]: mismatched types
   --> $DIR/lex-bad-char-literals-6.rs:15:20
    |
 LL |     let a: usize = "";
-   |                    ^^ expected `usize`, found `&str`
+   |            -----   ^^ expected `usize`, found `&str`
+   |            |
+   |            expected due to this
 
 error[E0277]: can't compare `&str` with `char`
   --> $DIR/lex-bad-char-literals-6.rs:12:10
index d9585e7cbf2f45327479e5fb7e113a5b18b70e80..73a828952b2a65ee4d65a693e5348f1c26d1e0b7 100644 (file)
@@ -14,7 +14,9 @@ error[E0308]: mismatched types
   --> $DIR/numeric-lifetime.rs:6:20
    |
 LL |     let x: usize = "";
-   |                    ^^ expected `usize`, found `&str`
+   |            -----   ^^ expected `usize`, found `&str`
+   |            |
+   |            expected due to this
 
 error: aborting due to 3 previous errors
 
index 51a7c8e08026a75b1e96c1b9db64ae8789e88ceb..c807931beee1901f7595ccee7887212051935245 100644 (file)
@@ -13,7 +13,9 @@ error[E0308]: mismatched types
   --> $DIR/recover-from-homoglyph.rs:3:20
    |
 LL |     let x: usize = ();
-   |                    ^^ expected `usize`, found `()`
+   |            -----   ^^ expected `usize`, found `()`
+   |            |
+   |            expected due to this
 
 error: aborting due to 2 previous errors
 
index b824f92dfaac90820e244af7255fbcccd69197c1..2f2464d3629c6b0fbd3ee527853d8ef199565fec 100644 (file)
@@ -20,13 +20,17 @@ error[E0308]: mismatched types
   --> $DIR/recover-missing-semi.rs:2:20
    |
 LL |     let _: usize = ()
-   |                    ^^ expected `usize`, found `()`
+   |            -----   ^^ expected `usize`, found `()`
+   |            |
+   |            expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/recover-missing-semi.rs:9:20
    |
 LL |     let _: usize = ()
-   |                    ^^ expected `usize`, found `()`
+   |            -----   ^^ expected `usize`, found `()`
+   |            |
+   |            expected due to this
 
 error: aborting due to 4 previous errors
 
index e6e094dc2e3af6bb1d0eb910b2d06ba9cd58b50e..88891b54bb20c26e2a21cc1e3ebe266790c96e6a 100644 (file)
@@ -8,7 +8,9 @@ error[E0308]: mismatched types
   --> $DIR/recover-tuple.rs:6:20
    |
 LL |     let y: usize = "";
-   |                    ^^ expected `usize`, found `&str`
+   |            -----   ^^ expected `usize`, found `&str`
+   |            |
+   |            expected due to this
 
 error: aborting due to 2 previous errors
 
index 426748b5086bb4da64772b420a20a61257b3e990..bda59d4dea644f7185a9c9b502e0dafa0bd12edd 100644 (file)
@@ -13,7 +13,9 @@ error[E0308]: mismatched types
   --> $DIR/unclosed-delimiter-in-dep.rs:4:20
    |
 LL |     let _: usize = unclosed_delim_mod::new();
-   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found enum `std::result::Result`
+   |            -----   ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found enum `std::result::Result`
+   |            |
+   |            expected due to this
    |
    = note: expected type `usize`
               found enum `std::result::Result<unclosed_delim_mod::Value, ()>`
index d107697d2bf005748fa1956990f6e2c8e853bb6f..193482a42ab7226a67fe7e8a63e0b1005cda25dd 100644 (file)
@@ -2,13 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/attribute-spans-preserved.rs:7:23
    |
 LL | #[ foo ( let y: u32 = "z"; ) ]
-   |                       ^^^ expected `u32`, found `&str`
+   |                 ---   ^^^ expected `u32`, found `&str`
+   |                 |
+   |                 expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/attribute-spans-preserved.rs:8:23
    |
 LL | #[ bar { let x: u32 = "y"; } ]
-   |                       ^^^ expected `u32`, found `&str`
+   |                 ---   ^^^ expected `u32`, found `&str`
+   |                 |
+   |                 expected due to this
 
 error: aborting due to 2 previous errors
 
index 391a259c3800a9caf13fd7c5e5727683ca675b37..7f3a7e670b9b75b8c5727f55502d9b03c985a8a1 100644 (file)
@@ -2,25 +2,33 @@ error[E0308]: mismatched types
   --> $DIR/attribute-with-error.rs:10:18
    |
 LL |     let a: i32 = "foo";
-   |                  ^^^^^ expected `i32`, found `&str`
+   |            ---   ^^^^^ expected `i32`, found `&str`
+   |            |
+   |            expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/attribute-with-error.rs:12:18
    |
 LL |     let b: i32 = "f'oo";
-   |                  ^^^^^^ expected `i32`, found `&str`
+   |            ---   ^^^^^^ expected `i32`, found `&str`
+   |            |
+   |            expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/attribute-with-error.rs:25:22
    |
 LL |         let a: i32 = "foo";
-   |                      ^^^^^ expected `i32`, found `&str`
+   |                ---   ^^^^^ expected `i32`, found `&str`
+   |                |
+   |                expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/attribute-with-error.rs:35:22
    |
 LL |         let a: i32 = "foo";
-   |                      ^^^^^ expected `i32`, found `&str`
+   |                ---   ^^^^^ expected `i32`, found `&str`
+   |                |
+   |                expected due to this
 
 error: aborting due to 4 previous errors
 
index 09e13c7014b074f40639e75183ac2d013efdbcfa..44b338fa62215a78f567f35811b1cdb182a61fd7 100644 (file)
@@ -2,13 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/nested-item-spans.rs:9:22
    |
 LL |         let x: u32 = "x";
-   |                      ^^^ expected `u32`, found `&str`
+   |                ---   ^^^ expected `u32`, found `&str`
+   |                |
+   |                expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/nested-item-spans.rs:18:22
    |
 LL |         let x: u32 = "x";
-   |                      ^^^ expected `u32`, found `&str`
+   |                ---   ^^^ expected `u32`, found `&str`
+   |                |
+   |                expected due to this
 
 error: aborting due to 2 previous errors
 
index c978380817791a2735ebe16dec0c131198c1ef24..cd6f0ea10eac90d96677084eba264de488eedbc3 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/span-preservation.rs:11:20
    |
 LL |     let x: usize = "hello";
-   |                    ^^^^^^^ expected `usize`, found `&str`
+   |            -----   ^^^^^^^ expected `usize`, found `&str`
+   |            |
+   |            expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/span-preservation.rs:17:29
index 49dc4b36268c471727d7d92bfbb8604a8057c822..29b7e5da849d43ec112f61e91d00446ef083fe78 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/ptr-coercion.rs:7:25
    |
 LL |     let x: *mut isize = x;
-   |                         ^ types differ in mutability
+   |            ----------   ^ types differ in mutability
+   |            |
+   |            expected due to this
    |
    = note: expected raw pointer `*mut isize`
               found raw pointer `*const isize`
@@ -11,7 +13,9 @@ error[E0308]: mismatched types
   --> $DIR/ptr-coercion.rs:13:25
    |
 LL |     let x: *mut isize = &42;
-   |                         ^^^ types differ in mutability
+   |            ----------   ^^^ types differ in mutability
+   |            |
+   |            expected due to this
    |
    = note: expected raw pointer `*mut isize`
                 found reference `&isize`
@@ -20,7 +24,9 @@ error[E0308]: mismatched types
   --> $DIR/ptr-coercion.rs:19:25
    |
 LL |     let x: *mut isize = x;
-   |                         ^ types differ in mutability
+   |            ----------   ^ types differ in mutability
+   |            |
+   |            expected due to this
    |
    = note: expected raw pointer `*mut isize`
               found raw pointer `*const isize`
index b47e2ea3981efe5d069190c39350667d6bd8058f..c3e8789a903b16446fa43f720c2d278f5a597aa4 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:43
    |
 LL |     let _: fn(&mut &isize, &mut &isize) = a;
-   |                                           ^ expected concrete lifetime, found bound lifetime parameter
+   |            ----------------------------   ^ expected concrete lifetime, found bound lifetime parameter
+   |            |
+   |            expected due to this
    |
    = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
                  found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
index d2608e09ac5518ac3bb12fa6fa0d341a30715dd3..159d32b50b03c5da035e3f52cf88871689c55935 100644 (file)
@@ -20,7 +20,9 @@ error[E0308]: mismatched types
   --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:43
    |
 LL |     let _: fn(&mut &isize, &mut &isize) = a;
-   |                                           ^ expected concrete lifetime, found bound lifetime parameter
+   |            ----------------------------   ^ expected concrete lifetime, found bound lifetime parameter
+   |            |
+   |            expected due to this
    |
    = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
                  found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
index 85046f59da67d814e82df47f17553b15e59748f9..2aadd8f4f8c7ed550742175169dabd8db5a0150e 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:56
    |
 LL |     let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
-   |                                                        ^ expected concrete lifetime, found bound lifetime parameter
+   |            -----------------------------------------   ^ expected concrete lifetime, found bound lifetime parameter
+   |            |
+   |            expected due to this
    |
    = note: expected fn pointer `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)`
                  found fn item `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}`
index fa39d800b0ecdd2ec800623f1c5fc5a73c94ea7f..dda6129e195369e1848b738f139dc3032407865d 100644 (file)
@@ -31,7 +31,9 @@ error[E0308]: mismatched types
   --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:56
    |
 LL |     let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
-   |                                                        ^ expected concrete lifetime, found bound lifetime parameter
+   |            -----------------------------------------   ^ expected concrete lifetime, found bound lifetime parameter
+   |            |
+   |            expected due to this
    |
    = note: expected fn pointer `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)`
                  found fn item `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}`
index 78966048265d382aecf1495cc1fb5702cab4b150..434a3e47b492a6b51fb73685d2db658136eaa5c3 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/regions-lifetime-bounds-on-fns.rs:20:43
    |
 LL |     let _: fn(&mut &isize, &mut &isize) = a;
-   |                                           ^ expected concrete lifetime, found bound lifetime parameter
+   |            ----------------------------   ^ expected concrete lifetime, found bound lifetime parameter
+   |            |
+   |            expected due to this
    |
    = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
                  found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
index a251bb7eb1afd7a123f5cf788c0bb35a6832ce2d..01f43aeebaf7cb3a77a051efd20bd81149cf9082 100644 (file)
@@ -20,7 +20,9 @@ error[E0308]: mismatched types
   --> $DIR/regions-lifetime-bounds-on-fns.rs:20:43
    |
 LL |     let _: fn(&mut &isize, &mut &isize) = a;
-   |                                           ^ expected concrete lifetime, found bound lifetime parameter
+   |            ----------------------------   ^ expected concrete lifetime, found bound lifetime parameter
+   |            |
+   |            expected due to this
    |
    = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
                  found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
index da433278975383532c3a1314c71f06bdbe3c66d9..4defe12b1b37b58ba9d760603e601b25755d6925 100644 (file)
@@ -2,10 +2,11 @@ error[E0308]: cannot coerce intrinsics to function pointers
   --> $DIR/reify-intrinsic.rs:6:64
    |
 LL |     let _: unsafe extern "rust-intrinsic" fn(isize) -> usize = std::mem::transmute;
-   |                                                                ^^^^^^^^^^^^^^^^^^^
-   |                                                                |
-   |                                                                cannot coerce intrinsics to function pointers
-   |                                                                help: use parentheses to call this function: `std::mem::transmute(...)`
+   |            -------------------------------------------------   ^^^^^^^^^^^^^^^^^^^
+   |            |                                                   |
+   |            |                                                   cannot coerce intrinsics to function pointers
+   |            |                                                   help: use parentheses to call this function: `std::mem::transmute(...)`
+   |            expected due to this
    |
    = note: expected fn pointer `unsafe extern "rust-intrinsic" fn(isize) -> usize`
                  found fn item `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}`
index 12270e42644836713edbca03cf54385ff3aecb61..688720e8cd3885e9a96a2f6f6042ef2cd0e93dc4 100644 (file)
@@ -280,10 +280,11 @@ LL |             Fn(u8),
    |             ------ fn(u8) -> m::n::Z {m::n::Z::Fn} defined here
 ...
 LL |         let _: Z = Z::Fn;
-   |                    ^^^^^
-   |                    |
-   |                    expected enum `m::n::Z`, found fn item
-   |                    help: use parentheses to instantiate this tuple variant: `Z::Fn(_)`
+   |                -   ^^^^^
+   |                |   |
+   |                |   expected enum `m::n::Z`, found fn item
+   |                |   help: use parentheses to instantiate this tuple variant: `Z::Fn(_)`
+   |                expected due to this
    |
    = note: expected enum `m::n::Z`
            found fn item `fn(u8) -> m::n::Z {m::n::Z::Fn}`
@@ -311,10 +312,11 @@ LL |         Fn(u8),
    |         ------ fn(u8) -> m::E {m::E::Fn} defined here
 ...
 LL |     let _: E = m::E::Fn;
-   |                ^^^^^^^^
-   |                |
-   |                expected enum `m::E`, found fn item
-   |                help: use parentheses to instantiate this tuple variant: `m::E::Fn(_)`
+   |            -   ^^^^^^^^
+   |            |   |
+   |            |   expected enum `m::E`, found fn item
+   |            |   help: use parentheses to instantiate this tuple variant: `m::E::Fn(_)`
+   |            expected due to this
    |
    = note: expected enum `m::E`
            found fn item `fn(u8) -> m::E {m::E::Fn}`
@@ -342,10 +344,11 @@ LL |         Fn(u8),
    |         ------ fn(u8) -> m::E {m::E::Fn} defined here
 ...
 LL |     let _: E = E::Fn;
-   |                ^^^^^
-   |                |
-   |                expected enum `m::E`, found fn item
-   |                help: use parentheses to instantiate this tuple variant: `E::Fn(_)`
+   |            -   ^^^^^
+   |            |   |
+   |            |   expected enum `m::E`, found fn item
+   |            |   help: use parentheses to instantiate this tuple variant: `E::Fn(_)`
+   |            expected due to this
    |
    = note: expected enum `m::E`
            found fn item `fn(u8) -> m::E {m::E::Fn}`
index 3be1217440b7e7e608bf1a76c47af1ca8df6e1cc..91f8b0e630901868c0748408d70900e7e609b053 100644 (file)
@@ -26,7 +26,9 @@ error[E0308]: mismatched types
   --> $DIR/shift-various-bad-types.rs:25:18
    |
 LL |     let _: i32 = 22_i64 >> 1_i32;
-   |                  ^^^^^^^^^^^^^^^ expected `i32`, found `i64`
+   |            ---   ^^^^^^^^^^^^^^^ expected `i32`, found `i64`
+   |            |
+   |            expected due to this
    |
 help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit
    |
index c1c5f316e958bb012d9fc939e15209946a32d53d..7d34defc1d577dcdb467291c4fbf8ab611fb5a8c 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/slice-mut.rs:7:22
    |
 LL |     let y: &mut[_] = &x[2..4];
-   |                      ^^^^^^^^ types differ in mutability
+   |            -------   ^^^^^^^^ types differ in mutability
+   |            |
+   |            expected due to this
    |
    = note: expected mutable reference `&mut [_]`
                       found reference `&[isize]`
index 5918888ff89a3514b0c19796bcc593df32531f8e..343644006b15383d4821dd2b94e46517d0c0f895 100644 (file)
@@ -2,16 +2,19 @@ error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:7:20
    |
 LL |     let x: usize = String::new();
-   |                    ^^^^^^^^^^^^^ expected `usize`, found struct `std::string::String`
+   |            -----   ^^^^^^^^^^^^^ expected `usize`, found struct `std::string::String`
+   |            |
+   |            expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:9:19
    |
 LL |     let x: &str = String::new();
-   |                   ^^^^^^^^^^^^^
-   |                   |
-   |                   expected `&str`, found struct `std::string::String`
-   |                   help: consider borrowing here: `&String::new()`
+   |            ----   ^^^^^^^^^^^^^
+   |            |      |
+   |            |      expected `&str`, found struct `std::string::String`
+   |            |      help: consider borrowing here: `&String::new()`
+   |            expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:12:10
index 9914d7e8507110fcf5c94f49fb987b8d6393428c..ded581dc4968e1604a143b78f801bbbc2ac3fc95 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/move-closure.rs:5:17
    |
 LL |     let x: () = move || ();
-   |                 ^^^^^^^^^^ expected `()`, found closure
+   |            --   ^^^^^^^^^^ expected `()`, found closure
+   |            |
+   |            expected due to this
    |
    = note: expected unit type `()`
                 found closure `[closure@$DIR/move-closure.rs:5:17: 5:27]`
index 909ff1e0263b6237d79c8ac118333bba83f8c1f2..a133c69eeefc84b8dd5bda8af420407dc5f0395c 100644 (file)
@@ -32,10 +32,11 @@ error[E0308]: mismatched types
   --> $DIR/str-array-assignment.rs:9:17
    |
 LL |   let w: &str = s[..2];
-   |                 ^^^^^^
-   |                 |
-   |                 expected `&str`, found `str`
-   |                 help: consider borrowing here: `&s[..2]`
+   |          ----   ^^^^^^
+   |          |      |
+   |          |      expected `&str`, found `str`
+   |          |      help: consider borrowing here: `&s[..2]`
+   |          expected due to this
 
 error: aborting due to 4 previous errors
 
index 7174fd972eb7f841673e6e4a564f8a51a65e8474..64ddfcc9b476505897f7e515714d77f78aa6e1e1 100644 (file)
@@ -2,10 +2,11 @@ error[E0308]: mismatched types
   --> $DIR/str-lit-type-mismatch.rs:2:20
    |
 LL |     let x: &[u8] = "foo";
-   |                    ^^^^^
-   |                    |
-   |                    expected slice `[u8]`, found `str`
-   |                    help: consider adding a leading `b`: `b"foo"`
+   |            -----   ^^^^^
+   |            |       |
+   |            |       expected slice `[u8]`, found `str`
+   |            |       help: consider adding a leading `b`: `b"foo"`
+   |            expected due to this
    |
    = note: expected reference `&[u8]`
               found reference `&'static str`
@@ -14,10 +15,11 @@ error[E0308]: mismatched types
   --> $DIR/str-lit-type-mismatch.rs:3:23
    |
 LL |     let y: &[u8; 4] = "baaa";
-   |                       ^^^^^^
-   |                       |
-   |                       expected array `[u8; 4]`, found `str`
-   |                       help: consider adding a leading `b`: `b"baaa"`
+   |            --------   ^^^^^^
+   |            |          |
+   |            |          expected array `[u8; 4]`, found `str`
+   |            |          help: consider adding a leading `b`: `b"baaa"`
+   |            expected due to this
    |
    = note: expected reference `&[u8; 4]`
               found reference `&'static str`
@@ -26,10 +28,11 @@ error[E0308]: mismatched types
   --> $DIR/str-lit-type-mismatch.rs:4:19
    |
 LL |     let z: &str = b"foo";
-   |                   ^^^^^^
-   |                   |
-   |                   expected `str`, found array `[u8; 3]`
-   |                   help: consider removing the leading `b`: `"foo"`
+   |            ----   ^^^^^^
+   |            |      |
+   |            |      expected `str`, found array `[u8; 3]`
+   |            |      help: consider removing the leading `b`: `"foo"`
+   |            expected due to this
    |
    = note: expected reference `&str`
               found reference `&'static [u8; 3]`
index b75a53915b526d869248f1539a1473b5a6f9ba70..d232a46f8ec29b1b3b4651d39954e8c387b5bc8c 100644 (file)
@@ -63,7 +63,9 @@ error[E0308]: mismatched types
   --> $DIR/struct-literal-variant-in-if.rs:21:20
    |
 LL |     let y: usize = ();
-   |                    ^^ expected `usize`, found `()`
+   |            -----   ^^ expected `usize`, found `()`
+   |            |
+   |            expected due to this
 
 error: aborting due to 7 previous errors
 
index 8a233105491e5e2f2972ec719017b3ccb1a0b59f..4423f3c130e2a31ddf562d1cd65b362e264c6efe 100644 (file)
@@ -5,10 +5,11 @@ LL |     fn bar<'a, T>() where T: 'a {}
    |     --------------------------- fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>} defined here
 ...
 LL |     let x: () = <i8 as Foo<'static, 'static,  u8>>::bar::<'static, char>;
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                 |
-   |                 expected `()`, found fn item
-   |                 help: use parentheses to call this function: `<i8 as Foo<'static, 'static,  u8>>::bar::<'static, char>()`
+   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |            |    |
+   |            |    expected `()`, found fn item
+   |            |    help: use parentheses to call this function: `<i8 as Foo<'static, 'static,  u8>>::bar::<'static, char>()`
+   |            expected due to this
    |
    = note: expected unit type `()`
                 found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
@@ -20,10 +21,11 @@ LL |     fn bar<'a, T>() where T: 'a {}
    |     --------------------------- fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>} defined here
 ...
 LL |     let x: () = <i8 as Foo<'static, 'static,  u32>>::bar::<'static, char>;
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                 |
-   |                 expected `()`, found fn item
-   |                 help: use parentheses to call this function: `<i8 as Foo<'static, 'static,  u32>>::bar::<'static, char>()`
+   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |            |    |
+   |            |    expected `()`, found fn item
+   |            |    help: use parentheses to call this function: `<i8 as Foo<'static, 'static,  u32>>::bar::<'static, char>()`
+   |            expected due to this
    |
    = note: expected unit type `()`
                 found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
@@ -35,10 +37,11 @@ LL |     fn baz() {}
    |     -------- fn() {<i8 as Foo<'static, 'static, u8>>::baz} defined here
 ...
 LL |     let x: () = <i8 as Foo<'static, 'static,  u8>>::baz;
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                 |
-   |                 expected `()`, found fn item
-   |                 help: use parentheses to call this function: `<i8 as Foo<'static, 'static,  u8>>::baz()`
+   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |            |    |
+   |            |    expected `()`, found fn item
+   |            |    help: use parentheses to call this function: `<i8 as Foo<'static, 'static,  u8>>::baz()`
+   |            expected due to this
    |
    = note: expected unit type `()`
                 found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
@@ -50,10 +53,11 @@ LL | fn foo<'z>() where &'z (): Sized {
    | -------------------------------- fn() {foo::<'static>} defined here
 ...
 LL |     let x: () = foo::<'static>;
-   |                 ^^^^^^^^^^^^^^
-   |                 |
-   |                 expected `()`, found fn item
-   |                 help: use parentheses to call this function: `foo::<'static>()`
+   |            --   ^^^^^^^^^^^^^^
+   |            |    |
+   |            |    expected `()`, found fn item
+   |            |    help: use parentheses to call this function: `foo::<'static>()`
+   |            expected due to this
    |
    = note: expected unit type `()`
                 found fn item `fn() {foo::<'static>}`
index ab70d02e1578a7c157b449aabb19976ee3272fb2..2aebdebee72c1e1ccf5fb663a1f965a0fa72145e 100644 (file)
@@ -5,10 +5,11 @@ LL |     fn bar<'a, T>() where T: 'a {}
    |     --------------------------- fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>} defined here
 ...
 LL |     let x: () = <i8 as Foo<'static, 'static,  u8>>::bar::<'static, char>;
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                 |
-   |                 expected `()`, found fn item
-   |                 help: use parentheses to call this function: `<i8 as Foo<'static, 'static,  u8>>::bar::<'static, char>()`
+   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |            |    |
+   |            |    expected `()`, found fn item
+   |            |    help: use parentheses to call this function: `<i8 as Foo<'static, 'static,  u8>>::bar::<'static, char>()`
+   |            expected due to this
    |
    = note: expected unit type `()`
                 found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>}`
@@ -20,10 +21,11 @@ LL |     fn bar<'a, T>() where T: 'a {}
    |     --------------------------- fn() {<i8 as Foo<ReStatic, ReStatic>>::bar::<ReStatic, char>} defined here
 ...
 LL |     let x: () = <i8 as Foo<'static, 'static,  u32>>::bar::<'static, char>;
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                 |
-   |                 expected `()`, found fn item
-   |                 help: use parentheses to call this function: `<i8 as Foo<'static, 'static,  u32>>::bar::<'static, char>()`
+   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |            |    |
+   |            |    expected `()`, found fn item
+   |            |    help: use parentheses to call this function: `<i8 as Foo<'static, 'static,  u32>>::bar::<'static, char>()`
+   |            expected due to this
    |
    = note: expected unit type `()`
                 found fn item `fn() {<i8 as Foo<ReStatic, ReStatic>>::bar::<ReStatic, char>}`
@@ -35,10 +37,11 @@ LL |     fn baz() {}
    |     -------- fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz} defined here
 ...
 LL |     let x: () = <i8 as Foo<'static, 'static,  u8>>::baz;
-   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                 |
-   |                 expected `()`, found fn item
-   |                 help: use parentheses to call this function: `<i8 as Foo<'static, 'static,  u8>>::baz()`
+   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |            |    |
+   |            |    expected `()`, found fn item
+   |            |    help: use parentheses to call this function: `<i8 as Foo<'static, 'static,  u8>>::baz()`
+   |            expected due to this
    |
    = note: expected unit type `()`
                 found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz}`
@@ -50,10 +53,11 @@ LL | fn foo<'z>() where &'z (): Sized {
    | -------------------------------- fn() {foo::<ReStatic>} defined here
 ...
 LL |     let x: () = foo::<'static>;
-   |                 ^^^^^^^^^^^^^^
-   |                 |
-   |                 expected `()`, found fn item
-   |                 help: use parentheses to call this function: `foo::<'static>()`
+   |            --   ^^^^^^^^^^^^^^
+   |            |    |
+   |            |    expected `()`, found fn item
+   |            |    help: use parentheses to call this function: `foo::<'static>()`
+   |            expected due to this
    |
    = note: expected unit type `()`
                 found fn item `fn() {foo::<ReStatic>}`
index 1cc63f5c476db0cc8a89c7344339f84d18195650..8445a706f4306c67f48bab203c0abd47bb689d63 100644 (file)
@@ -34,10 +34,11 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:16:27
    |
 LL |   let y: Option<&usize> = x;
-   |                           ^
-   |                           |
-   |                           expected enum `std::option::Option`, found reference
-   |                           help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`: `x.as_ref()`
+   |          --------------   ^
+   |          |                |
+   |          |                expected enum `std::option::Option`, found reference
+   |          |                help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`: `x.as_ref()`
+   |          expected due to this
    |
    = note:   expected enum `std::option::Option<&usize>`
            found reference `&std::option::Option<usize>`
@@ -46,7 +47,9 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:19:35
    |
 LL |   let y: Result<&usize, &usize> = x;
-   |                                   ^ expected enum `std::result::Result`, found reference
+   |          ----------------------   ^ expected enum `std::result::Result`, found reference
+   |          |
+   |          expected due to this
    |
    = note:   expected enum `std::result::Result<&usize, &usize>`
            found reference `&std::result::Result<usize, usize>`
@@ -59,7 +62,9 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:23:34
    |
 LL |   let y: Result<&usize, usize> = x;
-   |                                  ^ expected enum `std::result::Result`, found reference
+   |          ---------------------   ^ expected enum `std::result::Result`, found reference
+   |          |
+   |          expected due to this
    |
    = note:   expected enum `std::result::Result<&usize, usize>`
            found reference `&std::result::Result<usize, usize>`
index e699a753d3aa2862d001535cc2b4a45fbc6c7ade..2f0a457a795946d49ba39dc72ec8a8eb0b295ac2 100644 (file)
@@ -19,10 +19,11 @@ LL | fn foo(a: usize, b: usize) -> usize { a }
    | ----------------------------------- fn(usize, usize) -> usize {foo} defined here
 ...
 LL |     let _: usize = foo;
-   |                    ^^^
-   |                    |
-   |                    expected `usize`, found fn item
-   |                    help: use parentheses to call this function: `foo(a, b)`
+   |            -----   ^^^
+   |            |       |
+   |            |       expected `usize`, found fn item
+   |            |       help: use parentheses to call this function: `foo(a, b)`
+   |            expected due to this
    |
    = note: expected type `usize`
            found fn item `fn(usize, usize) -> usize {foo}`
@@ -34,10 +35,11 @@ LL | struct S(usize, usize);
    | ----------------------- fn(usize, usize) -> S {S} defined here
 ...
 LL |     let _: S = S;
-   |                ^
-   |                |
-   |                expected struct `S`, found fn item
-   |                help: use parentheses to instantiate this tuple struct: `S(_, _)`
+   |            -   ^
+   |            |   |
+   |            |   expected struct `S`, found fn item
+   |            |   help: use parentheses to instantiate this tuple struct: `S(_, _)`
+   |            expected due to this
    |
    = note: expected struct `S`
              found fn item `fn(usize, usize) -> S {S}`
@@ -49,10 +51,11 @@ LL | fn bar() -> usize { 42 }
    | ----------------- fn() -> usize {bar} defined here
 ...
 LL |     let _: usize = bar;
-   |                    ^^^
-   |                    |
-   |                    expected `usize`, found fn item
-   |                    help: use parentheses to call this function: `bar()`
+   |            -----   ^^^
+   |            |       |
+   |            |       expected `usize`, found fn item
+   |            |       help: use parentheses to call this function: `bar()`
+   |            expected due to this
    |
    = note: expected type `usize`
            found fn item `fn() -> usize {bar}`
@@ -64,10 +67,11 @@ LL | struct V();
    | ----------- fn() -> V {V} defined here
 ...
 LL |     let _: V = V;
-   |                ^
-   |                |
-   |                expected struct `V`, found fn item
-   |                help: use parentheses to instantiate this tuple struct: `V()`
+   |            -   ^
+   |            |   |
+   |            |   expected struct `V`, found fn item
+   |            |   help: use parentheses to instantiate this tuple struct: `V()`
+   |            expected due to this
    |
    = note: expected struct `V`
              found fn item `fn() -> V {V}`
@@ -79,10 +83,11 @@ LL |     fn baz(x: usize, y: usize) -> usize { x }
    |     ----------------------------------- fn(usize, usize) -> usize {<_ as T>::baz} defined here
 ...
 LL |     let _: usize = T::baz;
-   |                    ^^^^^^
-   |                    |
-   |                    expected `usize`, found fn item
-   |                    help: use parentheses to call this function: `T::baz(x, y)`
+   |            -----   ^^^^^^
+   |            |       |
+   |            |       expected `usize`, found fn item
+   |            |       help: use parentheses to call this function: `T::baz(x, y)`
+   |            expected due to this
    |
    = note: expected type `usize`
            found fn item `fn(usize, usize) -> usize {<_ as T>::baz}`
@@ -94,10 +99,11 @@ LL |     fn bat(x: usize) -> usize { 42 }
    |     ------------------------- fn(usize) -> usize {<_ as T>::bat} defined here
 ...
 LL |     let _: usize = T::bat;
-   |                    ^^^^^^
-   |                    |
-   |                    expected `usize`, found fn item
-   |                    help: use parentheses to call this function: `T::bat(x)`
+   |            -----   ^^^^^^
+   |            |       |
+   |            |       expected `usize`, found fn item
+   |            |       help: use parentheses to call this function: `T::bat(x)`
+   |            expected due to this
    |
    = note: expected type `usize`
            found fn item `fn(usize) -> usize {<_ as T>::bat}`
@@ -109,10 +115,11 @@ LL |     A(usize),
    |     -------- fn(usize) -> E {E::A} defined here
 ...
 LL |     let _: E = E::A;
-   |                ^^^^
-   |                |
-   |                expected enum `E`, found fn item
-   |                help: use parentheses to instantiate this tuple variant: `E::A(_)`
+   |            -   ^^^^
+   |            |   |
+   |            |   expected enum `E`, found fn item
+   |            |   help: use parentheses to instantiate this tuple variant: `E::A(_)`
+   |            expected due to this
    |
    = note: expected enum `E`
            found fn item `fn(usize) -> E {E::A}`
@@ -124,10 +131,11 @@ LL |     fn baz(x: usize, y: usize) -> usize { x }
    |     ----------------------------------- fn(usize, usize) -> usize {<X as T>::baz} defined here
 ...
 LL |     let _: usize = X::baz;
-   |                    ^^^^^^
-   |                    |
-   |                    expected `usize`, found fn item
-   |                    help: use parentheses to call this function: `X::baz(x, y)`
+   |            -----   ^^^^^^
+   |            |       |
+   |            |       expected `usize`, found fn item
+   |            |       help: use parentheses to call this function: `X::baz(x, y)`
+   |            expected due to this
    |
    = note: expected type `usize`
            found fn item `fn(usize, usize) -> usize {<X as T>::baz}`
@@ -139,10 +147,11 @@ LL |     fn bat(x: usize) -> usize { 42 }
    |     ------------------------- fn(usize) -> usize {<X as T>::bat} defined here
 ...
 LL |     let _: usize = X::bat;
-   |                    ^^^^^^
-   |                    |
-   |                    expected `usize`, found fn item
-   |                    help: use parentheses to call this function: `X::bat(x)`
+   |            -----   ^^^^^^
+   |            |       |
+   |            |       expected `usize`, found fn item
+   |            |       help: use parentheses to call this function: `X::bat(x)`
+   |            expected due to this
    |
    = note: expected type `usize`
            found fn item `fn(usize) -> usize {<X as T>::bat}`
@@ -154,10 +163,11 @@ LL |     fn bax(x: usize) -> usize { 42 }
    |     ------------------------- fn(usize) -> usize {<X as T>::bax} defined here
 ...
 LL |     let _: usize = X::bax;
-   |                    ^^^^^^
-   |                    |
-   |                    expected `usize`, found fn item
-   |                    help: use parentheses to call this function: `X::bax(x)`
+   |            -----   ^^^^^^
+   |            |       |
+   |            |       expected `usize`, found fn item
+   |            |       help: use parentheses to call this function: `X::bax(x)`
+   |            expected due to this
    |
    = note: expected type `usize`
            found fn item `fn(usize) -> usize {<X as T>::bax}`
@@ -169,10 +179,11 @@ LL |     fn bach(x: usize) -> usize;
    |     --------------------------- fn(usize) -> usize {<X as T>::bach} defined here
 ...
 LL |     let _: usize = X::bach;
-   |                    ^^^^^^^
-   |                    |
-   |                    expected `usize`, found fn item
-   |                    help: use parentheses to call this function: `X::bach(x)`
+   |            -----   ^^^^^^^
+   |            |       |
+   |            |       expected `usize`, found fn item
+   |            |       help: use parentheses to call this function: `X::bach(x)`
+   |            expected due to this
    |
    = note: expected type `usize`
            found fn item `fn(usize) -> usize {<X as T>::bach}`
@@ -184,10 +195,11 @@ LL |     fn ban(&self) -> usize { 42 }
    |     ---------------------- for<'r> fn(&'r X) -> usize {<X as T>::ban} defined here
 ...
 LL |     let _: usize = X::ban;
-   |                    ^^^^^^
-   |                    |
-   |                    expected `usize`, found fn item
-   |                    help: use parentheses to call this function: `X::ban(_)`
+   |            -----   ^^^^^^
+   |            |       |
+   |            |       expected `usize`, found fn item
+   |            |       help: use parentheses to call this function: `X::ban(_)`
+   |            expected due to this
    |
    = note: expected type `usize`
            found fn item `for<'r> fn(&'r X) -> usize {<X as T>::ban}`
@@ -199,10 +211,11 @@ LL |     fn bal(&self) -> usize;
    |     ----------------------- for<'r> fn(&'r X) -> usize {<X as T>::bal} defined here
 ...
 LL |     let _: usize = X::bal;
-   |                    ^^^^^^
-   |                    |
-   |                    expected `usize`, found fn item
-   |                    help: use parentheses to call this function: `X::bal(_)`
+   |            -----   ^^^^^^
+   |            |       |
+   |            |       expected `usize`, found fn item
+   |            |       help: use parentheses to call this function: `X::bal(_)`
+   |            expected due to this
    |
    = note: expected type `usize`
            found fn item `for<'r> fn(&'r X) -> usize {<X as T>::bal}`
@@ -225,10 +238,11 @@ error[E0308]: mismatched types
 LL |     let closure = || 42;
    |                   -- closure defined here
 LL |     let _: usize = closure;
-   |                    ^^^^^^^
-   |                    |
-   |                    expected `usize`, found closure
-   |                    help: use parentheses to call this closure: `closure()`
+   |            -----   ^^^^^^^
+   |            |       |
+   |            |       expected `usize`, found closure
+   |            |       help: use parentheses to call this closure: `closure()`
+   |            expected due to this
    |
    = note: expected type `usize`
            found closure `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:24]`
index 4b11139643194f38d68158997c4827dc88ba1e8c..44fac16260afc8f551adcc1413a09bbe152f1058 100644 (file)
@@ -2,19 +2,21 @@ error[E0308]: mismatched types
   --> $DIR/format-borrow.rs:2:21
    |
 LL |     let a: String = &String::from("a");
-   |                     ^^^^^^^^^^^^^^^^^^
-   |                     |
-   |                     expected struct `std::string::String`, found `&std::string::String`
-   |                     help: consider removing the borrow: `String::from("a")`
+   |            ------   ^^^^^^^^^^^^^^^^^^
+   |            |        |
+   |            |        expected struct `std::string::String`, found `&std::string::String`
+   |            |        help: consider removing the borrow: `String::from("a")`
+   |            expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/format-borrow.rs:4:21
    |
 LL |     let b: String = &format!("b");
-   |                     ^^^^^^^^^^^^^
-   |                     |
-   |                     expected struct `std::string::String`, found `&std::string::String`
-   |                     help: consider removing the borrow: `format!("b")`
+   |            ------   ^^^^^^^^^^^^^
+   |            |        |
+   |            |        expected struct `std::string::String`, found `&std::string::String`
+   |            |        help: consider removing the borrow: `format!("b")`
+   |            expected due to this
 
 error: aborting due to 2 previous errors
 
index 23991bbbe690b1147ac00824d0982f7e6063e8b5..b20327a9ff83318049c2234e928ac097d3affe50 100644 (file)
@@ -2,28 +2,31 @@ error[E0308]: mismatched types
   --> $DIR/issue-59819.rs:28:18
    |
 LL |     let y: i32 = x;
-   |                  ^
-   |                  |
-   |                  expected `i32`, found struct `Foo`
-   |                  help: consider dereferencing the type: `*x`
+   |            ---   ^
+   |            |     |
+   |            |     expected `i32`, found struct `Foo`
+   |            |     help: consider dereferencing the type: `*x`
+   |            expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/issue-59819.rs:30:18
    |
 LL |     let b: i32 = a;
-   |                  ^
-   |                  |
-   |                  expected `i32`, found `&{integer}`
-   |                  help: consider dereferencing the borrow: `*a`
+   |            ---   ^
+   |            |     |
+   |            |     expected `i32`, found `&{integer}`
+   |            |     help: consider dereferencing the borrow: `*a`
+   |            expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/issue-59819.rs:34:21
    |
 LL |     let g: String = f;
-   |                     ^
-   |                     |
-   |                     expected struct `std::string::String`, found struct `Bar`
-   |                     help: try using a conversion method: `f.to_string()`
+   |            ------   ^
+   |            |        |
+   |            |        expected struct `std::string::String`, found struct `Bar`
+   |            |        help: try using a conversion method: `f.to_string()`
+   |            expected due to this
 
 error: aborting due to 3 previous errors
 
index f2c67dd1fdb4d4fb1309e526ef7b074b1d0d5c1e..4d44d893a86d9a20a818dc0cb3c056ac2de1e3e2 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/mismatched-types-numeric-from.rs:2:18
    |
 LL |     let _: u32 = i32::from(0_u8);
-   |                  ^^^^^^^^^^^^^^^ expected `u32`, found `i32`
+   |            ---   ^^^^^^^^^^^^^^^ expected `u32`, found `i32`
+   |            |
+   |            expected due to this
 
 error: aborting due to previous error
 
index a93eca0c99dc380100dc86e09f39980b50dd172b..163be4cfce7a1baec21cabc99b28c8be359e7a47 100644 (file)
@@ -22,13 +22,17 @@ error[E0308]: mismatched types
   --> $DIR/recover-from-semicolon-trailing-item.rs:10:20
    |
 LL |     let _: usize = S {};
-   |                    ^^^^ expected `usize`, found struct `S`
+   |            -----   ^^^^ expected `usize`, found struct `S`
+   |            |
+   |            expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/recover-from-semicolon-trailing-item.rs:12:20
    |
 LL |     let _: usize = X {};
-   |                    ^^^^ expected `usize`, found struct `main::X`
+   |            -----   ^^^^ expected `usize`, found struct `main::X`
+   |            |
+   |            expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/recover-from-semicolon-trailing-item.rs:14:9
index cda6d5254e7ad720e31fe75f1b0da4618be29f22..19786bee9cb29d7e2263cff811146ed956ac0626 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/suggest-box.rs:4:47
    |
 LL |       let _x: Box<dyn Fn() -> Result<(), ()>> = || {
-   |  _______________________________________________^
+   |  _____________-------------------------------___^
+   | |             |
+   | |             expected due to this
 LL | |         Err(())?;
 LL | |         Ok(())
 LL | |     };
index 63280082e0e0b0c1a3d230be737135fbfd30191f..cafb6d2d288eeed903ee92c5c402e2032f3ed38f 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/tag-that-dare-not-speak-its-name.rs:11:20
    |
 LL |     let x : char = last(y);
-   |                    ^^^^^^^ expected `char`, found enum `std::option::Option`
+   |             ----   ^^^^^^^ expected `char`, found enum `std::option::Option`
+   |             |
+   |             expected due to this
    |
    = note: expected type `char`
               found enum `std::option::Option<_>`
index 64d0ea012c8ddd60f764221cbaaa03aceae26dde..5dbb9ce45ee9e7b929756560f532e2cab7eb68c2 100644 (file)
@@ -1,8 +1,10 @@
 error[E0308]: mismatched types
   --> $DIR/non-whitespace-trimming-2.rs:4:311
    |
-LL | ... let _: usize = 14; let _: usize = 15; let _: () = 42; let _: usize = 0; let _: usize = 1; let _: usize = 2; let _: usize = 3; let _: ...
-   |                                                       ^^ expected `()`, found integer
+LL | ...13; let _: usize = 14; let _: usize = 15; let _: () = 42; let _: usize = 0; let _: usize = 1; let _: usize = 2; let _: usize = 3; let ...
+   |                                                     --   ^^ expected `()`, found integer
+   |                                                     |
+   |                                                     expected due to this
 
 error: aborting due to previous error
 
index c1b6544cdc854c7b86f870e01c40ff1a7dd28e25..d4993fad15c9796b490b2f2d95610f217a32423f 100644 (file)
@@ -1,8 +1,10 @@
 error[E0308]: mismatched types
   --> $DIR/non-whitespace-trimming-unicode.rs:4:415
    |
-LL | ...♰♱♲♳♴♵♶♷♸♹♺♻♼♽♾♿⚀⚁⚂⚃⚄⚅⚆⚈⚉4"; let _: () = 42;  let _: &str = "🦀☀☁☂☃☄★☆☇☈☉☊☋☌☍☎☏☐☑☒☓  ☖☗☘☙☚☛☜☝☞☟☠☡☢☣☤☥☦☧☨☩☪☫☬☭☮☯☰☱☲☳☴☵☶☷☸☹☺☻☼☽☾☿♀♁♂♃♄♅♆...
-   |                                              ^^ expected `()`, found integer
+LL | ...♭♮♯♰♱♲♳♴♵♶♷♸♹♺♻♼♽♾♿⚀⚁⚂⚃⚄⚅⚆⚈⚉4"; let _: () = 42;  let _: &str = "🦀☀☁☂☃☄★☆☇☈☉☊☋☌☍☎☏☐☑☒☓  ☖☗☘☙☚☛☜☝☞☟☠☡☢☣☤☥☦☧☨☩☪☫☬☭☮☯☰☱☲☳☴☵☶☷☸☹☺☻☼☽☾☿♀♁♂♃♄...
+   |                                            --   ^^ expected `()`, found integer
+   |                                                     |
+   |                                            expected due to this
 
 error: aborting due to previous error
 
index a8f2212b5572535c89affaf9d867af56c0adaf18..c4ff0e16890b23e94fe26b237ef4f80eb7da6f3a 100644 (file)
@@ -1,8 +1,10 @@
 error[E0308]: mismatched types
   --> $DIR/non-whitespace-trimming.rs:4:241
    |
-LL | ... = (); let _: () = (); let _: () = (); let _: () = 42; let _: () = (); let _: () = (); let _: () = (); let _: () = (); let _: () = ();...
-   |                                                       ^^ expected `()`, found integer
+LL | ... () = (); let _: () = (); let _: () = (); let _: () = 42; let _: () = (); let _: () = (); let _: () = (); let _: () = (); let _: () = ...
+   |                                                     --   ^^ expected `()`, found integer
+   |                                                     |
+   |                                                     expected due to this
 
 error: aborting due to previous error
 
index 903673266cc47d47918b534b7b9dedc48e3e81eb..e296d48893cdac7b50f0df5f0bbb296351a35ce1 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/whitespace-trimming.rs:4:193
    |
 LL | ...                   let _: () = 42;
-   |                                   ^^ expected `()`, found integer
+   |                              --   ^^ expected `()`, found integer
+   |                              |
+   |                              expected due to this
 
 error: aborting due to previous error
 
index 078971b89f773cbf0f5ae8bf12d2a641dc152811..95c3a08c04aa80a6955659e48150b26bd06925b3 100644 (file)
@@ -11,7 +11,9 @@ error[E0308]: mismatched types
   --> $DIR/enum-variant-priority-higher-than-other-inherent.rs:22:17
    |
 LL |     let _: u8 = <E2>::V;
-   |                 ^^^^^^^ expected `u8`, found enum `E2`
+   |            --   ^^^^^^^ expected `u8`, found enum `E2`
+   |            |
+   |            expected due to this
 
 error: aborting due to 2 previous errors
 
index 4fe25d6d287394280ac7248db056237d2f53ea29..dc41cbc5fe3f8d5634f1a134e5eb3c4bbb3eba3b 100644 (file)
@@ -8,7 +8,9 @@ error[E0308]: mismatched types
   --> $DIR/generic_type_does_not_live_long_enough.rs:6:18
    |
 LL |     let z: i32 = x;
-   |                  ^ expected `i32`, found opaque type
+   |            ---   ^ expected `i32`, found opaque type
+   |            |
+   |            expected due to this
    |
    = note:     expected type `i32`
            found opaque type `WrongGeneric::<&{integer}>`
index 2a037e681746930117898334ca0a724290d70ebe..24d23de797690362f04e644e93886271972936a0 100644 (file)
@@ -8,7 +8,9 @@ error[E0308]: mismatched types
   --> $DIR/generic_type_does_not_live_long_enough.rs:6:18
    |
 LL |     let z: i32 = x;
-   |                  ^ expected `i32`, found opaque type
+   |            ---   ^ expected `i32`, found opaque type
+   |            |
+   |            expected due to this
    |
    = note:     expected type `i32`
            found opaque type `WrongGeneric::<&{integer}>`
index 89add864f9ada58990501715806b49418ab84386..07962e36da1e66905187e1574575389e0e197e85 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/never_reveal_concrete_type.rs:13:27
    |
 LL |     let _: &'static str = x;
-   |                           ^ expected `&str`, found opaque type
+   |            ------------   ^ expected `&str`, found opaque type
+   |            |
+   |            expected due to this
    |
    = note: expected reference `&'static str`
             found opaque type `NoReveal`
index 7650013e41b1e294c2f77c7f8afe63f57e714b2c..a2081424ab497d241fa09b07ae46fcad62a62974 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/no_revealing_outside_defining_module.rs:15:19
    |
 LL |     let _: &str = bomp();
-   |                   ^^^^^^ expected `&str`, found opaque type
+   |            ----   ^^^^^^ expected `&str`, found opaque type
+   |            |
+   |            expected due to this
    |
    = note: expected reference `&str`
             found opaque type `Boo`
index 58a9e643cf629babcb8ccf41a422bef8922077f3..9a1cf5b25625ccb6df818b5a4e011d242801b4c2 100644 (file)
@@ -107,7 +107,9 @@ error[E0308]: mismatched types
   --> $DIR/assignment-expected-bool.rs:31:20
    |
 LL |     let _: usize = 0 = 0;
-   |                    ^^^^^ expected `usize`, found `()`
+   |            -----   ^^^^^ expected `usize`, found `()`
+   |            |
+   |            expected due to this
 
 error: aborting due to 13 previous errors
 
index d615e599501bec9ded4f2297888db230c8bd645b..2e8654d319640f6eebf7bcc373f813a69776cb3c 100644 (file)
@@ -2,13 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch-multiple.rs:3:27
    |
 LL | fn main() { let a: bool = 1; let b: i32 = true; }
-   |                           ^ expected `bool`, found integer
+   |                    ----   ^ expected `bool`, found integer
+   |                    |
+   |                    expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch-multiple.rs:3:43
    |
 LL | fn main() { let a: bool = 1; let b: i32 = true; }
-   |                                           ^^^^ expected `i32`, found `bool`
+   |                                     ---   ^^^^ expected `i32`, found `bool`
+   |                                     |
+   |                                     expected due to this
 
 error: aborting due to 2 previous errors
 
index b5a80766804a5dc602ab8a44cef07edfb7eba91a..25b4bff4d9aaa7453849322748392e27d87e7146 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/type-shadow.rs:6:20
    |
 LL |         let y: Y = "hello";
-   |                    ^^^^^^^ expected `isize`, found `&str`
+   |                -   ^^^^^^^ expected `isize`, found `&str`
+   |                |
+   |                expected due to this
 
 error: aborting due to previous error
 
index 1f6f89a6eb1cd7de08a927879b82ced190461043..867412a24b282c24b3055db8f8420101ed52b0df 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/typeck_type_placeholder_mismatch.rs:13:21
    |
 LL |     let x: Foo<_> = Bar::<usize>(PhantomData);
-   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found struct `Bar`
+   |            ------   ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found struct `Bar`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `Foo<_>`
               found struct `Bar<usize>`
@@ -11,7 +13,9 @@ error[E0308]: mismatched types
   --> $DIR/typeck_type_placeholder_mismatch.rs:22:21
    |
 LL |     let x: Foo<_> = Bar::<usize>(PhantomData);
-   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found struct `Bar`
+   |            ------   ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found struct `Bar`
+   |            |
+   |            expected due to this
    |
    = note: expected struct `Foo<_>`
               found struct `Bar<usize>`
index c0888b3b9d4d5b10a21445e20160c2bfc64301e2..23645759c04b0fadaf0ab10310936ee7ff6e6dca 100644 (file)
@@ -35,7 +35,9 @@ error[E0308]: mismatched types
   --> $DIR/wrong-mul-method-signature.rs:63:19
    |
 LL |     let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order
-   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found `f64`
+   |            ----   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found `f64`
+   |            |
+   |            expected due to this
 
 error: aborting due to 5 previous errors