]> git.lizzy.rs Git - rust.git/commitdiff
Remove E0308 note when primary label has all info
authorEsteban Küber <esteban@kuber.com.ar>
Fri, 15 Nov 2019 07:45:30 +0000 (23:45 -0800)
committerEsteban Küber <esteban@kuber.com.ar>
Mon, 18 Nov 2019 19:03:03 +0000 (11:03 -0800)
237 files changed:
src/librustc/infer/error_reporting/mod.rs
src/librustc/ty/error.rs
src/librustc/ty/mod.rs
src/test/rustdoc-ui/failed-doctest-missing-codes.stdout
src/test/ui/arg-type-mismatch.stderr
src/test/ui/array-not-vector.rs
src/test/ui/array-not-vector.stderr
src/test/ui/associated-const/associated-const-generic-obligations.stderr
src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr
src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr
src/test/ui/associated-types/associated-types-eq-3.stderr
src/test/ui/associated-types/associated-types-overridden-binding-2.stderr
src/test/ui/associated-types/issue-44153.stderr
src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr
src/test/ui/async-await/async-block-control-flow-static-semantics.stderr
src/test/ui/bad/bad-const-type.rs
src/test/ui/bad/bad-const-type.stderr
src/test/ui/binop/binop-logic-int.stderr
src/test/ui/blind/blind-item-block-middle.stderr
src/test/ui/block-expression-remove-semicolon.stderr
src/test/ui/block-result/block-must-not-have-result-do.stderr
src/test/ui/block-result/block-must-not-have-result-res.stderr
src/test/ui/block-result/block-must-not-have-result-while.rs
src/test/ui/block-result/block-must-not-have-result-while.stderr
src/test/ui/block-result/consider-removing-last-semi.stderr
src/test/ui/block-result/issue-11714.stderr
src/test/ui/block-result/issue-13428.stderr
src/test/ui/block-result/issue-13624.rs
src/test/ui/block-result/issue-13624.stderr
src/test/ui/block-result/issue-22645.stderr
src/test/ui/block-result/unexpected-return-on-unit.stderr
src/test/ui/chalkify/type_inference.stderr
src/test/ui/codemap_tests/tab.stderr
src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr
src/test/ui/coercion/coercion-missing-tail-expected-type.stderr
src/test/ui/coercion/coercion-slice.rs
src/test/ui/coercion/coercion-slice.stderr
src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr
src/test/ui/consts/const-array-oob-arith.stderr
src/test/ui/consts/const-eval/const-eval-span.rs
src/test/ui/consts/const-eval/const-eval-span.stderr
src/test/ui/consts/const-integer-bool-ops.stderr
src/test/ui/conversion-methods.stderr
src/test/ui/deref-suggestion.stderr
src/test/ui/did_you_mean/issue-42764.stderr
src/test/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr
src/test/ui/diverging-fn-tail-35849.stderr
src/test/ui/dst/dst-bad-coerce1.stderr
src/test/ui/dst/dst-bad-coerce4.rs
src/test/ui/dst/dst-bad-coerce4.stderr
src/test/ui/error-codes/E0070.stderr
src/test/ui/error-codes/E0271.stderr
src/test/ui/estr-subtyping.stderr
src/test/ui/float-literal-inference-restrictions.stderr
src/test/ui/fully-qualified-type/fully-qualified-type-name2.rs
src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr
src/test/ui/hrtb/issue-62203-hrtb-ice.stderr
src/test/ui/if-else-type-mismatch.stderr
src/test/ui/if/if-branch-types.stderr
src/test/ui/if/if-let-arm-types.rs
src/test/ui/if/if-let-arm-types.stderr
src/test/ui/if/if-no-match-bindings.stderr
src/test/ui/if/if-without-else-as-fn-expr.stderr
src/test/ui/if/if-without-else-result.rs
src/test/ui/if/if-without-else-result.stderr
src/test/ui/impl-trait/equality.stderr
src/test/ui/include-macros/mismatched-types.stderr
src/test/ui/integral-variable-unification-error.rs
src/test/ui/integral-variable-unification-error.stderr
src/test/ui/issues/issue-11319.rs
src/test/ui/issues/issue-11319.stderr
src/test/ui/issues/issue-12997-2.stderr
src/test/ui/issues/issue-13407.stderr
src/test/ui/issues/issue-13446.stderr
src/test/ui/issues/issue-14091.stderr
src/test/ui/issues/issue-14541.rs
src/test/ui/issues/issue-14541.stderr
src/test/ui/issues/issue-15783.rs
src/test/ui/issues/issue-15783.stderr
src/test/ui/issues/issue-15896.rs
src/test/ui/issues/issue-15896.stderr
src/test/ui/issues/issue-17033.rs
src/test/ui/issues/issue-17033.stderr
src/test/ui/issues/issue-19991.rs
src/test/ui/issues/issue-19991.stderr
src/test/ui/issues/issue-20225.rs
src/test/ui/issues/issue-20225.stderr
src/test/ui/issues/issue-22684.stderr
src/test/ui/issues/issue-23589.stderr
src/test/ui/issues/issue-27008.rs
src/test/ui/issues/issue-27008.stderr
src/test/ui/issues/issue-27042.stderr
src/test/ui/issues/issue-29084.rs
src/test/ui/issues/issue-29084.stderr
src/test/ui/issues/issue-30225.stderr
src/test/ui/issues/issue-33504.stderr
src/test/ui/issues/issue-37026.stderr
src/test/ui/issues/issue-37665.stderr
src/test/ui/issues/issue-39970.stderr
src/test/ui/issues/issue-41549.stderr
src/test/ui/issues/issue-41742.stderr
src/test/ui/issues/issue-4201.rs
src/test/ui/issues/issue-4201.stderr
src/test/ui/issues/issue-43162.stderr
src/test/ui/issues/issue-43420-no-over-suggest.stderr
src/test/ui/issues/issue-44023.stderr
src/test/ui/issues/issue-4517.rs
src/test/ui/issues/issue-4517.stderr
src/test/ui/issues/issue-46302.stderr
src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr
src/test/ui/issues/issue-47486.stderr
src/test/ui/issues/issue-48364.stderr
src/test/ui/issues/issue-50577.stderr
src/test/ui/issues/issue-50585.stderr
src/test/ui/issues/issue-53348.rs
src/test/ui/issues/issue-53348.stderr
src/test/ui/issues/issue-53692.stderr
src/test/ui/issues/issue-56943.stderr
src/test/ui/issues/issue-61106.stderr
src/test/ui/issues/issue-61882.stderr
src/test/ui/issues/issue-7061.stderr
src/test/ui/json-bom-plus-crlf-multifile.stderr
src/test/ui/json-bom-plus-crlf.stderr
src/test/ui/keyword/keyword-false-as-identifier.stderr
src/test/ui/keyword/keyword-true-as-identifier.stderr
src/test/ui/liveness/liveness-closure-require-ret.stderr
src/test/ui/liveness/liveness-forgot-ret.stderr
src/test/ui/liveness/liveness-issue-2163.stderr
src/test/ui/liveness/liveness-missing-ret2.stderr
src/test/ui/liveness/liveness-return-last-stmt-semi.stderr
src/test/ui/loops/loop-break-value.stderr
src/test/ui/loops/loop-labeled-break-value.stderr
src/test/ui/loops/loop-properly-diverging-2.stderr
src/test/ui/match/match-arm-resolving-to-never.stderr
src/test/ui/match/match-range-fail.rs
src/test/ui/match/match-range-fail.stderr
src/test/ui/match/match-struct.rs
src/test/ui/match/match-struct.stderr
src/test/ui/match/match-tag-nullary.stderr
src/test/ui/match/match-tag-unary.stderr
src/test/ui/match/match-type-err-first-arm.rs
src/test/ui/match/match-type-err-first-arm.stderr
src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
src/test/ui/methods/method-self-arg-1.rs
src/test/ui/methods/method-self-arg-1.stderr
src/test/ui/mir-unpretty.stderr
src/test/ui/mismatched_types/E0409.stderr
src/test/ui/mismatched_types/abridged.stderr
src/test/ui/mismatched_types/for-loop-has-unit-body.stderr
src/test/ui/mismatched_types/main.stderr
src/test/ui/mismatched_types/overloaded-calls-bad.stderr
src/test/ui/missing/missing-return.stderr
src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr
src/test/ui/never_type/never-assign-wrong-type.stderr
src/test/ui/or-patterns/consistent-bindings.stderr
src/test/ui/or-patterns/issue-64879-trailing-before-guard.stderr
src/test/ui/or-patterns/or-pattern-mismatch.stderr
src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr
src/test/ui/output-type-mismatch.stderr
src/test/ui/parser/expr-as-stmt.stderr
src/test/ui/parser/fn-arg-doc-comment.rs
src/test/ui/parser/fn-arg-doc-comment.stderr
src/test/ui/parser/issue-33413.stderr
src/test/ui/parser/issue-62881.stderr
src/test/ui/parser/issue-62895.stderr
src/test/ui/parser/lex-bad-char-literals-6.stderr
src/test/ui/parser/match-vec-invalid.stderr
src/test/ui/parser/numeric-lifetime.stderr
src/test/ui/parser/pat-lt-bracket-6.stderr
src/test/ui/parser/pat-lt-bracket-7.stderr
src/test/ui/parser/pat-tuple-4.stderr
src/test/ui/parser/recover-for-loop-parens-around-head.stderr
src/test/ui/parser/recover-from-homoglyph.stderr
src/test/ui/parser/recover-missing-semi.stderr
src/test/ui/parser/recover-range-pats.stderr
src/test/ui/parser/recover-tuple.stderr
src/test/ui/parser/require-parens-for-chained-comparison.stderr
src/test/ui/pattern/pat-tuple-bad-type.stderr
src/test/ui/pattern/pattern-error-continue.rs
src/test/ui/pattern/pattern-error-continue.stderr
src/test/ui/point-to-type-err-cause-on-impl-trait-return.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/repeat_count.rs
src/test/ui/repeat_count.stderr
src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr
src/test/ui/resolve/resolve-inconsistent-names.stderr
src/test/ui/return/return-from-diverging.stderr
src/test/ui/rfc-2005-default-binding-mode/const.stderr
src/test/ui/rfc-2005-default-binding-mode/lit.stderr
src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr
src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr
src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr
src/test/ui/span/coerce-suggestions.stderr
src/test/ui/span/issue-33884.stderr
src/test/ui/span/issue-34264.stderr
src/test/ui/span/issue-39018.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/structs/struct-base-wrong-type.stderr
src/test/ui/structs/structure-constructor-type-mismatch.stderr
src/test/ui/suggestions/as-ref.stderr
src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr
src/test/ui/suggestions/format-borrow.stderr
src/test/ui/suggestions/issue-52820.stderr
src/test/ui/suggestions/issue-59819.stderr
src/test/ui/suggestions/match-needing-semi.stderr
src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr
src/test/ui/switched-expectations.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-2.stderr
src/test/ui/terminal-width/whitespace-trimming.stderr
src/test/ui/terr-in-field.rs
src/test/ui/terr-in-field.stderr
src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr
src/test/ui/try-block/try-block-bad-type.stderr
src/test/ui/try-block/try-block-type-error.stderr
src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.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-ascription-precedence.stderr
src/test/ui/type/type-ascription-soundness.stderr
src/test/ui/type/type-check/assignment-expected-bool.stderr
src/test/ui/type/type-check/assignment-in-if.stderr
src/test/ui/type/type-error-break-tail.stderr
src/test/ui/type/type-mismatch-multiple.rs
src/test/ui/type/type-mismatch-multiple.stderr
src/test/ui/type/type-mismatch-same-crate-name.rs
src/test/ui/type/type-mismatch-same-crate-name.stderr
src/test/ui/type/type-mismatch.stderr
src/test/ui/type/type-shadow.stderr
src/test/ui/wrong-mul-method-signature.stderr

index caf9f7288b99fa33357ab8ad2f52d57654d4329a..cccdcc68a579328b0528c7a5b150ac7b69b75db2 100644 (file)
@@ -1163,8 +1163,8 @@ pub fn note_type_err(
             Some(values) => {
                 let (is_simple_error, exp_found) = match values {
                     ValuePairs::Types(exp_found) => {
-                        let is_simple_err =
-                            exp_found.expected.is_primitive() && exp_found.found.is_primitive();
+                        let is_simple_err = exp_found.expected.is_simple_text()
+                            && exp_found.found.is_simple_text();
 
                         (is_simple_err, Some(exp_found))
                     }
@@ -1201,8 +1201,8 @@ pub fn note_type_err(
                 .unwrap_or("type".into());
             let found_label = exp_found.map(|ef| ef.found.prefix_string())
                 .unwrap_or("type".into());
-            match (terr, is_simple_error, expected == found) {
-                (&TypeError::Sorts(ref values), false, extra) => {
+            match (&terr, expected == found) {
+                (TypeError::Sorts(values), extra) => {
                     let sort_string = |ty: Ty<'tcx>| match (extra, &ty.kind) {
                         (true, ty::Opaque(def_id, _)) => format!(
                             " (opaque type at {})",
@@ -1212,26 +1212,43 @@ pub fn note_type_err(
                         (true, _) => format!(" ({})", ty.sort_string(self.tcx)),
                         (false, _) => "".to_string(),
                     };
-                    diag.note_expected_found_extra(
-                        &expected_label,
-                        expected,
-                        &found_label,
-                        found,
-                        &sort_string(values.expected),
-                        &sort_string(values.found),
-                    );
+                    if !(values.expected.is_simple_text() && values.found.is_simple_text()) || (
+                        exp_found.map_or(false, |ef| {
+                            // This happens when the type error is a subset of the expectation,
+                            // like when you have two references but one is `usize` and the other
+                            // is `f32`. In those cases we still want to show the `note`. If the
+                            // value from `ef` is `Infer(_)`, then we ignore it.
+                            if !ef.expected.is_ty_infer() {
+                                ef.expected != values.expected
+                            } else if !ef.found.is_ty_infer() {
+                                ef.found != values.found
+                            } else {
+                                false
+                            }
+                        })
+                    ) {
+                        diag.note_expected_found_extra(
+                            &expected_label,
+                            expected,
+                            &found_label,
+                            found,
+                            &sort_string(values.expected),
+                            &sort_string(values.found),
+                        );
+                    }
                 }
-                (TypeError::ObjectUnsafeCoercion(_), ..) => {
+                (TypeError::ObjectUnsafeCoercion(_), _) => {
                     diag.note_unsuccessfull_coercion(found, expected);
                 }
-                (_, false, _) => {
+                (_, _) => {
                     debug!(
                         "note_type_err: exp_found={:?}, expected={:?} found={:?}",
                         exp_found, expected, found
                     );
-                    diag.note_expected_found(&expected_label, expected, &found_label, found);
+                    if !is_simple_error || terr.must_include_note() {
+                        diag.note_expected_found(&expected_label, expected, &found_label, found);
+                    }
                 }
-                _ => (),
             }
         }
         if let Some(exp_found) = exp_found {
index 09a833baca93f3f455b8cafdf92a521a6c8a8449..feb53539a2eda3f9c384af2dbaa90643e614fd3e 100644 (file)
@@ -64,8 +64,11 @@ pub enum UnconstrainedNumeric {
 impl<'tcx> fmt::Display for TypeError<'tcx> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         use self::TypeError::*;
-        fn report_maybe_different(f: &mut fmt::Formatter<'_>,
-                                  expected: &str, found: &str) -> fmt::Result {
+        fn report_maybe_different(
+            f: &mut fmt::Formatter<'_>,
+            expected: &str,
+            found: &str,
+        ) -> fmt::Result {
             // A naive approach to making sure that we're not reporting silly errors such as:
             // (expected closure, found closure).
             if expected == found {
@@ -183,39 +186,70 @@ fn report_maybe_different(f: &mut fmt::Formatter<'_>,
     }
 }
 
+impl<'tcx> TypeError<'tcx> {
+    pub fn must_include_note(&self) -> bool {
+        use self::TypeError::*;
+        match self {
+            CyclicTy(_) |
+            UnsafetyMismatch(_) |
+            Mismatch |
+            AbiMismatch(_) |
+            FixedArraySize(_) |
+            Sorts(_) |
+            IntMismatch(_) |
+            FloatMismatch(_) |
+            VariadicMismatch(_) => false,
+
+            Mutability |
+            TupleSize(_) |
+            ArgCount |
+            RegionsDoesNotOutlive(..) |
+            RegionsInsufficientlyPolymorphic(..) |
+            RegionsOverlyPolymorphic(..) |
+            RegionsPlaceholderMismatch |
+            Traits(_) |
+            ProjectionMismatched(_) |
+            ProjectionBoundsLength(_) |
+            ExistentialMismatch(_) |
+            ConstMismatch(_) |
+            IntrinsicCast |
+            ObjectUnsafeCoercion(_) => true,
+        }
+    }
+}
+
 impl<'tcx> ty::TyS<'tcx> {
     pub fn sort_string(&self, tcx: TyCtxt<'_>) -> Cow<'static, str> {
         match self.kind {
             ty::Bool | ty::Char | ty::Int(_) |
-            ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => self.to_string().into(),
-            ty::Tuple(ref tys) if tys.is_empty() => self.to_string().into(),
+            ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => format!("{}", self).into(),
+            ty::Tuple(ref tys) if tys.is_empty() => format!("{}", self).into(),
 
             ty::Adt(def, _) => format!("{} `{}`", def.descr(), tcx.def_path_str(def.did)).into(),
             ty::Foreign(def_id) => format!("extern type `{}`", tcx.def_path_str(def_id)).into(),
-            ty::Array(_, n) => {
+            ty::Array(t, n) => {
                 let n = tcx.lift(&n).unwrap();
                 match n.try_eval_usize(tcx, ty::ParamEnv::empty()) {
-                    Some(n) => {
-                        format!("array of {} element{}", n, pluralize!(n)).into()
-                    }
+                    _ if t.is_simple_ty() => format!("array `{}`", self).into(),
+                    Some(n) => format!("array of {} element{} ", n, pluralize!(n)).into(),
                     None => "array".into(),
                 }
             }
+            ty::Slice(ty) if ty.is_simple_ty() => format!("slice `{}`", self).into(),
             ty::Slice(_) => "slice".into(),
             ty::RawPtr(_) => "*-ptr".into(),
-            ty::Ref(region, ty, mutbl) => {
+            ty::Ref(_, ty, mutbl) => {
                 let tymut = ty::TypeAndMut { ty, mutbl };
                 let tymut_string = tymut.to_string();
-                if tymut_string == "_" ||         //unknown type name,
-                   tymut_string.len() > 10 ||     //name longer than saying "reference",
-                   region.to_string() != "'_"     //... or a complex type
-                {
-                    format!("{}reference", match mutbl {
-                        hir::Mutability::Mutable => "mutable ",
-                        _ => ""
-                    }).into()
-                } else {
+                if tymut_string != "_" && (
+                    ty.is_simple_text() || tymut_string.len() < "mutable reference".len()
+                ) {
                     format!("&{}", tymut_string).into()
+                } else { // Unknown type name, it's long or has type arguments
+                    match mutbl {
+                        hir::Mutability::Mutable => "mutable reference",
+                        _ => "reference",
+                    }.into()
                 }
             }
             ty::FnDef(..) => "fn item".into(),
@@ -248,7 +282,6 @@ pub fn sort_string(&self, tcx: TyCtxt<'_>) -> Cow<'static, str> {
     }
 
     pub fn prefix_string(&self) -> Cow<'static, str> {
-        debug!("prefix_string {:?} {} {:?}", self, self, self.kind);
         match self.kind {
             ty::Infer(_) | ty::Error | ty::Bool | ty::Char | ty::Int(_) |
             ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => "type".into(),
index 031d6f09b4485bce988a102cc862b8843be561d6..5fc2812fd97db10d8fa1b4abaa93bc55d8b9690b 100644 (file)
@@ -555,16 +555,29 @@ fn hash<H: Hasher>(&self, s: &mut H) {
 impl<'tcx> TyS<'tcx> {
     pub fn is_primitive_ty(&self) -> bool {
         match self.kind {
-            Bool |
-            Char |
-            Int(_) |
-            Uint(_) |
-            Float(_) |
-            Infer(InferTy::IntVar(_)) |
-            Infer(InferTy::FloatVar(_)) |
-            Infer(InferTy::FreshIntTy(_)) |
-            Infer(InferTy::FreshFloatTy(_)) => true,
-            Ref(_, x, _) => x.is_primitive_ty(),
+            Bool | Char | Str | Int(_) | Uint(_) | Float(_) |
+            Infer(InferTy::IntVar(_)) | Infer(InferTy::FloatVar(_)) |
+            Infer(InferTy::FreshIntTy(_)) | Infer(InferTy::FreshFloatTy(_)) => true,
+            _ => false,
+        }
+    }
+
+    pub fn is_simple_ty(&self) -> bool {
+        match self.kind {
+            Bool | Char | Str | Int(_) | Uint(_) | Float(_) |
+            Infer(InferTy::IntVar(_)) | Infer(InferTy::FloatVar(_)) |
+            Infer(InferTy::FreshIntTy(_)) | Infer(InferTy::FreshFloatTy(_)) => true,
+            Ref(_, x, _) | Array(x, _) | Slice(x) => x.peel_refs().is_simple_ty(),
+            Tuple(tys) if tys.is_empty() => true,
+            _ => false,
+        }
+    }
+
+    pub fn is_simple_text(&self) -> bool {
+        match self.kind {
+            Adt(_, substs) => substs.types().next().is_none(),
+            Ref(_, ty, _) => ty.is_simple_text(),
+            _ if self.is_simple_ty() => true,
             _ => false,
         }
     }
index a8753d14de22f958f656fe431c3c80b279b84de6..42dc56c44ce95cf917951a29c473562d7b8d6e62 100644 (file)
@@ -10,9 +10,6 @@ error[E0308]: mismatched types
    |
 LL | let x: () = 5i32;
    |             ^^^^ expected (), found i32
-   |
-   = note: expected type `()`
-              found type `i32`
 
 error: aborting due to previous error
 
index 95aa36ebb89f99cb8fcf4f0446cd251df0ccd5c3..321a07c4a66b2a642d60ac1e17de47b3502c5345 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL | fn main() { let i: (); i = f(()); }
    |                              ^^ expected isize, found ()
-   |
-   = note:   expected type `isize`
-           found unit type `()`
 
 error: aborting due to previous error
 
index 838951c7c1d484f7e4fb19a772fbe5c0f8339e57..504874f2ce364cd65b7c4263e19c8681d8518fa4 100644 (file)
@@ -1,9 +1,7 @@
 fn main() {
     let _x: i32 = [1, 2, 3];
     //~^ ERROR mismatched types
-    //~| expected type `i32`
-    //~| found array `[{integer}; 3]`
-    //~| expected i32, found array of 3 elements
+    //~| expected i32, found array
 
     let x: &[i32] = &[1, 2, 3];
     let _y: &i32 = x;
index 2a2fbe6660a358e703c131fbbd13a991ce778ef8..fd02307ffd30e5c45d4e0b99144352dbfdc755f9 100644 (file)
@@ -2,16 +2,13 @@ error[E0308]: mismatched types
   --> $DIR/array-not-vector.rs:2:19
    |
 LL |     let _x: i32 = [1, 2, 3];
-   |                   ^^^^^^^^^ expected i32, found array of 3 elements
-   |
-   = note: expected type `i32`
-             found array `[{integer}; 3]`
+   |                   ^^^^^^^^^ expected i32, found array `[{integer}; 3]`
 
 error[E0308]: mismatched types
-  --> $DIR/array-not-vector.rs:9:20
+  --> $DIR/array-not-vector.rs:7:20
    |
 LL |     let _y: &i32 = x;
-   |                    ^ expected i32, found slice
+   |                    ^ expected i32, found slice `[i32]`
    |
    = note: expected reference `&i32`
               found reference `&[i32]`
index 6a48bbabe1078b650010db4f9757cd3c9bf58d90..f2312cbaa06229b27b8c8190b531c5b603e10eb2 100644 (file)
@@ -5,7 +5,7 @@ LL |     const FROM: Self::Out;
    |                 --------- type in trait
 ...
 LL |     const FROM: &'static str = "foo";
-   |                 ^^^^^^^^^^^^ expected associated type, found reference
+   |                 ^^^^^^^^^^^^ expected associated type, found &str
    |
    = note: expected associated type `<T as Foo>::Out`
                     found reference `&'static str`
index 483c7e7707e4f7f9c6def3e1505be76295d40a19..07f207627f4df2faadd79986c7a2d292c9b03446 100644 (file)
@@ -3,36 +3,24 @@ error[E0308]: mismatched types
    |
 LL | fn b() { dent(ModelT, Blue); }
    |                       ^^^^ expected struct `Black`, found struct `Blue`
-   |
-   = note: expected struct `Black`
-              found struct `Blue`
 
 error[E0308]: mismatched types
   --> $DIR/associated-type-projection-from-supertrait.rs:28:23
    |
 LL | fn c() { dent(ModelU, Black); }
    |                       ^^^^^ expected struct `Blue`, found struct `Black`
-   |
-   = note: expected struct `Blue`
-              found struct `Black`
 
 error[E0308]: mismatched types
   --> $DIR/associated-type-projection-from-supertrait.rs:32:28
    |
 LL | fn f() { ModelT.chip_paint(Blue); }
    |                            ^^^^ expected struct `Black`, found struct `Blue`
-   |
-   = note: expected struct `Black`
-              found struct `Blue`
 
 error[E0308]: mismatched types
   --> $DIR/associated-type-projection-from-supertrait.rs:33:28
    |
 LL | fn g() { ModelU.chip_paint(Black); }
    |                            ^^^^^ expected struct `Blue`, found struct `Black`
-   |
-   = note: expected struct `Blue`
-              found struct `Black`
 
 error: aborting due to 4 previous errors
 
index 6443de5878181facb998901523de8e95028f73b4..86e651b53f0b96c4d048e2461e3a2dfaa6743c75 100644 (file)
@@ -6,9 +6,6 @@ LL | fn blue_car<C:Car<Color=Blue>>(c: C) {
 ...
 LL | fn b() { blue_car(ModelT); }
    |          ^^^^^^^^ expected struct `Blue`, found struct `Black`
-   |
-   = note: expected struct `Blue`
-              found struct `Black`
 
 error[E0271]: type mismatch resolving `<ModelU as Vehicle>::Color == Black`
   --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:32:10
@@ -18,9 +15,6 @@ LL | fn black_car<C:Car<Color=Black>>(c: C) {
 ...
 LL | fn c() { black_car(ModelU); }
    |          ^^^^^^^^^ expected struct `Black`, found struct `Blue`
-   |
-   = note: expected struct `Black`
-              found struct `Blue`
 
 error: aborting due to 2 previous errors
 
index 88910f6de2a3a49688eed8f8940e19c9febaef21..060e2c8a2ccc1905e20de7763bf2155129974037 100644 (file)
@@ -17,9 +17,6 @@ LL | fn foo1<I: Foo<A=Bar>>(x: I) {
 ...
 LL |     foo1(a);
    |     ^^^^ expected struct `Bar`, found usize
-   |
-   = note: expected struct `Bar`
-                found type `usize`
 
 error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
   --> $DIR/associated-types-eq-3.rs:41:9
@@ -27,8 +24,6 @@ error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
 LL |     baz(&a);
    |         ^^ expected struct `Bar`, found usize
    |
-   = note: expected struct `Bar`
-                found type `usize`
    = note: required for the cast to the object type `dyn Foo<A = Bar>`
 
 error: aborting due to 3 previous errors
index 02a6ac12dd927a8afca22e25237dfffefabc2c94..4ec1fd810aa76a7abf37025476fad28baaf40b55 100644 (file)
@@ -4,8 +4,6 @@ error[E0271]: type mismatch resolving `<std::vec::IntoIter<u32> as std::iter::It
 LL |     let _: &dyn I32Iterator<Item = u32> = &vec![42].into_iter();
    |                                           ^^^^^^^^^^^^^^^^^^^^^ expected i32, found u32
    |
-   = note: expected type `i32`
-              found type `u32`
    = note: required for the cast to the object type `dyn std::iter::Iterator<Item = u32, Item = i32>`
 
 error: aborting due to previous error
index 7751d20f3527a3c3b704acc74708b88d566dcf39..f9b1373820f3a1e8a58808abf8e4d52471134621 100644 (file)
@@ -7,8 +7,6 @@ LL |     fn visit() {}
 LL |     <() as Visit>::visit();
    |     ^^^^^^^^^^^^^^^^^^^^ expected (), found &()
    |
-   = note: expected unit type `()`
-              found reference `&()`
    = note: required because of the requirements on the impl of `Visit` for `()`
 
 error: aborting due to previous error
index ceb811f7e014391478f20519ba5128309d680d2e..9b4defaa0bd86ab35b3188ed79a617f6e8c65929 100644 (file)
@@ -8,9 +8,6 @@ LL | impl Bar for Foo {
    | ---------------- in this `impl` item
 LL |     type Ok = ();
    |     ^^^^^^^^^^^^^ expected u32, found ()
-   |
-   = note:   expected type `u32`
-           found unit type `()`
 
 error: aborting due to previous error
 
index 832f00642e3a50d8ea839d732e7fc25a6fabc137..212558cf9328ed56166aac99593d11086b2b2c39 100644 (file)
@@ -25,9 +25,6 @@ LL | fn return_targets_async_block_not_fn() -> u8 {
    |    ---------------------------------      ^^ expected u8, found ()
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
-   |
-   = note:   expected type `u8`
-           found unit type `()`
 
 error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()`
   --> $DIR/async-block-control-flow-static-semantics.rs:18:39
@@ -35,8 +32,6 @@ error[E0271]: type mismatch resolving `<impl std::future::Future as std::future:
 LL |     let _: &dyn Future<Output = ()> = &block;
    |                                       ^^^^^^ expected (), found u8
    |
-   = note: expected unit type `()`
-                   found type `u8`
    = note: required for the cast to the object type `dyn std::future::Future<Output = ()>`
 
 error[E0308]: mismatched types
@@ -51,9 +46,6 @@ LL | |         return 0u8;
 LL | |
 LL | | }
    | |_^ expected u8, found ()
-   |
-   = note:   expected type `u8`
-           found unit type `()`
 
 error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()`
   --> $DIR/async-block-control-flow-static-semantics.rs:27:39
@@ -61,8 +53,6 @@ error[E0271]: type mismatch resolving `<impl std::future::Future as std::future:
 LL |     let _: &dyn Future<Output = ()> = &block;
    |                                       ^^^^^^ expected (), found u8
    |
-   = note: expected unit type `()`
-                   found type `u8`
    = note: required for the cast to the object type `dyn std::future::Future<Output = ()>`
 
 error[E0308]: mismatched types
index aacc796e2a84a1278def556abec04dd4ae530ca6..ce9ea7bc9edfc7c5dbc4b77d5b6e39e50d8ef70e 100644 (file)
@@ -1,6 +1,4 @@
 static i: String = 10;
 //~^ ERROR mismatched types
 //~| expected struct `std::string::String`, found integer
-//~| expected struct `std::string::String`
-//~| found type `{integer}`
 fn main() { println!("{}", i); }
index d3da6bd771897cb576dd673a35b0bfdf9b48316f..f667779fab58f37f5daa7e51e8cd80faa20c4d40 100644 (file)
@@ -6,9 +6,6 @@ LL | static i: String = 10;
    |                    |
    |                    expected struct `std::string::String`, found integer
    |                    help: try using a conversion method: `10.to_string()`
-   |
-   = note: expected struct `std::string::String`
-                found type `{integer}`
 
 error: aborting due to previous error
 
index b699b390b8bb1532999abaa7399fdb7b3b729789..06b7fcbe9b6b9817aa2f3c339e56025dee05ee97 100644 (file)
@@ -3,18 +3,12 @@ error[E0308]: mismatched types
    |
 LL | fn main() { let x = 1 && 2; }
    |                     ^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/binop-logic-int.rs:1:26
    |
 LL | fn main() { let x = 1 && 2; }
    |                          ^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error: aborting due to 2 previous errors
 
index 8e6e754df5b213118796590382b6a0b87a0f50dc..264e7fc8e73a212cb17c9943318b97b3afdb074d 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     let bar = 5;
    |         ^^^ expected integer, found struct `foo::bar`
-   |
-   = note: expected type `{integer}`
-            found struct `foo::bar`
 
 error: aborting due to previous error
 
index 29a53bed7d7448821bf98c6f576e94d465cdc3f1..cc515f4bf456d42afff61e4d350941966d419bb4 100644 (file)
@@ -8,9 +8,6 @@ LL | |         foo();
    | |              - help: consider removing this semicolon
 LL | |     };
    | |_____^ expected i32, found ()
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error: aborting due to previous error
 
index 11f9db6937e1205502cc3f0d4f90d2bd34a3b005..a303f5d29d04515e62552a1bedcad2f9c0a7d76a 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |         true
    |         ^^^^ expected (), found bool
-   |
-   = note: expected unit type `()`
-                   found type `bool`
 
 error: aborting due to previous error
 
index ba80ce2d6b14ab6138f2fd1fb52f69175707c588..aabc7604f90c03de15f10e8cf507eb6000cadb8b 100644 (file)
@@ -5,9 +5,6 @@ LL |     fn drop(&mut self) {
    |                        - expected `()` because of default return type
 LL |         true
    |         ^^^^ expected (), found bool
-   |
-   = note: expected unit type `()`
-                   found type `bool`
 
 error: aborting due to previous error
 
index 42b439cd3208e25f0f1aeddbb9b6a398de6fab78..f93725937299a697a1a738f2dff15185e68638ef 100644 (file)
@@ -1,8 +1,6 @@
 fn main() {
     while true { //~ WARN denote infinite loops with
         true //~  ERROR mismatched types
-             //~| expected unit type `()`
-             //~| found type `bool`
              //~| expected (), found bool
     }
 }
index d19ae3af657c02e462a819ec7ba6f10d1ed7f4b8..72063ad1731df2bcc4fbabeb93565781148a42ed 100644 (file)
@@ -11,9 +11,6 @@ error[E0308]: mismatched types
    |
 LL |         true
    |         ^^^^ expected (), found bool
-   |
-   = note: expected unit type `()`
-                   found type `bool`
 
 error: aborting due to previous error
 
index 76643b49bc04e50c6916181751ac13427f562ec6..fed98f912462b38fe5a1a177dc81be6fda99fe2f 100644 (file)
@@ -8,9 +8,6 @@ LL | fn f() -> String {
 LL |     0u8;
 LL |     "bla".to_string();
    |                      - help: consider removing this semicolon
-   |
-   = note: expected struct `std::string::String`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/consider-removing-last-semi.rs:6:11
@@ -22,9 +19,6 @@ LL | fn g() -> String {
 LL |     "this won't work".to_string();
 LL |     "removeme".to_string();
    |                           - help: consider removing this semicolon
-   |
-   = note: expected struct `std::string::String`
-           found unit type `()`
 
 error: aborting due to 2 previous errors
 
index 54c1bb220a912f734d5feb6fd7f0acc0096ea11d..5cd2726b8ddbc5146c85b83c35678a0d2fe8ffec 100644 (file)
@@ -8,9 +8,6 @@ LL | fn blah() -> i32 {
 ...
 LL |     ;
    |     - help: consider removing this semicolon
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error: aborting due to previous error
 
index b1f2ca634511b1281c8889a7572570d98a13a96b..24e942619f0d1817c1f21849d86ee0a177580092 100644 (file)
@@ -8,9 +8,6 @@ LL | fn foo() -> String {
 ...
 LL |     ;
    |     - help: consider removing this semicolon
-   |
-   = note: expected struct `std::string::String`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/issue-13428.rs:11:13
@@ -22,9 +19,6 @@ LL | fn bar() -> String {
 LL |     "foobar".to_string()
 LL |     ;
    |     - help: consider removing this semicolon
-   |
-   = note: expected struct `std::string::String`
-           found unit type `()`
 
 error: aborting due to 2 previous errors
 
index ca457aa907d9f0cc450a33859679e0ca8a0b18e9..ed0b3021746042b08d7edb79ce14ddc2b8d5b970 100644 (file)
@@ -7,8 +7,6 @@ pub fn get_enum_struct_variant() -> () {
     Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
     //~^ ERROR mismatched types
     //~| expected (), found enum `a::Enum`
-    //~| expected unit type `()`
-    //~| found enum `a::Enum`
   }
 }
 
@@ -22,8 +20,6 @@ fn test_enum_struct_variant() {
         a::Enum::EnumStructVariant { x, y, z } => {
         //~^ ERROR mismatched types
         //~| expected (), found enum `a::Enum`
-        //~| expected unit type `()`
-        //~| found enum `a::Enum`
         }
       }
     }
index 6e2b2812c7241dbf5962b3ef3ac8cfe2dd9b8217..2404d06ae8665308c052149c81aaac1b9ef50e6f 100644 (file)
@@ -5,20 +5,14 @@ LL |   pub fn get_enum_struct_variant() -> () {
    |                                       -- expected `()` because of return type
 LL |     Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum`
-   |
-   = note: expected unit type `()`
-                   found enum `a::Enum`
 
 error[E0308]: mismatched types
-  --> $DIR/issue-13624.rs:22:9
+  --> $DIR/issue-13624.rs:20:9
    |
 LL |       match enum_struct_variant {
    |             ------------------- this match expression has type `()`
 LL |         a::Enum::EnumStructVariant { x, y, z } => {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum`
-   |
-   = note: expected unit type `()`
-                   found enum `a::Enum`
 
 error: aborting due to 2 previous errors
 
index 5df71e8374b1d2f730d30c948133df89e3e860d8..cc1b4a217ce476dbe6b5c209504813bfeedab2f0 100644 (file)
@@ -16,9 +16,6 @@ LL | fn main() {
 LL |   let b = Bob + 3.5;
 LL |   b + 3
    |   ^^^^^ expected (), found struct `Bob`
-   |
-   = note: expected unit type `()`
-                 found struct `Bob`
 
 error: aborting due to 2 previous errors
 
index 3eae3e7542241df7a11caec4dcba448de66b55b8..170d11373ddd0d06ad2bbafd61632d43e48a9920 100644 (file)
@@ -4,8 +4,6 @@ error[E0308]: mismatched types
 LL |     foo()
    |     ^^^^^ expected (), found usize
    |
-   = note: expected unit type `()`
-                   found type `usize`
 help: try adding a semicolon
    |
 LL |     foo();
index c6bc306e45a1c2274d80a8147eaebeb8791fe633..fdc79ec29f378044fdf5f1101ab237acd7ecf70a 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     only_foo(x);
    |              ^ expected i32, found floating-point number
-   |
-   = note: expected type `i32`
-              found type `{float}`
 
 error[E0277]: the trait bound `{float}: Bar` is not satisfied
   --> $DIR/type_inference.rs:25:5
index ea3ded67c0a0c780e78b488c2f626b29f46a5088..3ee10cd4cb8288126d794f7595ad0e6d0bd3300b 100644 (file)
@@ -10,10 +10,7 @@ error[E0308]: mismatched types
 LL | fn foo() {
    |          - help: try adding a return type: `-> &'static str`
 LL |     "bar            boo"
-   |     ^^^^^^^^^^^^^^^^^^^^ expected (), found reference
-   |
-   = note: expected unit type `()`
-              found reference `&'static str`
+   |     ^^^^^^^^^^^^^^^^^^^^ expected (), found &str
 
 error: aborting due to 2 previous errors
 
index acbc8339b1911999b6d52a6dad766beb4363372a..db8ecb818c9bd39d3d1d9ecb022598f361ebf6df 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:9:13
    |
 LL |     let _ = box { [1, 2, 3] }: Box<[i32]>;
-   |             ^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements
+   |             ^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
    |
    = note: expected struct `std::boxed::Box<[i32]>`
               found struct `std::boxed::Box<[i32; 3]>`
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:10:13
    |
 LL |     let _ = box if true { [1, 2, 3] } else { [1, 3, 4] }: Box<[i32]>;
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
    |
    = note: expected struct `std::boxed::Box<[i32]>`
               found struct `std::boxed::Box<[i32; 3]>`
@@ -20,7 +20,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:11:13
    |
 LL |     let _ = box match true { true => [1, 2, 3], false => [1, 3, 4] }: Box<[i32]>;
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
    |
    = note: expected struct `std::boxed::Box<[i32]>`
               found struct `std::boxed::Box<[i32; 3]>`
@@ -56,7 +56,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:17:13
    |
 LL |     let _ = &{ [1, 2, 3] }: &[i32];
-   |             ^^^^^^^^^^^^^^ expected slice, found array of 3 elements
+   |             ^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
    |
    = note: expected reference `&[i32]`
               found reference `&[i32; 3]`
@@ -65,7 +65,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:18:13
    |
 LL |     let _ = &if true { [1, 2, 3] } else { [1, 3, 4] }: &[i32];
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
    |
    = note: expected reference `&[i32]`
               found reference `&[i32; 3]`
@@ -74,7 +74,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:19:13
    |
 LL |     let _ = &match true { true => [1, 2, 3], false => [1, 3, 4] }: &[i32];
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
    |
    = note: expected reference `&[i32]`
               found reference `&[i32; 3]`
@@ -110,7 +110,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:25:13
    |
 LL |     let _ = Box::new([1, 2, 3]): Box<[i32]>;
-   |             ^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements
+   |             ^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
    |
    = note: expected struct `std::boxed::Box<[i32]>`
               found struct `std::boxed::Box<[i32; 3]>`
index 1122901a17eda8ec8a2e48905ee8f8f4682d97dd..7811df45259835b3bd9717d7e38048cf05ee0e29 100644 (file)
@@ -7,9 +7,6 @@ LL | fn plus_one(x: i32) -> i32 {
    |    implicitly returns `()` as its body has no tail or `return` expression
 LL |     x + 1;
    |          - help: consider removing this semicolon
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/coercion-missing-tail-expected-type.rs:7:13
index fbfe1984b9f4ae324b85c838b00dc47495c7f541..1d54d35f649a3d6786b5d7aa91db75df92981fac 100644 (file)
@@ -3,6 +3,5 @@
 fn main() {
     let _: &[i32] = [0];
     //~^ ERROR mismatched types
-    //~| expected reference `&[i32]`
-    //~| expected &[i32], found array of 1 element
+    //~| expected &[i32], found array `[{integer}; 1]`
 }
index 55523933f5472c438324f5045bbda16a23139e5f..34caaed9de4f5bb79a44bc7217acfd60a7166426 100644 (file)
@@ -4,11 +4,8 @@ error[E0308]: mismatched types
 LL |     let _: &[i32] = [0];
    |                     ^^^
    |                     |
-   |                     expected &[i32], found array of 1 element
+   |                     expected &[i32], found array `[{integer}; 1]`
    |                     help: consider borrowing here: `&[0]`
-   |
-   = note: expected reference `&[i32]`
-                  found array `[{integer}; 1]`
 
 error: aborting due to previous error
 
index 8461755dbfe57c1ef55241504e3093784f76f61b..aefd514f7a68ec65bb145a5ab9a33a9428f321f6 100644 (file)
@@ -3,18 +3,12 @@ error[E0308]: mismatched types
    |
 LL |     let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8]));
    |                                                                   ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements
-   |
-   = note: expected array `[u8; 3]`
-              found array `[u8; 2]`
 
 error[E0308]: mismatched types
   --> $DIR/const-argument-cross-crate-mismatch.rs:8:65
    |
 LL |     let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]);
    |                                                                 ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements
-   |
-   = note: expected array `[u8; 2]`
-              found array `[u8; 3]`
 
 error: aborting due to 2 previous errors
 
index f4a4c091e78a00aeb99cab28205e33ae5391d5f5..eae93b72ddc86e5eeba5babac1fa2613add73fac 100644 (file)
@@ -3,18 +3,12 @@ error[E0308]: mismatched types
    |
 LL | const BLUB: [i32; (ARR[0] - 40) as usize] = [5];
    |                                             ^^^ expected an array with a fixed size of 2 elements, found one with 1 element
-   |
-   = note: expected array `[i32; 2]`
-              found array `[i32; 1]`
 
 error[E0308]: mismatched types
   --> $DIR/const-array-oob-arith.rs:10:44
    |
 LL | const BOO: [i32; (ARR[0] - 41) as usize] = [5, 99];
    |                                            ^^^^^^^ expected an array with a fixed size of 1 element, found one with 2 elements
-   |
-   = note: expected array `[i32; 1]`
-              found array `[i32; 2]`
 
 error: aborting due to 2 previous errors
 
index 279fe7fb7fed5ea93079b79d72ce64ebbe64fc0e..682c7a1d65fc9c3e1c40d60f853565fa7ca69ada 100644 (file)
@@ -9,7 +9,6 @@ enum E {
     V = CONSTANT,
     //~^ ERROR mismatched types
     //~| expected isize, found struct `S`
-    //~|         found struct `S`
 }
 
 fn main() {}
index 5b046e266a2df03d9f3a306cb3a0e1f6c0315d8b..3436802f8a95b4126c2b9069dcbd1d01d4ec77a9 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     V = CONSTANT,
    |         ^^^^^^^^ expected isize, found struct `S`
-   |
-   = note: expected type `isize`
-            found struct `S`
 
 error: aborting due to previous error
 
index 7fd973786d1b7554a882c28b8c3e809297a8378b..8b5f3440964d5f190aa1f62aecb8eafb29c4fba1 100644 (file)
@@ -3,18 +3,12 @@ error[E0308]: mismatched types
    |
 LL | const X: usize = 42 && 39;
    |                  ^^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/const-integer-bool-ops.rs:1:24
    |
 LL | const X: usize = 42 && 39;
    |                        ^^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/const-integer-bool-ops.rs:1:18
@@ -33,18 +27,12 @@ error[E0308]: mismatched types
    |
 LL | const X1: usize = 42 || 39;
    |                   ^^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/const-integer-bool-ops.rs:11:25
    |
 LL | const X1: usize = 42 || 39;
    |                         ^^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/const-integer-bool-ops.rs:11:19
@@ -63,18 +51,12 @@ error[E0308]: mismatched types
    |
 LL | const X2: usize = -42 || -39;
    |                   ^^^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/const-integer-bool-ops.rs:21:26
    |
 LL | const X2: usize = -42 || -39;
    |                          ^^^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/const-integer-bool-ops.rs:21:19
@@ -93,18 +75,12 @@ error[E0308]: mismatched types
    |
 LL | const X3: usize = -42 && -39;
    |                   ^^^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/const-integer-bool-ops.rs:31:26
    |
 LL | const X3: usize = -42 && -39;
    |                          ^^^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/const-integer-bool-ops.rs:31:19
index 11384d92cb8a6271507a39f1f3f30dfea7416582..ff5529a840852c2c50e1f6a06f5d0295575fff4a 100644 (file)
@@ -4,11 +4,8 @@ error[E0308]: mismatched types
 LL |     let _tis_an_instants_play: String = "'Tis a fond Ambush—";
    |                                         ^^^^^^^^^^^^^^^^^^^^^
    |                                         |
-   |                                         expected struct `std::string::String`, found reference
+   |                                         expected struct `std::string::String`, found &str
    |                                         help: try using a conversion method: `"'Tis a fond Ambush—".to_string()`
-   |
-   = note: expected struct `std::string::String`
-           found reference `&'static str`
 
 error[E0308]: mismatched types
   --> $DIR/conversion-methods.rs:6:40
@@ -16,11 +13,8 @@ error[E0308]: mismatched types
 LL |     let _just_to_make_bliss: PathBuf = Path::new("/ern/her/own/surprise");
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                                        |
-   |                                        expected struct `std::path::PathBuf`, found reference
+   |                                        expected struct `std::path::PathBuf`, found &std::path::Path
    |                                        help: try using a conversion method: `Path::new("/ern/her/own/surprise").to_path_buf()`
-   |
-   = note: expected struct `std::path::PathBuf`
-           found reference `&std::path::Path`
 
 error[E0308]: mismatched types
   --> $DIR/conversion-methods.rs:9:40
@@ -30,9 +24,6 @@ LL |     let _but_should_the_play: String = 2; // Perhaps surprisingly, we sugge
    |                                        |
    |                                        expected struct `std::string::String`, found integer
    |                                        help: try using a conversion method: `2.to_string()`
-   |
-   = note: expected struct `std::string::String`
-                found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/conversion-methods.rs:12:47
@@ -40,7 +31,7 @@ error[E0308]: mismatched types
 LL |     let _prove_piercing_earnest: Vec<usize> = &[1, 2, 3];
    |                                               ^^^^^^^^^^
    |                                               |
-   |                                               expected struct `std::vec::Vec`, found reference
+   |                                               expected struct `std::vec::Vec`, found &[{integer}; 3]
    |                                               help: try using a conversion method: `(&[1, 2, 3]).to_vec()`
    |
    = note: expected struct `std::vec::Vec<usize>`
index 53bc3212a7fb01f7b44f52be5f0747585c9d68d1..433bab77189174963e519f56b222178d312a1f08 100644 (file)
@@ -4,11 +4,8 @@ error[E0308]: mismatched types
 LL |     foo(s);
    |         ^
    |         |
-   |         expected struct `std::string::String`, found reference
+   |         expected struct `std::string::String`, found &std::string::String
    |         help: try using a conversion method: `s.to_string()`
-   |
-   = note: expected struct `std::string::String`
-           found reference `&std::string::String`
 
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:14:10
@@ -18,9 +15,6 @@ LL |     foo3(u);
    |          |
    |          expected u32, found &u32
    |          help: consider dereferencing the borrow: `*u`
-   |
-   = note:   expected type `u32`
-           found reference `&u32`
 
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:30:9
@@ -28,11 +22,8 @@ error[E0308]: mismatched types
 LL |     foo(&"aaa".to_owned());
    |         ^^^^^^^^^^^^^^^^^
    |         |
-   |         expected struct `std::string::String`, found reference
+   |         expected struct `std::string::String`, found &std::string::String
    |         help: consider removing the borrow: `"aaa".to_owned()`
-   |
-   = note: expected struct `std::string::String`
-           found reference `&std::string::String`
 
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:32:9
@@ -40,11 +31,8 @@ error[E0308]: mismatched types
 LL |     foo(&mut "aaa".to_owned());
    |         ^^^^^^^^^^^^^^^^^^^^^
    |         |
-   |         expected struct `std::string::String`, found mutable reference
+   |         expected struct `std::string::String`, found &mut std::string::String
    |         help: consider removing the borrow: `"aaa".to_owned()`
-   |
-   = note:         expected struct `std::string::String`
-           found mutable reference `&mut std::string::String`
 
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:2:20
@@ -54,9 +42,6 @@ LL |     ($x:expr) => { &$x }
 ...
 LL |     foo3(borrow!(0));
    |          ---------- in this macro invocation
-   |
-   = note:   expected type `u32`
-           found reference `&{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:36:5
@@ -64,8 +49,6 @@ error[E0308]: mismatched types
 LL |     assert_eq!(3i32, &3i32);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found &i32
    |
-   = note:   expected type `i32`
-           found reference `&i32`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
 error[E0308]: mismatched types
@@ -76,9 +59,6 @@ LL |     let s = S { u };
    |                 |
    |                 expected &u32, found integer
    |                 help: consider borrowing here: `u: &u`
-   |
-   = note: expected reference `&u32`
-                   found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:41:20
@@ -88,9 +68,6 @@ LL |     let s = S { u: u };
    |                    |
    |                    expected &u32, found integer
    |                    help: consider borrowing here: `&u`
-   |
-   = note: expected reference `&u32`
-                   found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:44:17
@@ -100,9 +77,6 @@ LL |     let r = R { i };
    |                 |
    |                 expected u32, found &{integer}
    |                 help: consider dereferencing the borrow: `i: *i`
-   |
-   = note:   expected type `u32`
-           found reference `&{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:46:20
@@ -112,9 +86,6 @@ LL |     let r = R { i: i };
    |                    |
    |                    expected u32, found &{integer}
    |                    help: consider dereferencing the borrow: `*i`
-   |
-   = note:   expected type `u32`
-           found reference `&{integer}`
 
 error: aborting due to 10 previous errors
 
index bd913649dd07012022cafef4b2102830be91b5ac..5fd3676d3613f1b75737d8ac6b85f0071902f8a7 100644 (file)
@@ -18,9 +18,6 @@ error[E0308]: mismatched types
    |
 LL |     let _c = Context { wrapper: Payload{} };
    |                                 ^^^^^^^^^ expected struct `Wrapper`, found struct `Payload`
-   |
-   = note: expected struct `Wrapper`
-              found struct `Payload`
 
 error: aborting due to 2 previous errors
 
index 301704ec0c7ef83eba7d053003801d6ca29d586b..76641b1120a274651ee4ee56e9b6fdeb91d6fc1b 100644 (file)
@@ -6,9 +6,6 @@ LL |     let sixteen: f32 = 16;
    |                        |
    |                        expected f32, found integer
    |                        help: use a float literal: `16.0`
-   |
-   = note: expected type `f32`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/issue-53280-expected-float-found-integer-literal.rs:5:38
@@ -18,9 +15,6 @@ LL |     let a_million_and_seventy: f64 = 1_000_070;
    |                                      |
    |                                      expected f64, found integer
    |                                      help: use a float literal: `1_000_070.0`
-   |
-   = note: expected type `f64`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/issue-53280-expected-float-found-integer-literal.rs:8:30
@@ -30,27 +24,18 @@ LL |     let negative_nine: f32 = -9;
    |                              |
    |                              expected f32, found integer
    |                              help: use a float literal: `-9.0`
-   |
-   = note: expected type `f32`
-              found type `{integer}`
 
 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
-   |
-   = note: expected type `f64`
-              found type `{integer}`
 
 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
-   |
-   = note: expected type `f32`
-              found type `{integer}`
 
 error: aborting due to 5 previous errors
 
index ebca760e235498881bcdf777eb1e483f34fd8d9e..3f3ef666f66397245a075ac27240a97e540eed18 100644 (file)
@@ -5,7 +5,7 @@ LL | fn assert_sizeof() -> ! {
    |                       - expected `!` because of return type
 LL |     unsafe {
 LL |         ::std::mem::transmute::<f64, [u8; 8]>(panic!())
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected !, found array of 8 elements
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected !, found array `[u8; 8]`
    |
    = note: expected type `!`
              found array `[u8; 8]`
index 7e9d127a9af6e485a85da14113a7b37611186998..3eb16663e13e1258dd6579cf475a245c3c69901e 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coerce1.rs:16:29
    |
 LL |     let f3: &Fat<[usize]> = f2;
-   |                             ^^ expected slice, found array of 3 elements
+   |                             ^^ expected slice `[usize]`, found array `[isize; 3]`
    |
    = note: expected reference `&Fat<[usize]>`
               found reference `&Fat<[isize; 3]>`
@@ -19,7 +19,7 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coerce1.rs:28:27
    |
 LL |     let f3: &([usize],) = f2;
-   |                           ^^ expected slice, found array of 3 elements
+   |                           ^^ expected slice `[usize]`, found array `[isize; 3]`
    |
    = note: expected reference `&([usize],)`
               found reference `&([isize; 3],)`
index d1c590347eda03c2d3c605a1b9265c4a4a1cc04a..f63da60d281d7069e3fee802bd3cfba3368ae6cc 100644 (file)
@@ -11,15 +11,15 @@ pub fn main() {
     let f1: &Fat<[isize]> = &Fat { ptr: [1, 2, 3] };
     let f2: &Fat<[isize; 3]> = f1;
     //~^ ERROR mismatched types
+    //~| expected array `[isize; 3]`, found slice `[isize]`
     //~| expected reference `&Fat<[isize; 3]>`
     //~| found reference `&Fat<[isize]>`
-    //~| expected array of 3 elements, found slice
 
     // Tuple with a vec of isizes.
     let f1: &([isize],) = &([1, 2, 3],);
     let f2: &([isize; 3],) = f1;
     //~^ ERROR mismatched types
+    //~| expected array `[isize; 3]`, found slice `[isize]`
     //~| expected reference `&([isize; 3],)`
     //~| found reference `&([isize],)`
-    //~| expected array of 3 elements, found slice
 }
index fad34633da5cbde393ccb1ea853e05fe5b34cf89..e85d354e4680d32468d84004230094ac7f393d88 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coerce4.rs:12:32
    |
 LL |     let f2: &Fat<[isize; 3]> = f1;
-   |                                ^^ expected array of 3 elements, found slice
+   |                                ^^ expected array `[isize; 3]`, found slice `[isize]`
    |
    = note: expected reference `&Fat<[isize; 3]>`
               found reference `&Fat<[isize]>`
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coerce4.rs:20:30
    |
 LL |     let f2: &([isize; 3],) = f1;
-   |                              ^^ expected array of 3 elements, found slice
+   |                              ^^ expected array `[isize; 3]`, found slice `[isize]`
    |
    = note: expected reference `&([isize; 3],)`
               found reference `&([isize],)`
index c77a337012d55162f68e5dcbb69533f4eb880680..779b6ea924c721b614b64f2233d29a00297d3bfb 100644 (file)
@@ -15,9 +15,6 @@ error[E0308]: mismatched types
    |
 LL |     some_other_func() = 4;
    |                         ^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error[E0070]: invalid left-hand side expression
   --> $DIR/E0070.rs:8:5
index 2f9191b43269b0038630c271915d88b98ed01830..3ed2f6f0d235b7437c74e00da9f45f808df4a7f1 100644 (file)
@@ -5,10 +5,7 @@ LL | fn foo<T>(t: T) where T: Trait<AssociatedType=u32> {
    |    ---                         ------------------ required by this bound in `foo`
 ...
 LL |     foo(3_i8);
-   |     ^^^ expected u32, found reference
-   |
-   = note:   expected type `u32`
-           found reference `&'static str`
+   |     ^^^ expected u32, found &str
 
 error: aborting due to previous error
 
index 810c52a57066bf2a0191fdbc696f2ac974c501d8..108df4ae1c9d215d380253f08b30eb6f2a4e81f9 100644 (file)
@@ -6,9 +6,6 @@ LL |    wants_uniq(x);
    |               |
    |               expected struct `std::string::String`, found &str
    |               help: try using a conversion method: `x.to_string()`
-   |
-   = note: expected struct `std::string::String`
-           found reference `&str`
 
 error: aborting due to previous error
 
index 08513507ecf9604d2ff6881be705540c52395292..ea4db564829484862d2097a64e5684c2ed9a787d 100644 (file)
@@ -6,9 +6,6 @@ LL |     let x: f32 = 1;
    |                  |
    |                  expected f32, found integer
    |                  help: use a float literal: `1.0`
-   |
-   = note: expected type `f32`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/float-literal-inference-restrictions.rs:3:18
index af4a633090b0e1585f7fc49592ef086568d9adb3..94a9f4e5692a3bb8efa1b2922ca63efe8e1e75b9 100644 (file)
@@ -12,8 +12,6 @@ fn bar(x: x::Foo) -> y::Foo {
     return x;
     //~^ ERROR mismatched types
     //~| expected enum `y::Foo`, found enum `x::Foo`
-    //~| expected enum `y::Foo`
-    //~| found enum `x::Foo`
 }
 
 fn main() {
index fe4579f49b910b3ff69bf84ccca5740122d1e933..aed7f72c660df187956c8965c0bc3bb4174bb161 100644 (file)
@@ -5,9 +5,6 @@ LL | fn bar(x: x::Foo) -> y::Foo {
    |                      ------ expected `y::Foo` because of return type
 LL |     return x;
    |            ^ expected enum `y::Foo`, found enum `x::Foo`
-   |
-   = note: expected enum `y::Foo`
-              found enum `x::Foo`
 
 error: aborting due to previous error
 
index 16847727aef30eef35f61f635a0e56a51623e110..759c7302d13c6e8ce933454907e49967379b7c0d 100644 (file)
@@ -15,8 +15,6 @@ error[E0271]: type mismatch resolving `<[closure@$DIR/issue-62203-hrtb-ice.rs:42
 LL |     let v = Unit2.m(
    |                   ^ expected struct `Unit4`, found struct `Unit3`
    |
-   = note: expected struct `Unit4`
-              found struct `Unit3`
    = note: required because of the requirements on the impl of `for<'r> T0<'r, (<Unit2 as Ty<'r>>::V,)>` for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]>`
 
 error: aborting due to 2 previous errors
index d25eda0e9805734ec3898090c5f4bb647f80ebcc..6d36854545cabe3070611363dcc839971a5d3b6b 100644 (file)
@@ -10,9 +10,6 @@ LL | |         2u32
    | |         ^^^^ expected i32, found u32
 LL | |     };
    | |_____- if and else have incompatible types
-   |
-   = note: expected type `i32`
-              found type `u32`
 
 error[E0308]: if and else have incompatible types
   --> $DIR/if-else-type-mismatch.rs:8:38
@@ -21,9 +18,6 @@ LL |     let _ = if true { 42i32 } else { 42u32 };
    |                       -----          ^^^^^ expected i32, found u32
    |                       |
    |                       expected because of this
-   |
-   = note: expected type `i32`
-              found type `u32`
 
 error[E0308]: if and else have incompatible types
   --> $DIR/if-else-type-mismatch.rs:13:9
@@ -40,9 +34,6 @@ LL | |         4u32
    | |         ^^^^ expected (), found u32
 LL | |     };
    | |_____- if and else have incompatible types
-   |
-   = note: expected type `()`
-              found type `u32`
 
 error[E0308]: if and else have incompatible types
   --> $DIR/if-else-type-mismatch.rs:19:9
@@ -59,9 +50,6 @@ LL | |         6u32;
    | |         expected u32, found ()
 LL | |     };
    | |_____- if and else have incompatible types
-   |
-   = note:   expected type `u32`
-           found unit type `()`
 
 error[E0308]: if and else have incompatible types
   --> $DIR/if-else-type-mismatch.rs:25:9
@@ -75,9 +63,6 @@ LL | |         8u32
    | |         ^^^^ expected (), found u32
 LL | |     };
    | |_____- if and else have incompatible types
-   |
-   = note: expected type `()`
-              found type `u32`
 
 error[E0308]: if and else have incompatible types
   --> $DIR/if-else-type-mismatch.rs:31:9
@@ -91,9 +76,6 @@ LL | |         10u32;
    | |         ^^^^^^ expected i32, found ()
 LL | |     };
    | |_____- if and else have incompatible types
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error[E0308]: if and else have incompatible types
   --> $DIR/if-else-type-mismatch.rs:37:9
@@ -105,9 +87,6 @@ LL | |     } else {
    | |_____- expected because of this
 LL |           11u32
    |           ^^^^^ expected (), found u32
-   |
-   = note: expected type `()`
-              found type `u32`
 
 error[E0308]: if and else have incompatible types
   --> $DIR/if-else-type-mismatch.rs:42:12
@@ -121,9 +100,6 @@ LL |       } else {
 LL | |
 LL | |     };
    | |_____^ expected i32, found ()
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error: aborting due to 8 previous errors
 
index 74b925f72fff02248f7542a72a2beabce559e4cb..bfaae2d31a01be6cbe6eeaf0addb24f4a215d5a4 100644 (file)
@@ -5,9 +5,6 @@ LL |     let x = if true { 10i32 } else { 10u32 };
    |                       -----          ^^^^^ expected i32, found u32
    |                       |
    |                       expected because of this
-   |
-   = note: expected type `i32`
-              found type `u32`
 
 error: aborting due to previous error
 
index 0f8815f0479f5fa256c449d316c9193d1dadd430..f120b60c611f05685a95e4216c3631c6f0e124f4 100644 (file)
@@ -8,5 +8,4 @@ fn main() {
     };
     //~^^ ERROR: if and else have incompatible types
     //~| NOTE expected (), found integer
-    //~| NOTE expected type `()`
 }
index ff88de20f76ccf709b9991361d3fe2edf1b67e20..088aa0e8554bb968d2a630ccd5b6bcb874b1f9ba 100644 (file)
@@ -11,9 +11,6 @@ LL | |         1
    | |         ^ expected (), found integer
 LL | |     };
    | |_____- if and else have incompatible types
-   |
-   = note: expected type `()`
-              found type `{integer}`
 
 error: aborting due to previous error
 
index 215e236f6b01ee0fe9d532e3001f6a40b4424310..add9ee86ac2262ba99c3ab1b8a7334a5d6e39947 100644 (file)
@@ -6,9 +6,6 @@ LL |     if b_ref() {}
    |        |
    |        expected bool, found &bool
    |        help: consider dereferencing the borrow: `*b_ref()`
-   |
-   = note:   expected type `bool`
-           found reference `&bool`
 
 error[E0308]: mismatched types
   --> $DIR/if-no-match-bindings.rs:19:8
@@ -18,9 +15,6 @@ LL |     if b_mut_ref() {}
    |        |
    |        expected bool, found &mut bool
    |        help: consider dereferencing the borrow: `*b_mut_ref()`
-   |
-   = note:           expected type `bool`
-           found mutable reference `&mut bool`
 
 error[E0308]: mismatched types
   --> $DIR/if-no-match-bindings.rs:20:8
@@ -30,9 +24,6 @@ LL |     if &true {}
    |        |
    |        expected bool, found &bool
    |        help: consider removing the borrow: `true`
-   |
-   = note:   expected type `bool`
-           found reference `&bool`
 
 error[E0308]: mismatched types
   --> $DIR/if-no-match-bindings.rs:21:8
@@ -42,9 +33,6 @@ LL |     if &mut true {}
    |        |
    |        expected bool, found &mut bool
    |        help: consider removing the borrow: `true`
-   |
-   = note:           expected type `bool`
-           found mutable reference `&mut bool`
 
 error[E0308]: mismatched types
   --> $DIR/if-no-match-bindings.rs:24:11
@@ -54,9 +42,6 @@ LL |     while b_ref() {}
    |           |
    |           expected bool, found &bool
    |           help: consider dereferencing the borrow: `*b_ref()`
-   |
-   = note:   expected type `bool`
-           found reference `&bool`
 
 error[E0308]: mismatched types
   --> $DIR/if-no-match-bindings.rs:25:11
@@ -66,9 +51,6 @@ LL |     while b_mut_ref() {}
    |           |
    |           expected bool, found &mut bool
    |           help: consider dereferencing the borrow: `*b_mut_ref()`
-   |
-   = note:           expected type `bool`
-           found mutable reference `&mut bool`
 
 error[E0308]: mismatched types
   --> $DIR/if-no-match-bindings.rs:26:11
@@ -78,9 +60,6 @@ LL |     while &true {}
    |           |
    |           expected bool, found &bool
    |           help: consider removing the borrow: `true`
-   |
-   = note:   expected type `bool`
-           found reference `&bool`
 
 error[E0308]: mismatched types
   --> $DIR/if-no-match-bindings.rs:27:11
@@ -90,9 +69,6 @@ LL |     while &mut true {}
    |           |
    |           expected bool, found &mut bool
    |           help: consider removing the borrow: `true`
-   |
-   = note:           expected type `bool`
-           found mutable reference `&mut bool`
 
 error: aborting due to 8 previous errors
 
index a62a2cc1522a7ffbd2a323b4b6067a5def1cb72f..472c85d96fbd7abbd47a11292976ac497355857a 100644 (file)
@@ -8,8 +8,6 @@ LL | |         return 3;
 LL | |     }
    | |_____^ expected usize, found ()
    |
-   = note:   expected type `usize`
-           found unit type `()`
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
 
@@ -24,8 +22,6 @@ LL | |         return 3;
 LL | |     };
    | |_____^ expected usize, found ()
    |
-   = note:   expected type `usize`
-           found unit type `()`
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
 
@@ -39,8 +35,6 @@ LL | |         3
 LL | |     }
    | |_____^ expected usize, found ()
    |
-   = note:   expected type `usize`
-           found unit type `()`
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
 
@@ -54,8 +48,6 @@ LL | |         return 3;
 LL | |     }
    | |_____^ expected usize, found ()
    |
-   = note:   expected type `usize`
-           found unit type `()`
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
 
@@ -70,8 +62,6 @@ LL | |         return 3;
 LL | |     };
    | |_____^ expected usize, found ()
    |
-   = note:   expected type `usize`
-           found unit type `()`
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
 
@@ -85,8 +75,6 @@ LL | |         3
 LL | |     }
    | |_____^ expected usize, found ()
    |
-   = note:   expected type `usize`
-           found unit type `()`
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
 
index 4602beb4c77dbdf74277c835371f90309d0e3ff4..bd5597334666508028254748cda61c7ce729db90 100644 (file)
@@ -1,8 +1,6 @@
 fn main() {
     let a = if true { true };
     //~^ ERROR if may be missing an else clause [E0317]
-    //~| expected unit type `()`
-    //~| found type `bool`
     //~| expected (), found bool
     println!("{}", a);
 }
index 7870439fee15ddb4065a95c0bc8fbf3945780cd1..b2c700d3c8febd6e96a005e46d7b480006f94e5f 100644 (file)
@@ -7,8 +7,6 @@ LL |     let a = if true { true };
    |             |         found here
    |             expected (), found bool
    |
-   = note: expected unit type `()`
-                   found type `bool`
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
 
index 7bb2d7d47a51d01a75b02a701096d53006078dc3..7349ab12cda0464ca021f0ba06a675b48db46d5d 100644 (file)
@@ -9,9 +9,6 @@ LL |         return 1_i32;
 LL |     }
 LL |     0_u32
    |     ^^^^^ expected i32, found u32
-   |
-   = note: expected type `i32`
-              found type `u32`
 
 error[E0277]: cannot add `impl Foo` to `u32`
   --> $DIR/equality.rs:24:11
index 79f12356a6de426caf1defe21ee3b149a9d640d9..43d8ba1d7a361f802f0207cc775ff2a9ad9f80e7 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/mismatched-types.rs:2:20
    |
 LL |     let b: &[u8] = include_str!("file.txt");
-   |                    ^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found str
+   |                    ^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[u8]`, found str
    |
    = note: expected reference `&[u8]`
               found reference `&'static str`
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
   --> $DIR/mismatched-types.rs:3:19
    |
 LL |     let s: &str = include_bytes!("file.txt");
-   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected str, found array of 0 elements
+   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected str, found array `[u8; 0]`
    |
    = note: expected reference `&str`
               found reference `&'static [u8; 0]`
index 3eefcdea3d902d4c43aaf12acc8f1752d2a76c09..5200b4a829db236f4298288cabf0f03bb13ea250 100644 (file)
@@ -2,7 +2,5 @@ fn main() {
     let mut x = 2;
     x = 5.0;
     //~^ ERROR mismatched types
-    //~| expected type `{integer}`
-    //~| found type `{float}`
     //~| expected integer, found floating-point number
 }
index 262203b7b8e4d7e789a81135b225a4dc4ddb2626..b49bff1b0d84dc9e076ce9409e0c8a9e3ac8fb53 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     x = 5.0;
    |         ^^^ expected integer, found floating-point number
-   |
-   = note: expected type `{integer}`
-              found type `{float}`
 
 error: aborting due to previous error
 
index 726c437355e53cbef382f5706a69dd435def67a7..f40d00051615685678ca03ce04dca6df3ec71862 100644 (file)
@@ -8,7 +8,6 @@ fn main() {
         None    => (),
         //~^ ERROR match arms have incompatible types
         //~| NOTE expected bool, found ()
-        //~| NOTE expected type `bool`
         _       => true
     }
 }
index 9abae68ed5290c063651f620188d558b484d56dc..2ca49922d06126aa2d8a5b458b6d7d43f87e08b6 100644 (file)
@@ -15,9 +15,6 @@ LL | |         None    => (),
 LL | |         _       => true
 LL | |     }
    | |_____- `match` arms have incompatible types
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error: aborting due to previous error
 
index bac69075c83bb356c5c6895770d0e74d9028f669..102405cd0f674be3c479f43f35634d872a1ee430 100644 (file)
@@ -2,10 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-12997-2.rs:8:1
    |
 LL | fn bar(x: isize) { }
-   | ^^^^^^^^^^^^^^^^^^^^ expected isize, found mutable reference
-   |
-   = note:           expected type `isize`
-           found mutable reference `&mut test::Bencher`
+   | ^^^^^^^^^^^^^^^^^^^^ expected isize, found &mut test::Bencher
 
 error: aborting due to previous error
 
index 4c3e481564f23441dbf74f4f233ef5965f35094c..5a465cc533bb7004fdcc2b9f8375412d934443e7 100644 (file)
@@ -9,9 +9,6 @@ error[E0308]: mismatched types
    |
 LL |     A::C = 1;
    |            ^ expected struct `A::C`, found integer
-   |
-   = note: expected struct `A::C`
-                found type `{integer}`
 
 error[E0070]: invalid left-hand side expression
   --> $DIR/issue-13407.rs:6:5
index 80a32cd276a98171341805e19a05b248dc99502a..13c35dd84f7c51499f4f9a46bc37f59072e4554a 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-13446.rs:3:26
    |
 LL | static VEC: [u32; 256] = vec![];
-   |                          ^^^^^^ expected array of 256 elements, found struct `std::vec::Vec`
+   |                          ^^^^^^ expected array `[u32; 256]`, found struct `std::vec::Vec`
    |
    = note: expected array `[u32; 256]`
              found struct `std::vec::Vec<_>`
index 24a076624edee9427a2af0ccf61c55b906339dc8..bb9f843dadfe38b09d3a12e657d74252f06ab7c7 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     assert!(1,1);
    |     ^^^^^^^^^^^^^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error: aborting due to previous error
 
index e8d44a4a9f88d4364035a6e5d06bd9eaf501fc78..555ec9f9868c5778cd086ef5bff443551c6776eb 100644 (file)
@@ -5,8 +5,6 @@ fn make(v: Vec2) {
     let Vec3 { y: _, z: _ } = v;
     //~^ ERROR mismatched types
     //~| expected struct `Vec2`, found struct `Vec3`
-    //~| expected struct `Vec2`
-    //~| found struct `Vec3`
 }
 
 fn main() { }
index e7cae883d6bf204ecf9e7efffc783e58def250ff..c5512e03007dfb5c3c56bd83332cdf71537eb1d0 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     let Vec3 { y: _, z: _ } = v;
    |         ^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found struct `Vec3`
-   |
-   = note: expected struct `Vec2`
-              found struct `Vec3`
 
 error: aborting due to previous error
 
index 61cb0093b1c44344aee7f1f3844202d768c4b350..0c1db02a8e6370f5b58980ee19ead2d30e1a8b03 100644 (file)
@@ -9,6 +9,6 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected enum `std::option::Option<&[&str]>`
     //~| found enum `std::option::Option<&[&str; 1]>`
-    //~| expected slice, found array of 1 element
+    //~| expected slice `[&str]`, found array `[&str; 1]`
     assert_eq!(msg, 3);
 }
index f60655b7a34d3a68ec5cb51e3f85e2477c54ea01..74a96df5b1b0fa4e339a1a565d28a31863b30b2c 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-15783.rs:8:19
    |
 LL |     let msg = foo(x);
-   |                   ^ expected slice, found array of 1 element
+   |                   ^ expected slice `[&str]`, found array `[&str; 1]`
    |
    = note: expected enum `std::option::Option<&[&str]>`
               found enum `std::option::Option<&[&str; 1]>`
index 1a0a7b4b8e6d934afe243c82b9c97511d54a7be1..a11c9d07f6fe5a1a236e4fa3e961079d98a66726 100644 (file)
@@ -11,8 +11,6 @@ enum E { B(R, Tau) }
           Tau{t: x},
           //~^ ERROR mismatched types
           //~| expected enum `main::R`, found struct `main::Tau`
-          //~| expected enum `main::R`
-          //~| found struct `main::Tau`
           _) => x,
     };
 }
index a8227bb19c23f994e6d9d85015dfe7cec691a124..f553be9df55eb2c38c10a6cfd11796b3fa93464d 100644 (file)
@@ -6,9 +6,6 @@ LL |     let u = match e {
 LL |         E::B(
 LL |           Tau{t: x},
    |           ^^^^^^^^^ expected enum `main::R`, found struct `main::Tau`
-   |
-   = note: expected enum `main::R`
-            found struct `main::Tau`
 
 error: aborting due to previous error
 
index c330745bc07d65643f06ec8edf4277e92b538f5e..715892397a479f8cc6cd630ccbb54481d8e2adb3 100644 (file)
@@ -1,7 +1,5 @@
 fn f<'r>(p: &'r mut fn(p: &mut ())) {
     (*p)(()) //~  ERROR mismatched types
-             //~| expected mutable reference `&mut ()`
-             //~| found unit type `()`
              //~| expected &mut (), found ()
 }
 
index 37f817c2e9b143be6510b192a1e18c8a237322a1..4bdc806f71763e42efa902916458b583e21f21a0 100644 (file)
@@ -6,9 +6,6 @@ LL |     (*p)(())
    |          |
    |          expected &mut (), found ()
    |          help: consider mutably borrowing here: `&mut ()`
-   |
-   = note: expected mutable reference `&mut ()`
-                      found unit type `()`
 
 error: aborting due to previous error
 
index 1d8128ffcb9e1ca3b9775de91e0e9e0e2f945417..e79a006afd9f754c120a90c5df1e173b89ae7ae8 100644 (file)
@@ -3,8 +3,6 @@
 
 fn main() {
     if let Some(homura) = Some("madoka") { //~  ERROR missing an else clause
-                                           //~| expected unit type `()`
-                                           //~| found type `{integer}`
                                            //~| expected (), found integer
         765
     };
index c808680ce619b0a975cf66eb3958f1b348a7e18a..d06c3acfd12c6b9e5e7512a87eaea8890cccb887 100644 (file)
@@ -3,15 +3,11 @@ error[E0317]: if may be missing an else clause
    |
 LL | /     if let Some(homura) = Some("madoka") {
 LL | |
-LL | |
-LL | |
 LL | |         765
    | |         --- found here
 LL | |     };
    | |_____^ expected (), found integer
    |
-   = note: expected unit type `()`
-                   found type `{integer}`
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
 
index b15f2a631fd86533584aef6d1b737fde357cb7ab..0c8e6e402e2ce008f39d267221c661949a1a1b57 100644 (file)
@@ -5,13 +5,11 @@
 impl<'a, T> Fn<(&'a T,)> for Foo {
   extern "rust-call" fn call(&self, (_,): (T,)) {}
   //~^ ERROR: has an incompatible type for trait
-  //~| expected reference
 }
 
 impl<'a, T> FnMut<(&'a T,)> for Foo {
   extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {}
   //~^ ERROR: has an incompatible type for trait
-  //~| expected reference
 }
 
 impl<'a, T> FnOnce<(&'a T,)> for Foo {
@@ -19,7 +17,6 @@ impl<'a, T> FnOnce<(&'a T,)> for Foo {
 
   extern "rust-call" fn call_once(self, (_,): (T,)) {}
   //~^ ERROR: has an incompatible type for trait
-  //~| expected reference
 }
 
 fn main() {}
index 63b0451e01a185bea0ab39a82db67c9835dcea91..baee8b967992f16912f74ce58424bdc50f7960a6 100644 (file)
@@ -4,7 +4,7 @@ error[E0053]: method `call` has an incompatible type for trait
 LL | impl<'a, T> Fn<(&'a T,)> for Foo {
    |          - this type parameter
 LL |   extern "rust-call" fn call(&self, (_,): (T,)) {}
-   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter `T`
+   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &T, found type parameter `T`
    |
    = note: expected fn pointer `extern "rust-call" fn(&Foo, (&'a T,))`
               found fn pointer `extern "rust-call" fn(&Foo, (T,))`
@@ -12,12 +12,12 @@ LL |   extern "rust-call" fn call(&self, (_,): (T,)) {}
    = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
 
 error[E0053]: method `call_mut` has an incompatible type for trait
-  --> $DIR/issue-20225.rs:12:3
+  --> $DIR/issue-20225.rs:11:3
    |
 LL | impl<'a, T> FnMut<(&'a T,)> for Foo {
    |          - this type parameter
 LL |   extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {}
-   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter `T`
+   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &T, found type parameter `T`
    |
    = note: expected fn pointer `extern "rust-call" fn(&mut Foo, (&'a T,))`
               found fn pointer `extern "rust-call" fn(&mut Foo, (T,))`
@@ -25,13 +25,13 @@ LL |   extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {}
    = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
 
 error[E0053]: method `call_once` has an incompatible type for trait
-  --> $DIR/issue-20225.rs:20:3
+  --> $DIR/issue-20225.rs:18:3
    |
 LL | impl<'a, T> FnOnce<(&'a T,)> for Foo {
    |          - this type parameter
 ...
 LL |   extern "rust-call" fn call_once(self, (_,): (T,)) {}
-   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter `T`
+   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &T, found type parameter `T`
    |
    = note: expected fn pointer `extern "rust-call" fn(Foo, (&'a T,))`
               found fn pointer `extern "rust-call" fn(Foo, (T,))`
index 20a0d6f41033863c77cbd0bf3fd621cf2d5d5a20..3c6d3df7faee4c1f9ca80cc7824d080fe41b8637 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     let _: () = foo::Foo.bar();
    |                 ^^^^^^^^^^^^^^ expected (), found bool
-   |
-   = note: expected unit type `()`
-                   found type `bool`
 
 error: aborting due to previous error
 
index 8d58095ceff307fd8aeace4a79b6066437241467..a36b380b9c1f074259fbd0c9fb566dfca0a10e9e 100644 (file)
@@ -12,9 +12,6 @@ error[E0308]: mismatched types
    |
 LL |     let v: Vec(&str) = vec!['1', '2'];
    |                             ^^^ expected &str, found char
-   |
-   = note: expected reference `&str`
-                   found type `char`
 
 error: aborting due to 2 previous errors
 
index 3b271a2a35bdbea5195d710766af06d885cb0504..1a08647358cccd63883d009798e184baac540d3b 100644 (file)
@@ -4,6 +4,4 @@ fn main() {
     let b = [0; S];
     //~^ ERROR mismatched types
     //~| expected usize, found struct `S`
-    //~| expected type `usize`
-    //~| found struct `S`
 }
index 598ee741a5c8b45c4efaf987710e888bb5f230ed..2c9eed0b3a54b524ad461488b17aae58a8532f1d 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     let b = [0; S];
    |                 ^ expected usize, found struct `S`
-   |
-   = note: expected type `usize`
-            found struct `S`
 
 error: aborting due to previous error
 
index 4244f36e481802b92208ae1bcee9375fc2802341..e379b23a5950a006df1a683282de7c372272eece 100644 (file)
@@ -16,9 +16,6 @@ LL |         loop { break };
    |                |
    |                expected i32, found ()
    |                help: give it a value of the expected type: `break 42`
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/issue-27042.rs:8:9
@@ -27,9 +24,6 @@ LL | /         'b:
 LL | |
 LL | |         while true { break }; // but here we cite the whole loop
    | |____________________________^ expected i32, found ()
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/issue-27042.rs:12:9
@@ -37,9 +31,6 @@ error[E0308]: mismatched types
 LL | /         'c:
 LL | |         for _ in None { break }; // but here we cite the whole loop
    | |_______________________________^ expected i32, found ()
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/issue-27042.rs:15:9
@@ -47,9 +38,6 @@ error[E0308]: mismatched types
 LL | /         'd:
 LL | |         while let Some(_) = None { break };
    | |__________________________________________^ expected i32, found ()
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error: aborting due to 4 previous errors
 
index 4710a594b3102319f9dfb5f1df470eb55e2eaa52..c4c6b6f8183b999ea651fa95da4d2865106e4a3f 100644 (file)
@@ -4,8 +4,6 @@ fn bar(d: u8) { }
         bar(&mut $d);
         //~^ ERROR mismatched types
         //~| expected u8, found &mut u8
-        //~| expected type `u8`
-        //~| found mutable reference `&mut u8`
     }}
 }
 
index 0a238761fc60492fbd25d3869126c19c4fa939f4..a91033e336020f79f6f7cd8e4d43f7b33935595e 100644 (file)
@@ -6,9 +6,6 @@ LL |         bar(&mut $d);
 ...
 LL |     foo!(0u8);
    |     ---------- in this macro invocation
-   |
-   = note:           expected type `u8`
-           found mutable reference `&mut u8`
 
 error: aborting due to previous error
 
index 27a567548ba29f8f23fdc3c89c72227ed9dd3856..ccd05fa6bfb0957ea00688b6a4202ad9e3d2184b 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     u = v; // mark $0 and $1 in a subtype relationship
    |         ^ expected struct `A`, found struct `B`
-   |
-   = note: expected struct `A`
-              found struct `B`
 
 error: aborting due to previous error
 
index 758f86d3db850ac3a8b2ee3294ac62841b15c74b..522df6a07c2c6a521911f0cceb15b89b1b5e6089 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |         let Test = 1;
    |             ^^^^ expected integer, found struct `Test`
-   |
-   = note: expected type `{integer}`
-            found struct `Test`
 
 error: aborting due to previous error
 
index 00e44738742ec284fa56261e815964f70f3d98f8..5613d3f1766b2d5737061213889124a553b6694e 100644 (file)
@@ -3,18 +3,12 @@ error[E0308]: mismatched types
    |
 LL |     let empty_struct::XEmpty2 = ();
    |         ^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty2`
-   |
-   = note: expected unit type `()`
-                 found struct `empty_struct::XEmpty2`
 
 error[E0308]: mismatched types
   --> $DIR/issue-37026.rs:7:9
    |
 LL |     let empty_struct::XEmpty6(..) = ();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty6`
-   |
-   = note: expected unit type `()`
-                 found struct `empty_struct::XEmpty6`
 
 error: aborting due to 2 previous errors
 
index e7eef47fd29102996a9f45f4f8c83cacee09e7e7..f872557966bfee3137b324c57236fbfcc4c31eab 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     let x: () = 0;
    |                 ^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error: aborting due to previous error
 
index 7cef2e6cd4c88ad6fbf7faf0c24c381f9aa06f73..b758cccd8f7bfa3229ced20b4dde1fef36c930b1 100644 (file)
@@ -7,8 +7,6 @@ LL |     fn visit() {}
 LL |     <() as Visit>::visit();
    |     ^^^^^^^^^^^^^^^^^^^^ expected &(), found ()
    |
-   = note: expected reference `&()`
-              found unit type `()`
    = note: required because of the requirements on the impl of `Visit` for `()`
 
 error: aborting due to previous error
index c2ffc2f4ac30cdd9ea70913221f82f1cda7cb667..6d2ef769a162ad9afd715319cdfd35c624c2ee0c 100644 (file)
@@ -3,9 +3,6 @@ error[E0326]: implemented const `CONST` has an incompatible type for trait
    |
 LL |     const CONST: () = ();
    |                  ^^ expected u32, found ()
-   |
-   = note:   expected type `u32`
-           found unit type `()`
 
 error: aborting due to previous error
 
index a1dae867ae6fb7e465c87ec4f9213fffac664084..d6e2146208e3d4ddd98179998a004ffddcd01443 100644 (file)
@@ -2,10 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-41742.rs:24:7
    |
 LL |     H["?"].f();
-   |       ^^^ expected u32, found reference
-   |
-   = note:   expected type `u32`
-           found reference `&'static str`
+   |       ^^^ expected u32, found &str
 
 error: aborting due to previous error
 
index d4ac39526dd6862b8bec19a4db65ec5774fa6ac6..ba4e9f6fa98923f2148567bb8e7f56e9178a429d 100644 (file)
@@ -3,8 +3,6 @@ fn main() {
         0
     } else if false {
 //~^ ERROR if may be missing an else clause
-//~| expected unit type `()`
-//~| found type `{integer}`
 //~| expected (), found integer
         1
     };
index 8abb7c3c9f585af1b5749a161ac4dba9f57e9be9..5ea4fdbf7ecc83deb83cecf6e0f1444e5200978a 100644 (file)
@@ -5,15 +5,11 @@ LL |       } else if false {
    |  ____________^
 LL | |
 LL | |
-LL | |
-LL | |
 LL | |         1
    | |         - found here
 LL | |     };
    | |_____^ expected (), found integer
    |
-   = note: expected unit type `()`
-                   found type `{integer}`
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
 
index 259b47ebe7c21e2adf29d628ab1823e002fcc46d..76696873f4eefd8f2b1d759a0615ce2cb8a32fbc 100644 (file)
@@ -20,9 +20,6 @@ LL | fn foo() -> bool {
 LL |
 LL |     break true;
    |               - help: consider removing this semicolon
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error: aborting due to 3 previous errors
 
index 4d61788c347d5dfa2b9383c9c5d05349c27b9576..27aebc548e1981a74c3d9fc00bc23ccd7baaf9c0 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-43420-no-over-suggest.rs:8:9
    |
 LL |     foo(&a);
-   |         ^^ expected slice, found struct `std::vec::Vec`
+   |         ^^ expected slice `[u16]`, found struct `std::vec::Vec`
    |
    = note: expected reference `&[u16]`
               found reference `&std::vec::Vec<u8>`
index c7b5f7b204048b5fa6b8c5ad0e5900fb32c7febb..a55bb22986963622d0d18691a096ebd333ae8afc 100644 (file)
@@ -5,9 +5,6 @@ LL | fn საჭმელად_გემრიელი_სადილი ( )
    |    ------------------------        ^^^^^ expected isize, found ()
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
-   |
-   = note:   expected type `isize`
-           found unit type `()`
 
 error: aborting due to previous error
 
index 569fdc1662a7bc5e648cfafda880b1a1b07cec39..df3da04f2e835ccc09055c9cff1ae0ff7dc1fbf6 100644 (file)
@@ -4,7 +4,5 @@ fn main() {
     let foo: [u8; 4] = [1; 4];
     bar(foo);
     //~^ ERROR mismatched types
-    //~| expected type `usize`
-    //~| found array `[u8; 4]`
-    //~| expected usize, found array of 4 elements
+    //~| expected usize, found array `[u8; 4]`
 }
index 0f45e91d6f5622ae2a75f4c3619bfa95b8c157fe..6c5495484b33c85f4f3985e022b67def6e098122 100644 (file)
@@ -2,10 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-4517.rs:5:9
    |
 LL |     bar(foo);
-   |         ^^^ expected usize, found array of 4 elements
-   |
-   = note: expected type `usize`
-             found array `[u8; 4]`
+   |         ^^^ expected usize, found array `[u8; 4]`
 
 error: aborting due to previous error
 
index 221d4b6d67f71bb523d0c4bb2cbe6b25bf754511..073abdfefdc8199afd186ebe63cc62ab7ae50e4a 100644 (file)
@@ -6,9 +6,6 @@ LL |   let u: &str = if true { s[..2] } else { s };
    |                           |
    |                           expected &str, found str
    |                           help: consider borrowing here: `&s[..2]`
-   |
-   = note: expected reference `&str`
-                   found type `str`
 
 error: aborting due to previous error
 
index dd6bef5c102c6045d5a042ca49422e749742277c..7e356ba1c11643013dfcbe7e2447eff91c5660d5 100644 (file)
@@ -6,9 +6,6 @@ LL |     light_flows_our_war_of_mocking_words(behold as usize);
    |                                          |
    |                                          expected &usize, found usize
    |                                          help: consider borrowing here: `&(behold as usize)`
-   |
-   = note: expected reference `&usize`
-                   found type `usize`
 
 error[E0308]: mismatched types
   --> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:14:42
@@ -18,9 +15,6 @@ LL |     light_flows_our_war_of_mocking_words(with_tears + 4);
    |                                          |
    |                                          expected &usize, found usize
    |                                          help: consider borrowing here: `&(with_tears + 4)`
-   |
-   = note: expected reference `&usize`
-                   found type `usize`
 
 error: aborting due to 2 previous errors
 
index 2b49c273330684ba3fe808feddc07de1ac79cc2f..9237b93924a8599981b1a917eb764d23a41e9ff5 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     () < std::mem::size_of::<_>();
    |          ^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found usize
-   |
-   = note: expected unit type `()`
-                   found type `usize`
 
 error[E0282]: type annotations needed
   --> $DIR/issue-47486.rs:3:11
index 4e4e0e7ed94a0fd0d40054f70981b54e2469e9a0..4fc534d59c8997b53eab55409279b2452f0cada0 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-48364.rs:2:21
    |
 LL |     b"".starts_with(stringify!(foo))
-   |                     ^^^^^^^^^^^^^^^ expected slice, found str
+   |                     ^^^^^^^^^^^^^^^ expected slice `[u8]`, found str
    |
    = note: expected reference `&[u8]`
               found reference `&'static str`
index bcc2fc500995f8058f8a83566cbcc2622232d162..2494bf7471bb9d79584acb54b345e3896af238b9 100644 (file)
@@ -31,8 +31,6 @@ LL |         Drop = assert_eq!(1, 1)
    |                expected (), found isize
    |                found here
    |
-   = note: expected unit type `()`
-                   found type `isize`
    = note: `if` expressions without `else` evaluate to `()`
    = help: consider adding an `else` block that evaluates to the expected type
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
index d2a21c48a09fc0e1a712e9cae2f02e5a128b1f96..9f60db917316ee6fd838949a5439a8a7163700ea 100644 (file)
@@ -9,9 +9,6 @@ error[E0308]: mismatched types
    |
 LL |     |y: Vec<[(); for x in 0..2 {}]>| {};
    |                  ^^^^^^^^^^^^^^^^ expected usize, found ()
-   |
-   = note:   expected type `usize`
-           found unit type `()`
 
 error: aborting due to 2 previous errors
 
index 83e5ddc48261ac08cafa9797e8aa85362b4230e8..e453b0cfaa83becf4a9d1ff72ebb2e366c7d5b96 100644 (file)
@@ -10,7 +10,6 @@ fn main() {
         a = *i.to_string();
         //~^ ERROR mismatched types
         //~| NOTE expected struct `std::string::String`, found str
-        //~| NOTE expected struct
         v2.push(a);
     }
 }
index 949d9a2f47d3db58a256b5e0a163685c581f0ae4..2c117f52a26bf40484e12d6b283a54bb69962f93 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |         a = *i.to_string();
    |             ^^^^^^^^^^^^^^ expected struct `std::string::String`, found str
-   |
-   = note: expected struct `std::string::String`
-                found type `str`
 
 error: aborting due to previous error
 
index e3f2cb8c4101d1d6534915235822cb1b8a31bac7..8dc5c95b9b1e3f7d3d59e51390e816e4f9ba44e1 100644 (file)
@@ -18,9 +18,6 @@ LL |         let string: String = s.clone();
    |                              |
    |                              expected struct `std::string::String`, found &str
    |                              help: try using a conversion method: `s.to_string()`
-   |
-   = note: expected struct `std::string::String`
-           found reference `&str`
 
 error: aborting due to 2 previous errors
 
index fc6370b2d31cb43110decd386702cd049a690fe2..7fd124046dc618a07c6ee4e2f5ced599648e4c21 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     let _: issue_56943::S = issue_56943::S2;
    |                             ^^^^^^^^^^^^^^^ expected struct `issue_56943::S`, found struct `issue_56943::S2`
-   |
-   = note: expected struct `issue_56943::S`
-              found struct `issue_56943::S2`
 
 error: aborting due to previous error
 
index 8690ff4731fed645c070d21862320c4dd6e637b6..c8439ee18f4f3e372695773877cb2edf893f1ed5 100644 (file)
@@ -6,9 +6,6 @@ LL |     foo(x.clone());
    |         |
    |         expected &str, found struct `std::string::String`
    |         help: consider borrowing here: `&x`
-   |
-   = note: expected reference `&str`
-                 found struct `std::string::String`
 
 error: aborting due to previous error
 
index dbdb14d7160ec56203abf57c25fea4909d8f0d46..86cc48aff06e96f6a89c752d1ce05cd5783ab459 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     const B: A<u8> = Self(0);
    |                           ^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/issue-61882.rs:4:22
index 223cc48c7dd617880297eda8608646089bf22103..b498ff0b534b4310909edd10184ad309b513936d 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-7061.rs:4:46
    |
 LL |     fn foo(&'a mut self) -> Box<BarStruct> { self }
-   |                             --------------   ^^^^ expected struct `std::boxed::Box`, found mutable reference
+   |                             --------------   ^^^^ expected struct `std::boxed::Box`, found &mut BarStruct
    |                             |
    |                             expected `std::boxed::Box<BarStruct>` because of return type
    |
index 5d631d576c7ac9da4a46fb8026d3f3674c8644bf..c1cc57ab5119ebe84a154c266e6dd43ee2666649 100644 (file)
@@ -15,8 +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":"expected struct `std::string::String`
-     found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"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}],"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
@@ -35,8 +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":"expected struct `std::string::String`
-     found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"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}],"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
@@ -55,8 +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":"expected struct `std::string::String`
-     found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"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}],"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
@@ -75,8 +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":[{"message":"expected struct `std::string::String`
-found unit type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"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}],"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 a9c3ae4795d20a2a02aacd7ddccc4b4c1d6f3297..581605ca5bbfb6bc71658b8711fc052265f22778 100644 (file)
@@ -15,8 +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":"expected struct `std::string::String`
-     found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"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}],"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
@@ -35,8 +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":"expected struct `std::string::String`
-     found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"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}],"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
@@ -55,8 +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":"expected struct `std::string::String`
-     found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"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}],"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
@@ -75,8 +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":[{"message":"expected struct `std::string::String`
-found unit type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"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}],"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 95446045998355827aef02ddd53211dc9032e683..7774349b75ae6498a83dc6a74fd26f8ff958dc33 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     let false = 22;
    |         ^^^^^ expected integer, found bool
-   |
-   = note: expected type `{integer}`
-              found type `bool`
 
 error: aborting due to previous error
 
index 36b1d882a347f7d3eeb24eee774efb9ef2322809..b2c2fc744c3bbee99110938d6d1c061791b6acbf 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     let true = 22;
    |         ^^^^ expected integer, found bool
-   |
-   = note: expected type `{integer}`
-              found type `bool`
 
 error: aborting due to previous error
 
index 3885341e7b312f7ff3447346468e3565b237f72f..db330c2f3540854603ecd56ac9b523ddc119295f 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL | fn main() { println!("{}", force(|| {})); }
    |                                     ^^ expected isize, found ()
-   |
-   = note:   expected type `isize`
-           found unit type `()`
 
 error: aborting due to previous error
 
index 201f90c6412e1ca5d3787ce69e5c638e53b174fc..6b7bd1acdc7a730dbc600f52dfdff09cfad91f04 100644 (file)
@@ -5,9 +5,6 @@ LL | fn f(a: isize) -> isize { if god_exists(a) { return 5; }; }
    |    -              ^^^^^ expected isize, found ()
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
-   |
-   = note:   expected type `isize`
-           found unit type `()`
 
 error: aborting due to previous error
 
index 738811adedb29d5d61c169ea6dda8c598961d1bd..7606413f15ef8f96d769f4538b46f0185a5135c2 100644 (file)
@@ -6,9 +6,6 @@ LL |       a.iter().all(|_| -> bool {
 LL | |
 LL | |     });
    | |_____^ expected bool, found ()
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error: aborting due to previous error
 
index 9825ecce403c50a621112d5afad75efc722bc950..499dbf10ede28ee7bf8b67e3c8fe97a6f070c10f 100644 (file)
@@ -5,9 +5,6 @@ LL | fn f() -> isize {
    |    -      ^^^^^ expected isize, found ()
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
-   |
-   = note:   expected type `isize`
-           found unit type `()`
 
 error: aborting due to previous error
 
index 4255f55a4ec5f658cf7dea56ba1a30b3d54ea8ae..93249fd5aff571c67fa614bc9f479879fb98b7ff 100644 (file)
@@ -9,9 +9,6 @@ LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } }
 ...
 LL |     test!();
    |     -------- in this macro invocation
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/liveness-return-last-stmt-semi.rs:7:19
@@ -20,9 +17,6 @@ LL | fn no_return() -> i32 {}
    |    ---------      ^^^ expected i32, found ()
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/liveness-return-last-stmt-semi.rs:9:19
@@ -33,9 +27,6 @@ LL | fn bar(x: u32) -> u32 {
    |    implicitly returns `()` as its body has no tail or `return` expression
 LL |     x * 2;
    |          - help: consider removing this semicolon
-   |
-   = note:   expected type `u32`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/liveness-return-last-stmt-semi.rs:13:19
@@ -44,9 +35,6 @@ LL | fn baz(x: u64) -> u32 {
    |    ---            ^^^ expected u32, found ()
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
-   |
-   = note:   expected type `u32`
-           found unit type `()`
 
 error: aborting due to 4 previous errors
 
index 8a049ac002356f9b21cb1ef50151b6db8616b8d2..4588b7b02bbe0de2afd5092e681ce866968b626c 100644 (file)
@@ -108,36 +108,24 @@ error[E0308]: mismatched types
    |
 LL |             break 123;
    |                   ^^^ expected &str, found integer
-   |
-   = note: expected type `&str`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/loop-break-value.rs:16:15
    |
 LL |         break "asdf";
-   |               ^^^^^^ expected i32, found reference
-   |
-   = note:   expected type `i32`
-           found reference `&'static str`
+   |               ^^^^^^ expected i32, found &str
 
 error[E0308]: mismatched types
   --> $DIR/loop-break-value.rs:21:31
    |
 LL |             break 'outer_loop "nope";
-   |                               ^^^^^^ expected i32, found reference
-   |
-   = note:   expected type `i32`
-           found reference `&'static str`
+   |                               ^^^^^^ expected i32, found &str
 
 error[E0308]: mismatched types
   --> $DIR/loop-break-value.rs:73:26
    |
 LL |                 break 'c 123;
    |                          ^^^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/loop-break-value.rs:80:15
@@ -153,9 +141,6 @@ error[E0308]: mismatched types
    |
 LL |         break 2;
    |               ^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/loop-break-value.rs:90:9
@@ -165,9 +150,6 @@ LL |         break;
    |         |
    |         expected integer, found ()
    |         help: give it a value of the expected type: `break value`
-   |
-   = note:   expected type `{integer}`
-           found unit type `()`
 
 error: aborting due to 16 previous errors
 
index e34e7f4e956e21ce57a98275d65c018afbd4ced9..c3d0ae28f74d7360e470d3a6d87852855caeb1e7 100644 (file)
@@ -6,9 +6,6 @@ LL |         let _: i32 = loop { break };
    |                             |
    |                             expected i32, found ()
    |                             help: give it a value of the expected type: `break 42`
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/loop-labeled-break-value.rs:6:37
@@ -18,9 +15,6 @@ LL |         let _: i32 = 'inner: loop { break 'inner };
    |                                     |
    |                                     expected i32, found ()
    |                                     help: give it a value of the expected type: `break 'inner 42`
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/loop-labeled-break-value.rs:9:45
@@ -30,9 +24,6 @@ LL |         let _: i32 = 'inner2: loop { loop { break 'inner2 } };
    |                                             |
    |                                             expected i32, found ()
    |                                             help: give it a value of the expected type: `break 'inner2 42`
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error: aborting due to 3 previous errors
 
index 41027dc3ad6e4e5c953ea432ff72f2ffd748e19e..9b4329ded18bd767cd0cc6a6149fdfff98202f66 100644 (file)
@@ -6,9 +6,6 @@ LL |   let x: i32 = loop { break };
    |                       |
    |                       expected i32, found ()
    |                       help: give it a value of the expected type: `break 42`
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error: aborting due to previous error
 
index f717cf4ea75c4823926644e230b91d95e1cadbfe..4598b512f1d1f63c82166cca5fe8b6f4b3c01c28 100644 (file)
@@ -9,12 +9,10 @@ LL | |         E::D => 4,
 LL | |         E::E => unimplemented!(""),
    | |                 ------------------ this and all prior arms are found to be of type `{integer}`
 LL | |         E::F => "",
-   | |                 ^^ expected integer, found reference
+   | |                 ^^ expected integer, found &str
 LL | |     };
    | |_____- `match` arms have incompatible types
    |
-   = note:   expected type `{integer}`
-           found reference `&'static str`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
 error: aborting due to previous error
index 252d4cbf162415f67159b94f0a9a5af59cc4aeb6..c0cdbe342a07d503dfa5f62e19ab321e36997925 100644 (file)
@@ -19,6 +19,4 @@ fn main() {
         _ => { }
     };
     //~^^^ ERROR mismatched types
-    //~| expected type `{integer}`
-    //~| found type `char`
 }
index 25fa9c2f6182e8e58a47a1fe31dfc03bb16a98ba..8ce2d8853de31f1b4532b5e54208d6303042556b 100644 (file)
@@ -29,9 +29,6 @@ error[E0308]: mismatched types
    |
 LL |         'c' ..= 100 => { }
    |         ^^^^^^^^^^^ expected integer, found char
-   |
-   = note: expected type `{integer}`
-              found type `char`
 
 error: aborting due to 4 previous errors
 
index e82d9581b2d1e0f7f8b77ae8fcf72dc676bb90de..7a54c54b98cb85c2762a4d1402797863db58159c 100644 (file)
@@ -6,8 +6,6 @@ fn main() {
         E::C(_) => (),
         //~^ ERROR mismatched types
         //~| expected struct `S`, found enum `E`
-        //~| expected struct `S`
-        //~| found enum `E`
         _ => ()
     }
 }
index 3d4a19a93170d2b998b957a3efb5ecb2ec17227e..c23451d51ec5a89445b148691f14a20f79f930a0 100644 (file)
@@ -5,9 +5,6 @@ LL |     match (S { a: 1 }) {
    |           ------------ this match expression has type `S`
 LL |         E::C(_) => (),
    |         ^^^^^^^ expected struct `S`, found enum `E`
-   |
-   = note: expected struct `S`
-                found enum `E`
 
 error: aborting due to previous error
 
index 5dd7b564d9dc23a20e61db4e548f5f9fe97da265..4b6260b2199e1a2e3a161096a377999e6c2171f8 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL | fn main() { let x: A = A::A; match x { B::B => { } } }
    |                                        ^^^^ expected enum `A`, found enum `B`
-   |
-   = note: expected enum `A`
-              found enum `B`
 
 error: aborting due to previous error
 
index 833d8838e57a8fce5042d431b116a16b98fbf50c..db5dcd2be3b51345438f485b447903373aa2ac0f 100644 (file)
@@ -5,9 +5,6 @@ LL | fn main() { let x: A = A::A(0); match x { B::B(y) => { } } }
    |                                       -   ^^^^^^^ expected enum `A`, found enum `B`
    |                                       |
    |                                       this match expression has type `A`
-   |
-   = note: expected enum `A`
-              found enum `B`
 
 error: aborting due to previous error
 
index 8dfbf1019e9a402245b73b6acd8abf86fd46cd2c..2a0f01a0b093f35a00affd35fe2800e81db4d07a 100644 (file)
@@ -18,7 +18,6 @@ fn test_func2(n: i32) -> i32 {
         _ => 42,
         //~^ ERROR match arms have incompatible types
         //~| NOTE expected char, found integer
-        //~| NOTE expected type `char`
     };
     x
 }
@@ -35,7 +34,6 @@ fn test_func3(n: i32) -> i32 {
         _ => 42,
         //~^ ERROR match arms have incompatible types
         //~| NOTE expected char, found integer
-        //~| NOTE expected type `char`
     };
     x
 }
@@ -48,6 +46,5 @@ fn test_func4() {
         None => {}
         //~^ ERROR match arms have incompatible types
         //~| NOTE expected u32, found ()
-        //~| NOTE expected type `u32`
     };
 }
index 8f8bb4bdcd2ca1410c04c75c3a31b35126b4cee3..39048e03296a977317b3abb8516491611e16cceb 100644 (file)
@@ -18,15 +18,11 @@ LL | |         _ => 42,
    | |              ^^ expected char, found integer
 LL | |
 LL | |
-LL | |
 LL | |     };
    | |_____- `match` arms have incompatible types
-   |
-   = note: expected type `char`
-              found type `{integer}`
 
 error[E0308]: match arms have incompatible types
-  --> $DIR/match-type-err-first-arm.rs:35:14
+  --> $DIR/match-type-err-first-arm.rs:34:14
    |
 LL |       let x = match n {
    |  _____________-
@@ -39,16 +35,13 @@ LL | |         6 => 'b',
 LL | |
 LL | |         _ => 42,
    | |              ^^ expected char, found integer
-...  |
+LL | |
 LL | |
 LL | |     };
    | |_____- `match` arms have incompatible types
-   |
-   = note: expected type `char`
-              found type `{integer}`
 
 error[E0308]: match arms have incompatible types
-  --> $DIR/match-type-err-first-arm.rs:48:17
+  --> $DIR/match-type-err-first-arm.rs:46:17
    |
 LL | /     match Some(0u32) {
 LL | |         Some(x) => {
@@ -57,13 +50,10 @@ LL | |             x
 LL | |         },
 LL | |         None => {}
    | |                 ^^ expected u32, found ()
-...  |
+LL | |
 LL | |
 LL | |     };
    | |_____- `match` arms have incompatible types
-   |
-   = note:   expected type `u32`
-           found unit type `()`
 
 error: aborting due to 4 previous errors
 
index 99e0a466817fcaf4b9207fcabccd6167e8c139bb..12f75d009e2e54a32f9766824e2137878e575608 100644 (file)
@@ -3,18 +3,12 @@ error[E0308]: mismatched types
    |
 LL |     let _seetype: () = z;
    |                        ^ expected (), found u32
-   |
-   = note: expected unit type `()`
-                   found type `u32`
 
 error[E0308]: mismatched types
   --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:102:24
    |
 LL |     let _seetype: () = z;
    |                        ^ expected (), found u64
-   |
-   = note: expected unit type `()`
-                   found type `u64`
 
 error[E0034]: multiple applicable items in scope
   --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:120:15
@@ -46,27 +40,18 @@ error[E0308]: mismatched types
    |
 LL |     let _seetype: () = z;
    |                        ^ expected (), found u8
-   |
-   = note: expected unit type `()`
-                   found type `u8`
 
 error[E0308]: mismatched types
   --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:155:24
    |
 LL |     let _seetype: () = z;
    |                        ^ expected (), found u32
-   |
-   = note: expected unit type `()`
-                   found type `u32`
 
 error[E0308]: mismatched types
   --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:172:24
    |
 LL |     let _seetype: () = z;
    |                        ^ expected (), found u32
-   |
-   = note: expected unit type `()`
-                   found type `u32`
 
 error: aborting due to 6 previous errors
 
index 169c14c0f5354b1fac53ae1ee894df3f5ee3174f..c58040cdf5fb7075cafe52d2ef2863f52f04e9d6 100644 (file)
@@ -10,8 +10,6 @@ fn main() {
     let x = Foo;
     Foo::bar(x); //~  ERROR mismatched types
                  //~| expected &Foo, found struct `Foo`
-                 //~| expected reference `&Foo`
-                 //~| found struct `Foo`
     Foo::bar(&42); //~  ERROR mismatched types
                       //~| expected struct `Foo`, found integer
                       //~| expected reference `&Foo`
index e0cb0915fe109a7653e6fe2e51cd0a0f773bd700..a56164db1b6c2a134581db96b04599ee77f4873a 100644 (file)
@@ -6,12 +6,9 @@ LL |     Foo::bar(x);
    |              |
    |              expected &Foo, found struct `Foo`
    |              help: consider borrowing here: `&x`
-   |
-   = note: expected reference `&Foo`
-                 found struct `Foo`
 
 error[E0308]: mismatched types
-  --> $DIR/method-self-arg-1.rs:15:14
+  --> $DIR/method-self-arg-1.rs:13:14
    |
 LL |     Foo::bar(&42);
    |              ^^^ expected struct `Foo`, found integer
index cb2715f5543528fe11a27b229ede3376b21cfe61..d3e41dabba61d93090af9908a3c72c245c51ddf9 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     let x: () = 0;
    |                 ^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error: aborting due to previous error
 
index e3919bf260264e9311b6a3721f27021e213cbd82..5a961f8948b922e2b561651a18901a65a45e7e03 100644 (file)
@@ -11,9 +11,6 @@ error[E0308]: mismatched types
    |
 LL |         (0, ref y) | (y, 0) => {}
    |                       ^ expected &{integer}, found integer
-   |
-   = note: expected type `&{integer}`
-              found type `{integer}`
 
 error: aborting due to 2 previous errors
 
index 81cc8e29e49c5ed3149e0933a83cc80d1eeec46f..c2081878629a6025caddb77de23c7cfb01ea0a07 100644 (file)
@@ -76,9 +76,6 @@ LL |     1+2
    |     |
    |     expected struct `std::string::String`, found integer
    |     help: try using a conversion method: `(1+2).to_string()`
-   |
-   = note: expected struct `std::string::String`
-                found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/abridged.rs:59:5
@@ -90,9 +87,6 @@ LL |     -2
    |     |
    |     expected struct `std::string::String`, found integer
    |     help: try using a conversion method: `(-2).to_string()`
-   |
-   = note: expected struct `std::string::String`
-                found type `{integer}`
 
 error: aborting due to 8 previous errors
 
index 8bba0efc8142de8dd64b1319721b81a6adc3adcf..97b1139abd5996856d1e14160bad6e860592d4e1 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |         x
    |         ^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error: aborting due to previous error
 
index fc128fe6fc7f303bda9259d037002fea4d7bffe4..de66c504f8cce2d51a84db6c386fe004cd4860f4 100644 (file)
@@ -5,9 +5,6 @@ LL |       let x: u32 = (
    |  __________________^
 LL | |     );
    | |_____^ expected u32, found ()
-   |
-   = note:   expected type `u32`
-           found unit type `()`
 
 error: aborting due to previous error
 
index b5daf195ef78af4dc7b14178c7383bb3c304a9ef..b57ceb08b172555ebed76bd9e372bd9cbf2f50e3 100644 (file)
@@ -2,10 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/overloaded-calls-bad.rs:28:17
    |
 LL |     let ans = s("what");
-   |                 ^^^^^^ expected isize, found reference
-   |
-   = note:   expected type `isize`
-           found reference `&'static str`
+   |                 ^^^^^^ expected isize, found &str
 
 error[E0057]: this function takes 1 parameter but 0 parameters were supplied
   --> $DIR/overloaded-calls-bad.rs:29:15
index 8d8d6b78c197bada569f16446abe7921fd05413c..441551486a40cdf5a0fea62e69e42fea1759c7dd 100644 (file)
@@ -5,9 +5,6 @@ LL | fn f() -> isize { }
    |    -      ^^^^^ expected isize, found ()
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
-   |
-   = note:   expected type `isize`
-           found unit type `()`
 
 error: aborting due to previous error
 
index cf3952bca11dc4af2864e82d288934f7ee704d3a..d7013bf3c0fb0b4c8e7aae75f4f67255e0b55834 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/call-fn-never-arg-wrong-type.rs:10:9
    |
 LL |     foo("wow");
-   |         ^^^^^ expected !, found reference
+   |         ^^^^^ expected !, found &str
    |
    = note:   expected type `!`
            found reference `&'static str`
index fcdb9ef6c921167d19f9c6b1300e7caa4b30ba2f..3f72b6914ca38c2fc88fe27cd4c6ef706eab723d 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/never-assign-wrong-type.rs:7:16
    |
 LL |     let x: ! = "hello";
-   |                ^^^^^^^ expected !, found reference
+   |                ^^^^^^^ expected !, found &str
    |
    = note:   expected type `!`
            found reference `&'static str`
index b56aebb99d5623426df3f73a87786410b0ad7566..d787cae4343620fab47362dd49f3ec04583d61bd 100644 (file)
@@ -11,9 +11,6 @@ error[E0308]: mismatched types
    |
 LL |     let () = 0;
    |         ^^ expected integer, found ()
-   |
-   = note:   expected type `{integer}`
-           found unit type `()`
 
 error: aborting due to previous error
 
index db6670fc5b1e074ab194b4283076a1a5c982f216..4502ae0c0cc3e8d24579c5a5ebdf45c86e63b482 100644 (file)
@@ -11,9 +11,6 @@ error[E0308]: mismatched types
    |
 LL |             let recovery_witness: bool = 0;
    |                                          ^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error: aborting due to 2 previous errors
 
index 731b2090a7ba04bc140d7c825bf96c74575b7133..be06f3666cb3e803496525ad31bb73235806aff9 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL | fn main() { match Blah::A(1, 1, 2) { Blah::A(_, x, y) | Blah::B(x, y) => { } } }
    |                                                                    ^ expected usize, found isize
-   |
-   = note: expected type `usize`
-              found type `isize`
 
 error: aborting due to previous error
 
index 5985b2aecfc203f4784eb2b5e7f3cf40bb4643c0..7e4cf0d14e1f8fa42c3277272e0f32022fe24759 100644 (file)
@@ -122,9 +122,6 @@ LL |     let recovery_witness: String = 0;
    |                                    |
    |                                    expected struct `std::string::String`, found integer
    |                                    help: try using a conversion method: `0.to_string()`
-   |
-   = note: expected struct `std::string::String`
-                found type `{integer}`
 
 error: aborting due to 16 previous errors
 
index 051af60121bcf553d34c23e9c72c3bd983ab4c6d..91ee46c55a7866fa99e0db42aa000386903cf695 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL | fn main() { let i: isize; i = f(); }
    |                               ^^^ expected isize, found ()
-   |
-   = note:   expected type `isize`
-           found unit type `()`
 
 error: aborting due to previous error
 
index 83e8880f183f264929e00d9b79e14b2bda542d34..2a751e9d43a37a2265ebb5685ba2daed4380d5a3 100644 (file)
@@ -48,36 +48,24 @@ error[E0308]: mismatched types
    |
 LL |     {2} + {2}
    |      ^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/expr-as-stmt.rs:12:6
    |
 LL |     {2} + 2
    |      ^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/expr-as-stmt.rs:18:7
    |
 LL |     { 42 } + foo;
    |       ^^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/expr-as-stmt.rs:24:7
    |
 LL |     { 3 } * 3
    |       ^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error[E0614]: type `{integer}` cannot be dereferenced
   --> $DIR/expr-as-stmt.rs:24:11
index 995eb62d0bb59b191b9b58e76c28b5e9911e9750..ad28c9d3dce34f0740c51adde856474c9f6a5dbf 100644 (file)
@@ -17,13 +17,10 @@ fn main() {
     // verify that the parser recovered and properly typechecked the args
     f("", "");
     //~^ ERROR mismatched types
-    //~| NOTE expected u8, found reference
-    //~| NOTE expected
+    //~| NOTE expected u8, found &str
     //~| ERROR mismatched types
-    //~| NOTE expected u8, found reference
-    //~| NOTE expected
+    //~| NOTE expected u8, found &str
     bar("");
     //~^ ERROR mismatched types
-    //~| NOTE expected i32, found reference
-    //~| NOTE expected
+    //~| NOTE expected i32, found &str
 }
index 9554cf42ee383c1cb64a30661e6752951dadf303..5ea1eef0e4f0d7aa351f1e45bb7e3650d2848bbc 100644 (file)
@@ -20,28 +20,19 @@ error[E0308]: mismatched types
   --> $DIR/fn-arg-doc-comment.rs:18:7
    |
 LL |     f("", "");
-   |       ^^ expected u8, found reference
-   |
-   = note:   expected type `u8`
-           found reference `&'static str`
+   |       ^^ expected u8, found &str
 
 error[E0308]: mismatched types
   --> $DIR/fn-arg-doc-comment.rs:18:11
    |
 LL |     f("", "");
-   |           ^^ expected u8, found reference
-   |
-   = note:   expected type `u8`
-           found reference `&'static str`
+   |           ^^ expected u8, found &str
 
 error[E0308]: mismatched types
-  --> $DIR/fn-arg-doc-comment.rs:25:9
+  --> $DIR/fn-arg-doc-comment.rs:23:9
    |
 LL |     bar("");
-   |         ^^ expected i32, found reference
-   |
-   = note:   expected type `i32`
-           found reference `&'static str`
+   |         ^^ expected i32, found &str
 
 error: aborting due to 6 previous errors
 
index d1e09ce16554a100cea04a4c91e95ec0d5cce31b..b0d41a27dc909538323c5ea02d391106656d1624 100644 (file)
@@ -11,9 +11,6 @@ LL |     fn f(*, a: u8) -> u8 {}
    |        -              ^^ expected u8, found ()
    |        |
    |        implicitly returns `()` as its body has no tail or `return` expression
-   |
-   = note:   expected type `u8`
-           found unit type `()`
 
 error: aborting due to 2 previous errors
 
index 2905cc7370db24bbd038dd166aefdfa0548695b4..ddb97b40e95902fdd64a7144e2b345389ed6ad55 100644 (file)
@@ -20,9 +20,6 @@ LL | fn f() -> isize { fn f() -> isize {} pub f<
    |                      -      ^^^^^ expected isize, found ()
    |                      |
    |                      implicitly returns `()` as its body has no tail or `return` expression
-   |
-   = note:   expected type `isize`
-           found unit type `()`
 
 error: aborting due to 3 previous errors
 
index 61cb1faead124a8b657be6f8c91e0ca6dc000f96..e46152fad0e5e0bb11d1eb02d60000b2669779f8 100644 (file)
@@ -40,9 +40,6 @@ LL | fn v() -> isize {
    |    -      ^^^^^ expected isize, found ()
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
-   |
-   = note:   expected type `isize`
-           found unit type `()`
 
 error: aborting due to 6 previous errors
 
index fbd1fc28dd6e7f882eb7818000b4514418c7c2bd..db2b9c70a03a70e2d2b85ab24f0c2af590099518 100644 (file)
@@ -43,10 +43,7 @@ error[E0308]: mismatched types
   --> $DIR/lex-bad-char-literals-6.rs:15:20
    |
 LL |     let a: usize = "";
-   |                    ^^ expected usize, found reference
-   |
-   = note:   expected type `usize`
-           found reference `&'static str`
+   |                    ^^ expected usize, found &str
 
 error[E0277]: can't compare `&str` with `char`
   --> $DIR/lex-bad-char-literals-6.rs:12:10
index 2e4bf8320fb58061c78429e5ca776aef82b24c70..b9d0f13c0651f2e00b4bd8bdcd15643a59b9334c 100644 (file)
@@ -35,9 +35,6 @@ error[E0308]: mismatched types
    |
 LL | const RECOVERY_WITNESS: () = 0;
    |                              ^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error: aborting due to 5 previous errors
 
index 4a7a28825ffc2f0100096469bced04bec8036656..2ef6aa6f113c503dc84a6a5085d67b9786c29f11 100644 (file)
@@ -14,10 +14,7 @@ error[E0308]: mismatched types
   --> $DIR/numeric-lifetime.rs:6:20
    |
 LL |     let x: usize = "";
-   |                    ^^ expected usize, found reference
-   |
-   = note:   expected type `usize`
-           found reference `&'static str`
+   |                    ^^ expected usize, found &str
 
 error: aborting due to 3 previous errors
 
index d702dac81daf6c07b2fd383cff74ffedddb64cda..bfb8866437bcdc5aff15088a8ce9e2dd454a7330 100644 (file)
@@ -18,9 +18,6 @@ error[E0308]: mismatched types
    |
 LL | const RECOVERY_WITNESS: () = 0;
    |                              ^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error: aborting due to 3 previous errors
 
index 77bb3b0417adba72c775eec6c54cabd6b3584d0e..d30a3bc0b1499391a64966f1f7fe25472e2c9c56 100644 (file)
@@ -9,9 +9,6 @@ error[E0308]: mismatched types
    |
 LL | const RECOVERY_WITNESS: () = 0;
    |                              ^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error: aborting due to 2 previous errors
 
index 7aa91ab2af476585778920a24f10624595144bef..9472237a22ef483ebb0baae7f427df0123c7ba9f 100644 (file)
@@ -18,9 +18,6 @@ error[E0308]: mismatched types
    |
 LL | const RECOVERY_WITNESS: () = 0;
    |                              ^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error: aborting due to 3 previous errors
 
index f0373b0c89f191922d9ec2322aaa515bd666b3d7..74ac926cb028395d6dc70fe697303b5228e603ad 100644 (file)
@@ -18,9 +18,6 @@ error[E0308]: mismatched types
    |
 LL |         const RECOVERY_WITNESS: () = 0;
    |                                      ^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error: aborting due to 3 previous errors
 
index d69cba7a106530037f2b4c0e482c472f40e04a13..3f5a986f08684bcd1a4230067bfe0e6d8da2ae7c 100644 (file)
@@ -14,9 +14,6 @@ error[E0308]: mismatched types
    |
 LL |     let x: usize = ();
    |                    ^^ expected usize, found ()
-   |
-   = note:   expected type `usize`
-           found unit type `()`
 
 error: aborting due to 2 previous errors
 
index 41640ac3f23a64acce4575d708fed8f8a8cbb843..1ccf8b22c536458570c8916742eeb6337027cc0d 100644 (file)
@@ -21,18 +21,12 @@ error[E0308]: mismatched types
    |
 LL |     let _: usize = ()
    |                    ^^ expected usize, found ()
-   |
-   = note:   expected type `usize`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/recover-missing-semi.rs:9:20
    |
 LL |     let _: usize = ()
    |                    ^^ expected usize, found ()
-   |
-   = note:   expected type `usize`
-           found unit type `()`
 
 error: aborting due to 4 previous errors
 
index 160ab18e34a54a1657714a9558bbbe2f3499f377..af03b577548f7d026858114dce1d7ffdc1a3fee2 100644 (file)
@@ -418,18 +418,12 @@ error[E0308]: mismatched types
    |
 LL |     if let .0..Y = 0 {}
    |            ^^^^^ expected integer, found floating-point number
-   |
-   = note: expected type `{integer}`
-              found type `{float}`
 
 error[E0308]: mismatched types
   --> $DIR/recover-range-pats.rs:23:12
    |
 LL |     if let X.. .0 = 0 {}
    |            ^^^^^^ expected integer, found floating-point number
-   |
-   = note: expected type `u8`
-              found type `{float}`
 
 error[E0029]: only char and numeric types are allowed in range patterns
   --> $DIR/recover-range-pats.rs:32:12
@@ -452,18 +446,12 @@ error[E0308]: mismatched types
    |
 LL |     if let .0..=Y = 0 {}
    |            ^^^^^^ expected integer, found floating-point number
-   |
-   = note: expected type `{integer}`
-              found type `{float}`
 
 error[E0308]: mismatched types
   --> $DIR/recover-range-pats.rs:36:12
    |
 LL |     if let X..=.0 = 0 {}
    |            ^^^^^^ expected integer, found floating-point number
-   |
-   = note: expected type `u8`
-              found type `{float}`
 
 error[E0029]: only char and numeric types are allowed in range patterns
   --> $DIR/recover-range-pats.rs:45:12
@@ -486,18 +474,12 @@ error[E0308]: mismatched types
    |
 LL |     if let .0...Y = 0 {}
    |            ^^^^^^ expected integer, found floating-point number
-   |
-   = note: expected type `{integer}`
-              found type `{float}`
 
 error[E0308]: mismatched types
   --> $DIR/recover-range-pats.rs:52:12
    |
 LL |     if let X... .0 = 0 {}
    |            ^^^^^^^ expected integer, found floating-point number
-   |
-   = note: expected type `u8`
-              found type `{float}`
 
 error[E0029]: only char and numeric types are allowed in range patterns
   --> $DIR/recover-range-pats.rs:60:12
@@ -510,9 +492,6 @@ error[E0308]: mismatched types
    |
 LL |     if let .0.. = 0 {}
    |            ^^^^ expected integer, found floating-point number
-   |
-   = note: expected type `{integer}`
-              found type `{float}`
 
 error[E0029]: only char and numeric types are allowed in range patterns
   --> $DIR/recover-range-pats.rs:70:12
@@ -525,9 +504,6 @@ error[E0308]: mismatched types
    |
 LL |     if let .0..= = 0 {}
    |            ^^^^^ expected integer, found floating-point number
-   |
-   = note: expected type `{integer}`
-              found type `{float}`
 
 error[E0029]: only char and numeric types are allowed in range patterns
   --> $DIR/recover-range-pats.rs:82:12
@@ -540,9 +516,6 @@ error[E0308]: mismatched types
    |
 LL |     if let .0... = 0 {}
    |            ^^^^^ expected integer, found floating-point number
-   |
-   = note: expected type `{integer}`
-              found type `{float}`
 
 error[E0029]: only char and numeric types are allowed in range patterns
   --> $DIR/recover-range-pats.rs:94:14
@@ -555,9 +528,6 @@ error[E0308]: mismatched types
    |
 LL |     if let .. .0 = 0 {}
    |            ^^^^^ expected integer, found floating-point number
-   |
-   = note: expected type `{integer}`
-              found type `{float}`
 
 error[E0029]: only char and numeric types are allowed in range patterns
   --> $DIR/recover-range-pats.rs:104:15
@@ -570,9 +540,6 @@ error[E0308]: mismatched types
    |
 LL |     if let ..=.0 = 0 {}
    |            ^^^^^ expected integer, found floating-point number
-   |
-   = note: expected type `{integer}`
-              found type `{float}`
 
 error[E0029]: only char and numeric types are allowed in range patterns
   --> $DIR/recover-range-pats.rs:116:15
@@ -585,9 +552,6 @@ error[E0308]: mismatched types
    |
 LL |     if let ....3 = 0 {}
    |            ^^^^^ expected integer, found floating-point number
-   |
-   = note: expected type `{integer}`
-              found type `{float}`
 
 error: aborting due to 85 previous errors
 
index 70eefd8a1701e8cd8bf63c37f648dbf4c7fe8046..1bd2e9867533e151ca348de1e2c2fe3601d2c6cd 100644 (file)
@@ -8,10 +8,7 @@ error[E0308]: mismatched types
   --> $DIR/recover-tuple.rs:6:20
    |
 LL |     let y: usize = "";
-   |                    ^^ expected usize, found reference
-   |
-   = note:   expected type `usize`
-           found reference `&'static str`
+   |                    ^^ expected usize, found &str
 
 error: aborting due to 2 previous errors
 
index 85478dcd1dce599715ea07df7359f9b9a9959deb..f57668812490c829cb698dddb3920f83b2e6b26f 100644 (file)
@@ -46,18 +46,12 @@ error[E0308]: mismatched types
    |
 LL |     false == 0 < 2;
    |              ^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/require-parens-for-chained-comparison.rs:8:18
    |
 LL |     false == 0 < 2;
    |                  ^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error: aborting due to 7 previous errors
 
index 7a599b07f1e55cacbc7d488bc76734634f938c8a..a6224d8989437cf7ba89e67116e934eba0160a81 100644 (file)
@@ -14,9 +14,6 @@ error[E0308]: mismatched types
    |
 LL |         (..) => {}
    |         ^^^^ expected u8, found ()
-   |
-   = note:   expected type `u8`
-           found unit type `()`
 
 error: aborting due to 2 previous errors
 
index f21da3b55dc35e05c10a94a820366cbf16dfdf2b..eb57210f45474c31d8d2ab4fd4e7d0ff40d2b310 100644 (file)
@@ -22,8 +22,6 @@ fn main() {
         S { .. } => (),
         //~^ ERROR mismatched types
         //~| expected char, found struct `S`
-        //~| expected type `char`
-        //~| found struct `S`
 
         _ => ()
     }
index c8d80043fdbef13db33f9b425d6bb8fa2e2481bb..22da0d5e0db3ab5421e245071b7d04123c54c066 100644 (file)
@@ -1,5 +1,5 @@
 error[E0433]: failed to resolve: use of undeclared type or module `E`
-  --> $DIR/pattern-error-continue.rs:35:9
+  --> $DIR/pattern-error-continue.rs:33:9
    |
 LL |         E::V => {}
    |         ^ use of undeclared type or module `E`
@@ -31,12 +31,9 @@ LL |     match 'c' {
    |           --- this match expression has type `char`
 LL |         S { .. } => (),
    |         ^^^^^^^^ expected char, found struct `S`
-   |
-   = note: expected type `char`
-            found struct `S`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-error-continue.rs:30:7
+  --> $DIR/pattern-error-continue.rs:28:7
    |
 LL |     f(true);
    |       ^^^^ expected char, found bool
index 314ff84ae3c4696dc1c79ec4296836f4edc551ed..b73ab6e5d9f18e8d2a3fa4ba775b2e5b75db9a10 100644 (file)
@@ -9,9 +9,6 @@ LL |         return 0i32;
 LL |     }
 LL |     1u32
    |     ^^^^ expected i32, found u32
-   |
-   = note: expected type `i32`
-              found type `u32`
 
 error[E0308]: mismatched types
   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:13:16
@@ -24,9 +21,6 @@ LL |         return 0i32;
 LL |     } else {
 LL |         return 1u32;
    |                ^^^^ expected i32, found u32
-   |
-   = note: expected type `i32`
-              found type `u32`
 
 error[E0308]: mismatched types
   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:22:9
@@ -39,9 +33,6 @@ LL |         return 0i32;
 LL |     } else {
 LL |         1u32
    |         ^^^^ expected i32, found u32
-   |
-   = note: expected type `i32`
-              found type `u32`
 
 error[E0308]: if and else have incompatible types
   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:31:9
@@ -55,9 +46,6 @@ LL | |         1u32
 LL | |
 LL | |     }
    | |_____- if and else have incompatible types
-   |
-   = note: expected type `i32`
-              found type `u32`
 
 error[E0308]: mismatched types
   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:39:14
@@ -69,9 +57,6 @@ LL |         0 => return 0i32,
    |                     ---- ...is found to be `i32` here
 LL |         _ => 1u32,
    |              ^^^^ expected i32, found u32
-   |
-   = note: expected type `i32`
-              found type `u32`
 
 error[E0308]: mismatched types
   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:45:5
@@ -86,9 +71,6 @@ LL | |         1 => 1u32,
 LL | |         _ => 2u32,
 LL | |     }
    | |_____^ expected i32, found u32
-   |
-   = note: expected type `i32`
-              found type `u32`
 
 error[E0308]: mismatched types
   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:59:13
@@ -101,9 +83,6 @@ LL |             return 0i32;
 ...
 LL |             1u32
    |             ^^^^ expected i32, found u32
-   |
-   = note: expected type `i32`
-              found type `u32`
 
 error: aborting due to 7 previous errors
 
index e8e3b488209e8025de79226f57dea006b0cab497..34a203300949b41123f7b41843452e81cb765147 100644 (file)
@@ -2,19 +2,13 @@ error[E0308]: mismatched types
   --> $DIR/attribute-spans-preserved.rs:7:23
    |
 LL | #[ foo ( let y: u32 = "z"; ) ]
-   |                       ^^^ expected u32, found reference
-   |
-   = note:   expected type `u32`
-           found reference `&'static str`
+   |                       ^^^ expected u32, found &str
 
 error[E0308]: mismatched types
   --> $DIR/attribute-spans-preserved.rs:8:23
    |
 LL | #[ bar { let x: u32 = "y"; } ]
-   |                       ^^^ expected u32, found reference
-   |
-   = note:   expected type `u32`
-           found reference `&'static str`
+   |                       ^^^ expected u32, found &str
 
 error: aborting due to 2 previous errors
 
index 73d0e2ef66e7769ef07b9af98e03bb1877143a7b..e810e9ad658829ff2eefea25644a47e1517c0233 100644 (file)
@@ -2,37 +2,25 @@ error[E0308]: mismatched types
   --> $DIR/attribute-with-error.rs:10:18
    |
 LL |     let a: i32 = "foo";
-   |                  ^^^^^ expected i32, found reference
-   |
-   = note:   expected type `i32`
-           found reference `&'static str`
+   |                  ^^^^^ expected i32, found &str
 
 error[E0308]: mismatched types
   --> $DIR/attribute-with-error.rs:12:18
    |
 LL |     let b: i32 = "f'oo";
-   |                  ^^^^^^ expected i32, found reference
-   |
-   = note:   expected type `i32`
-           found reference `&'static str`
+   |                  ^^^^^^ expected i32, found &str
 
 error[E0308]: mismatched types
   --> $DIR/attribute-with-error.rs:25:22
    |
 LL |         let a: i32 = "foo";
-   |                      ^^^^^ expected i32, found reference
-   |
-   = note:   expected type `i32`
-           found reference `&'static str`
+   |                      ^^^^^ expected i32, found &str
 
 error[E0308]: mismatched types
   --> $DIR/attribute-with-error.rs:35:22
    |
 LL |         let a: i32 = "foo";
-   |                      ^^^^^ expected i32, found reference
-   |
-   = note:   expected type `i32`
-           found reference `&'static str`
+   |                      ^^^^^ expected i32, found &str
 
 error: aborting due to 4 previous errors
 
index b8776c29057c1db027a27fbb2b46f68190887f4f..e6d1c9356ea76c63142cafe3810195b7ef12fbdc 100644 (file)
@@ -2,19 +2,13 @@ error[E0308]: mismatched types
   --> $DIR/nested-item-spans.rs:9:22
    |
 LL |         let x: u32 = "x";
-   |                      ^^^ expected u32, found reference
-   |
-   = note:   expected type `u32`
-           found reference `&'static str`
+   |                      ^^^ expected u32, found &str
 
 error[E0308]: mismatched types
   --> $DIR/nested-item-spans.rs:18:22
    |
 LL |         let x: u32 = "x";
-   |                      ^^^ expected u32, found reference
-   |
-   = note:   expected type `u32`
-           found reference `&'static str`
+   |                      ^^^ expected u32, found &str
 
 error: aborting due to 2 previous errors
 
index 60fb9755003276e2d4ae521a803f1e8be6000a43..86d2bee20683bcf3671edfa2a39cc6322cf359e4 100644 (file)
@@ -2,10 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/span-preservation.rs:11:20
    |
 LL |     let x: usize = "hello";
-   |                    ^^^^^^^ expected usize, found reference
-   |
-   = note:   expected type `usize`
-           found reference `&'static str`
+   |                    ^^^^^^^ expected usize, found &str
 
 error[E0308]: mismatched types
   --> $DIR/span-preservation.rs:17:29
@@ -48,9 +45,6 @@ LL | extern "C" fn baz() {
    |                     - possibly return type missing here?
 LL |     0
    |     ^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/span-preservation.rs:49:5
index cd1b9336ac7701c996d32fedb73f3fb1dda58559..7e899ec37d244adfe69fb30efa497767b15ba9ba 100644 (file)
@@ -7,21 +7,15 @@ fn main() {
     let b = [0; ()];
     //~^ ERROR mismatched types
     //~| expected usize, found ()
-    //~| expected type `usize`
-    //~| found unit type `()`
     let c = [0; true];
     //~^ ERROR mismatched types
     //~| expected usize, found bool
     let d = [0; 0.5];
     //~^ ERROR mismatched types
     //~| expected usize, found floating-point number
-    //~| expected type `usize`
-    //~| found type `{float}`
     let e = [0; "foo"];
     //~^ ERROR mismatched types
-    //~| expected usize, found reference
-    //~| expected type `usize`
-    //~| found reference `&'static str`
+    //~| expected usize, found &str
     let f = [0; -4_isize];
     //~^ ERROR mismatched types
     //~| expected usize, found isize
@@ -34,6 +28,4 @@ struct G {
     let g = [0; G { g: () }];
     //~^ ERROR mismatched types
     //~| expected usize, found struct `main::G`
-    //~| expected type `usize`
-    //~| found struct `main::G`
 }
index 056cad6127f1a2945f8815152878a75f1b6e1f85..76e90af7557a8f8fa6a0b0b1ee79831feef29987 100644 (file)
@@ -9,36 +9,27 @@ error[E0308]: mismatched types
    |
 LL |     let b = [0; ()];
    |                 ^^ expected usize, found ()
-   |
-   = note:   expected type `usize`
-           found unit type `()`
 
 error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:12:17
+  --> $DIR/repeat_count.rs:10:17
    |
 LL |     let c = [0; true];
    |                 ^^^^ expected usize, found bool
 
 error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:15:17
+  --> $DIR/repeat_count.rs:13:17
    |
 LL |     let d = [0; 0.5];
    |                 ^^^ expected usize, found floating-point number
-   |
-   = note: expected type `usize`
-              found type `{float}`
 
 error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:20:17
+  --> $DIR/repeat_count.rs:16:17
    |
 LL |     let e = [0; "foo"];
-   |                 ^^^^^ expected usize, found reference
-   |
-   = note:   expected type `usize`
-           found reference `&'static str`
+   |                 ^^^^^ expected usize, found &str
 
 error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:25:17
+  --> $DIR/repeat_count.rs:19:17
    |
 LL |     let f = [0; -4_isize];
    |                 ^^^^^^^^ expected usize, found isize
@@ -49,7 +40,7 @@ LL |     let f = [0; (-4_isize).try_into().unwrap()];
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:28:23
+  --> $DIR/repeat_count.rs:22:23
    |
 LL |     let f = [0_usize; -1_isize];
    |                       ^^^^^^^^ expected usize, found isize
@@ -60,13 +51,10 @@ LL |     let f = [0_usize; (-1_isize).try_into().unwrap()];
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:34:17
+  --> $DIR/repeat_count.rs:28:17
    |
 LL |     let g = [0; G { g: () }];
    |                 ^^^^^^^^^^^ expected usize, found struct `main::G`
-   |
-   = note: expected type `usize`
-            found struct `main::G`
 
 error: aborting due to 8 previous errors
 
index 6f660872f5e5858a4f49ac999b4ea6c6458eca1a..361c79dabd14faa868a0d8d1638e0983e7f3c4cf 100644 (file)
@@ -25,18 +25,12 @@ error[E0308]: mismatched types
    |
 LL |       Opts::A(ref i) | Opts::B(i) => {}
    |                                ^ expected &isize, found isize
-   |
-   = note: expected type `&isize`
-              found type `isize`
 
 error[E0308]: mismatched types
   --> $DIR/resolve-inconsistent-binding-mode.rs:16:32
    |
 LL |       Opts::A(ref i) | Opts::B(i) => {}
    |                                ^ expected &isize, found isize
-   |
-   = note: expected type `&isize`
-              found type `isize`
 
 error[E0308]: mismatched types
   --> $DIR/resolve-inconsistent-binding-mode.rs:25:36
index f02867a0024b558d78b95be8e9e19235c42f8ca1..04edc2da2565151eb0c7d20e97c6795dfd6406f7 100644 (file)
@@ -88,9 +88,6 @@ error[E0308]: mismatched types
    |
 LL |         (A, B) | (ref B, c) | (c, A) => ()
    |                   ^^^^^ expected enum `E`, found &E
-   |
-   = note: expected type `E`
-              found type `&E`
 
 error: aborting due to 9 previous errors
 
index 31f86bdf15de6a04c7b4ff54914178d0b2725af5..c1dcc1d5d8fb5d9244a0a8e8d75fa1a980595ec0 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn fail() -> ! {
    |              - expected `!` because of return type
 LL |     return "wow";
-   |            ^^^^^ expected !, found reference
+   |            ^^^^^ expected !, found &str
    |
    = note:   expected type `!`
            found reference `&'static str`
index e536ed50de1539538f8b3e00cdee346c22ca5791..8e1873c06593d9111c64528945236b934d0351b5 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |         FOO => {},
    |         ^^^ expected &Foo, found struct `Foo`
-   |
-   = note: expected type `&Foo`
-            found struct `Foo`
 
 error: aborting due to previous error
 
index f8df0b4ada0826b0b7395d632fcbe2500e371287..fd48c56c07b798360cf6d7f11765536afcf0c0df 100644 (file)
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
   --> $DIR/lit.rs:16:9
    |
 LL |         b"abc" => true,
-   |         ^^^^^^ expected &[u8], found array of 3 elements
+   |         ^^^^^^ expected &[u8], found array `[u8; 3]`
    |
    = note:   expected type `&&[u8]`
            found reference `&'static [u8; 3]`
index 0a597eaa1ffcdd718ed333b5b878c124b06b5016..d2d319f50c78dfffc0dfa7d74ec9a4f8a8ecdac0 100644 (file)
@@ -5,9 +5,6 @@ LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A {
    |                                                                - expected `A` because of return type
 LL |     x
    |     ^ expected struct `A`, found enum `uninhabited::UninhabitedEnum`
-   |
-   = note: expected struct `A`
-                found enum `uninhabited::UninhabitedEnum`
 
 error[E0308]: mismatched types
   --> $DIR/coercions.rs:27:5
@@ -16,9 +13,6 @@ LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct)
    |                                                                               - expected `A` because of return type
 LL |     x
    |     ^ expected struct `A`, found struct `uninhabited::UninhabitedTupleStruct`
-   |
-   = note: expected struct `A`
-              found struct `uninhabited::UninhabitedTupleStruct`
 
 error[E0308]: mismatched types
   --> $DIR/coercions.rs:31:5
@@ -27,9 +21,6 @@ LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A {
    |                                                                    - expected `A` because of return type
 LL |     x
    |     ^ expected struct `A`, found struct `uninhabited::UninhabitedStruct`
-   |
-   = note: expected struct `A`
-              found struct `uninhabited::UninhabitedStruct`
 
 error[E0308]: mismatched types
   --> $DIR/coercions.rs:35:5
@@ -38,9 +29,6 @@ LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariant
    |                                                                                  - expected `A` because of return type
 LL |     x
    |     ^ expected struct `A`, found enum `uninhabited::UninhabitedVariants`
-   |
-   = note: expected struct `A`
-                found enum `uninhabited::UninhabitedVariants`
 
 error: aborting due to 4 previous errors
 
index 6d7383b38960b53e8a259c02c6f8b30908ee476f..fd2c56974bd4ac7567262ce420c41e9b72ad5750 100644 (file)
@@ -5,9 +5,6 @@ LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A {
    |                                                                - expected `A` because of return type
 LL |     x
    |     ^ expected struct `A`, found enum `UninhabitedEnum`
-   |
-   = note: expected struct `A`
-                found enum `UninhabitedEnum`
 
 error[E0308]: mismatched types
   --> $DIR/coercions_same_crate.rs:34:5
@@ -16,9 +13,6 @@ LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct)
    |                                                                               - expected `A` because of return type
 LL |     x
    |     ^ expected struct `A`, found struct `UninhabitedTupleStruct`
-   |
-   = note: expected struct `A`
-              found struct `UninhabitedTupleStruct`
 
 error[E0308]: mismatched types
   --> $DIR/coercions_same_crate.rs:38:5
@@ -27,9 +21,6 @@ LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A {
    |                                                                    - expected `A` because of return type
 LL |     x
    |     ^ expected struct `A`, found struct `UninhabitedStruct`
-   |
-   = note: expected struct `A`
-              found struct `UninhabitedStruct`
 
 error[E0308]: mismatched types
   --> $DIR/coercions_same_crate.rs:42:5
@@ -38,9 +29,6 @@ LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariant
    |                                                                                  - expected `A` because of return type
 LL |     x
    |     ^ expected struct `A`, found enum `UninhabitedVariants`
-   |
-   = note: expected struct `A`
-                found enum `UninhabitedVariants`
 
 error: aborting due to 4 previous errors
 
index b7f16a8d5bbd9d62de4d5bc2ccadeddab6d00520..a04b109ba6d3c9e36e7d4f40bc0c66c9e175b511 100644 (file)
@@ -539,9 +539,6 @@ LL |     if &let 0 = 0 {}
    |        |
    |        expected bool, found &bool
    |        help: consider removing the borrow: `let 0 = 0`
-   |
-   = note:   expected type `bool`
-           found reference `&bool`
 
 error[E0614]: type `bool` cannot be dereferenced
   --> $DIR/disallowed-positions.rs:36:8
@@ -583,9 +580,6 @@ LL |     if x = let 0 = 0 {}
    |        |
    |        expected bool, found ()
    |        help: try comparing for equality: `x == let 0 = 0`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:59:8
@@ -697,9 +691,6 @@ error[E0308]: mismatched types
    |
 LL |     if let Range { start: true, end } = t..&&false {}
    |                                            ^^^^^^^ expected bool, found &&bool
-   |
-   = note:   expected type `bool`
-           found reference `&&bool`
 
 error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:86:8
@@ -727,9 +718,6 @@ LL |     while &let 0 = 0 {}
    |           |
    |           expected bool, found &bool
    |           help: consider removing the borrow: `let 0 = 0`
-   |
-   = note:   expected type `bool`
-           found reference `&bool`
 
 error[E0614]: type `bool` cannot be dereferenced
   --> $DIR/disallowed-positions.rs:100:11
@@ -771,9 +759,6 @@ LL |     while x = let 0 = 0 {}
    |           |
    |           expected bool, found ()
    |           help: try comparing for equality: `x == let 0 = 0`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:123:11
@@ -885,9 +870,6 @@ error[E0308]: mismatched types
    |
 LL |     while let Range { start: true, end } = t..&&false {}
    |                                               ^^^^^^^ expected bool, found &&bool
-   |
-   = note:   expected type `bool`
-           found reference `&&bool`
 
 error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:150:11
@@ -958,9 +940,6 @@ LL | fn outside_if_and_while_expr() {
 ...
 LL |     &let 0 = 0
    |     ^^^^^^^^^^ expected (), found &bool
-   |
-   = note: expected unit type `()`
-              found reference `&bool`
 
 error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
   --> $DIR/disallowed-positions.rs:179:17
index 84b92a7c04adde198b6f3b28242aaf9254e32b36..da9ac04e34883474ce0b38673999c5111e38d840 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     let x: usize = String::new();
    |                    ^^^^^^^^^^^^^ expected usize, found struct `std::string::String`
-   |
-   = note: expected type `usize`
-            found struct `std::string::String`
 
 error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:9:19
@@ -15,9 +12,6 @@ LL |     let x: &str = String::new();
    |                   |
    |                   expected &str, found struct `std::string::String`
    |                   help: consider borrowing here: `&String::new()`
-   |
-   = note: expected reference `&str`
-                 found struct `std::string::String`
 
 error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:12:10
@@ -50,10 +44,8 @@ error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:21:9
    |
 LL |     s = format!("foo");
-   |         ^^^^^^^^^^^^^^ expected mutable reference, found struct `std::string::String`
+   |         ^^^^^^^^^^^^^^ expected &mut std::string::String, found struct `std::string::String`
    |
-   = note: expected mutable reference `&mut std::string::String`
-                         found struct `std::string::String`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
 error: aborting due to 6 previous errors
index 4cb2fc24a05496d63ba11745104bf4e61b5b6875..4f46c4c73943682e33ee94ea67ba26602a70d098 100644 (file)
@@ -4,8 +4,6 @@ error[E0308]: mismatched types
 LL |     stream.write_fmt(format!("message received"))
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::fmt::Arguments`, found struct `std::string::String`
    |
-   = note: expected struct `std::fmt::Arguments<'_>`
-              found struct `std::string::String`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
 error: aborting due to previous error
index a9cf323c990576c76f591e4e93c4b7b6964fcd7c..c0e9d6cfab8cfc3474a63c82954955a4799c44fb 100644 (file)
@@ -55,10 +55,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-34264.rs:8:13
    |
 LL |     bar("", "");
-   |             ^^ expected usize, found reference
-   |
-   = note:   expected type `usize`
-           found reference `&'static str`
+   |             ^^ expected usize, found &str
 
 error[E0061]: this function takes 2 parameters but 3 parameters were supplied
   --> $DIR/issue-34264.rs:10:5
index 8ce1dfb11bca20de95d299f845c6bd54b14b9f26..e2ba768d7a3e810b1086e29ef547f125a469f544 100644 (file)
@@ -72,9 +72,6 @@ LL |     let _ = a + b;
    |                 |
    |                 expected &str, found struct `std::string::String`
    |                 help: consider borrowing here: `&b`
-   |
-   = note: expected reference `&str`
-                 found struct `std::string::String`
 
 error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
   --> $DIR/issue-39018.rs:30:15
index 9f790d33659392b032c2536200151b7124dc5488..e8678b439d4a041066e17c6e5c255e4d00cf8947 100644 (file)
@@ -5,9 +5,6 @@ LL |   let t = if true { s[..2] } else { s };
    |                     ------          ^ expected str, found &str
    |                     |
    |                     expected because of this
-   |
-   = note:   expected type `str`
-           found reference `&str`
 
 error[E0308]: mismatched types
   --> $DIR/str-array-assignment.rs:5:27
@@ -17,9 +14,6 @@ LL |   let u: &str = if true { s[..2] } else { s };
    |                           |
    |                           expected &str, found str
    |                           help: consider borrowing here: `&s[..2]`
-   |
-   = note: expected reference `&str`
-                   found type `str`
 
 error[E0277]: the size for values of type `str` cannot be known at compilation time
   --> $DIR/str-array-assignment.rs:7:7
@@ -42,9 +36,6 @@ LL |   let w: &str = s[..2];
    |                 |
    |                 expected &str, found str
    |                 help: consider borrowing here: `&s[..2]`
-   |
-   = note: expected reference `&str`
-                   found type `str`
 
 error: aborting due to 4 previous errors
 
index e328bb33c837be5c6d270f2c8f00801913224bfb..af66fe8b88049c6271f4bf1bb479fbeed45c07ad 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     let x: &[u8] = "foo";
    |                    ^^^^^
    |                    |
-   |                    expected slice, found str
+   |                    expected slice `[u8]`, found str
    |                    help: consider adding a leading `b`: `b"foo"`
    |
    = note: expected reference `&[u8]`
@@ -16,7 +16,7 @@ error[E0308]: mismatched types
 LL |     let y: &[u8; 4] = "baaa";
    |                       ^^^^^^
    |                       |
-   |                       expected array of 4 elements, found str
+   |                       expected array `[u8; 4]`, found str
    |                       help: consider adding a leading `b`: `b"baaa"`
    |
    = note: expected reference `&[u8; 4]`
@@ -28,7 +28,7 @@ error[E0308]: mismatched types
 LL |     let z: &str = b"foo";
    |                   ^^^^^^
    |                   |
-   |                   expected str, found array of 3 elements
+   |                   expected str, found array `[u8; 3]`
    |                   help: consider removing the leading `b`: `"foo"`
    |
    = note: expected reference `&str`
index 8c7475e622a21a8a07b80c7a0929785c70e4ea0a..e89111ca2c8a8899c1083c736f00867ebf68bc39 100644 (file)
@@ -58,18 +58,12 @@ LL |     if x == E::V { field } {}
    |     |              |
    |     |              expected (), found bool
    |     expected this to be `()`
-   |
-   = note: expected unit type `()`
-                   found type `bool`
 
 error[E0308]: mismatched types
   --> $DIR/struct-literal-variant-in-if.rs:21:20
    |
 LL |     let y: usize = ();
    |                    ^^ expected usize, found ()
-   |
-   = note:   expected type `usize`
-           found unit type `()`
 
 error: aborting due to 7 previous errors
 
index c0bd9bda451850674fedcea92111f58f76f56a64..b039ce2cc9209fc81f5e967dd762c032c5ec57c3 100644 (file)
@@ -3,36 +3,24 @@ error[E0308]: mismatched types
    |
 LL | static foo: Foo = Foo { a: 2, ..bar };
    |                                 ^^^ expected struct `Foo`, found struct `Bar`
-   |
-   = note: expected struct `Foo`
-              found struct `Bar`
 
 error[E0308]: mismatched types
   --> $DIR/struct-base-wrong-type.rs:8:35
    |
 LL | static foo_i: Foo = Foo { a: 2, ..4 };
    |                                   ^ expected struct `Foo`, found integer
-   |
-   = note: expected struct `Foo`
-                found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/struct-base-wrong-type.rs:12:27
    |
 LL |     let f = Foo { a: 2, ..b };
    |                           ^ expected struct `Foo`, found struct `Bar`
-   |
-   = note: expected struct `Foo`
-              found struct `Bar`
 
 error[E0308]: mismatched types
   --> $DIR/struct-base-wrong-type.rs:13:34
    |
 LL |     let f__isize = Foo { a: 2, ..4 };
    |                                  ^ expected struct `Foo`, found integer
-   |
-   = note: expected struct `Foo`
-                found type `{integer}`
 
 error: aborting due to 4 previous errors
 
index 4a78fa3896ffa96aab6a5f6e15435e7fb8574022..f184f81647d13743180189a41285ca3eef50f537 100644 (file)
@@ -6,9 +6,6 @@ LL |         x: 1,
    |            |
    |            expected f32, found integer
    |            help: use a float literal: `1.0`
-   |
-   = note: expected type `f32`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/structure-constructor-type-mismatch.rs:20:12
@@ -18,9 +15,6 @@ LL |         y: 2,
    |            |
    |            expected f32, found integer
    |            help: use a float literal: `2.0`
-   |
-   = note: expected type `f32`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/structure-constructor-type-mismatch.rs:26:12
@@ -30,9 +24,6 @@ LL |         x: 3,
    |            |
    |            expected f32, found integer
    |            help: use a float literal: `3.0`
-   |
-   = note: expected type `f32`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/structure-constructor-type-mismatch.rs:29:12
@@ -42,9 +33,6 @@ LL |         y: 4,
    |            |
    |            expected f32, found integer
    |            help: use a float literal: `4.0`
-   |
-   = note: expected type `f32`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/structure-constructor-type-mismatch.rs:35:12
@@ -54,9 +42,6 @@ LL |         x: 5,
    |            |
    |            expected f32, found integer
    |            help: use a float literal: `5.0`
-   |
-   = note: expected type `f32`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/structure-constructor-type-mismatch.rs:42:12
@@ -66,9 +51,6 @@ LL |         x: 7,
    |            |
    |            expected f32, found integer
    |            help: use a float literal: `7.0`
-   |
-   = note: expected type `f32`
-              found type `{integer}`
 
 error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/structure-constructor-type-mismatch.rs:48:24
@@ -84,9 +66,6 @@ LL |         x: 9,
    |            |
    |            expected f32, found integer
    |            help: use a float literal: `9.0`
-   |
-   = note: expected type `f32`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/structure-constructor-type-mismatch.rs:50:12
@@ -96,9 +75,6 @@ LL |         y: 10,
    |            |
    |            expected f32, found integer
    |            help: use a float literal: `10.0`
-   |
-   = note: expected type `f32`
-              found type `{integer}`
 
 error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/structure-constructor-type-mismatch.rs:54:18
index d01c37351951f396eb6e19fdf80c2d40c6d66ad4..5379f77ae5c31e9731dfa563c4edbfedb7d9ba1c 100644 (file)
@@ -5,9 +5,6 @@ LL |   opt.map(|arg| takes_ref(arg));
    |       ---                 ^^^ expected &Foo, found struct `Foo`
    |       |
    |       help: consider using `as_ref` instead: `as_ref().map`
-   |
-   = note: expected reference `&Foo`
-                 found struct `Foo`
 
 error[E0308]: mismatched types
   --> $DIR/as-ref.rs:8:37
@@ -16,9 +13,6 @@ LL |   opt.and_then(|arg| Some(takes_ref(arg)));
    |       --------                      ^^^ expected &Foo, found struct `Foo`
    |       |
    |       help: consider using `as_ref` instead: `as_ref().and_then`
-   |
-   = note: expected reference `&Foo`
-                 found struct `Foo`
 
 error[E0308]: mismatched types
   --> $DIR/as-ref.rs:11:27
@@ -27,9 +21,6 @@ LL |   opt.map(|arg| takes_ref(arg));
    |       ---                 ^^^ expected &Foo, found struct `Foo`
    |       |
    |       help: consider using `as_ref` instead: `as_ref().map`
-   |
-   = note: expected reference `&Foo`
-                 found struct `Foo`
 
 error[E0308]: mismatched types
   --> $DIR/as-ref.rs:13:35
@@ -38,9 +29,6 @@ LL |   opt.and_then(|arg| Ok(takes_ref(arg)));
    |       --------                    ^^^ expected &Foo, found struct `Foo`
    |       |
    |       help: consider using `as_ref` instead: `as_ref().and_then`
-   |
-   = note: expected reference `&Foo`
-                 found struct `Foo`
 
 error[E0308]: mismatched types
   --> $DIR/as-ref.rs:16:27
index 66f6bf91cc28966e5d807a57792b3a436a64b660..7ec1daacb6142758da47bc7e3395eb65b2c628f6 100644 (file)
@@ -9,8 +9,6 @@ LL | |     };
    | |______expected &str, found struct `std::string::String`
    |        in this macro invocation
    |
-   = note: expected reference `&str`
-                 found struct `std::string::String`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
 error: aborting due to previous error
index 7f1cec2d21881761e178a3a146be085bfeff8d4a..d43a249d9cc966ec33a7d8ef47b9aa7c53d3a82c 100644 (file)
@@ -4,11 +4,8 @@ error[E0308]: mismatched types
 LL |     let a: String = &String::from("a");
    |                     ^^^^^^^^^^^^^^^^^^
    |                     |
-   |                     expected struct `std::string::String`, found reference
+   |                     expected struct `std::string::String`, found &std::string::String
    |                     help: consider removing the borrow: `String::from("a")`
-   |
-   = note: expected struct `std::string::String`
-           found reference `&std::string::String`
 
 error[E0308]: mismatched types
   --> $DIR/format-borrow.rs:4:21
@@ -16,11 +13,8 @@ error[E0308]: mismatched types
 LL |     let b: String = &format!("b");
    |                     ^^^^^^^^^^^^^
    |                     |
-   |                     expected struct `std::string::String`, found reference
+   |                     expected struct `std::string::String`, found &std::string::String
    |                     help: consider removing the borrow: `format!("b")`
-   |
-   = note: expected struct `std::string::String`
-           found reference `&std::string::String`
 
 error: aborting due to 2 previous errors
 
index 0b064d196750e789f7bc639cc47f3bad7a349d3b..ba7457df0693e9accf6387dcd48562e40821a2a2 100644 (file)
@@ -6,9 +6,6 @@ LL |         guts,
    |         |
    |         expected struct `std::string::String`, found &str
    |         help: try using a conversion method: `guts: guts.to_string()`
-   |
-   = note: expected struct `std::string::String`
-           found reference `&str`
 
 error[E0308]: mismatched types
   --> $DIR/issue-52820.rs:10:17
@@ -18,9 +15,6 @@ LL |         brains: guts.clone(),
    |                 |
    |                 expected struct `std::string::String`, found &str
    |                 help: try using a conversion method: `guts.to_string()`
-   |
-   = note: expected struct `std::string::String`
-           found reference `&str`
 
 error: aborting due to 2 previous errors
 
index b04ab374f0f0ff2275faa41ba6b2284f8a4d85e5..331a6a53b123934b00d9fb2d3a18d92b45d2a44d 100644 (file)
@@ -6,9 +6,6 @@ LL |     let y: i32 = x;
    |                  |
    |                  expected i32, found struct `Foo`
    |                  help: consider dereferencing the type: `*x`
-   |
-   = note: expected type `i32`
-            found struct `Foo`
 
 error[E0308]: mismatched types
   --> $DIR/issue-59819.rs:30:18
@@ -18,9 +15,6 @@ LL |     let b: i32 = a;
    |                  |
    |                  expected i32, found &{integer}
    |                  help: consider dereferencing the borrow: `*a`
-   |
-   = note:   expected type `i32`
-           found reference `&{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/issue-59819.rs:34:21
@@ -30,9 +24,6 @@ LL |     let g: String = f;
    |                     |
    |                     expected struct `std::string::String`, found struct `Bar`
    |                     help: try using a conversion method: `f.to_string()`
-   |
-   = note: expected struct `std::string::String`
-              found struct `Bar`
 
 error: aborting due to 3 previous errors
 
index eccd9d01fec5e69c5fa9c786ae6406f34a28d57e..c9e263d0db8428b9a5e6d8f4326f50e62eac67ba 100644 (file)
@@ -12,9 +12,6 @@ LL | |     }
    | |     -- help: consider using a semicolon here
    | |_____|
    |       expected this to be `()`
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/match-needing-semi.rs:12:5
@@ -27,9 +24,6 @@ LL | |     }
    | |     ^- help: consider using a semicolon here
    | |_____|
    |       expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error: aborting due to 2 previous errors
 
index 36548a3dfcbfa49c2467cb82010fb1b9cd27d606..44c07a7c83a8bc424b7f81928a2882a42aba9c0d 100644 (file)
@@ -23,27 +23,18 @@ error[E0308]: mismatched types
    |
 LL |     let _: usize = S {};
    |                    ^^^^ expected usize, found struct `S`
-   |
-   = note: expected type `usize`
-            found struct `S`
 
 error[E0308]: mismatched types
   --> $DIR/recover-from-semicolon-trailing-item.rs:12:20
    |
 LL |     let _: usize = X {};
    |                    ^^^^ expected usize, found struct `main::X`
-   |
-   = note: expected type `usize`
-            found struct `main::X`
 
 error[E0308]: mismatched types
   --> $DIR/recover-from-semicolon-trailing-item.rs:14:9
    |
 LL |     foo("");
-   |         ^^ expected usize, found reference
-   |
-   = note:   expected type `usize`
-           found reference `&'static str`
+   |         ^^ expected usize, found &str
 
 error: aborting due to 6 previous errors
 
index b38c0d93099802d482736e40dc988a7ba63dd276..d65adea1ed426d23403b1dca354298758954aa2a 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     let ref string: String = var;
    |                              ^^^ expected struct `std::string::String`, found i32
-   |
-   = note: expected struct `std::string::String`
-                found type `i32`
 
 error: aborting due to previous error
 
index fca72817d651f5655fb92789103bc4c06c4c2ede..5e49fcdf95a878ee82f0bacd013286b1cb789a34 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 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
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error: aborting due to previous error
 
index e1b73104521a876f77d95330f2aaaba57a8189f1..cea937ca8b1557850259013283465bb3963ca234 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL | ...♯♰♱♲♳♴♵♶♷♸♹♺♻♼♽♾♿⚀⚁⚂⚃⚄⚅⚆⚈⚉4"; let _: () = 42;  let _: &str = "🦀☀☁☂☃☄★☆☇☈☉☊☋☌☍☎☏☐☑☒☓  ☖☗☘☙☚☛☜☝☞☟☠☡☢☣☤☥☦☧☨☩☪☫☬☭☮☯☰☱☲☳☴☵☶☷☸☹☺☻☼☽☾☿♀♁♂♃♄♅♆...
    |                                               ^^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error: aborting due to previous error
 
index 72b1502fbf23ee91e917bc4cf847ea4350a9cb5d..b024d2ace37afd2da48f2af841198943b8a66be1 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL | ...) = (); let _: () = (); let _: () = (); let _: () = 42; let _: () = (); let _: () = (); let _: () = (); let _: () = (); let _: () = ()...
    |                                                        ^^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error: aborting due to previous error
 
index dae00b902dcf8b982110eaeb71ebf7f281712cbf..3013019df269ffa65a4fe0edd2d164631c82ef70 100644 (file)
@@ -5,9 +5,6 @@ LL | ...-> usize {
    |       ----- expected `usize` because of return type
 LL | ...                                                                                                                                                                                 ()
    |                                                                                                                                                                                     ^^ expected usize, found ()
-   |
-   = note:   expected type `usize`
-           found unit type `()`
 
 error: aborting due to previous error
 
index 4a1f8f6f84669bdff2ec3af550afabce14218191..d3064d8bfb9765d63a09c16b91b8bcc94d6c20b6 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL | ...                   let _: () = 42;
    |                                   ^^ expected (), found integer
-   |
-   = note: expected unit type `()`
-                   found type `{integer}`
 
 error: aborting due to previous error
 
index 80834985471d5242a267372e94c10e0a678159c7..aa801fd0a6c64b15b86dccdefbd057cf3ee98865 100644 (file)
@@ -12,8 +12,6 @@ fn want_foo(f: Foo) {}
 fn have_bar(b: Bar) {
     want_foo(b); //~  ERROR mismatched types
                  //~| expected struct `Foo`, found struct `Bar`
-                 //~| expected struct `Foo`
-                 //~| found struct `Bar`
 }
 
 fn main() {}
index ef6412a633babf8b3720ad245e57eb9e8e24fe08..5c6859a0efe98a353db191d68ea39f93010dd1b4 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL |     want_foo(b);
    |              ^ expected struct `Foo`, found struct `Bar`
-   |
-   = note: expected struct `Foo`
-              found struct `Bar`
 
 error: aborting due to previous error
 
index 44643e8c8de43719c88b908dae45454061baf54f..19374ba49c5c7efd34db130ccef92dc9e8b67353 100644 (file)
@@ -3,9 +3,6 @@ error[E0271]: type mismatch resolving `<std::vec::IntoIter<i32> as std::iter::It
    |
 LL | impl Foo for IntoIter<i32> {
    |      ^^^ expected i32, found u32
-   |
-   = note: expected type `i32`
-              found type `u32`
 
 error: aborting due to previous error
 
index 722b7a3b60a63443aaa0cb23f512129be621440f..75ff998d3bf079fc57d4e9e18ff1d522b8ae37e0 100644 (file)
@@ -18,18 +18,12 @@ error[E0271]: type mismatch resolving `<std::result::Result<i32, i32> as std::op
    |
 LL |         ""
    |         ^^ expected i32, found &str
-   |
-   = note:   expected type `i32`
-           found reference `&str`
 
 error[E0271]: type mismatch resolving `<std::result::Result<i32, i32> as std::ops::Try>::Ok == ()`
   --> $DIR/try-block-bad-type.rs:15:39
    |
 LL |     let res: Result<i32, i32> = try { };
    |                                       ^ expected i32, found ()
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error[E0277]: the trait bound `(): std::ops::Try` is not satisfied
   --> $DIR/try-block-bad-type.rs:17:23
index 0dd81d8e152fe006dee6417524597b86215a530b..63f2c02bc71029b76d97b15ad98c5622e726f891 100644 (file)
@@ -6,18 +6,12 @@ LL |         42
    |         |
    |         expected f32, found integer
    |         help: use a float literal: `42.0`
-   |
-   = note: expected type `f32`
-              found type `{integer}`
 
 error[E0271]: type mismatch resolving `<std::option::Option<i32> as std::ops::Try>::Ok == ()`
   --> $DIR/try-block-type-error.rs:16:5
    |
 LL |     };
    |     ^ expected i32, found ()
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error: aborting due to 2 previous errors
 
index e6e82f4969230146aecfbdbf7ef143b2d5690016..a1afd5e9a0e255c1bd616a33e54eb3161e2d73f7 100644 (file)
@@ -12,9 +12,6 @@ error[E0308]: mismatched types
    |
 LL |     let _: u8 = <E2>::V;
    |                 ^^^^^^^ expected u8, found enum `E2`
-   |
-   = note: expected type `u8`
-              found enum `E2`
 
 error: aborting due to 2 previous errors
 
index 0a6d454a67f43ec3c6890ce2c8cf0693f18f152c..5411456b34b9851c21b7b6a6b4e54edcb124061a 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/never_reveal_concrete_type.rs:13:27
    |
 LL |     let _: &'static str = x;
-   |                           ^ expected reference, found opaque type
+   |                           ^ expected &str, found opaque type
    |
    = note: expected reference `&'static str`
             found opaque type `NoReveal`
index 366d6bad37a5f3f5102d479d46f66ce4cd32f7ab..aaf5e286643f96ef436a081d3ae60dff26980037 100644 (file)
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
 LL | fn bomp() -> boo::Boo {
    |              -------- expected `Boo` because of return type
 LL |     ""
-   |     ^^ expected opaque type, found reference
+   |     ^^ expected opaque type, found &str
    |
    = note: expected opaque type `Boo`
                 found reference `&'static str`
index ebb9c4199dc70812fd6eded6f426422152b01f06..5f42ed228dd0e220b87ab13e894853d1d0d7f9a0 100644 (file)
@@ -3,18 +3,12 @@ error[E0308]: mismatched types
    |
 LL |     &(S: &S);
    |       ^ expected &S, found struct `S`
-   |
-   = note: expected reference `&S`
-                 found struct `S`
 
 error[E0308]: mismatched types
   --> $DIR/type-ascription-precedence.rs:35:7
    |
 LL |     *(S: Z);
    |       ^ expected struct `Z`, found struct `S`
-   |
-   = note: expected struct `Z`
-              found struct `S`
 
 error[E0614]: type `Z` cannot be dereferenced
   --> $DIR/type-ascription-precedence.rs:35:5
@@ -27,9 +21,6 @@ error[E0308]: mismatched types
    |
 LL |     -(S: Z);
    |       ^ expected struct `Z`, found struct `S`
-   |
-   = note: expected struct `Z`
-              found struct `S`
 
 error[E0600]: cannot apply unary operator `-` to type `Z`
   --> $DIR/type-ascription-precedence.rs:40:5
@@ -44,18 +35,12 @@ error[E0308]: mismatched types
    |
 LL |     (S + Z): Z;
    |     ^^^^^^^ expected struct `Z`, found struct `S`
-   |
-   = note: expected struct `Z`
-              found struct `S`
 
 error[E0308]: mismatched types
   --> $DIR/type-ascription-precedence.rs:49:5
    |
 LL |     (S * Z): Z;
    |     ^^^^^^^ expected struct `Z`, found struct `S`
-   |
-   = note: expected struct `Z`
-              found struct `S`
 
 error[E0308]: mismatched types
   --> $DIR/type-ascription-precedence.rs:53:5
index d8803cad0113b24eac1c37de8067c2e35dfab79a..6ed940823af1af43d00654b28fde7ac3dc7e1c5b 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/type-ascription-soundness.rs:7:17
    |
 LL |     let ref x = arr: &[u8];
-   |                 ^^^ expected slice, found array of 3 elements
+   |                 ^^^ expected slice `[u8]`, found array `[u8; 3]`
    |
    = note: expected reference `&[u8]`
               found reference `&[u8; 3]`
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
   --> $DIR/type-ascription-soundness.rs:8:21
    |
 LL |     let ref mut x = arr: &[u8];
-   |                     ^^^ expected slice, found array of 3 elements
+   |                     ^^^ expected slice `[u8]`, found array `[u8; 3]`
    |
    = note: expected reference `&[u8]`
               found reference `&[u8; 3]`
@@ -20,7 +20,7 @@ error[E0308]: mismatched types
   --> $DIR/type-ascription-soundness.rs:9:11
    |
 LL |     match arr: &[u8] {
-   |           ^^^ expected slice, found array of 3 elements
+   |           ^^^ expected slice `[u8]`, found array `[u8; 3]`
    |
    = note: expected reference `&[u8]`
               found reference `&[u8; 3]`
@@ -29,7 +29,7 @@ error[E0308]: mismatched types
   --> $DIR/type-ascription-soundness.rs:12:17
    |
 LL |     let _len = (arr: &[u8]).len();
-   |                 ^^^ expected slice, found array of 3 elements
+   |                 ^^^ expected slice `[u8]`, found array `[u8; 3]`
    |
    = note: expected reference `&[u8]`
               found reference `&[u8; 3]`
index c6b42afa513b41dbe34cd38ea669506d8441b6b9..f210fd62d7dc7c7dab7e5537614926aa4d12942d 100644 (file)
@@ -6,9 +6,6 @@ LL |     let _: bool = 0 = 0;
    |                   |
    |                   expected bool, found ()
    |                   help: try comparing for equality: `0 == 0`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-expected-bool.rs:9:14
@@ -18,9 +15,6 @@ LL |         0 => 0 = 0,
    |              |
    |              expected bool, found ()
    |              help: try comparing for equality: `0 == 0`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-expected-bool.rs:10:14
@@ -30,9 +24,6 @@ LL |         _ => 0 = 0,
    |              |
    |              expected bool, found ()
    |              help: try comparing for equality: `0 == 0`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-expected-bool.rs:14:17
@@ -42,9 +33,6 @@ LL |         true => 0 = 0,
    |                 |
    |                 expected bool, found ()
    |                 help: try comparing for equality: `0 == 0`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-expected-bool.rs:18:8
@@ -54,9 +42,6 @@ LL |     if 0 = 0 {}
    |        |
    |        expected bool, found ()
    |        help: try comparing for equality: `0 == 0`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-expected-bool.rs:20:24
@@ -66,9 +51,6 @@ LL |     let _: bool = if { 0 = 0 } {
    |                        |
    |                        expected bool, found ()
    |                        help: try comparing for equality: `0 == 0`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-expected-bool.rs:21:9
@@ -78,9 +60,6 @@ LL |         0 = 0
    |         |
    |         expected bool, found ()
    |         help: try comparing for equality: `0 == 0`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-expected-bool.rs:23:9
@@ -90,9 +69,6 @@ LL |         0 = 0
    |         |
    |         expected bool, found ()
    |         help: try comparing for equality: `0 == 0`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-expected-bool.rs:26:13
@@ -102,9 +78,6 @@ LL |     let _ = (0 = 0)
    |             |
    |             expected bool, found ()
    |             help: try comparing for equality: `0 == 0`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-expected-bool.rs:27:14
@@ -114,9 +87,6 @@ LL |         && { 0 = 0 }
    |              |
    |              expected bool, found ()
    |              help: try comparing for equality: `0 == 0`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-expected-bool.rs:28:12
@@ -126,9 +96,6 @@ LL |         || (0 = 0);
    |            |
    |            expected bool, found ()
    |            help: try comparing for equality: `0 == 0`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0070]: invalid left-hand side expression
   --> $DIR/assignment-expected-bool.rs:31:20
@@ -141,9 +108,6 @@ error[E0308]: mismatched types
    |
 LL |     let _: usize = 0 = 0;
    |                    ^^^^^ expected usize, found ()
-   |
-   = note:   expected type `usize`
-           found unit type `()`
 
 error: aborting due to 13 previous errors
 
index 05280aab2ddfb9e21ddfe84a533f66a6ad6f1b9b..789902bbb94559e6f4dcf98aeac82102d3b8df3e 100644 (file)
@@ -6,9 +6,6 @@ LL |     if x = x {
    |        |
    |        expected bool, found ()
    |        help: try comparing for equality: `x == x`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-in-if.rs:20:8
@@ -18,9 +15,6 @@ LL |     if (x = x) {
    |        |
    |        expected bool, found ()
    |        help: try comparing for equality: `x == x`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-in-if.rs:25:8
@@ -30,9 +24,6 @@ LL |     if y = (Foo { foo: x }) {
    |        |
    |        expected bool, found ()
    |        help: try comparing for equality: `y == (Foo { foo: x })`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-in-if.rs:30:8
@@ -42,9 +33,6 @@ LL |     if 3 = x {
    |        |
    |        expected bool, found ()
    |        help: try comparing for equality: `3 == x`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-in-if.rs:36:13
@@ -54,9 +42,6 @@ LL |             x = 4
    |             |
    |             expected bool, found ()
    |             help: try comparing for equality: `x == 4`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error[E0308]: mismatched types
   --> $DIR/assignment-in-if.rs:38:13
@@ -66,9 +51,6 @@ LL |             x = 5
    |             |
    |             expected bool, found ()
    |             help: try comparing for equality: `x == 5`
-   |
-   = note:   expected type `bool`
-           found unit type `()`
 
 error: aborting due to 6 previous errors
 
index 47416c4f911f5e400445cf7dfa7f86369f16242c..720bde9371132e8bce180d47453f03c38ab5163f 100644 (file)
@@ -9,9 +9,6 @@ LL |         if false { break; }
    |                    |
    |                    expected i32, found ()
    |                    help: give it a value of the expected type: `break 42`
-   |
-   = note:   expected type `i32`
-           found unit type `()`
 
 error: aborting due to previous error
 
index b8f04ca8d4a33f07bcb08210d0370f60caac93c3..6270ee6471301f9eb03955d1333184f21436e489 100644 (file)
@@ -2,8 +2,6 @@
 
 fn main() { let a: bool = 1; let b: i32 = true; }
 //~^ ERROR mismatched types
-//~| expected type `bool`
-//~| found type `{integer}`
 //~| expected bool, found integer
 //~| ERROR mismatched types
 //~| expected i32, found bool
index 8f6b23ea091a23023f787e5ac8658055e19d98a0..6de8a056978cbe4be1d0441e85b7dae54a744837 100644 (file)
@@ -3,9 +3,6 @@ error[E0308]: mismatched types
    |
 LL | fn main() { let a: bool = 1; let b: i32 = true; }
    |                           ^ expected bool, found integer
-   |
-   = note: expected type `bool`
-              found type `{integer}`
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch-multiple.rs:3:43
index 88daffde504a534c1cb391d17b37f971024cc45a..b1f9a28e16d5610f8accc06f1b05d4ae5b0a943e 100644 (file)
@@ -17,8 +17,6 @@ fn main() {
         //~^ ERROR mismatched types
         //~| Perhaps two different versions of crate `crate_a1`
         //~| expected struct `main::a::Foo`
-        //~| expected struct `main::a::Foo`
-        //~| found struct `main::a::Foo`
         a::try_bar(bar2);
         //~^ ERROR mismatched types
         //~| Perhaps two different versions of crate `crate_a1`
index db53344a07e7cc07f6839132f629d6edeadf75c4..91bbe9c1fbe2a2c6cb69261f2f898582c7ef337d 100644 (file)
@@ -4,8 +4,6 @@ error[E0308]: mismatched types
 LL |         a::try_foo(foo2);
    |                    ^^^^ expected struct `main::a::Foo`, found a different struct `main::a::Foo`
    |
-   = note: expected struct `main::a::Foo` (struct `main::a::Foo`)
-              found struct `main::a::Foo` (struct `main::a::Foo`)
 note: Perhaps two different versions of crate `crate_a1` are being used?
   --> $DIR/type-mismatch-same-crate-name.rs:16:20
    |
@@ -13,7 +11,7 @@ LL |         a::try_foo(foo2);
    |                    ^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/type-mismatch-same-crate-name.rs:22:20
+  --> $DIR/type-mismatch-same-crate-name.rs:20:20
    |
 LL |         a::try_bar(bar2);
    |                    ^^^^ expected trait `main::a::Bar`, found a different trait `main::a::Bar`
@@ -21,7 +19,7 @@ LL |         a::try_bar(bar2);
    = note: expected struct `std::boxed::Box<(dyn main::a::Bar + 'static)>`
               found struct `std::boxed::Box<dyn main::a::Bar>`
 note: Perhaps two different versions of crate `crate_a1` are being used?
-  --> $DIR/type-mismatch-same-crate-name.rs:22:20
+  --> $DIR/type-mismatch-same-crate-name.rs:20:20
    |
 LL |         a::try_bar(bar2);
    |                    ^^^^
index 2d9481e5a4102c00b8e8409c31110f9eb46873af..e6016bdef18ed8c5b8cb5e6d7463057d35335962 100644 (file)
@@ -3,18 +3,12 @@ error[E0308]: mismatched types
    |
 LL |     want::<foo>(f);
    |                 ^ expected struct `foo`, found usize
-   |
-   = note: expected struct `foo`
-                found type `usize`
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:18:17
    |
 LL |     want::<bar>(f);
    |                 ^ expected struct `bar`, found usize
-   |
-   = note: expected struct `bar`
-                found type `usize`
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:19:24
@@ -75,18 +69,12 @@ error[E0308]: mismatched types
    |
 LL |     want::<usize>(f);
    |                   ^ expected usize, found struct `foo`
-   |
-   = note: expected type `usize`
-            found struct `foo`
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:29:17
    |
 LL |     want::<bar>(f);
    |                 ^ expected struct `bar`, found struct `foo`
-   |
-   = note: expected struct `bar`
-              found struct `foo`
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:30:24
@@ -230,7 +218,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:48:26
    |
 LL |     want::<&Foo<foo, B>>(f);
-   |                          ^ expected reference, found struct `Foo`
+   |                          ^ expected &Foo<foo, B>, found struct `Foo`
    |
    = note: expected reference `&Foo<foo, B>`
                  found struct `Foo<foo>`
@@ -322,7 +310,7 @@ error[E0308]: mismatched types
 LL |     want::<&Foo<foo, B>>(f);
    |                          ^
    |                          |
-   |                          expected reference, found struct `Foo`
+   |                          expected &Foo<foo, B>, found struct `Foo`
    |                          help: consider borrowing here: `&f`
    |
    = note: expected reference `&Foo<foo, B>`
@@ -422,7 +410,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:75:26
    |
 LL |     want::<&Foo<foo, B>>(f);
-   |                          ^ expected reference, found struct `Foo`
+   |                          ^ expected &Foo<foo, B>, found struct `Foo`
    |
    = note: expected reference `&Foo<foo, B>`
                  found struct `Foo<foo, B, A>`
index 56185e048a3208822a11f5e4aca82190e55c1ded..70be30ed53e8339940131bbac612f9c1a37b68e2 100644 (file)
@@ -2,10 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/type-shadow.rs:6:20
    |
 LL |         let y: Y = "hello";
-   |                    ^^^^^^^ expected isize, found reference
-   |
-   = note:   expected type `isize`
-           found reference `&'static str`
+   |                    ^^^^^^^ expected isize, found &str
 
 error: aborting due to previous error
 
index 61c976b773af4e18eb29045e2ff1d874337cf079..fb21980805fa8b2114ff0e72f391276bf59f93e2 100644 (file)
@@ -30,18 +30,12 @@ error[E0308]: mismatched types
    |
 LL |     let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order
    |                                             ^^^ expected struct `Vec2`, found floating-point number
-   |
-   = note: expected struct `Vec2`
-                found type `{float}`
 
 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
-   |
-   = note: expected struct `Vec2`
-                found type `f64`
 
 error: aborting due to 5 previous errors