]> git.lizzy.rs Git - rust.git/commitdiff
Modify primary span label for E0308
authorEsteban Küber <esteban@kuber.com.ar>
Tue, 3 Jan 2023 02:00:33 +0000 (18:00 -0800)
committerEsteban Küber <esteban@kuber.com.ar>
Mon, 30 Jan 2023 20:12:19 +0000 (20:12 +0000)
The previous output was unintuitive to users.

383 files changed:
compiler/rustc_hir_analysis/src/check/check.rs
compiler/rustc_infer/src/infer/error_reporting/mod.rs
compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs
compiler/rustc_middle/src/ty/error.rs
compiler/rustc_trait_selection/src/traits/select/mod.rs
src/tools/clippy/tests/ui/track-diagnostics.stderr
tests/run-make-fulldeps/type-mismatch-same-crate-name/Makefile
tests/rustdoc-ui/track-diagnostics.stderr
tests/ui/alloc-error/alloc-error-handler-bad-signature-1.stderr
tests/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr
tests/ui/argument-suggestions/formal-and-expected-differ.stderr
tests/ui/argument-suggestions/invalid_arguments.stderr
tests/ui/argument-suggestions/issue-100478.stderr
tests/ui/argument-suggestions/issue-101097.stderr
tests/ui/argument-suggestions/issue-97484.stderr
tests/ui/argument-suggestions/mixed_cases.stderr
tests/ui/argument-suggestions/two-mismatch-notes.stderr
tests/ui/array-slice-vec/array-not-vector.rs
tests/ui/array-slice-vec/array-not-vector.stderr
tests/ui/array-slice-vec/slice-to-vec-comparison.stderr
tests/ui/associated-consts/associated-const-generic-obligations.stderr
tests/ui/associated-type-bounds/elision.stderr
tests/ui/associated-type-bounds/issue-71443-1.stderr
tests/ui/associated-types/associated-type-projection-from-supertrait.stderr
tests/ui/associated-types/associated-types-eq-3.rs
tests/ui/associated-types/associated-types-eq-3.stderr
tests/ui/async-await/async-block-control-flow-static-semantics.stderr
tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr
tests/ui/async-await/in-trait/return-type-suggestion.stderr
tests/ui/async-await/issue-61076.rs
tests/ui/async-await/issue-61076.stderr
tests/ui/async-await/issue-98634.stderr
tests/ui/async-await/issues/issue-102206.stderr
tests/ui/async-await/proper-span-for-type-error.stderr
tests/ui/async-await/suggest-missing-await.stderr
tests/ui/autoref-autoderef/issue-38940.stderr
tests/ui/blind/blind-item-block-middle.stderr
tests/ui/block-result/consider-removing-last-semi.stderr
tests/ui/block-result/issue-13428.stderr
tests/ui/block-result/issue-13624.rs
tests/ui/block-result/issue-13624.stderr
tests/ui/block-result/issue-22645.stderr
tests/ui/block-result/issue-5500.rs
tests/ui/block-result/issue-5500.stderr
tests/ui/box/issue-82446.stderr
tests/ui/closures/issue-78720.stderr
tests/ui/coercion/coerce-block-tail-26978.stderr
tests/ui/coercion/coerce-block-tail-57749.stderr
tests/ui/coercion/coerce-block-tail-83783.stderr
tests/ui/coercion/coerce-block-tail-83850.stderr
tests/ui/coercion/coerce-block-tail.stderr
tests/ui/coercion/coerce-expect-unsized-ascribed.stderr
tests/ui/coercion/coerce-to-bang.stderr
tests/ui/coercion/coercion-missing-tail-expected-type.stderr
tests/ui/coercion/coercion-slice.rs
tests/ui/coercion/coercion-slice.stderr
tests/ui/compare-method/bad-self-type.stderr
tests/ui/const-generics/defaults/mismatch.stderr
tests/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr
tests/ui/const-generics/issues/issue-67945-1.full.stderr
tests/ui/const-generics/type_mismatch.stderr
tests/ui/const-generics/type_not_in_scope.stderr
tests/ui/const-generics/types-mismatch-const-args.full.stderr
tests/ui/const-generics/types-mismatch-const-args.min.stderr
tests/ui/consts/const-eval/const-eval-span.rs
tests/ui/consts/const-eval/const-eval-span.stderr
tests/ui/consts/const-tup-index-span.rs
tests/ui/consts/const-tup-index-span.stderr
tests/ui/consts/nested_erroneous_ctfe.stderr
tests/ui/cross/cross-borrow-trait.stderr
tests/ui/deref-patterns/gate.stderr
tests/ui/destructure-trait-ref.stderr
tests/ui/destructuring-assignment/default-match-bindings-forbidden.stderr
tests/ui/diagnostic-width/long-E0308.stderr
tests/ui/did_you_mean/brackets-to-braces-single-element.stderr
tests/ui/did_you_mean/compatible-variants-in-pat.stderr
tests/ui/did_you_mean/compatible-variants.stderr
tests/ui/did_you_mean/issue-42764.stderr
tests/ui/did_you_mean/recursion_limit_deref.stderr
tests/ui/disambiguate-identical-names.stderr
tests/ui/diverging-fn-tail-35849.stderr
tests/ui/dst/dst-bad-assign-3.rs
tests/ui/dst/dst-bad-assign-3.stderr
tests/ui/dst/dst-bad-assign.rs
tests/ui/dst/dst-bad-assign.stderr
tests/ui/dst/dst-bad-coerce1.stderr
tests/ui/dst/dst-bad-coerce4.rs
tests/ui/dst/dst-bad-coerce4.stderr
tests/ui/dyn-star/no-implicit-dyn-star.stderr
tests/ui/empty/issue-37026.stderr
tests/ui/error-codes/E0071.rs
tests/ui/error-codes/E0071.stderr
tests/ui/extern/extern-types-distinct-types.stderr
tests/ui/fmt/ifmt-bad-arg.stderr
tests/ui/fn/fn-item-type.rs
tests/ui/fn/fn-item-type.stderr
tests/ui/fn/fn-pointer-mismatch.stderr
tests/ui/fn/fn-trait-formatting.stderr
tests/ui/fn/signature-error-reporting-under-verbose.rs
tests/ui/fn/signature-error-reporting-under-verbose.stderr
tests/ui/fully-qualified-type/fully-qualified-type-name1.rs
tests/ui/fully-qualified-type/fully-qualified-type-name1.stderr
tests/ui/fully-qualified-type/fully-qualified-type-name2.rs
tests/ui/fully-qualified-type/fully-qualified-type-name2.stderr
tests/ui/fully-qualified-type/fully-qualified-type-name4.rs
tests/ui/fully-qualified-type/fully-qualified-type-name4.stderr
tests/ui/generator/type-mismatch-signature-deduction.stderr
tests/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr
tests/ui/generics/generic-type-params-name-repr.rs
tests/ui/generics/generic-type-params-name-repr.stderr
tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.stderr
tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.stderr
tests/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr
tests/ui/half-open-range-patterns/pat-tuple-5.stderr
tests/ui/higher-rank-trait-bounds/hang-on-deeply-nested-dyn.stderr
tests/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.stderr
tests/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr
tests/ui/impl-trait/in-trait/deep-match.stderr
tests/ui/impl-trait/in-trait/default-body-type-err-2.stderr
tests/ui/impl-trait/in-trait/default-body-type-err.stderr
tests/ui/impl-trait/issue-102605.stderr
tests/ui/impl-trait/issue-99914.stderr
tests/ui/impl-trait/issues/issue-74282.stderr
tests/ui/impl-trait/object-unsafe-trait-in-return-position-impl-trait.stderr
tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr
tests/ui/impl-trait/universal-mismatched-type.stderr
tests/ui/include-macros/mismatched-types.stderr
tests/ui/inference/deref-suggestion.stderr
tests/ui/issues/issue-100605.stderr
tests/ui/issues/issue-102964.stderr
tests/ui/issues/issue-11374.stderr
tests/ui/issues/issue-11844.stderr
tests/ui/issues/issue-13446.stderr
tests/ui/issues/issue-13466.rs
tests/ui/issues/issue-13466.stderr
tests/ui/issues/issue-14541.rs
tests/ui/issues/issue-14541.stderr
tests/ui/issues/issue-15783.rs
tests/ui/issues/issue-15783.stderr
tests/ui/issues/issue-15896.stderr
tests/ui/issues/issue-16338.stderr
tests/ui/issues/issue-16401.rs
tests/ui/issues/issue-16401.stderr
tests/ui/issues/issue-18819.stderr
tests/ui/issues/issue-20225.stderr
tests/ui/issues/issue-21332.rs
tests/ui/issues/issue-21332.stderr
tests/ui/issues/issue-24322.stderr
tests/ui/issues/issue-24819.rs
tests/ui/issues/issue-24819.stderr
tests/ui/issues/issue-27008.rs
tests/ui/issues/issue-27008.stderr
tests/ui/issues/issue-32122-1.stderr
tests/ui/issues/issue-32122-2.stderr
tests/ui/issues/issue-33504.stderr
tests/ui/issues/issue-33941.stderr
tests/ui/issues/issue-35241.stderr
tests/ui/issues/issue-3680.rs
tests/ui/issues/issue-3680.stderr
tests/ui/issues/issue-40749.stderr
tests/ui/issues/issue-43420-no-over-suggest.stderr
tests/ui/issues/issue-4517.rs
tests/ui/issues/issue-4517.stderr
tests/ui/issues/issue-48364.stderr
tests/ui/issues/issue-4968.rs
tests/ui/issues/issue-4968.stderr
tests/ui/issues/issue-5100.rs
tests/ui/issues/issue-5100.stderr
tests/ui/issues/issue-51632-try-desugar-incompatible-types.stderr
tests/ui/issues/issue-53348.rs
tests/ui/issues/issue-53348.stderr
tests/ui/issues/issue-5358-1.rs
tests/ui/issues/issue-5358-1.stderr
tests/ui/issues/issue-56943.stderr
tests/ui/issues/issue-57741-1.stderr
tests/ui/issues/issue-57741.stderr
tests/ui/issues/issue-59488.stderr
tests/ui/issues/issue-61106.stderr
tests/ui/issues/issue-6458-4.stderr
tests/ui/issues/issue-67039-unsound-pin-partialeq.stderr
tests/ui/issues/issue-69306.stderr
tests/ui/issues/issue-7061.stderr
tests/ui/issues/issue-7092.rs
tests/ui/issues/issue-7092.stderr
tests/ui/issues/issue-71676-1.stderr
tests/ui/issues/issue-74236/main.stderr
tests/ui/issues/issue-76191.stderr
tests/ui/issues/issue-7867.rs
tests/ui/issues/issue-7867.stderr
tests/ui/json/json-bom-plus-crlf-multifile.stderr
tests/ui/json/json-bom-plus-crlf.stderr
tests/ui/let-else/issue-94176.stderr
tests/ui/let-else/let-else-deref-coercion.stderr
tests/ui/let-else/let-else-non-diverging.stderr
tests/ui/let-else/let-else-ref-bindings.stderr
tests/ui/lifetimes/issue-17728.stderr
tests/ui/lifetimes/issue-26638.stderr
tests/ui/lint/must_not_suspend/tuple-mismatch.stderr
tests/ui/loops/loop-break-value.stderr
tests/ui/match/issue-12552.stderr
tests/ui/match/issue-91058.stderr
tests/ui/match/match-struct.rs
tests/ui/match/match-struct.stderr
tests/ui/match/match-tag-nullary.stderr
tests/ui/match/match-tag-unary.stderr
tests/ui/methods/issues/issue-61525.stderr
tests/ui/methods/issues/issue-90315.stderr
tests/ui/methods/method-self-arg-1.rs
tests/ui/methods/method-self-arg-1.stderr
tests/ui/mismatched_types/abridged.stderr
tests/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.stderr
tests/ui/mismatched_types/issue-106182.stderr
tests/ui/mismatched_types/issue-38371-unfixable.stderr
tests/ui/mismatched_types/issue-38371.stderr
tests/ui/mismatched_types/non_zero_assigned_something.stderr
tests/ui/mismatched_types/normalize-fn-sig.stderr
tests/ui/mismatched_types/ref-pat-suggestions.stderr
tests/ui/mismatched_types/show_module.stderr
tests/ui/mismatched_types/similar_paths.stderr
tests/ui/mismatched_types/similar_paths_primitive.stderr
tests/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.stderr
tests/ui/mismatched_types/suggest-removing-tuple-struct-field.stderr
tests/ui/mismatched_types/wrap-suggestion-privacy.stderr
tests/ui/mut/mut-cross-borrowing.stderr
tests/ui/never_type/diverging-tuple-parts-39485.stderr
tests/ui/never_type/issue-10176.rs
tests/ui/never_type/issue-10176.stderr
tests/ui/never_type/issue-52443.stderr
tests/ui/never_type/issue-96335.stderr
tests/ui/noexporttypeexe.rs
tests/ui/noexporttypeexe.stderr
tests/ui/or-patterns/already-bound-name.stderr
tests/ui/or-patterns/nested-undelimited-precedence.stderr
tests/ui/parser/issues/issue-87812-path.stderr
tests/ui/parser/recover-range-pats.stderr
tests/ui/parser/unclosed-delimiter-in-dep.stderr
tests/ui/pattern/for-loop-bad-item.stderr
tests/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr
tests/ui/pattern/pat-struct-field-expr-has-type.stderr
tests/ui/pattern/pat-type-err-formal-param.stderr
tests/ui/pattern/pat-type-err-let-stmt.stderr
tests/ui/pattern/pattern-error-continue.rs
tests/ui/pattern/pattern-error-continue.stderr
tests/ui/pattern/pattern-ident-path-generics.stderr
tests/ui/pattern/pattern-tyvar.stderr
tests/ui/point-to-type-err-cause-on-impl-trait-return-2.stderr
tests/ui/proc-macro/break-token-spans.stderr
tests/ui/proc-macro/issue-37788.stderr
tests/ui/proc-macro/resolved-located-at.stderr
tests/ui/range/issue-54505-no-literals.stderr
tests/ui/range/issue-54505-no-std.stderr
tests/ui/range/issue-54505.stderr
tests/ui/range/issue-73553-misinterp-range-literal.stderr
tests/ui/repeat-expr/repeat_count.rs
tests/ui/repeat-expr/repeat_count.stderr
tests/ui/resolve/name-clash-nullary.stderr
tests/ui/resolve/privacy-enum-ctor.stderr
tests/ui/resolve/resolve-inconsistent-names.stderr
tests/ui/return/return-type.stderr
tests/ui/return/tail-expr-as-potential-return.stderr
tests/ui/rfc-2005-default-binding-mode/const.stderr
tests/ui/rfc-2005-default-binding-mode/lit.stderr
tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr
tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr
tests/ui/rfc-2294-if-let-guard/typeck.stderr
tests/ui/rfc-2497-if-let-chains/disallowed-positions.stderr
tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr
tests/ui/rfcs/rfc-2528-type-changing-struct-update/feature-gate.stderr
tests/ui/rfcs/rfc-2528-type-changing-struct-update/issue-92010-trait-bound-not-satisfied.stderr
tests/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.stderr
tests/ui/self/issue-61882.stderr
tests/ui/slightly-nice-generic-literal-messages.rs
tests/ui/slightly-nice-generic-literal-messages.stderr
tests/ui/span/coerce-suggestions.stderr
tests/ui/span/issue-33884.stderr
tests/ui/span/issue-39018.stderr
tests/ui/specialization/specialization-default-types.stderr
tests/ui/static/bad-const-type.rs
tests/ui/static/bad-const-type.stderr
tests/ui/static/issue-5216.stderr
tests/ui/static/static-reference-to-fn-1.stderr
tests/ui/str/str-lit-type-mismatch.stderr
tests/ui/structs/struct-base-wrong-type.stderr
tests/ui/structs/struct-path-self-type-mismatch.stderr
tests/ui/structs/struct-record-suggestion.stderr
tests/ui/structs/structure-constructor-type-mismatch.stderr
tests/ui/suggestions/args-instead-of-tuple-errors.stderr
tests/ui/suggestions/args-instead-of-tuple.stderr
tests/ui/suggestions/as-ref.stderr
tests/ui/suggestions/boxed-variant-field.stderr
tests/ui/suggestions/call-boxed.stderr
tests/ui/suggestions/chain-method-call-mutation-in-place.stderr
tests/ui/suggestions/clone-on-unconstrained-borrowed-type-param.stderr
tests/ui/suggestions/const-in-struct-pat.stderr
tests/ui/suggestions/copied-and-cloned.stderr
tests/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr
tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-child.stderr
tests/ui/suggestions/dont-suggest-doc-hidden-variant-for-enum/hidden-parent.stderr
tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr
tests/ui/suggestions/field-access.stderr
tests/ui/suggestions/fn-or-tuple-struct-without-args.stderr
tests/ui/suggestions/format-borrow.stderr
tests/ui/suggestions/into-convert.stderr
tests/ui/suggestions/issue-101065.stderr
tests/ui/suggestions/issue-101465.stderr
tests/ui/suggestions/issue-101984.stderr
tests/ui/suggestions/issue-102892.stderr
tests/ui/suggestions/issue-105494.stderr
tests/ui/suggestions/issue-106443-sugg-clone-for-arg.stderr
tests/ui/suggestions/issue-52820.stderr
tests/ui/suggestions/issue-53692.stderr
tests/ui/suggestions/issue-59819.stderr
tests/ui/suggestions/issue-83943.stderr
tests/ui/suggestions/issue-86100-tuple-paren-comma.stderr
tests/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr
tests/ui/suggestions/match-ergonomics.stderr
tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr
tests/ui/suggestions/method-access-to-range-literal-typo.stderr
tests/ui/suggestions/mut-ref-reassignment.stderr
tests/ui/suggestions/option-to-bool.stderr
tests/ui/suggestions/recover-from-semicolon-trailing-item.stderr
tests/ui/suggestions/return-bindings.stderr
tests/ui/suggestions/shadowed-lplace-method-2.stderr
tests/ui/suggestions/shadowed-lplace-method.stderr
tests/ui/suggestions/suggest-box.stderr
tests/ui/suggestions/suggest-full-enum-variant-for-local-module.stderr
tests/ui/suggestions/suggest-remove-deref.stderr
tests/ui/suggestions/unnecessary_dot_for_floating_point_literal.stderr
tests/ui/suppressed-error.rs
tests/ui/suppressed-error.stderr
tests/ui/switched-expectations.stderr
tests/ui/tag-that-dare-not-speak-its-name.rs
tests/ui/tag-that-dare-not-speak-its-name.stderr
tests/ui/terr-in-field.rs
tests/ui/terr-in-field.stderr
tests/ui/terr-sorts.stderr
tests/ui/traits/issue-52893.stderr
tests/ui/traits/issue-68295.stderr
tests/ui/transmutability/issue-101739-1.stderr
tests/ui/tuple/add-tuple-within-arguments.stderr
tests/ui/tuple/wrong_argument_ice-3.stderr
tests/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr
tests/ui/type-alias-impl-trait/issue-98604.stderr
tests/ui/type-alias-impl-trait/issue-98608.stderr
tests/ui/type-alias-impl-trait/unnameable_type.stderr
tests/ui/type-inference/issue-30225.stderr
tests/ui/type/type-ascription-precedence.stderr
tests/ui/type/type-ascription-soundness.stderr
tests/ui/type/type-check/coerce-result-return-value-2.stderr
tests/ui/type/type-check/coerce-result-return-value.stderr
tests/ui/type/type-check/point-at-inference-2.stderr
tests/ui/type/type-check/point-at-inference.stderr
tests/ui/type/type-mismatch-same-crate-name.rs
tests/ui/type/type-mismatch-same-crate-name.stderr
tests/ui/type/type-mismatch.stderr
tests/ui/typeck/assign-non-lval-derefmut.stderr
tests/ui/typeck/bad-type-in-vec-push.stderr
tests/ui/typeck/conversion-methods.stderr
tests/ui/typeck/deref-multi.stderr
tests/ui/typeck/explain_clone_autoref.rs
tests/ui/typeck/explain_clone_autoref.stderr
tests/ui/typeck/issue-100246.stderr
tests/ui/typeck/issue-13853.stderr
tests/ui/typeck/issue-31173.stderr
tests/ui/typeck/issue-46112.stderr
tests/ui/typeck/issue-50687-ice-on-borrow.stderr
tests/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr
tests/ui/typeck/issue-67971.stderr
tests/ui/typeck/issue-84160.stderr
tests/ui/typeck/issue-84768.stderr
tests/ui/typeck/issue-89856.stderr
tests/ui/typeck/issue-91450-inner-ty-error.stderr
tests/ui/typeck/issue-92481.stderr
tests/ui/typeck/issue-96530.stderr
tests/ui/typeck/return_type_containing_closure.rs
tests/ui/typeck/return_type_containing_closure.stderr
tests/ui/typeck/typeck_type_placeholder_mismatch.rs
tests/ui/typeck/typeck_type_placeholder_mismatch.stderr
tests/ui/unsized-locals/suggest-borrow.stderr
tests/ui/unsized/box-instead-of-dyn-fn.stderr
tests/ui/unsized/param-mentioned-by-different-field.stderr
tests/ui/wf/wf-unsafe-trait-obj-match.stderr
tests/ui/wrong-mul-method-signature.stderr

index 6f4ebc987e6a97ee0951550e5c894f76a68f8f41..ccd75ad0ec5a1f28f3933327bc1053d3242c0a34 100644 (file)
@@ -444,7 +444,10 @@ fn check_opaque_meets_bounds<'tcx>(
         Err(ty_err) => {
             tcx.sess.delay_span_bug(
                 span,
-                &format!("could not unify `{hidden_ty}` with revealed type:\n{ty_err}"),
+                &format!(
+                    "could not unify `{hidden_ty}` with revealed type:\n{}",
+                    ty_err.to_string(tcx)
+                ),
             );
         }
     }
index b11db8396c9203e9e840c599590c8da6a2885c6e..d58a5ceef966b54c0f61d4989da9dfbc0e99b8b5 100644 (file)
@@ -67,6 +67,7 @@
 use rustc_hir::lang_items::LangItem;
 use rustc_hir::Node;
 use rustc_middle::dep_graph::DepContext;
+use rustc_middle::ty::print::with_forced_trimmed_paths;
 use rustc_middle::ty::relate::{self, RelateResult, TypeRelation};
 use rustc_middle::ty::{
     self, error::TypeError, List, Region, Ty, TyCtxt, TypeFoldable, TypeSuperVisitable,
@@ -1612,16 +1613,31 @@ enum Mismatch<'a> {
                 {
                     format!("expected this to be `{}`", expected)
                 } else {
-                    terr.to_string()
+                    terr.to_string(self.tcx)
                 };
                 label_or_note(sp, &terr);
                 label_or_note(span, &msg);
             } else {
-                label_or_note(span, &terr.to_string());
+                label_or_note(span, &terr.to_string(self.tcx));
                 label_or_note(sp, &msg);
             }
         } else {
-            label_or_note(span, &terr.to_string());
+            if let Some(values) = values
+                && let Some((e, f)) = values.ty()
+                && let TypeError::ArgumentSorts(..) | TypeError::Sorts(_) = terr
+            {
+                let e = self.tcx.erase_regions(e);
+                let f = self.tcx.erase_regions(f);
+                let expected = with_forced_trimmed_paths!(e.sort_string(self.tcx));
+                let found = with_forced_trimmed_paths!(f.sort_string(self.tcx));
+                if expected == found {
+                    label_or_note(span, &terr.to_string(self.tcx));
+                } else {
+                    label_or_note(span, &format!("expected {expected}, found {found}"));
+                }
+            } else {
+                label_or_note(span, &terr.to_string(self.tcx));
+            }
         }
 
         if let Some((expected, found, exp_p, found_p)) = expected_found {
index 34e8edd6140b211002eaf1f6de68b5b3a0bc8fcf..e18cfb93beddc4875747868ef784125ddbf4c0b0 100644 (file)
@@ -137,25 +137,25 @@ pub fn note_and_explain_type_err(
                             diag.help(
                                 "given a type parameter `T` and a method `foo`:
 ```
-trait Trait<T> { fn foo(&tcx) -> T; }
+trait Trait<T> { fn foo(&self) -> T; }
 ```
 the only ways to implement method `foo` are:
 - constrain `T` with an explicit type:
 ```
 impl Trait<String> for X {
-    fn foo(&tcx) -> String { String::new() }
+    fn foo(&self) -> String { String::new() }
 }
 ```
 - add a trait bound to `T` and call a method on that trait that returns `Self`:
 ```
 impl<T: std::default::Default> Trait<T> for X {
-    fn foo(&tcx) -> T { <T as std::default::Default>::default() }
+    fn foo(&self) -> T { <T as std::default::Default>::default() }
 }
 ```
 - change `foo` to return an argument of type `T`:
 ```
 impl<T> Trait<T> for X {
-    fn foo(&tcx, x: T) -> T { x }
+    fn foo(&self, x: T) -> T { x }
 }
 ```",
                             );
@@ -389,14 +389,14 @@ fn expected_projection(
 ```
 trait Trait {
 type T;
-fn foo(&tcx) -> Self::T;
+fn foo(&self) -> Self::T;
 }
 ```
 the only way of implementing method `foo` is to constrain `T` with an explicit associated type:
 ```
 impl Trait for X {
 type T = String;
-fn foo(&tcx) -> Self::T { String::new() }
+fn foo(&self) -> Self::T { String::new() }
 }
 ```",
             );
index d83fc95ac4eeb04995110044354443608befb283..bb87b0eea378b8422ab760745c7e854e78ed42a0 100644 (file)
@@ -8,9 +8,7 @@
 use rustc_target::spec::abi;
 use std::borrow::Cow;
 use std::collections::hash_map::DefaultHasher;
-use std::fmt;
-use std::hash::Hash;
-use std::hash::Hasher;
+use std::hash::{Hash, Hasher};
 use std::path::PathBuf;
 
 #[derive(Clone, Copy, Debug, PartialEq, Eq, TypeFoldable, TypeVisitable, Lift)]
@@ -87,20 +85,16 @@ pub fn involves_regions(self) -> bool {
 /// in parentheses after some larger message. You should also invoke `note_and_explain_type_err()`
 /// afterwards to present additional details, particularly when it comes to lifetime-related
 /// errors.
-impl<'tcx> fmt::Display for TypeError<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+impl<'tcx> TypeError<'tcx> {
+    pub fn to_string(self, tcx: TyCtxt<'tcx>) -> String {
         use self::TypeError::*;
-        fn report_maybe_different(
-            f: &mut fmt::Formatter<'_>,
-            expected: &str,
-            found: &str,
-        ) -> fmt::Result {
+        fn report_maybe_different(expected: &str, found: &str) -> String {
             // A naive approach to making sure that we're not reporting silly errors such as:
             // (expected closure, found closure).
             if expected == found {
-                write!(f, "expected {}, found a different {}", expected, found)
+                format!("expected {}, found a different {}", expected, found)
             } else {
-                write!(f, "expected {}, found {}", expected, found)
+                format!("expected {}, found {}", expected, found)
             }
         }
 
@@ -109,64 +103,59 @@ fn report_maybe_different(
             _ => String::new(),
         };
 
-        match *self {
-            CyclicTy(_) => write!(f, "cyclic type of infinite size"),
-            CyclicConst(_) => write!(f, "encountered a self-referencing constant"),
-            Mismatch => write!(f, "types differ"),
+        match self {
+            CyclicTy(_) => format!("cyclic type of infinite size"),
+            CyclicConst(_) => format!("encountered a self-referencing constant"),
+            Mismatch => format!("types differ"),
             ConstnessMismatch(values) => {
-                write!(f, "expected {} bound, found {} bound", values.expected, values.found)
+                format!("expected {} bound, found {} bound", values.expected, values.found)
             }
             PolarityMismatch(values) => {
-                write!(f, "expected {} polarity, found {} polarity", values.expected, values.found)
+                format!("expected {} polarity, found {} polarity", values.expected, values.found)
             }
             UnsafetyMismatch(values) => {
-                write!(f, "expected {} fn, found {} fn", values.expected, values.found)
+                format!("expected {} fn, found {} fn", values.expected, values.found)
             }
             AbiMismatch(values) => {
-                write!(f, "expected {} fn, found {} fn", values.expected, values.found)
+                format!("expected {} fn, found {} fn", values.expected, values.found)
             }
-            ArgumentMutability(_) | Mutability => write!(f, "types differ in mutability"),
-            TupleSize(values) => write!(
-                f,
+            ArgumentMutability(_) | Mutability => format!("types differ in mutability"),
+            TupleSize(values) => format!(
                 "expected a tuple with {} element{}, found one with {} element{}",
                 values.expected,
                 pluralize!(values.expected),
                 values.found,
                 pluralize!(values.found)
             ),
-            FixedArraySize(values) => write!(
-                f,
+            FixedArraySize(values) => format!(
                 "expected an array with a fixed size of {} element{}, found one with {} element{}",
                 values.expected,
                 pluralize!(values.expected),
                 values.found,
                 pluralize!(values.found)
             ),
-            ArgCount => write!(f, "incorrect number of function parameters"),
-            FieldMisMatch(adt, field) => write!(f, "field type mismatch: {}.{}", adt, field),
-            RegionsDoesNotOutlive(..) => write!(f, "lifetime mismatch"),
+            ArgCount => format!("incorrect number of function parameters"),
+            FieldMisMatch(adt, field) => format!("field type mismatch: {}.{}", adt, field),
+            RegionsDoesNotOutlive(..) => format!("lifetime mismatch"),
             // Actually naming the region here is a bit confusing because context is lacking
             RegionsInsufficientlyPolymorphic(..) => {
-                write!(f, "one type is more general than the other")
+                format!("one type is more general than the other")
             }
-            RegionsOverlyPolymorphic(br, _) => write!(
-                f,
+            RegionsOverlyPolymorphic(br, _) => format!(
                 "expected concrete lifetime, found bound lifetime parameter{}",
                 br_string(br)
             ),
-            RegionsPlaceholderMismatch => write!(f, "one type is more general than the other"),
-            ArgumentSorts(values, _) | Sorts(values) => ty::tls::with(|tcx| {
-                let (mut expected, mut found) = with_forced_trimmed_paths!((
-                    values.expected.sort_string(tcx),
-                    values.found.sort_string(tcx),
-                ));
+            RegionsPlaceholderMismatch => format!("one type is more general than the other"),
+            ArgumentSorts(values, _) | Sorts(values) => {
+                let mut expected = values.expected.sort_string(tcx);
+                let mut found = values.found.sort_string(tcx);
                 if expected == found {
                     expected = values.expected.sort_string(tcx);
                     found = values.found.sort_string(tcx);
                 }
-                report_maybe_different(f, &expected, &found)
-            }),
-            Traits(values) => ty::tls::with(|tcx| {
+                report_maybe_different(&expected, &found)
+            }
+            Traits(values) => {
                 let (mut expected, mut found) = with_forced_trimmed_paths!((
                     tcx.def_path_str(values.expected),
                     tcx.def_path_str(values.found),
@@ -175,12 +164,8 @@ fn report_maybe_different(
                     expected = tcx.def_path_str(values.expected);
                     found = tcx.def_path_str(values.found);
                 }
-                report_maybe_different(
-                    f,
-                    &format!("trait `{expected}`"),
-                    &format!("trait `{found}`"),
-                )
-            }),
+                report_maybe_different(&format!("trait `{expected}`"), &format!("trait `{found}`"))
+            }
             IntMismatch(ref values) => {
                 let expected = match values.expected {
                     ty::IntVarValue::IntType(ty) => ty.name_str(),
@@ -190,41 +175,34 @@ fn report_maybe_different(
                     ty::IntVarValue::IntType(ty) => ty.name_str(),
                     ty::IntVarValue::UintType(ty) => ty.name_str(),
                 };
-                write!(f, "expected `{}`, found `{}`", expected, found)
+                format!("expected `{}`, found `{}`", expected, found)
             }
             FloatMismatch(ref values) => {
-                write!(
-                    f,
+                format!(
                     "expected `{}`, found `{}`",
                     values.expected.name_str(),
                     values.found.name_str()
                 )
             }
-            VariadicMismatch(ref values) => write!(
-                f,
+            VariadicMismatch(ref values) => format!(
                 "expected {} fn, found {} function",
                 if values.expected { "variadic" } else { "non-variadic" },
                 if values.found { "variadic" } else { "non-variadic" }
             ),
-            ProjectionMismatched(ref values) => ty::tls::with(|tcx| {
-                write!(
-                    f,
-                    "expected {}, found {}",
-                    tcx.def_path_str(values.expected),
-                    tcx.def_path_str(values.found)
-                )
-            }),
+            ProjectionMismatched(ref values) => format!(
+                "expected {}, found {}",
+                tcx.def_path_str(values.expected),
+                tcx.def_path_str(values.found)
+            ),
             ExistentialMismatch(ref values) => report_maybe_different(
-                f,
                 &format!("trait `{}`", values.expected),
                 &format!("trait `{}`", values.found),
             ),
             ConstMismatch(ref values) => {
-                write!(f, "expected `{}`, found `{}`", values.expected, values.found)
+                format!("expected `{}`, found `{}`", values.expected, values.found)
             }
-            IntrinsicCast => write!(f, "cannot coerce intrinsics to function pointers"),
-            TargetFeatureCast(_) => write!(
-                f,
+            IntrinsicCast => format!("cannot coerce intrinsics to function pointers"),
+            TargetFeatureCast(_) => format!(
                 "cannot coerce functions with `#[target_feature]` to safe function pointers"
             ),
         }
@@ -259,60 +237,9 @@ pub fn must_include_note(self) -> bool {
 }
 
 impl<'tcx> Ty<'tcx> {
-    pub fn sort_string(self, tcx: TyCtxt<'_>) -> Cow<'static, str> {
+    pub fn sort_string(self, tcx: TyCtxt<'tcx>) -> String {
         match *self.kind() {
-            ty::Bool | ty::Char | ty::Int(_) | 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(t, n) => {
-                if t.is_simple_ty() {
-                    return format!("array `{}`", self).into();
-                }
-
-                let n = tcx.lift(n).unwrap();
-                if let ty::ConstKind::Value(v) = n.kind() {
-                    if let Some(n) = v.try_to_machine_usize(tcx) {
-                        return format!("array of {} element{}", n, pluralize!(n)).into();
-                    }
-                }
-                "array".into()
-            }
-            ty::Slice(ty) if ty.is_simple_ty() => format!("slice `{}`", self).into(),
-            ty::Slice(_) => "slice".into(),
-            ty::RawPtr(tymut) => {
-                let tymut_string = match tymut.mutbl {
-                    hir::Mutability::Mut => tymut.to_string(),
-                    hir::Mutability::Not => format!("const {}", tymut.ty),
-                };
-
-                if tymut_string != "_" && (tymut.ty.is_simple_text() || tymut_string.len() < "const raw pointer".len()) {
-                    format!("`*{}`", tymut_string).into()
-                } else {
-                    // Unknown type name, it's long or has type arguments
-                    "raw pointer".into()
-                }
-            },
-            ty::Ref(_, ty, mutbl) => {
-                let tymut = ty::TypeAndMut { ty, mutbl };
-                let tymut_string = tymut.to_string();
-
-                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::Mut => "mutable reference",
-                        _ => "reference",
-                    }
-                    .into()
-                }
-            }
             ty::FnDef(def_id, ..) => match tcx.def_kind(def_id) {
                 DefKind::Ctor(CtorOf::Struct, _) => "struct constructor".into(),
                 DefKind::Ctor(CtorOf::Variant, _) => "enum constructor".into(),
@@ -320,14 +247,13 @@ pub fn sort_string(self, tcx: TyCtxt<'_>) -> Cow<'static, str> {
             },
             ty::FnPtr(_) => "fn pointer".into(),
             ty::Dynamic(ref inner, ..) if let Some(principal) = inner.principal() => {
-                format!("trait object `dyn {}`", tcx.def_path_str(principal.def_id())).into()
+                format!("`dyn {}`", tcx.def_path_str(principal.def_id()))
             }
             ty::Dynamic(..) => "trait object".into(),
             ty::Closure(..) => "closure".into(),
             ty::Generator(def_id, ..) => tcx.generator_kind(def_id).unwrap().descr().into(),
             ty::GeneratorWitness(..) |
             ty::GeneratorWitnessMIR(..) => "generator witness".into(),
-            ty::Tuple(..) => "tuple".into(),
             ty::Infer(ty::TyVar(_)) => "inferred type".into(),
             ty::Infer(ty::IntVar(_)) => "integer".into(),
             ty::Infer(ty::FloatVar(_)) => "floating-point number".into(),
@@ -337,9 +263,14 @@ pub fn sort_string(self, tcx: TyCtxt<'_>) -> Cow<'static, str> {
             ty::Infer(ty::FreshIntTy(_)) => "fresh integral type".into(),
             ty::Infer(ty::FreshFloatTy(_)) => "fresh floating-point type".into(),
             ty::Alias(ty::Projection, _) => "associated type".into(),
-            ty::Param(p) => format!("type parameter `{}`", p).into(),
+            ty::Param(p) => format!("type parameter `{p}`").into(),
             ty::Alias(ty::Opaque, ..) => "opaque type".into(),
             ty::Error(_) => "type error".into(),
+            _ => {
+                let width = tcx.sess.diagnostic_width();
+                let length_limit = std::cmp::max(width / 4, 15);
+                format!("`{}`", tcx.ty_string_with_limit(self, length_limit))
+            }
         }
     }
 
@@ -386,16 +317,14 @@ pub fn prefix_string(self, tcx: TyCtxt<'_>) -> Cow<'static, str> {
 }
 
 impl<'tcx> TyCtxt<'tcx> {
-    pub fn short_ty_string(self, ty: Ty<'tcx>) -> (String, Option<PathBuf>) {
-        let width = self.sess.diagnostic_width();
-        let length_limit = width.saturating_sub(30);
+    pub fn ty_string_with_limit(self, ty: Ty<'tcx>, length_limit: usize) -> String {
         let mut type_limit = 50;
         let regular = FmtPrinter::new(self, hir::def::Namespace::TypeNS)
             .pretty_print_type(ty)
             .expect("could not write to `String`")
             .into_buffer();
-        if regular.len() <= width {
-            return (regular, None);
+        if regular.len() <= length_limit {
+            return regular;
         }
         let mut short;
         loop {
@@ -415,6 +344,20 @@ pub fn short_ty_string(self, ty: Ty<'tcx>) -> (String, Option<PathBuf>) {
             }
             type_limit -= 1;
         }
+        short
+    }
+
+    pub fn short_ty_string(self, ty: Ty<'tcx>) -> (String, Option<PathBuf>) {
+        let width = self.sess.diagnostic_width();
+        let length_limit = width.saturating_sub(30);
+        let regular = FmtPrinter::new(self, hir::def::Namespace::TypeNS)
+            .pretty_print_type(ty)
+            .expect("could not write to `String`")
+            .into_buffer();
+        if regular.len() <= width {
+            return (regular, None);
+        }
+        let short = self.ty_string_with_limit(ty, length_limit);
         if regular == short {
             return (regular, None);
         }
index b8f5aeee2d593f4386107e3d11b4f9a2144cffa4..ad7d479896fd04eddacaaa4e3f58fce3a50eaff7 100644 (file)
@@ -2454,7 +2454,9 @@ fn match_impl(
             .at(&cause, obligation.param_env)
             .define_opaque_types(false)
             .eq(placeholder_obligation_trait_ref, impl_trait_ref)
-            .map_err(|e| debug!("match_impl: failed eq_trait_refs due to `{e}`"))?;
+            .map_err(|e| {
+                debug!("match_impl: failed eq_trait_refs due to `{}`", e.to_string(self.tcx()))
+            })?;
         nested_obligations.extend(obligations);
 
         if !self.is_intercrate()
index ec30318625311fadb7af2c1017c1add7d216a2f0..39418d359288bafbbcd4a5bb0712b81c683dc312 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/track-diagnostics.rs:LL:CC
    |
 LL | const S: A = B;
-   |              ^ expected struct `A`, found struct `B`
+   |              ^ expected `A`, found `B`
 -Ztrack-diagnostics: created at compiler/rustc_infer/src/infer/error_reporting/mod.rs:LL:CC
 
 error: aborting due to previous error
index 9f4be712634659d0ba71a80cee0d68076cb40d53..a2a2a41c7a5a130d75f5fa6396213211d9092864 100644 (file)
@@ -11,7 +11,7 @@ all:
                tr -d '\r\n' | $(CGREP) -e \
        "mismatched types.*\
        crateB::try_foo\(foo2\);.*\
-       expected struct \`crateA::foo::Foo\`, found struct \`Foo\`.*\
+       expected \`crateA::foo::Foo\`, found \`Foo\`.*\
        different versions of crate \`crateA\`.*\
        mismatched types.*\
        crateB::try_bar\(bar2\);.*\
index ec30318625311fadb7af2c1017c1add7d216a2f0..39418d359288bafbbcd4a5bb0712b81c683dc312 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/track-diagnostics.rs:LL:CC
    |
 LL | const S: A = B;
-   |              ^ expected struct `A`, found struct `B`
+   |              ^ expected `A`, found `B`
 -Ztrack-diagnostics: created at compiler/rustc_infer/src/infer/error_reporting/mod.rs:LL:CC
 
 error: aborting due to previous error
index 59192a1ecc3f493a8a3e34f93583fe00a94680bf..de92841d7f18e835699495ea9f5e8744ea74cebb 100644 (file)
@@ -10,7 +10,7 @@ LL | || ) -> ()
 LL | |  {
 LL | |      loop {}
 LL | |  }
-   | |__^ expected `&Layout`, found struct `Layout`
+   | |__^ expected `&Layout`, found `Layout`
    |
 note: function defined here
   --> $DIR/alloc-error-handler-bad-signature-1.rs:10:4
index 7d23c2fc05ac3d9d086c91fb928f15a8f8f2bd56..7a495380f2ba17376e5bf75bdf2e1f387b8035cf 100644 (file)
@@ -9,12 +9,12 @@ LL | || ) {
    | ||_- arguments to this function are incorrect
 LL | |      loop {}
 LL | |  }
-   | |__^ expected struct `Layout`, found struct `core::alloc::Layout`
+   | |__^ expected `Layout`, found `core::alloc::Layout`
    |
-   = note: struct `core::alloc::Layout` and struct `Layout` have similar names, but are actually distinct types
-note: struct `core::alloc::Layout` is defined in crate `core`
+   = note: `core::alloc::Layout` and `Layout` have similar names, but are actually distinct types
+note: `core::alloc::Layout` is defined in crate `core`
   --> $SRC_DIR/core/src/alloc/layout.rs:LL:COL
-note: struct `Layout` is defined in the current crate
+note: `Layout` is defined in the current crate
   --> $DIR/alloc-error-handler-bad-signature-2.rs:7:1
    |
 LL | struct Layout;
index 905875b52776907678176f1866e4a20f44bf85d2..6076b7ccb8ff6f3ef7e8cf15a7d6c7b4c017059e 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/formal-and-expected-differ.rs:22:29
    |
 LL |     let _: U<_, u32> = U(1, S(3u32));
-   |                        -    ^^^^^^^ expected `f32`, found `u32`
+   |                        -    ^^^^^^^ expected `S<f32>`, found `S<u32>`
    |                        |
    |                        arguments to this struct are incorrect
    |
@@ -18,7 +18,7 @@ error[E0308]: mismatched types
   --> $DIR/formal-and-expected-differ.rs:22:24
    |
 LL |     let _: U<_, u32> = U(1, S(3u32));
-   |            ---------   ^^^^^^^^^^^^^ expected `u32`, found `f32`
+   |            ---------   ^^^^^^^^^^^^^ expected `U<_, u32>`, found `U<i32, f32>`
    |            |
    |            expected due to this
    |
index 303f0869578535b96d33c2a39cfefbcca30e72a7..d26f33d098be09448c03019c15a274675836c194 100644 (file)
@@ -100,7 +100,7 @@ error[E0308]: mismatched types
   --> $DIR/invalid_arguments.rs:24:18
    |
 LL |   three_arg_diff(X{}, 1.0, "");
-   |   -------------- ^^^ expected `i32`, found struct `X`
+   |   -------------- ^^^ expected `i32`, found `X`
    |   |
    |   arguments to this function are incorrect
    |
@@ -114,7 +114,7 @@ error[E0308]: mismatched types
   --> $DIR/invalid_arguments.rs:25:21
    |
 LL |   three_arg_diff(1, X {}, "");
-   |   --------------    ^^^^ expected `f32`, found struct `X`
+   |   --------------    ^^^^ expected `f32`, found `X`
    |   |
    |   arguments to this function are incorrect
    |
@@ -128,7 +128,7 @@ error[E0308]: mismatched types
   --> $DIR/invalid_arguments.rs:26:26
    |
 LL |   three_arg_diff(1, 1.0, X {});
-   |   --------------         ^^^^ expected `&str`, found struct `X`
+   |   --------------         ^^^^ expected `&str`, found `X`
    |   |
    |   arguments to this function are incorrect
    |
@@ -142,9 +142,9 @@ error[E0308]: arguments to this function are incorrect
   --> $DIR/invalid_arguments.rs:28:3
    |
 LL |   three_arg_diff(X {}, X {}, "");
-   |   ^^^^^^^^^^^^^^ ----  ---- expected `f32`, found struct `X`
+   |   ^^^^^^^^^^^^^^ ----  ---- expected `f32`, found `X`
    |                  |
-   |                  expected `i32`, found struct `X`
+   |                  expected `i32`, found `X`
    |
 note: function defined here
   --> $DIR/invalid_arguments.rs:8:4
@@ -156,9 +156,9 @@ error[E0308]: arguments to this function are incorrect
   --> $DIR/invalid_arguments.rs:29:3
    |
 LL |   three_arg_diff(X {}, 1.0, X {});
-   |   ^^^^^^^^^^^^^^ ----       ---- expected `&str`, found struct `X`
+   |   ^^^^^^^^^^^^^^ ----       ---- expected `&str`, found `X`
    |                  |
-   |                  expected `i32`, found struct `X`
+   |                  expected `i32`, found `X`
    |
 note: function defined here
   --> $DIR/invalid_arguments.rs:8:4
@@ -170,9 +170,9 @@ error[E0308]: arguments to this function are incorrect
   --> $DIR/invalid_arguments.rs:30:3
    |
 LL |   three_arg_diff(1, X {}, X {});
-   |   ^^^^^^^^^^^^^^    ----  ---- expected `&str`, found struct `X`
+   |   ^^^^^^^^^^^^^^    ----  ---- expected `&str`, found `X`
    |                     |
-   |                     expected `f32`, found struct `X`
+   |                     expected `f32`, found `X`
    |
 note: function defined here
   --> $DIR/invalid_arguments.rs:8:4
@@ -184,10 +184,10 @@ error[E0308]: arguments to this function are incorrect
   --> $DIR/invalid_arguments.rs:32:3
    |
 LL |   three_arg_diff(X {}, X {}, X {});
-   |   ^^^^^^^^^^^^^^ ----  ----  ---- expected `&str`, found struct `X`
+   |   ^^^^^^^^^^^^^^ ----  ----  ---- expected `&str`, found `X`
    |                  |     |
-   |                  |     expected `f32`, found struct `X`
-   |                  expected `i32`, found struct `X`
+   |                  |     expected `f32`, found `X`
+   |                  expected `i32`, found `X`
    |
 note: function defined here
   --> $DIR/invalid_arguments.rs:8:4
@@ -199,7 +199,7 @@ error[E0308]: mismatched types
   --> $DIR/invalid_arguments.rs:34:20
    |
 LL |   three_arg_repeat(X {}, 1, "");
-   |   ---------------- ^^^^ expected `i32`, found struct `X`
+   |   ---------------- ^^^^ expected `i32`, found `X`
    |   |
    |   arguments to this function are incorrect
    |
@@ -213,7 +213,7 @@ error[E0308]: mismatched types
   --> $DIR/invalid_arguments.rs:35:23
    |
 LL |   three_arg_repeat(1, X {}, "");
-   |   ----------------    ^^^^ expected `i32`, found struct `X`
+   |   ----------------    ^^^^ expected `i32`, found `X`
    |   |
    |   arguments to this function are incorrect
    |
@@ -227,7 +227,7 @@ error[E0308]: mismatched types
   --> $DIR/invalid_arguments.rs:36:26
    |
 LL |   three_arg_repeat(1, 1, X {});
-   |   ----------------       ^^^^ expected `&str`, found struct `X`
+   |   ----------------       ^^^^ expected `&str`, found `X`
    |   |
    |   arguments to this function are incorrect
    |
@@ -241,9 +241,9 @@ error[E0308]: arguments to this function are incorrect
   --> $DIR/invalid_arguments.rs:38:3
    |
 LL |   three_arg_repeat(X {}, X {}, "");
-   |   ^^^^^^^^^^^^^^^^ ----  ---- expected `i32`, found struct `X`
+   |   ^^^^^^^^^^^^^^^^ ----  ---- expected `i32`, found `X`
    |                    |
-   |                    expected `i32`, found struct `X`
+   |                    expected `i32`, found `X`
    |
 note: function defined here
   --> $DIR/invalid_arguments.rs:9:4
@@ -255,9 +255,9 @@ error[E0308]: arguments to this function are incorrect
   --> $DIR/invalid_arguments.rs:39:3
    |
 LL |   three_arg_repeat(X {}, 1, X {});
-   |   ^^^^^^^^^^^^^^^^ ----     ---- expected `&str`, found struct `X`
+   |   ^^^^^^^^^^^^^^^^ ----     ---- expected `&str`, found `X`
    |                    |
-   |                    expected `i32`, found struct `X`
+   |                    expected `i32`, found `X`
    |
 note: function defined here
   --> $DIR/invalid_arguments.rs:9:4
@@ -269,9 +269,9 @@ error[E0308]: arguments to this function are incorrect
   --> $DIR/invalid_arguments.rs:40:3
    |
 LL |   three_arg_repeat(1, X {}, X{});
-   |   ^^^^^^^^^^^^^^^^    ----  --- expected `&str`, found struct `X`
+   |   ^^^^^^^^^^^^^^^^    ----  --- expected `&str`, found `X`
    |                       |
-   |                       expected `i32`, found struct `X`
+   |                       expected `i32`, found `X`
    |
 note: function defined here
   --> $DIR/invalid_arguments.rs:9:4
@@ -283,10 +283,10 @@ error[E0308]: arguments to this function are incorrect
   --> $DIR/invalid_arguments.rs:42:3
    |
 LL |   three_arg_repeat(X {}, X {}, X {});
-   |   ^^^^^^^^^^^^^^^^ ----  ----  ---- expected `&str`, found struct `X`
+   |   ^^^^^^^^^^^^^^^^ ----  ----  ---- expected `&str`, found `X`
    |                    |     |
-   |                    |     expected `i32`, found struct `X`
-   |                    expected `i32`, found struct `X`
+   |                    |     expected `i32`, found `X`
+   |                    expected `i32`, found `X`
    |
 note: function defined here
   --> $DIR/invalid_arguments.rs:9:4
index df02a312cf11c1a79756f087acafcfa8f2884b26..e4304988f9bee1990a9f5537d7c5ffcea2ce9524 100644 (file)
@@ -41,7 +41,7 @@ error[E0308]: arguments to this function are incorrect
   --> $DIR/issue-100478.rs:36:5
    |
 LL |     four_shuffle(T3::default(), T2::default(), T1::default(), T3::default());
-   |     ^^^^^^^^^^^^ -------------                 -------------  ------------- expected struct `T4`, found struct `T3`
+   |     ^^^^^^^^^^^^ -------------                 -------------  ------------- expected `T4`, found `T3`
    |                  |                             |
    |                  |                             expected `T3`, found `T1`
    |                  expected `T1`, found `T3`
index 096f8c226f2aac19a1b7688a0315d0cd33a79824..7582082ac72ac7bb546b2ea6b33fba25ccaba2d5 100644 (file)
@@ -128,7 +128,7 @@ LL |     f(C, C, A, B, A, A);
    |     ^ -  -  -     -  - expected `C`, found `A`
    |       |  |  |     |
    |       |  |  |     expected `C`, found `A`
-   |       |  |  expected struct `B`, found struct `A`
+   |       |  |  expected `B`, found `A`
    |       |  expected `A`, found `C`
    |       expected `A`, found `C`
    |
index caa50f14b43e1e56da9df7e49a7f3016558532ad..c2e6e001b17917ad6acaae9bb7b32664aa52a4b5 100644 (file)
@@ -4,7 +4,7 @@ error[E0061]: this function takes 4 arguments but 7 arguments were supplied
 LL |     foo(&&A, B, C, D, E, F, G);
    |     ^^^      -  -     -  - argument of type `F` unexpected
    |              |  |     |
-   |              |  |     expected `&E`, found struct `E`
+   |              |  |     expected `&E`, found `E`
    |              |  argument of type `C` unexpected
    |              argument of type `B` unexpected
    |
index 8c525db1ac66ca03528993dad5a055d464a3520d..8cf48060a63528185329be15170080392ef02588 100644 (file)
@@ -41,7 +41,7 @@ error[E0061]: this function takes 3 arguments but 2 arguments were supplied
 LL |   three_args(1, X {});
    |   ^^^^^^^^^^---------
    |             |   |
-   |             |   expected `f32`, found struct `X`
+   |             |   expected `f32`, found `X`
    |             an argument of type `&str` is missing
    |
 note: function defined here
@@ -78,7 +78,7 @@ error[E0308]: arguments to this function are incorrect
 LL |   three_args("", X {}, 1);
    |   ^^^^^^^^^^ --  ----  - expected `&str`, found `{integer}`
    |              |   |
-   |              |   expected `f32`, found struct `X`
+   |              |   expected `f32`, found `X`
    |              expected `i32`, found `&'static str`
    |
 note: function defined here
index 7873cf964cbbc978b278bf3cf58b0a5320152d66..70cc60255c71759bc250ed3126abcd9d2e71eafd 100644 (file)
@@ -4,14 +4,14 @@ error[E0308]: arguments to this function are incorrect
 LL |     foo(f, w);
    |     ^^^
    |
-note: expected `i32`, found `u32`
+note: expected fn pointer, found fn item
   --> $DIR/two-mismatch-notes.rs:10:9
    |
 LL |     foo(f, w);
    |         ^
    = note: expected fn pointer `fn(i32)`
                  found fn item `fn(u32) {f}`
-note: expected `i32`, found `isize`
+note: expected `Wrapper<i32>`, found `Wrapper<isize>`
   --> $DIR/two-mismatch-notes.rs:10:12
    |
 LL |     foo(f, w);
index 5e46f015baf6268e41070a4d214960ee3345118f..d8b5b10d59148abd6706741db7ad9360911a0aad 100644 (file)
@@ -1,12 +1,12 @@
 fn main() {
     let _x: i32 = [1, 2, 3];
     //~^ ERROR mismatched types
-    //~| expected `i32`, found array
+    //~| expected `i32`, found `[{integer}; 3]`
 
     let x: &[i32] = &[1, 2, 3];
     let _y: &i32 = x;
     //~^ ERROR mismatched types
     //~| expected reference `&i32`
     //~| found reference `&[i32]`
-    //~| expected `i32`, found slice
+    //~| expected `&i32`, found `&[i32]`
 }
index 0e187d9072a8a512a51cf0cb439d7c1f4284b9e5..f20d99524dccd36d74a29d24ba6e2d7629a3aa21 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/array-not-vector.rs:2:19
    |
 LL |     let _x: i32 = [1, 2, 3];
-   |             ---   ^^^^^^^^^ expected `i32`, found array `[{integer}; 3]`
+   |             ---   ^^^^^^^^^ expected `i32`, found `[{integer}; 3]`
    |             |
    |             expected due to this
 
@@ -10,7 +10,7 @@ error[E0308]: mismatched types
   --> $DIR/array-not-vector.rs:7:20
    |
 LL |     let _y: &i32 = x;
-   |             ----   ^ expected `i32`, found slice `[i32]`
+   |             ----   ^ expected `&i32`, found `&[i32]`
    |             |
    |             expected due to this
    |
index e3b3b040f66444e8e47c52198edd57b7340ecda7..47008e1d99946f68c440bcb39cd46ca1b73af2bf 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/slice-to-vec-comparison.rs:4:9
    |
 LL |     a > b;
-   |         ^ expected array of 0 elements, found struct `Vec`
+   |         ^ expected `&[_; 0]`, found `&Vec<u8>`
    |
    = note: expected reference `&[_; 0]`
               found reference `&Vec<u8>`
index f45fa0ad55cd109e2166bdf9635176f639019b07..d45868151b16643d546d43785551e78a65bb5c09 100644 (file)
@@ -2,7 +2,7 @@ error[E0326]: implemented const `FROM` has an incompatible type for trait
   --> $DIR/associated-const-generic-obligations.rs:14:17
    |
 LL |     const FROM: &'static str = "foo";
-   |                 ^^^^^^^^^^^^ expected associated type, found `&str`
+   |                 ^^^^^^^^^^^^ expected associated type, found `&'static str`
    |
 note: type in trait
   --> $DIR/associated-const-generic-obligations.rs:10:17
index ea3024627496527e6f1be0ad46a7f6c72d22465b..b64a4dab2065d1dc4746c5cd735758f204290fd0 100644 (file)
@@ -14,7 +14,7 @@ error[E0308]: mismatched types
   --> $DIR/elision.rs:5:79
    |
 LL | fn f(x: &mut dyn Iterator<Item: Iterator<Item = &'_ ()>>) -> Option<&'_ ()> { x.next() }
-   |                           -----------------------------      --------------   ^^^^^^^^ expected `&()`, found type parameter `impl Iterator<Item = &'_ ()>`
+   |                           -----------------------------      --------------   ^^^^^^^^ expected `Option<&()>`, found `Option<impl Iterator<Item = &'_ ()>>`
    |                           |                                  |
    |                           |                                  expected `Option<&'static ()>` because of return type
    |                           this type parameter
index a9459ee7432831845a8a4c45b85b90a0d208d8a2..15cc9646b2c8e17ce2b90e8cf780862e3647f89c 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn hello<F: for<'a> Iterator<Item: 'a>>() {
    |                                           - help: try adding a return type: `-> Incorrect`
 LL |     Incorrect
-   |     ^^^^^^^^^ expected `()`, found struct `Incorrect`
+   |     ^^^^^^^^^ expected `()`, found `Incorrect`
 
 error: aborting due to previous error
 
index d6b18d4ed32e7e907aa77455f73c3666030e5c6b..5fe53a27eb8540f076931b3de0638221db129fea 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/associated-type-projection-from-supertrait.rs:27:23
    |
 LL | fn b() { dent(ModelT, Blue); }
-   |          ----         ^^^^ expected struct `Black`, found struct `Blue`
+   |          ----         ^^^^ expected `Black`, found `Blue`
    |          |
    |          arguments to this function are incorrect
    |
@@ -16,7 +16,7 @@ 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`
+   |          ----         ^^^^^ expected `Blue`, found `Black`
    |          |
    |          arguments to this function are incorrect
    |
@@ -30,7 +30,7 @@ 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`
+   |                 ---------- ^^^^ expected `Black`, found `Blue`
    |                 |
    |                 arguments to this method are incorrect
    |
@@ -44,7 +44,7 @@ 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`
+   |                 ---------- ^^^^^ expected `Blue`, found `Black`
    |                 |
    |                 arguments to this method are incorrect
    |
index f6988dcf65ebff2a3c5324e04949bebc0d648365..380d0e95c13f3e4437e09cb601c7236c7a43e2c9 100644 (file)
@@ -23,7 +23,7 @@ fn foo2<I: Foo>(x: I) {
     let _: Bar = x.boo();
     //~^ ERROR mismatched types
     //~| found associated type `<I as Foo>::A`
-    //~| expected struct `Bar`, found associated type
+    //~| expected `Bar`, found
     //~| expected struct `Bar`
 }
 
index fbe1a1ee8bcd7a1b7950ee4f8b64b4129660c1bd..15ce4fc91cb306921e35e32800598f203c4e08c4 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/associated-types-eq-3.rs:23:18
    |
 LL |     let _: Bar = x.boo();
-   |            ---   ^^^^^^^ expected struct `Bar`, found associated type
+   |            ---   ^^^^^^^ expected `Bar`, found associated type
    |            |
    |            expected due to this
    |
index c4487eb840abcab9eb8a698ba66970ad12d76848..a6dbb0716143a1bfbdf183719bef0d4260d263ba 100644 (file)
@@ -57,7 +57,7 @@ error[E0308]: mismatched types
   --> $DIR/async-block-control-flow-static-semantics.rs:49:44
    |
 LL | fn rethrow_targets_async_block_not_fn() -> Result<u8, MyErr> {
-   |    ----------------------------------      ^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
+   |    ----------------------------------      ^^^^^^^^^^^^^^^^^ expected `Result<u8, MyErr>`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
    |
@@ -68,7 +68,7 @@ error[E0308]: mismatched types
   --> $DIR/async-block-control-flow-static-semantics.rs:58:50
    |
 LL | fn rethrow_targets_async_block_not_async_fn() -> Result<u8, MyErr> {
-   |    ----------------------------------------      ^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
+   |    ----------------------------------------      ^^^^^^^^^^^^^^^^^ expected `Result<u8, MyErr>`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
    |
index 13e7222551aaf1f5783d93dcdd2b09973cb1d9fd..3c01fca2f4d8d5f97dfb6ec97aa867db4dd53b76 100644 (file)
@@ -2,7 +2,7 @@ error[E0053]: method `foo` has an incompatible type for trait
   --> $DIR/async-example-desugared-boxed-in-trait.rs:15:28
    |
 LL |     async fn foo(&self) -> i32 {
-   |                            ^^^ expected struct `Pin`, found opaque type
+   |                            ^^^ expected `Pin<Box<dyn Future<Output = i32>>>`, found opaque type
    |
 note: type in trait
   --> $DIR/async-example-desugared-boxed-in-trait.rs:11:22
index 5a9b15e54a00869b35f5cb2974ad29d28b109ffe..b8d83d0f28a3194d1e647c6b74ee8f2556a493a3 100644 (file)
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
 LL |         Ok(())
    |         ^^^^^^- help: consider using a semicolon here: `;`
    |         |
-   |         expected `()`, found enum `Result`
+   |         expected `()`, found `Result<(), _>`
    |
    = note: expected unit type `()`
                    found enum `Result<(), _>`
index 750fad8393bbf1bac8308303eb3da8f4f5d7083d..3cde5cca3c3cdddda0dbd6b2b1f88accb40eae5e 100644 (file)
@@ -89,7 +89,7 @@ async fn match_() {
     match tuple() { //~ HELP consider `await`ing on the `Future`
         //~^ NOTE this expression has type `impl Future<Output = Tuple>`
         Tuple(_) => {} //~ ERROR mismatched types
-        //~^ NOTE expected opaque type, found struct `Tuple`
+        //~^ NOTE expected opaque type, found `Tuple`
         //~| NOTE expected opaque type `impl Future<Output = Tuple>`
     }
 }
index 33839ea59392d111fb98292cfef63ddf1346563f..5a7316edd01f55ba5bca0df7e5c1a524a68db570 100644 (file)
@@ -62,7 +62,7 @@ LL |     match tuple() {
    |           ------- this expression has type `impl Future<Output = Tuple>`
 LL |
 LL |         Tuple(_) => {}
-   |         ^^^^^^^^ expected opaque type, found struct `Tuple`
+   |         ^^^^^^^^ expected opaque type, found `Tuple`
    |
 note: while checking the return type of the `async fn`
   --> $DIR/issue-61076.rs:56:21
index 5160e48d88afd2d22ed62275b3ecb3bdacf7432b..85fa04446cccf51903ced200b4c466bac7386308 100644 (file)
@@ -2,7 +2,7 @@ error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn
   --> $DIR/issue-98634.rs:45:23
    |
 LL |         StructAsync { callback }.await;
-   |                       ^^^^^^^^ expected struct `Pin`, found opaque type
+   |                       ^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
    |
 note: while checking the return type of the `async fn`
   --> $DIR/issue-98634.rs:24:21
@@ -21,7 +21,7 @@ error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn
   --> $DIR/issue-98634.rs:45:9
    |
 LL |         StructAsync { callback }.await;
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Pin`, found opaque type
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
    |
 note: while checking the return type of the `async fn`
   --> $DIR/issue-98634.rs:24:21
@@ -40,7 +40,7 @@ error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn
   --> $DIR/issue-98634.rs:45:33
    |
 LL |         StructAsync { callback }.await;
-   |                                 ^^^^^^ expected struct `Pin`, found opaque type
+   |                                 ^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
    |
 note: while checking the return type of the `async fn`
   --> $DIR/issue-98634.rs:24:21
index 2ab790ac761a04f7a7d0bf3fe521c55475a262ba..eef711910a1a08fbef8b3ba8455f37754111d814 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     std::mem::size_of_val(foo());
    |     --------------------- ^^^^^
    |     |                     |
-   |     |                     expected reference, found opaque type
+   |     |                     expected `&_`, found opaque type
    |     |                     help: consider borrowing here: `&foo()`
    |     arguments to this function are incorrect
    |
index 25f05156ce2bc57b4d60a55443a3dac2e8107b6c..592ef7faf81379f4b54c619bf74621548504a66b 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/proper-span-for-type-error.rs:8:5
    |
 LL |     a().await
-   |     ^^^^^^^^^ expected enum `Result`, found `()`
+   |     ^^^^^^^^^ expected `Result<(), i32>`, found `()`
    |
    = note:   expected enum `Result<(), i32>`
            found unit type `()`
index 1196601ace09087eb0433a807758f949eb2657d7..2db0666f1ae6847ed4c8c292b160b7ae9198a103 100644 (file)
@@ -127,7 +127,7 @@ LL |     match dummy_result() {
    |           -------------- this expression has type `impl Future<Output = Result<(), ()>>`
 ...
 LL |         Ok(_) => {}
-   |         ^^^^^ expected opaque type, found enum `Result`
+   |         ^^^^^ expected opaque type, found `Result<_, _>`
    |
 note: while checking the return type of the `async fn`
   --> $DIR/suggest-missing-await.rs:57:28
@@ -148,7 +148,7 @@ LL |     match dummy_result() {
    |           -------------- this expression has type `impl Future<Output = Result<(), ()>>`
 ...
 LL |         Err(_) => {}
-   |         ^^^^^^ expected opaque type, found enum `Result`
+   |         ^^^^^^ expected opaque type, found `Result<_, _>`
    |
 note: while checking the return type of the `async fn`
   --> $DIR/suggest-missing-await.rs:57:28
index f0b8405770e8d5c3a0fa793034a7711157079eee..8e98bfcd90fbc50a3a7ca0700ff72c3a6bb7dbf3 100644 (file)
@@ -10,7 +10,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-38940.rs:49:22
    |
 LL |     let x: &Bottom = &t;
-   |            -------   ^^ expected struct `Bottom`, found struct `Top`
+   |            -------   ^^ expected `&Bottom`, found `&Top`
    |            |
    |            expected due to this
    |
index eb64fea9433981b6080feb36df5f357e8b404a5b..63e6d76843d18b0f98a635157b151f59e3309763 100644 (file)
@@ -7,7 +7,7 @@ LL | mod foo { pub struct bar; }
 LL |     let bar = 5;
    |         ^^^   - this expression has type `{integer}`
    |         |
-   |         expected integer, found struct `bar`
+   |         expected integer, found `bar`
    |         `bar` is interpreted as a unit struct, not a new binding
    |         help: introduce a new binding instead: `other_bar`
 
index 9be0367ae383c4b3b7e018df3c33de76d3ad832e..d30ab1293431b59b60a1cab72af36bfde5a059a2 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/consider-removing-last-semi.rs:3:15
    |
 LL | pub fn f() -> String {
-   |        -      ^^^^^^ expected struct `String`, found `()`
+   |        -      ^^^^^^ expected `String`, found `()`
    |        |
    |        implicitly returns `()` as its body has no tail or `return` expression
 LL |     0u8;
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
   --> $DIR/consider-removing-last-semi.rs:8:15
    |
 LL | pub fn g() -> String {
-   |        -      ^^^^^^ expected struct `String`, found `()`
+   |        -      ^^^^^^ expected `String`, found `()`
    |        |
    |        implicitly returns `()` as its body has no tail or `return` expression
 LL |     "this won't work".to_string();
index 2b386d10c53c42c3a70087585b3e6c17a0a8f0d1..c119b69da2294e1b259dd993581be77d23c69402 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-13428.rs:3:13
    |
 LL | fn foo() -> String {
-   |    ---      ^^^^^^ expected struct `String`, found `()`
+   |    ---      ^^^^^^ expected `String`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
 
@@ -10,7 +10,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-13428.rs:11:13
    |
 LL | fn bar() -> String {
-   |    ---      ^^^^^^ expected struct `String`, found `()`
+   |    ---      ^^^^^^ expected `String`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
 LL |     "foobar".to_string()
index 4d2844cc5aec821ae0145c306b553ad1d0645dc2..8f93e5a356fa670cec4ec756f619e1930535490a 100644 (file)
@@ -6,7 +6,7 @@ pub enum Enum {
   pub fn get_enum_struct_variant() -> () {
     Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
     //~^ ERROR mismatched types
-    //~| expected `()`, found enum `Enum`
+    //~| expected `()`, found `Enum`
   }
 }
 
@@ -19,7 +19,7 @@ fn test_enum_struct_variant() {
       match enum_struct_variant {
         a::Enum::EnumStructVariant { x, y, z } => {
         //~^ ERROR mismatched types
-        //~| expected `()`, found enum `Enum`
+        //~| expected `()`, found `Enum`
         }
       }
     }
index 13070b4e821319ad8b9ee62b9851eb77cc3e7fa6..d41bd057f8246c0428a197d9901cd27f521ddbd8 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |   pub fn get_enum_struct_variant() -> () {
    |                                       -- expected `()` because of return type
 LL |     Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found enum `Enum`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Enum`
 
 error[E0308]: mismatched types
   --> $DIR/issue-13624.rs:20:9
@@ -12,7 +12,7 @@ error[E0308]: mismatched types
 LL |       match enum_struct_variant {
    |             ------------------- this expression has type `()`
 LL |         a::Enum::EnumStructVariant { x, y, z } => {
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found enum `Enum`
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Enum`
 
 error: aborting due to 2 previous errors
 
index 24341c0f58a80d3f9dc2d71febf5091331af091d..677b40aaa9dadae3099cf32b6c1d7c100cb1b884 100644 (file)
@@ -20,7 +20,7 @@ LL | fn main() {
    |           - expected `()` because of default return type
 LL |   let b = Bob + 3.5;
 LL |   b + 3
-   |   ^^^^^ expected `()`, found struct `Bob`
+   |   ^^^^^ expected `()`, found `Bob`
 
 error: aborting due to 2 previous errors
 
index 577987a4596cbebed7aae5cbfcea8598a159a90b..de7fd39a20caa1952b37828d1580c1d4129e490a 100644 (file)
@@ -3,5 +3,5 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected unit type `()`
     //~| found reference `&_`
-    //~| expected `()`, found reference
+    //~| expected `()`, found `&_`
 }
index 211a6052864e8eade0d248828b6e57d13df57016..8cd4bd65871a3601421098c8e6b6a4d84f69104f 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn main() {
    |           - expected `()` because of default return type
 LL |     &panic!()
-   |     ^^^^^^^^^ expected `()`, found reference
+   |     ^^^^^^^^^ expected `()`, found `&_`
    |
    = note: expected unit type `()`
               found reference `&_`
index 0374737957e48a04f2417b6614ebc13978a32e53..c03f35884b8a4099af99a4c650135c5c6f3bb84e 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-82446.rs:11:9
    |
 LL |         val
-   |         ^^^ expected struct `Box`, found reference
+   |         ^^^ expected `Box<dyn MyTrait>`, found `&Box<dyn MyTrait>`
    |
    = note: expected struct `Box<(dyn MyTrait + 'static)>`
            found reference `&Box<(dyn MyTrait + 'static)>`
index 1e860d32b2a06ea523cfc0ec086cf25cf61c35d1..5d65c87b0fd612d136a3ebbf28f1027b1f3a8f70 100644 (file)
@@ -26,7 +26,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-78720.rs:7:39
    |
 LL |     fn map2<F>(self, f: F) -> Map2<F> {}
-   |                                       ^^ expected struct `Map2`, found `()`
+   |                                       ^^ expected `Map2<F>`, found `()`
    |
    = note: expected struct `Map2<F>`
            found unit type `()`
index 384debd487c5156bcf9b3255d40878105e3940ca..90eb75f2bdfd181bff427bee458f8087b869698e 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-block-tail-26978.rs:9:9
    |
 LL |     f(&{x});
-   |         ^ expected `i32`, found struct `Box`
+   |         ^ expected `i32`, found `Box<i32>`
    |
    = note: expected type `i32`
             found struct `Box<i32>`
index d5660c81dbd3e67256825cf826ecde848fb254ef..7e14f42eaafce851c4f2e07fc19353f9ebd21e2b 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-block-tail-57749.rs:33:14
    |
 LL |     reset(&{ Homura });
-   |              ^^^^^^ expected `u32`, found struct `Homura`
+   |              ^^^^^^ expected `u32`, found `Homura`
    |
 help: consider dereferencing the type
    |
index 5f53606ce2225d42330518a1ac5e6f305a8841bb..d556d013bb5838f3c9aa1671cfcf6be84bb73f09 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-block-tail-83783.rs:7:32
    |
 LL |     _consume_reference::<i32>(&async { Box::new(7_i32) }.await);
-   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `Box`
+   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `Box<i32>`
    |
    = note: expected type `i32`
             found struct `Box<i32>`
index bbf6075437043532384ae1ccb7c9b542bf7159bc..3cfebb8a54372d9a70f54f2a1373fb2739f19308 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-block-tail-83850.rs:5:7
    |
 LL |     f(&Box::new([1, 2]));
-   |     - ^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found struct `Box`
+   |     - ^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&Box<[{integer}; 2]>`
    |     |
    |     arguments to this function are incorrect
    |
index 318cf75867b4b47d7a8dd4d5c517db5a1b6b12f5..7044fc3cefc4c281cf2219ce636b46f0be828c5a 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-block-tail.rs:4:23
    |
 LL |     let _: &i32 = & { Box::new(1i32) };
-   |                       ^^^^^^^^^^^^^^ expected `i32`, found struct `Box`
+   |                       ^^^^^^^^^^^^^^ expected `i32`, found `Box<i32>`
    |
    = note: expected type `i32`
             found struct `Box<i32>`
index 44968244c4d051bf5c8fa3b1f29912a6814cb023..f94422a9269856b29dd7e1bb670d5e259ae92cff 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:9:27
    |
 LL |     let _ = type_ascribe!(box { [1, 2, 3] }, Box<[i32]>);
-   |                           ^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
+   |                           ^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
    |
    = note: expected struct `Box<[i32]>`
               found struct `Box<[i32; 3]>`
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:10:27
    |
 LL |     let _ = type_ascribe!(box if true { [1, 2, 3] } else { [1, 3, 4] }, Box<[i32]>);
-   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
+   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
    |
    = note: expected struct `Box<[i32]>`
               found struct `Box<[i32; 3]>`
@@ -20,7 +20,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:11:27
    |
 LL |     let _ = type_ascribe!(box match true { true => [1, 2, 3], false => [1, 3, 4] }, Box<[i32]>);
-   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
+   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
    |
    = note: expected struct `Box<[i32]>`
               found struct `Box<[i32; 3]>`
@@ -29,7 +29,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:13:27
    |
 LL |     let _ = type_ascribe!(box { |x| (x as u8) }, Box<dyn Fn(i32) -> _>);
-   |                           ^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
+   |                           ^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Fn(i32) -> u8>`, found `Box<[closure@coerce-expect-unsized-ascribed.rs:13:33]>`
    |
    = note: expected struct `Box<dyn Fn(i32) -> u8>`
               found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:13:33: 13:36]>`
@@ -38,7 +38,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:14:27
    |
 LL |     let _ = type_ascribe!(box if true { false } else { true }, Box<dyn Debug>);
-   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `bool`
+   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Debug>`, found `Box<bool>`
    |
    = note: expected struct `Box<dyn Debug>`
               found struct `Box<bool>`
@@ -47,7 +47,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:15:27
    |
 LL |     let _ = type_ascribe!(box match true { true => 'a', false => 'b' }, Box<dyn Debug>);
-   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `char`
+   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Debug>`, found `Box<char>`
    |
    = note: expected struct `Box<dyn Debug>`
               found struct `Box<char>`
@@ -56,7 +56,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:17:27
    |
 LL |     let _ = type_ascribe!(&{ [1, 2, 3] }, &[i32]);
-   |                           ^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
+   |                           ^^^^^^^^^^^^^^ expected `&[i32]`, found `&[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:27
    |
 LL |     let _ = type_ascribe!(&if true { [1, 2, 3] } else { [1, 3, 4] }, &[i32]);
-   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
+   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&[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:27
    |
 LL |     let _ = type_ascribe!(&match true { true => [1, 2, 3], false => [1, 3, 4] }, &[i32]);
-   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
+   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i32]`, found `&[i32; 3]`
    |
    = note: expected reference `&[i32]`
               found reference `&[i32; 3]`
@@ -83,7 +83,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:21:27
    |
 LL |     let _ = type_ascribe!(&{ |x| (x as u8) }, &dyn Fn(i32) -> _);
-   |                           ^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
+   |                           ^^^^^^^^^^^^^^^^^^ expected `&dyn Fn(i32) -> u8`, found `&[closure@coerce-expect-unsized-ascribed.rs:21:30]`
    |
    = note: expected reference `&dyn Fn(i32) -> u8`
               found reference `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:21:30: 21:33]`
@@ -92,7 +92,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:22:27
    |
 LL |     let _ = type_ascribe!(&if true { false } else { true }, &dyn Debug);
-   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `bool`
+   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&dyn Debug`, found `&bool`
    |
    = note: expected reference `&dyn Debug`
               found reference `&bool`
@@ -101,7 +101,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:23:27
    |
 LL |     let _ = type_ascribe!(&match true { true => 'a', false => 'b' }, &dyn Debug);
-   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Debug`, found `char`
+   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&dyn Debug`, found `&char`
    |
    = note: expected reference `&dyn Debug`
               found reference `&char`
@@ -110,7 +110,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:25:27
    |
 LL |     let _ = type_ascribe!(Box::new([1, 2, 3]), Box<[i32]>);
-   |                           ^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]`
+   |                           ^^^^^^^^^^^^^^^^^^^ expected `Box<[i32]>`, found `Box<[i32; 3]>`
    |
    = note: expected struct `Box<[i32]>`
               found struct `Box<[i32; 3]>`
@@ -119,7 +119,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-expect-unsized-ascribed.rs:26:27
    |
 LL |     let _ = type_ascribe!(Box::new(|x| (x as u8)), Box<dyn Fn(i32) -> _>);
-   |                           ^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
+   |                           ^^^^^^^^^^^^^^^^^^^^^^^ expected `Box<dyn Fn(i32) -> u8>`, found `Box<[closure@coerce-expect-unsized-ascribed.rs:26:36]>`
    |
    = note: expected struct `Box<dyn Fn(i32) -> u8>`
               found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:26:36: 26:39]>`
index 1207dc7e7a2ff4415da00c5e039b3e4b16418d39..3c737358adc77ed1be8d99ae488f0271ddeb0872 100644 (file)
@@ -82,7 +82,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-to-bang.rs:50:21
    |
 LL |     let x: [!; 2] = [return, 22];
-   |            ------   ^^^^^^^^^^^^ expected `!`, found integer
+   |            ------   ^^^^^^^^^^^^ expected `[!; 2]`, found `[{integer}; 2]`
    |            |
    |            expected due to this
    |
index 4c04bb11351692c81e3db9e01238833c819e977a..288e945f1f8d5eb0625bfaf5357849ff89ed4085 100644 (file)
@@ -12,7 +12,7 @@ error[E0308]: mismatched types
   --> $DIR/coercion-missing-tail-expected-type.rs:8:13
    |
 LL | fn foo() -> Result<u8, u64> {
-   |    ---      ^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
+   |    ---      ^^^^^^^^^^^^^^^ expected `Result<u8, u64>`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
 LL |     Ok(1);
index b756c8f8203a086df7e2b8690d5a1c728db3f44a..b99235dd37f89ae0bcb2c019820fd1e60f119ff8 100644 (file)
@@ -3,5 +3,5 @@
 fn main() {
     let _: &[i32] = [0];
     //~^ ERROR mismatched types
-    //~| expected `&[i32]`, found array `[{integer}; 1]`
+    //~| expected `&[i32]`, found `[{integer}; 1]`
 }
index 42dc954ffd5e7c454d7b6e810fb94a1cd4b48efc..c7b856a57ebc9516f01c40fa6a8982cb8ac02508 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     let _: &[i32] = [0];
    |            ------   ^^^
    |            |        |
-   |            |        expected `&[i32]`, found array `[{integer}; 1]`
+   |            |        expected `&[i32]`, found `[{integer}; 1]`
    |            |        help: consider borrowing here: `&[0]`
    |            expected due to this
 
index cad942e646e3ee24037c579c69ae1f54950f6bae..f632a53f264e027bbb5018662e3281fe1c7b1979 100644 (file)
@@ -4,7 +4,7 @@ error[E0053]: method `poll` has an incompatible type for trait
 LL |     fn poll(self, _: &mut Context<'_>) -> Poll<()> {
    |             ^^^^
    |             |
-   |             expected struct `Pin`, found struct `MyFuture`
+   |             expected `Pin<&mut MyFuture>`, found `MyFuture`
    |             help: change the self-receiver type to match the trait: `self: Pin<&mut MyFuture>`
    |
    = note: expected signature `fn(Pin<&mut MyFuture>, &mut Context<'_>) -> Poll<_>`
@@ -16,7 +16,7 @@ error[E0053]: method `foo` has an incompatible type for trait
 LL |     fn foo(self: Box<Self>) {}
    |            ------^^^^^^^^^
    |            |     |
-   |            |     expected struct `MyFuture`, found struct `Box`
+   |            |     expected `MyFuture`, found `Box<MyFuture>`
    |            help: change the self-receiver type to match the trait: `self`
    |
 note: type in trait
@@ -31,7 +31,7 @@ error[E0053]: method `bar` has an incompatible type for trait
   --> $DIR/bad-self-type.rs:24:18
    |
 LL |     fn bar(self) {}
-   |                  ^ expected enum `Option`, found `()`
+   |                  ^ expected `Option<()>`, found `()`
    |
 note: type in trait
   --> $DIR/bad-self-type.rs:18:21
index 52c54aace5f16726356081b592aee88581f5e180..9c4f0bc950b2dba0add854d123d752e82752ee5a 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/mismatch.rs:7:26
    |
 LL |     let e: Example<13> = ();
-   |            -----------   ^^ expected struct `Example`, found `()`
+   |            -----------   ^^ expected `Example`, found `()`
    |            |
    |            expected due to this
    |
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
   --> $DIR/mismatch.rs:10:32
    |
 LL |     let e: Example2<u32, 13> = ();
-   |            -----------------   ^^ expected struct `Example2`, found `()`
+   |            -----------------   ^^ expected `Example2`, found `()`
    |            |
    |            expected due to this
    |
@@ -24,7 +24,7 @@ error[E0308]: mismatched types
   --> $DIR/mismatch.rs:13:32
    |
 LL |     let e: Example3<13, u32> = ();
-   |            -----------------   ^^ expected struct `Example3`, found `()`
+   |            -----------------   ^^ expected `Example3`, found `()`
    |            |
    |            expected due to this
    |
@@ -35,7 +35,7 @@ error[E0308]: mismatched types
   --> $DIR/mismatch.rs:16:26
    |
 LL |     let e: Example3<7> = ();
-   |            -----------   ^^ expected struct `Example3`, found `()`
+   |            -----------   ^^ expected `Example3<7>`, found `()`
    |            |
    |            expected due to this
    |
@@ -46,7 +46,7 @@ error[E0308]: mismatched types
   --> $DIR/mismatch.rs:19:26
    |
 LL |     let e: Example4<7> = ();
-   |            -----------   ^^ expected struct `Example4`, found `()`
+   |            -----------   ^^ expected `Example4<7>`, found `()`
    |            |
    |            expected due to this
    |
index 9baf9790e19b321601d2de1af2bd37bf8d08c790..511ae58a1dcdd1408893b006b887bd5342208f89 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-79518-default_trait_method_normalization.rs:16:32
    |
 LL |         Self::AssocInstance == [(); std::mem::size_of::<Self::Assoc>()];
-   |         -------------------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found array `[(); std::mem::size_of::<Self::Assoc>()]`
+   |         -------------------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found `[(); std::mem::size_of::<Self::Assoc>()]`
    |         |
    |         expected because this is `<Self as Foo>::Assoc`
    |
index 8e18fcdffab7063dea9fd34e6262d89d8e2b356d..8879aec35e5994bf12f8b0363ab5a4f9bc30fc7f 100644 (file)
@@ -5,7 +5,7 @@ LL | struct Bug<S> {
    |            - this type parameter
 ...
 LL |         let x: S = MaybeUninit::uninit();
-   |                -   ^^^^^^^^^^^^^^^^^^^^^ expected type parameter `S`, found union `MaybeUninit`
+   |                -   ^^^^^^^^^^^^^^^^^^^^^ expected type parameter `S`, found `MaybeUninit<_>`
    |                |
    |                expected due to this
    |
index 8d779bee265cf2914c24c6f12b3272bb35578e5c..b28ae8f7e7101480651342078ed330458f4da7dc 100644 (file)
@@ -8,7 +8,7 @@ error[E0308]: mismatched types
   --> $DIR/type_mismatch.rs:5:26
    |
 LL | fn bar<const N: u8>() -> [u8; N] {}
-   |    ---                   ^^^^^^^ expected array `[u8; N]`, found `()`
+   |    ---                   ^^^^^^^ expected `[u8; N]`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
 
index 16796acb3d2855a7d62ec7e3ed3d74ed6b5b3582..5f45550a6279633d319357f64a90f69bbd81ee13 100644 (file)
@@ -14,7 +14,7 @@ error[E0308]: mismatched types
   --> $DIR/type_not_in_scope.rs:7:33
    |
 LL | fn getn<const N: cfg_attr>() -> [u8; N] {}
-   |    ----                         ^^^^^^^ expected array `[u8; N]`, found `()`
+   |    ----                         ^^^^^^^ expected `[u8; N]`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
 
index b6a22df74369a3ebc849e884d4f0ebd6869fae0b..13cd5d17d4127ab89fd31917ef437b12f374c041 100644 (file)
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
   --> $DIR/types-mismatch-const-args.rs:16:41
    |
 LL |     let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData };
-   |            --------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32`
+   |            --------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `A<'_, u16, 2, 3>`, found `A<'_, u32, 2, 3>`
    |            |
    |            expected due to this
    |
@@ -22,7 +22,7 @@ error[E0308]: mismatched types
   --> $DIR/types-mismatch-const-args.rs:18:41
    |
 LL |     let _: A<'a, u16, {4u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData };
-   |            --------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32`
+   |            --------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `A<'_, u16, 4, 3>`, found `A<'_, u32, 2, 3>`
    |            |
    |            expected due to this
    |
index 6ac93a08d5d68af34f939cdc2f202b7c802e75e3..cae3adfa128d08c338fb3fe54017b49c119a7df7 100644 (file)
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
   --> $DIR/types-mismatch-const-args.rs:16:41
    |
 LL |     let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData };
-   |            --------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32`
+   |            --------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `A<'_, u16, 2, 3>`, found `A<'_, u32, 2, 3>`
    |            |
    |            expected due to this
    |
@@ -24,7 +24,7 @@ error[E0308]: mismatched types
   --> $DIR/types-mismatch-const-args.rs:18:41
    |
 LL |     let _: A<'a, u16, {4u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData };
-   |            --------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32`
+   |            --------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `A<'_, u16, 4, 3>`, found `A<'_, u32, 2, 3>`
    |            |
    |            expected due to this
    |
index 82f101b47cfebba6cedece8ca3e45d87307ba46c..1667c77d124c5f3e3675cd32c46b8237a27f2577 100644 (file)
@@ -8,7 +8,7 @@
 enum E {
     V = CONSTANT,
     //~^ ERROR mismatched types
-    //~| expected `isize`, found struct `S`
+    //~| expected `isize`, found `S`
 }
 
 fn main() {}
index c5b001899ff924a4af4c0bd4ede6562a6f71646e..fe33ad4905a5cc261d4a5e3d613c8e2dd2a227d5 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/const-eval-span.rs:9:9
    |
 LL |     V = CONSTANT,
-   |         ^^^^^^^^ expected `isize`, found struct `S`
+   |         ^^^^^^^^ expected `isize`, found `S`
 
 error: aborting due to previous error
 
index 778a212249c19d68aa0b944ac89ca36d78f250ba..18f4f59d3785ceb4b3a25b34a551871a94831e51 100644 (file)
@@ -2,7 +2,7 @@
 
 const TUP: (usize,) = 5usize << 64;
 //~^ ERROR mismatched types
-//~| expected tuple, found `usize`
+//~| expected `(usize,)`, found `usize`
 const ARR: [i32; TUP.0] = [];
 //~^ constant
 
index ad8468056172633d04debcdd183dfdca27121ebc..65f0520f8a46ee19f747d3fd20d08246a0912173 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/const-tup-index-span.rs:3:23
    |
 LL | const TUP: (usize,) = 5usize << 64;
-   |                       ^^^^^^^^^^^^ expected tuple, found `usize`
+   |                       ^^^^^^^^^^^^ expected `(usize,)`, found `usize`
    |
    = note: expected tuple `(usize,)`
                found type `usize`
index d579a54e9836fb76c713521fc0dfa77a57481ee3..b6a1725076bc63cf3a8599fa1ce182d1629e065e 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/nested_erroneous_ctfe.rs:2:16
    |
 LL |     [9; || [9; []]];
-   |                ^^ expected `usize`, found array of 0 elements
+   |                ^^ expected `usize`, found `[_; 0]`
    |
    = note: expected type `usize`
              found array `[_; 0]`
index 81f309eae087c9755687a1dc426efa5c6e535528..4f5af106613f634d7fb6f2d3b1c734d8efb64945 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/cross-borrow-trait.rs:10:26
    |
 LL |     let _y: &dyn Trait = x;
-   |             ----------   ^ expected `&dyn Trait`, found struct `Box`
+   |             ----------   ^ expected `&dyn Trait`, found `Box<dyn Trait>`
    |             |
    |             expected due to this
    |
index 993468b5e826bf9e2ecead481144468c6731c5ab..b5b79ed3771c32f3b6c965631e36b83c63a7ac5e 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match String::new() {
    |           ------------- this expression has type `String`
 LL |         "" | _ => {}
-   |         ^^ expected struct `String`, found `&str`
+   |         ^^ expected `String`, found `&str`
 
 error: aborting due to previous error
 
index 18a889837dfdb6852c7da225426dbd3cb1033acc..38d201888272708725f605e61ca94a3d5dced661 100644 (file)
@@ -22,7 +22,7 @@ error[E0308]: mismatched types
 LL |     let &&x = &1isize as &dyn T;
    |          ^^   ----------------- this expression has type `&dyn T`
    |          |
-   |          expected trait object `dyn T`, found reference
+   |          expected `dyn T`, found `&_`
    |
    = note: expected trait object `dyn T`
                  found reference `&_`
@@ -38,7 +38,7 @@ error[E0308]: mismatched types
 LL |     let &&&x = &(&1isize as &dyn T);
    |           ^^   -------------------- this expression has type `&&dyn T`
    |           |
-   |           expected trait object `dyn T`, found reference
+   |           expected `dyn T`, found `&_`
    |
    = note: expected trait object `dyn T`
                  found reference `&_`
@@ -54,7 +54,7 @@ error[E0308]: mismatched types
 LL |     let box box x = Box::new(1isize) as Box<dyn T>;
    |             ^^^^^   ------------------------------ this expression has type `Box<dyn T>`
    |             |
-   |             expected trait object `dyn T`, found struct `Box`
+   |             expected `dyn T`, found `Box<_>`
    |
    = note: expected trait object `dyn T`
                     found struct `Box<_>`
index 950e0223e2201161bd8c5e459684fe53899d4840..b285ee1f30482125dc8b0e461592338e76e64fb8 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     (x, y) = &(1, 2);
    |     ^^^^^^   ------- this expression has type `&({integer}, {integer})`
    |     |
-   |     expected reference, found tuple
+   |     expected `&({integer}, {integer})`, found `(_, _)`
    |
    = note: expected reference `&({integer}, {integer})`
                   found tuple `(_, _)`
index 1c99898bc8329fc03ec2699ff0cf5937cf9cdfab..20b018b9f77212b7cfecb47be39ac3666929dc82 100644 (file)
@@ -16,7 +16,7 @@ LL |  |         Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok...
 LL |  |             Ok("")
 LL |  |         ))))))))))))))))))))))))))))))
 LL |  |     ))))))))))))))))))))))))))))));
-   |  |__________________________________^ expected struct `Atype`, found enum `Result`
+   |  |__________________________________^ expected `Atype<Btype<..., ...>, ...>`, found `Result<Result<..., ...>, ...>`
    |
    = note: expected struct `Atype<Btype<..., ...>, ...>`
            the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt'
@@ -32,7 +32,7 @@ LL | |         Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(...
 LL | |             Ok(Ok(Ok(Ok(Ok(Ok(Ok("")))))))
 LL | |         ))))))))))))))))))))))))))))))
 LL | |     ))))))))))))))))))))))));
-   | |____________________________^ expected enum `Option`, found enum `Result`
+   | |____________________________^ expected `Option<Result<..., ...>>`, found `Result<Result<..., ...>, ...>`
    |
    = note: expected enum `Option<Result<..., ...>>`
            the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt'
@@ -50,7 +50,7 @@ LL | |           Atype<
 ...  |
 LL | |       i32
 LL | |     > = ();
-   | |     -   ^^ expected struct `Atype`, found `()`
+   | |     -   ^^ expected `Atype<Btype<..., ...>, ...>`, found `()`
    | |_____|
    |       expected due to this
    |
@@ -69,7 +69,7 @@ LL | |         Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(...
 LL | |             Ok(Ok(Ok(Ok(Ok(Ok(Ok("")))))))
 LL | |         ))))))))))))))))))))))))))))))
 LL | |     ))))))))))))))))))))))));
-   | |____________________________^ expected `()`, found enum `Result`
+   | |____________________________^ expected `()`, found `Result<Result<..., ...>, ...>`
    |
    = note: expected unit type `()`
                    found enum `Result<Result<..., ...>, ...>`
index 6ded03e45b55e9bc1e608468b533d0c9e83d02b0..a7ec192592e0d4d0deba2e4977737b38fbb8c433 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/brackets-to-braces-single-element.rs:1:24
    |
 LL | const A: [&str; 1] = { "hello" };
-   |                        ^^^^^^^ expected array `[&'static str; 1]`, found `&str`
+   |                        ^^^^^^^ expected `[&str; 1]`, found `&str`
    |
 help: to create an array, use square brackets instead of curly braces
    |
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
   --> $DIR/brackets-to-braces-single-element.rs:4:19
    |
 LL | const B: &[u32] = &{ 1 };
-   |                   ^^^^^^ expected slice `[u32]`, found integer
+   |                   ^^^^^^ expected `&[u32]`, found `&{integer}`
    |
    = note: expected reference `&'static [u32]`
               found reference `&{integer}`
@@ -26,7 +26,7 @@ error[E0308]: mismatched types
   --> $DIR/brackets-to-braces-single-element.rs:7:27
    |
 LL | const C: &&[u32; 1] = &&{ 1 };
-   |                           ^ expected array `[u32; 1]`, found integer
+   |                           ^ expected `[u32; 1]`, found integer
    |
 help: to create an array, use square brackets instead of curly braces
    |
index 473468af6eef8a6eacaf637d654786c5edf1dc9f..5e48871bb01bb840db6eacba8f7320b214e81646 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match f {
    |           - this expression has type `Foo`
 LL |         Bar { x } => {
-   |         ^^^^^^^^^ expected enum `Foo`, found struct `Bar`
+   |         ^^^^^^^^^ expected `Foo`, found `Bar`
    |
 help: try wrapping the pattern in `Foo::Bar`
    |
@@ -22,7 +22,7 @@ LL |     match s {
 LL |         S => {
    |         ^
    |         |
-   |         expected enum `Option`, found struct `S`
+   |         expected `Option<S>`, found `S`
    |         `S` is interpreted as a unit struct, not a new binding
    |
    = note: expected enum `Option<S>`
@@ -47,7 +47,7 @@ LL |     match s {
 LL |         S => {
    |         ^
    |         |
-   |         expected enum `Result`, found struct `S`
+   |         expected `Result<S, S>`, found `S`
    |         `S` is interpreted as a unit struct, not a new binding
    |
    = note: expected enum `Result<S, S>`
index fe81da19833a7e2baba18c922b3c834d8578aea6..7b88d93ead112bd21905a8c4de5660626d663f56 100644 (file)
@@ -7,7 +7,7 @@ LL | /     while false {
 LL | |
 LL | |         f();
 LL | |     }
-   | |_____^ expected enum `Option`, found `()`
+   | |_____^ expected `Option<()>`, found `()`
    |
    = note:   expected enum `Option<()>`
            found unit type `()`
@@ -26,7 +26,7 @@ error[E0308]: mismatched types
 LL | fn b() -> Result<(), ()> {
    |           -------------- expected `Result<(), ()>` because of return type
 LL |     f()
-   |     ^^^ expected enum `Result`, found `()`
+   |     ^^^ expected `Result<(), ()>`, found `()`
    |
    = note:   expected enum `Result<(), ()>`
            found unit type `()`
@@ -45,7 +45,7 @@ LL | /     for _ in [1, 2] {
 LL | |
 LL | |         f();
 LL | |     }
-   | |_____^ expected enum `Option`, found `()`
+   | |_____^ expected `Option<()>`, found `()`
    |
    = note:   expected enum `Option<()>`
            found unit type `()`
@@ -62,7 +62,7 @@ error[E0308]: `?` operator has incompatible types
   --> $DIR/compatible-variants.rs:35:5
    |
 LL |     c()?
-   |     ^^^^ expected enum `Option`, found `()`
+   |     ^^^^ expected `Option<()>`, found `()`
    |
    = note: `?` operator cannot convert from `()` to `Option<()>`
    = note:   expected enum `Option<()>`
@@ -85,7 +85,7 @@ error[E0308]: mismatched types
   --> $DIR/compatible-variants.rs:42:25
    |
 LL |     let _: Option<()> = while false {};
-   |            ----------   ^^^^^^^^^^^^^^ expected enum `Option`, found `()`
+   |            ----------   ^^^^^^^^^^^^^^ expected `Option<()>`, found `()`
    |            |
    |            expected due to this
    |
@@ -100,7 +100,7 @@ error[E0308]: mismatched types
   --> $DIR/compatible-variants.rs:46:9
    |
 LL |         while false {}
-   |         ^^^^^^^^^^^^^^ expected enum `Option`, found `()`
+   |         ^^^^^^^^^^^^^^ expected `Option<()>`, found `()`
    |
    = note:   expected enum `Option<()>`
            found unit type `()`
@@ -117,7 +117,7 @@ error[E0308]: mismatched types
   --> $DIR/compatible-variants.rs:50:31
    |
 LL |     let _: Result<i32, i32> = 1;
-   |            ----------------   ^ expected enum `Result`, found integer
+   |            ----------------   ^ expected `Result<i32, i32>`, found integer
    |            |
    |            expected due to this
    |
@@ -134,7 +134,7 @@ error[E0308]: mismatched types
   --> $DIR/compatible-variants.rs:53:26
    |
 LL |     let _: Option<i32> = 1;
-   |            -----------   ^ expected enum `Option`, found integer
+   |            -----------   ^ expected `Option<i32>`, found integer
    |            |
    |            expected due to this
    |
@@ -149,7 +149,7 @@ error[E0308]: mismatched types
   --> $DIR/compatible-variants.rs:56:28
    |
 LL |     let _: Hey<i32, i32> = 1;
-   |            -------------   ^ expected enum `Hey`, found integer
+   |            -------------   ^ expected `Hey<i32, i32>`, found integer
    |            |
    |            expected due to this
    |
@@ -166,7 +166,7 @@ error[E0308]: mismatched types
   --> $DIR/compatible-variants.rs:59:29
    |
 LL |     let _: Hey<i32, bool> = false;
-   |            --------------   ^^^^^ expected enum `Hey`, found `bool`
+   |            --------------   ^^^^^ expected `Hey<i32, bool>`, found `bool`
    |            |
    |            expected due to this
    |
@@ -181,7 +181,7 @@ error[E0308]: mismatched types
   --> $DIR/compatible-variants.rs:63:19
    |
 LL |     let _ = Foo { bar };
-   |                   ^^^ expected enum `Option`, found `i32`
+   |                   ^^^ expected `Option<i32>`, found `i32`
    |
    = note: expected enum `Option<i32>`
               found type `i32`
@@ -194,7 +194,7 @@ error[E0308]: mismatched types
   --> $DIR/compatible-variants.rs:80:16
    |
 LL |     let a: A = B::Fst;
-   |            -   ^^^^^^ expected enum `A`, found enum `B`
+   |            -   ^^^^^^ expected `A`, found `B`
    |            |
    |            expected due to this
    |
@@ -207,7 +207,7 @@ error[E0308]: mismatched types
   --> $DIR/compatible-variants.rs:86:17
    |
 LL |     let a: A2 = B::Fst;
-   |            --   ^^^^^^ expected struct `A2`, found enum `B`
+   |            --   ^^^^^^ expected `A2`, found `B`
    |            |
    |            expected due to this
    |
index 6a7fd8fe251dc16c06e50e2ff5f0db20780036a8..3819a5a187f97a8d0f4f725bfa5855d3d220a246 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-42764.rs:11:43
    |
 LL |     this_function_expects_a_double_option(n);
-   |     ------------------------------------- ^ expected enum `DoubleOption`, found `usize`
+   |     ------------------------------------- ^ expected `DoubleOption<_>`, found `usize`
    |     |
    |     arguments to this function are incorrect
    |
@@ -24,7 +24,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-42764.rs:27:33
    |
 LL |     let _c = Context { wrapper: Payload{} };
-   |                                 ^^^^^^^^^ expected struct `Wrapper`, found struct `Payload`
+   |                                 ^^^^^^^^^ expected `Wrapper`, found `Payload`
    |
 help: try wrapping the expression in `Wrapper`
    |
index a6b5681a68cba3ef0402ee6cbf68e9f486faeb74..32fb628c4707be78aeac0a2d4ad0bf714dd3dc3c 100644 (file)
@@ -10,7 +10,7 @@ error[E0308]: mismatched types
   --> $DIR/recursion_limit_deref.rs:51:22
    |
 LL |     let x: &Bottom = &t;
-   |            -------   ^^ expected struct `Bottom`, found struct `Top`
+   |            -------   ^^ expected `&Bottom`, found `&Top`
    |            |
    |            expected due to this
    |
index 87560c4c79735a9d83508be7d61b2e77a40c7893..7d8293018d27b7e80f557f092a128dbbd82c6256 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/disambiguate-identical-names.rs:13:10
    |
 LL |     test(&v);
-   |     ---- ^^ expected struct `Vec`, found struct `HashMap`
+   |     ---- ^^ expected `&Vec<Vec<u32>>`, found `&HashMap<u8, u8>`
    |     |
    |     arguments to this function are incorrect
    |
index 21361489a2c3af70f14e1c2e19936a726725b20e..f5b5a4cccad2c0196705264176826c331c0d06a0 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 `[u8; 8]`
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `!`, found `[u8; 8]`
    |
    = note: expected type `!`
              found array `[u8; 8]`
index d05b3937c998ccfaec6541d8347cda5ce09a0fa7..d199864d99c2d280be5ec568500b714f1f2d65cd 100644 (file)
@@ -32,7 +32,7 @@ pub fn main() {
     let z: Box<dyn ToBar> = Box::new(Bar1 {f: 36});
     f5.2 = Bar1 {f: 36};
     //~^ ERROR mismatched types
-    //~| expected trait object `dyn ToBar`, found struct `Bar1`
+    //~| expected `dyn ToBar`, found `Bar1`
     //~| expected trait object `dyn ToBar`
     //~| found struct `Bar1`
     //~| ERROR the size for values of type
index b326dbbbc1405aa6878025adc299b196c9bb5911..6dd3434fd21bef830e3bbf721f34ff32d73f7eff 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-assign-3.rs:33:12
    |
 LL |     f5.2 = Bar1 {f: 36};
-   |     ----   ^^^^^^^^^^^^ expected trait object `dyn ToBar`, found struct `Bar1`
+   |     ----   ^^^^^^^^^^^^ expected `dyn ToBar`, found `Bar1`
    |     |
    |     expected due to the type of this binding
    |
index 496e01ae005326748fd9f162e8642ed0ff1b1d4c..c55fb2c3e570993ac7ccc71290e175704712cdf5 100644 (file)
@@ -34,7 +34,7 @@ pub fn main() {
     let z: Box<dyn ToBar> = Box::new(Bar1 {f: 36});
     f5.ptr = Bar1 {f: 36};
     //~^ ERROR mismatched types
-    //~| expected trait object `dyn ToBar`, found struct `Bar1`
+    //~| expected `dyn ToBar`, found `Bar1`
     //~| expected trait object `dyn ToBar`
     //~| found struct `Bar1`
     //~| ERROR the size for values of type
index 614f213875129fa0fb1124b92ff899534000f4fc..d8d1057876f4f967b78e60bc8adc32d52f33a530 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-assign.rs:35:14
    |
 LL |     f5.ptr = Bar1 {f: 36};
-   |     ------   ^^^^^^^^^^^^ expected trait object `dyn ToBar`, found struct `Bar1`
+   |     ------   ^^^^^^^^^^^^ expected `dyn ToBar`, found `Bar1`
    |     |
    |     expected due to the type of this binding
    |
index 594acff853a0eb5b805917f162ffa8f0c489aff6..ff77bd4cef88f3d714767f134dff59bdbe27c7a1 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 `[usize]`, found array `[isize; 3]`
+   |             -------------   ^^ expected `&Fat<[usize]>`, found `&Fat<[isize; 3]>`
    |             |
    |             expected due to this
    |
@@ -21,7 +21,7 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coerce1.rs:28:27
    |
 LL |     let f3: &([usize],) = f2;
-   |             -----------   ^^ expected slice `[usize]`, found array `[isize; 3]`
+   |             -----------   ^^ expected `&([usize],)`, found `&([isize; 3],)`
    |             |
    |             expected due to this
    |
index f63da60d281d7069e3fee802bd3cfba3368ae6cc..9f297915e58c9b17596ca9fc11aff97432c12520 100644 (file)
@@ -11,7 +11,7 @@ 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 `&Fat<[isize; 3]>`, found `&Fat<[isize]>`
     //~| expected reference `&Fat<[isize; 3]>`
     //~| found reference `&Fat<[isize]>`
 
@@ -19,7 +19,7 @@ pub fn main() {
     let f1: &([isize],) = &([1, 2, 3],);
     let f2: &([isize; 3],) = f1;
     //~^ ERROR mismatched types
-    //~| expected array `[isize; 3]`, found slice `[isize]`
+    //~| expected `&([isize; 3],)`, found `&([isize],)`
     //~| expected reference `&([isize; 3],)`
     //~| found reference `&([isize],)`
 }
index 4c9954f35208bf87152daf65a4e1ca5a6d658c92..46e7dba817c846809647d2a3a6644a1bdb7ecf78 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 `[isize; 3]`, found slice `[isize]`
+   |             ----------------   ^^ expected `&Fat<[isize; 3]>`, found `&Fat<[isize]>`
    |             |
    |             expected due to this
    |
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
   --> $DIR/dst-bad-coerce4.rs:20:30
    |
 LL |     let f2: &([isize; 3],) = f1;
-   |             --------------   ^^ expected array `[isize; 3]`, found slice `[isize]`
+   |             --------------   ^^ expected `&([isize; 3],)`, found `&([isize],)`
    |             |
    |             expected due to this
    |
index a3f4d21ca94bd882f67d9fd074e2ecbf9fac18bb..66e1b9a092c364ffbe292a14a598aa0c45448123 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/no-implicit-dyn-star.rs:6:48
    |
 LL |     dyn_star_foreign::require_dyn_star_display(1usize);
-   |     ------------------------------------------ ^^^^^^ expected trait object `dyn Display`, found `usize`
+   |     ------------------------------------------ ^^^^^^ expected `dyn Display`, found `usize`
    |     |
    |     arguments to this function are incorrect
    |
index 48a4a5bcad2b57365524fa37a430db1b3d14c445..75c3ab13caccc681b9658feedeca20dac9e58032 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     let empty_struct::XEmpty2 = ();
    |         ^^^^^^^^^^^^^^^^^^^^^   -- this expression has type `()`
    |         |
-   |         expected `()`, found struct `XEmpty2`
+   |         expected `()`, found `XEmpty2`
 
 error[E0308]: mismatched types
   --> $DIR/issue-37026.rs:7:9
@@ -12,7 +12,7 @@ error[E0308]: mismatched types
 LL |     let empty_struct::XEmpty6(..) = ();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^   -- this expression has type `()`
    |         |
-   |         expected `()`, found struct `XEmpty6`
+   |         expected `()`, found `XEmpty6`
 
 error: aborting due to 2 previous errors
 
index bd8469de75da0cf9855bf2bacf084693ba7b0c0b..678502ba328894cdd7033a02a02ae830105b60e8 100644 (file)
@@ -3,5 +3,5 @@ enum Foo {}
 
 fn main() {
     let u = FooAlias { value: 0 };
-    //~^ ERROR expected struct, variant or union type, found enum `Foo` [E0071]
+    //~^ ERROR expected struct, variant or union type, found `Foo` [E0071]
 }
index ae312fc400aff628ee551bc22c0f2292cad87a11..7bd4ddaf26be24dc44e7aae664e0855be0c6b733 100644 (file)
@@ -1,4 +1,4 @@
-error[E0071]: expected struct, variant or union type, found enum `Foo`
+error[E0071]: expected struct, variant or union type, found `Foo`
   --> $DIR/E0071.rs:5:13
    |
 LL |     let u = FooAlias { value: 0 };
index ca25aa64eb8be0454d435a49a6000b06c10bc26e..3e6dc5cefadf2e4275ece0df6e215d06c11e26e6 100644 (file)
@@ -9,7 +9,7 @@ LL |     type B;
 LL | fn foo(r: &A) -> &B {
    |                  -- expected `&B` because of return type
 LL |     r
-   |     ^ expected extern type `B`, found extern type `A`
+   |     ^ expected `&B`, found `&A`
    |
    = note: expected reference `&B`
               found reference `&A`
index c2619d6df58b31d0007903e5f1cf9ad600454a78..d716bbe51affc9ec3953c4fa819afbb90c5ac113 100644 (file)
@@ -302,7 +302,7 @@ error[E0308]: mismatched types
 LL |     println!("{} {:.*} {}", 1, 3.2, 4);
    |                                ^^^
    |                                |
-   |                                expected `usize`, found floating-point number
+   |                                expected `&usize`, found `&{float}`
    |                                arguments to this function are incorrect
    |
    = note: expected reference `&usize`
@@ -317,7 +317,7 @@ error[E0308]: mismatched types
 LL |     println!("{} {:07$.*} {}", 1, 3.2, 4);
    |                                   ^^^
    |                                   |
-   |                                   expected `usize`, found floating-point number
+   |                                   expected `&usize`, found `&{float}`
    |                                   arguments to this function are incorrect
    |
    = note: expected reference `&usize`
index b6ebc867d284be59a383316218a6f644f455540a..c094a34b207d9219b10f0570dc7f107af4400bba 100644 (file)
@@ -34,8 +34,7 @@ fn main() {
     eq(bar::<String>, bar::<Vec<u8>>);
     //~^ ERROR mismatched types
     //~| found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
-    //~| expected struct `String`, found struct `Vec`
-    //~| different fn items have unique types, even if their signatures are the same
+    //~| expected `String`, found `Vec<u8>`
 
     // Make sure we distinguish between trait methods correctly.
     eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
index 9d41243ef11917479aca7c97468b5e5768578352..da90b8b81c8551b2dc0d225beb5dea0e1dd76930 100644 (file)
@@ -38,7 +38,7 @@ error[E0308]: mismatched types
   --> $DIR/fn-item-type.rs:34:23
    |
 LL |     eq(bar::<String>, bar::<Vec<u8>>);
-   |     --                ^^^^^^^^^^^^^^ expected struct `String`, found struct `Vec`
+   |     --                ^^^^^^^^^^^^^^ expected `String`, found `Vec<u8>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -53,7 +53,7 @@ LL | fn eq<T>(x: T, y: T) {}
    = help: consider casting both fn items to fn pointers using `as fn(isize) -> isize`
 
 error[E0308]: mismatched types
-  --> $DIR/fn-item-type.rs:41:26
+  --> $DIR/fn-item-type.rs:40:26
    |
 LL |     eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
    |     --                   ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
@@ -71,7 +71,7 @@ LL | fn eq<T>(x: T, y: T) {}
    = help: consider casting both fn items to fn pointers using `as fn()`
 
 error[E0308]: mismatched types
-  --> $DIR/fn-item-type.rs:46:19
+  --> $DIR/fn-item-type.rs:45:19
    |
 LL |     eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
    |     --            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer
index e0bd60fbc0b5ececeb825f217bc42413b073d26d..74f79f6df5ab5c7c76da98200eca193cb0510662 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: `if` and `else` have incompatible types
   --> $DIR/fn-pointer-mismatch.rs:11:43
    |
 LL |     let g = if n % 2 == 0 { &foo } else { &bar };
-   |                             ----          ^^^^ expected fn item, found a different fn item
+   |                             ----          ^^^^ expected `&fn(u32) -> u32 {foo}`, found `&fn(u32) -> u32 {bar}`
    |                             |
    |                             expected because of this
    |
@@ -45,7 +45,7 @@ error[E0308]: mismatched types
 LL |     let c: fn(u32) -> u32 = &foo;
    |            --------------   ^^^^
    |            |                |
-   |            |                expected fn pointer, found reference
+   |            |                expected fn pointer, found `&fn(u32) -> u32 {foo}`
    |            |                help: consider removing the reference: `foo`
    |            expected due to this
    |
@@ -71,7 +71,7 @@ error[E0308]: mismatched types
 LL |     let e: &fn(u32) -> u32 = &foo;
    |            ---------------   ^^^^
    |            |                 |
-   |            |                 expected fn pointer, found fn item
+   |            |                 expected `&fn(u32) -> u32`, found `&fn(u32) -> u32 {foo}`
    |            |                 help: consider casting to a fn pointer: `&(foo as fn(u32) -> u32)`
    |            expected due to this
    |
index 2a674d3c1d23dea4ee5f1859c779a48fd02bb183..45d543bda5323ffe0176335e593bb022760b7fbf 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/fn-trait-formatting.rs:6:17
    |
 LL |     let _: () = Box::new(|_: isize| {}) as Box<dyn FnOnce(isize)>;
-   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box`
+   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Box<dyn FnOnce(isize)>`
    |            |
    |            expected due to this
    |
@@ -17,7 +17,7 @@ error[E0308]: mismatched types
   --> $DIR/fn-trait-formatting.rs:10:17
    |
 LL |     let _: () = Box::new(|_: isize, isize| {}) as Box<dyn Fn(isize, isize)>;
-   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box`
+   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Box<dyn Fn(isize, isize)>`
    |            |
    |            expected due to this
    |
@@ -32,7 +32,7 @@ error[E0308]: mismatched types
   --> $DIR/fn-trait-formatting.rs:14:17
    |
 LL |     let _: () = Box::new(|| -> isize { unimplemented!() }) as Box<dyn FnMut() -> isize>;
-   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box`
+   |            --   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Box<dyn FnMut() -> isize>`
    |            |
    |            expected due to this
    |
index d7a8c95e8b2abf5d46b73bdd3a794c19499c5e97..d00cbd8a0f24298c581d5b8694595a9d5a5a3740 100644 (file)
@@ -9,7 +9,7 @@ fn needs_ptr(_: fn(i32, u32)) {}
 fn main() {
     needs_ptr(foo);
     //~^ ERROR mismatched types
-    //~| NOTE expected `u32`, found `i32`
+    //~| NOTE expected fn pointer, found fn item
     //~| NOTE expected fn pointer `fn(i32, u32)`
     //~| NOTE arguments to this function are incorrect
 }
index 6260fc8dcec528fb0b81e2f78a91341b4b3d6294..067ee824d5d84dd522887d4e9f34bb7ee2a87eb9 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/signature-error-reporting-under-verbose.rs:10:15
    |
 LL |     needs_ptr(foo);
-   |     --------- ^^^ expected `u32`, found `i32`
+   |     --------- ^^^ expected fn pointer, found fn item
    |     |
    |     arguments to this function are incorrect
    |
index 229c174daa86493e75ebf3fa4da83254a2645693..bbca22ad2e69d3c63ae3e4cb7becbdf9d3d700cf 100644 (file)
@@ -6,5 +6,5 @@ fn main() {
     x = 5;
     //~^ ERROR mismatched types
     //~| NOTE expected enum `Option<usize>`
-    //~| NOTE expected enum `Option`, found integer
+    //~| NOTE expected `Option<usize>`, found integer
 }
index 4750c5ccdf7029c993aceba5b5f00547ae3c1db1..258a8d163936acf71be741df36875e61eb92ba69 100644 (file)
@@ -6,7 +6,7 @@ LL |     let x:
 LL |         Option<usize>;
    |         ------------- expected due to this type
 LL |     x = 5;
-   |         ^ expected enum `Option`, found integer
+   |         ^ expected `Option<usize>`, found integer
    |
    = note: expected enum `Option<usize>`
               found type `{integer}`
index 94a9f4e5692a3bb8efa1b2922ca63efe8e1e75b9..f26d3be66303df6d7d75ab40daec9574c54da28b 100644 (file)
@@ -11,7 +11,7 @@ pub enum Foo { }
 fn bar(x: x::Foo) -> y::Foo {
     return x;
     //~^ ERROR mismatched types
-    //~| expected enum `y::Foo`, found enum `x::Foo`
+    //~| expected `y::Foo`, found `x::Foo`
 }
 
 fn main() {
index a8f23f81dea025b7d690a857836eac842052d585..c7c0846595d5a60b4e1ef265d75ef332ad21cc12 100644 (file)
@@ -4,15 +4,15 @@ error[E0308]: mismatched types
 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`
+   |            ^ expected `y::Foo`, found `x::Foo`
    |
-   = note: enum `x::Foo` and enum `y::Foo` have similar names, but are actually distinct types
-note: enum `x::Foo` is defined in module `crate::x` of the current crate
+   = note: `x::Foo` and `y::Foo` have similar names, but are actually distinct types
+note: `x::Foo` is defined in module `crate::x` of the current crate
   --> $DIR/fully-qualified-type-name2.rs:4:5
    |
 LL |     pub enum Foo { }
    |     ^^^^^^^^^^^^
-note: enum `y::Foo` is defined in module `crate::y` of the current crate
+note: `y::Foo` is defined in module `crate::y` of the current crate
   --> $DIR/fully-qualified-type-name2.rs:8:5
    |
 LL |     pub enum Foo { }
index 2486ae009c1ef82d627c03e59469ba7c33f1d750..41f07bab80966cdf73fe20e7aaef4eba08a8093b 100644 (file)
@@ -7,7 +7,7 @@ fn bar(x: usize) -> Option<usize> {
     //~^ ERROR mismatched types
     //~| expected enum `Option<usize>`
     //~| found type `usize`
-    //~| expected enum `Option`, found `usize`
+    //~| expected `Option<usize>`, found `usize`
 }
 
 fn main() {
index 778b13f24cf5667b82e8e1d0bcbd0aa22c362002..6b312202bfed4f379753efcc7186705000bee685 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn bar(x: usize) -> Option<usize> {
    |                     ------------- expected `Option<usize>` because of return type
 LL |     return x;
-   |            ^ expected enum `Option`, found `usize`
+   |            ^ expected `Option<usize>`, found `usize`
    |
    = note: expected enum `Option<usize>`
               found type `usize`
index b98da1ed8be6e50b6999bf36ab44742706b8fdbe..ef6d896f8afa3148c03a2eb7a3218e14b1a2e9b7 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch-signature-deduction.rs:14:9
    |
 LL |         5
-   |         ^ expected enum `Result`, found integer
+   |         ^ expected `Result<{integer}, _>`, found integer
    |
    = note: expected enum `Result<{integer}, _>`
               found type `{integer}`
@@ -22,7 +22,7 @@ error[E0271]: type mismatch resolving `<[generator@$DIR/type-mismatch-signature-
   --> $DIR/type-mismatch-signature-deduction.rs:5:13
    |
 LL | fn foo() -> impl Generator<Return = i32> {
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Result`, found `i32`
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Result<{integer}, _>`, found `i32`
    |
    = note: expected enum `Result<{integer}, _>`
               found type `i32`
index 96c4330fec027f987a0ba181b41c6e23129d8ae2..3b65b32f45d907fa4ea7e1bb91e1d3c3f2f71dad 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/constraint-assoc-type-suggestion.rs:10:23
    |
 LL |     let b: Vec<i32> = a;
-   |            --------   ^ expected struct `Vec`, found associated type
+   |            --------   ^ expected `Vec<i32>`, found associated type
    |            |
    |            expected due to this
    |
index 6e0beec66340295a924dbe4bd9a59d020decbb95..d60856b8904bb6ec0008bea56318c85186948cd8 100644 (file)
@@ -12,40 +12,40 @@ fn main() {
     // Ensure that the printed type doesn't include the default type params...
     let _: Foo<isize> = ();
     //~^ ERROR mismatched types
-    //~| expected struct `Foo`, found `()`
+    //~| expected `Foo<isize>`, found `()`
     //~| expected struct `Foo<isize>`
     //~| found unit type `()`
 
     // ...even when they're present, but the same types as the defaults.
     let _: Foo<isize, B, C> = ();
     //~^ ERROR mismatched types
-    //~| expected struct `Foo`, found `()`
+    //~| expected `Foo<isize>`, found `()`
     //~| expected struct `Foo<isize>`
     //~| found unit type `()`
 
     // Including cases where the default is using previous type params.
     let _: HashMap<String, isize> = ();
     //~^ ERROR mismatched types
-    //~| expected struct `HashMap`, found `()`
+    //~| expected `HashMap<String, isize>`, found `()`
     //~| expected struct `HashMap<String, isize>`
     //~| found unit type `()`
     let _: HashMap<String, isize, Hash<String>> = ();
     //~^ ERROR mismatched types
-    //~| expected struct `HashMap`, found `()`
+    //~| expected `HashMap<String, isize>`, found `()`
     //~| expected struct `HashMap<String, isize>`
     //~| found unit type `()`
 
     // But not when there's a different type in between.
     let _: Foo<A, isize, C> = ();
     //~^ ERROR mismatched types
-    //~| expected struct `Foo`, found `()`
+    //~| expected `Foo<A, isize>`, found `()`
     //~| expected struct `Foo<A, isize>`
     //~| found unit type `()`
 
     // And don't print <> at all when there's just defaults.
     let _: Foo<A, B, C> = ();
     //~^ ERROR mismatched types
-    //~| expected struct `Foo`, found `()`
+    //~| expected `Foo`, found `()`
     //~| expected struct `Foo`
     //~| found unit type `()`
 }
index 4c3c003965c1f1604d90c86ecc1b1bd0d1bae9c2..946f14cc1c6384eb2bddedd502abba9a9dd1d044 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/generic-type-params-name-repr.rs:13:25
    |
 LL |     let _: Foo<isize> = ();
-   |            ----------   ^^ expected struct `Foo`, found `()`
+   |            ----------   ^^ expected `Foo<isize>`, found `()`
    |            |
    |            expected due to this
    |
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
   --> $DIR/generic-type-params-name-repr.rs:20:31
    |
 LL |     let _: Foo<isize, B, C> = ();
-   |            ----------------   ^^ expected struct `Foo`, found `()`
+   |            ----------------   ^^ expected `Foo<isize>`, found `()`
    |            |
    |            expected due to this
    |
@@ -24,7 +24,7 @@ error[E0308]: mismatched types
   --> $DIR/generic-type-params-name-repr.rs:27:37
    |
 LL |     let _: HashMap<String, isize> = ();
-   |            ----------------------   ^^ expected struct `HashMap`, found `()`
+   |            ----------------------   ^^ expected `HashMap<String, isize>`, found `()`
    |            |
    |            expected due to this
    |
@@ -35,7 +35,7 @@ error[E0308]: mismatched types
   --> $DIR/generic-type-params-name-repr.rs:32:51
    |
 LL |     let _: HashMap<String, isize, Hash<String>> = ();
-   |            ------------------------------------   ^^ expected struct `HashMap`, found `()`
+   |            ------------------------------------   ^^ expected `HashMap<String, isize>`, found `()`
    |            |
    |            expected due to this
    |
@@ -46,7 +46,7 @@ error[E0308]: mismatched types
   --> $DIR/generic-type-params-name-repr.rs:39:31
    |
 LL |     let _: Foo<A, isize, C> = ();
-   |            ----------------   ^^ expected struct `Foo`, found `()`
+   |            ----------------   ^^ expected `Foo<A, isize>`, found `()`
    |            |
    |            expected due to this
    |
@@ -57,7 +57,7 @@ error[E0308]: mismatched types
   --> $DIR/generic-type-params-name-repr.rs:46:27
    |
 LL |     let _: Foo<A, B, C> = ();
-   |            ------------   ^^ expected struct `Foo`, found `()`
+   |            ------------   ^^ expected `Foo`, found `()`
    |            |
    |            expected due to this
    |
index 095a1c6af37bcb5eb5946dbab8120bd91e4bca45..6ce56ba4b7ce5b76d5d82917181b363a34a44029 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match [5..4, 99..105, 43..44] {
    |           ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
 LL |         [_, 99.., _] => {},
-   |             ^^ expected struct `Range`, found integer
+   |             ^^ expected `Range<{integer}>`, found integer
    |
    = note: expected struct `std::ops::Range<{integer}>`
                 found type `{integer}`
index 2ea3205dcd4acef72ba300757f41be06c3f0f11b..6f56ecd4c1c9ca5e9b1f519993f5aa08c30e89d9 100644 (file)
@@ -10,7 +10,7 @@ error[E0308]: mismatched types
 LL |     match [5..4, 99..105, 43..44] {
    |           ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
 LL |         [_, 99..] => {},
-   |             ^^ expected struct `Range`, found integer
+   |             ^^ expected `Range<{integer}>`, found integer
    |
    = note: expected struct `std::ops::Range<{integer}>`
                 found type `{integer}`
index bbdf0c83f6203f073c9ba9f9876b239a5be4924a..b9b272c4c7cb62fd4523a822a0efbad301060875 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match [5..4, 99..105, 43..44] {
    |           ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
 LL |         [..9, 99..100, _] => {},
-   |            ^ expected struct `Range`, found integer
+   |            ^ expected `Range<{integer}>`, found integer
    |
    = note: expected struct `std::ops::Range<{integer}>`
                 found type `{integer}`
@@ -17,7 +17,7 @@ LL |     match [5..4, 99..105, 43..44] {
 LL |         [..9, 99..100, _] => {},
    |               ^^  --- this is of type `{integer}`
    |               |
-   |               expected struct `Range`, found integer
+   |               expected `Range<{integer}>`, found integer
    |
    = note: expected struct `std::ops::Range<{integer}>`
                 found type `{integer}`
@@ -28,7 +28,7 @@ error[E0308]: mismatched types
 LL |     match [5..4, 99..105, 43..44] {
    |           ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
 LL |         [..9, 99..100, _] => {},
-   |               --  ^^^ expected struct `Range`, found integer
+   |               --  ^^^ expected `Range<{integer}>`, found integer
    |               |
    |               this is of type `{integer}`
    |
index c608426382d9ab0adcb217d300809d833bcf1791..43e7f03b8b4ef73195439935ce82107d8f98f557 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match (0, 1) {
    |           ------ this expression has type `({integer}, {integer})`
 LL |         (PAT ..) => {}
-   |          ^^^ expected tuple, found `u8`
+   |          ^^^ expected `({integer}, {integer})`, found `u8`
    |
    = note: expected tuple `({integer}, {integer})`
                found type `u8`
index 71e196c32276e4b3c62360eba1fa0a4df5e87dda..3e388653471eba376db615f86391e51e383bfc73 100644 (file)
@@ -11,7 +11,7 @@ LL | |     ),
 LL | | ) {
    | |_- expected `&dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn Fn(u32) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a))` because of return type
 LL |       f
-   |       ^ expected reference, found `u32`
+   |       ^ expected `&dyn for<'a> Fn(&'a ...)`, found `&dyn Fn(u32)`
    |
    = note: expected reference `&dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a ...) + 'a)) + 'a)) + 'a))`
            the full type name has been written to '$TEST_BUILD_DIR/higher-rank-trait-bounds/hang-on-deeply-nested-dyn/hang-on-deeply-nested-dyn.long-type-hash.txt'
index 810f7c28c004f61efa5575ec0e1426d170def6a2..01d48ab59af1934c68219817bd3dfb9cbcd6e5fa 100644 (file)
@@ -42,7 +42,7 @@ LL | |             f: |x| {
 ...  |
 LL | |             },
 LL | |         },
-   | |_________^ expected struct `Unit3`, found struct `Unit4`
+   | |_________^ expected `Unit3`, found `Unit4`
    |
 note: required for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:16: 42:19]>` to implement `for<'r> T0<'r, (&'r u8,)>`
   --> $DIR/issue-62203-hrtb-ice.rs:17:16
index 7f73d5e12d1962a9288eb62d472d632b983b1ae4..f64ba3bf1c414d20173832d59009dfa2c4d76f3e 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/dyn-trait-return-should-be-impl-trait.rs:7:35
    |
 LL | fn fuz() -> (usize, Trait) { (42, Struct) }
-   |                                   ^^^^^^ expected trait object `dyn Trait`, found struct `Struct`
+   |                                   ^^^^^^ expected `dyn Trait`, found `Struct`
    |
    = note: expected trait object `(dyn Trait + 'static)`
                     found struct `Struct`
@@ -23,7 +23,7 @@ error[E0308]: mismatched types
   --> $DIR/dyn-trait-return-should-be-impl-trait.rs:10:39
    |
 LL | fn bar() -> (usize, dyn Trait) { (42, Struct) }
-   |                                       ^^^^^^ expected trait object `dyn Trait`, found struct `Struct`
+   |                                       ^^^^^^ expected `dyn Trait`, found `Struct`
    |
    = note: expected trait object `(dyn Trait + 'static)`
                     found struct `Struct`
@@ -110,7 +110,7 @@ LL | |         Struct
    | |         ------ expected because of this
 LL | |     } else {
 LL | |         42
-   | |         ^^ expected struct `Struct`, found integer
+   | |         ^^ expected `Struct`, found integer
 LL | |     }
    | |_____- `if` and `else` have incompatible types
 
@@ -144,7 +144,7 @@ LL | fn bam() -> Box<dyn Trait> {
    |             -------------- expected `Box<(dyn Trait + 'static)>` because of return type
 LL |     if true {
 LL |         return Struct;
-   |                ^^^^^^ expected struct `Box`, found struct `Struct`
+   |                ^^^^^^ expected `Box<dyn Trait>`, found `Struct`
    |
    = note: expected struct `Box<(dyn Trait + 'static)>`
               found struct `Struct`
@@ -161,7 +161,7 @@ LL | fn bam() -> Box<dyn Trait> {
    |             -------------- expected `Box<(dyn Trait + 'static)>` because of return type
 ...
 LL |     42
-   |     ^^ expected struct `Box`, found integer
+   |     ^^ expected `Box<dyn Trait>`, found integer
    |
    = note: expected struct `Box<(dyn Trait + 'static)>`
                 found type `{integer}`
@@ -178,7 +178,7 @@ LL | fn baq() -> Box<dyn Trait> {
    |             -------------- expected `Box<(dyn Trait + 'static)>` because of return type
 LL |     if true {
 LL |         return 0;
-   |                ^ expected struct `Box`, found integer
+   |                ^ expected `Box<dyn Trait>`, found integer
    |
    = note: expected struct `Box<(dyn Trait + 'static)>`
                 found type `{integer}`
@@ -195,7 +195,7 @@ LL | fn baq() -> Box<dyn Trait> {
    |             -------------- expected `Box<(dyn Trait + 'static)>` because of return type
 ...
 LL |     42
-   |     ^^ expected struct `Box`, found integer
+   |     ^^ expected `Box<dyn Trait>`, found integer
    |
    = note: expected struct `Box<(dyn Trait + 'static)>`
                 found type `{integer}`
@@ -212,7 +212,7 @@ LL | fn baz() -> Box<dyn Trait> {
    |             -------------- expected `Box<(dyn Trait + 'static)>` because of return type
 LL |     if true {
 LL |         Struct
-   |         ^^^^^^ expected struct `Box`, found struct `Struct`
+   |         ^^^^^^ expected `Box<dyn Trait>`, found `Struct`
    |
    = note: expected struct `Box<(dyn Trait + 'static)>`
               found struct `Struct`
@@ -229,7 +229,7 @@ LL | fn baz() -> Box<dyn Trait> {
    |             -------------- expected `Box<(dyn Trait + 'static)>` because of return type
 ...
 LL |         42
-   |         ^^ expected struct `Box`, found integer
+   |         ^^ expected `Box<dyn Trait>`, found integer
    |
    = note: expected struct `Box<(dyn Trait + 'static)>`
                 found type `{integer}`
@@ -246,7 +246,7 @@ LL | fn baw() -> Box<dyn Trait> {
    |             -------------- expected `Box<(dyn Trait + 'static)>` because of return type
 LL |     if true {
 LL |         0
-   |         ^ expected struct `Box`, found integer
+   |         ^ expected `Box<dyn Trait>`, found integer
    |
    = note: expected struct `Box<(dyn Trait + 'static)>`
                 found type `{integer}`
@@ -263,7 +263,7 @@ LL | fn baw() -> Box<dyn Trait> {
    |             -------------- expected `Box<(dyn Trait + 'static)>` because of return type
 ...
 LL |         42
-   |         ^^ expected struct `Box`, found integer
+   |         ^^ expected `Box<dyn Trait>`, found integer
    |
    = note: expected struct `Box<(dyn Trait + 'static)>`
                 found type `{integer}`
index 034ee5ea4e10cef387a944f094c9970bb5be211f..3eba419c0a3fd31f1796beff51de198f132b91d9 100644 (file)
@@ -4,7 +4,7 @@ error[E0053]: method `bar` has an incompatible return type for trait
 LL |     fn bar() -> i32 { 0 }
    |                 ^^^
    |                 |
-   |                 expected struct `Wrapper`, found `i32`
+   |                 expected `Wrapper<_>`, found `i32`
    |                 return type in trait
    |
    = note: expected struct `Wrapper<_>`
index 142b1bff1a46a265a776325d7e73eb0894cf4b22..cc3bdf0e5717ecac48e61893ad1156c6b0f06880 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |         42
    |         ^^- help: try using a conversion method: `.to_string()`
    |         |
-   |         expected struct `String`, found integer
+   |         expected `String`, found integer
 
 error: aborting due to previous error
 
index 461247a3e3ff4c532c843ad19f1c8034b9d6cf79..4742eb37d3e4d55538167770d9093016c8357b0d 100644 (file)
@@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `<&i32 as Deref>::Target == String`
   --> $DIR/default-body-type-err.rs:7:22
    |
 LL |     fn lol(&self) -> impl Deref<Target = String> {
-   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `String`
+   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`
 LL |
 LL |         &1i32
    |         ----- return type was inferred to be `&i32` here
index d4aba914908fdd6fd1d821df254bb09678beb389..6cf0c33ad919015f3852f0b4c0856f9cccc60ea3 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-102605.rs:13:20
    |
 LL |     convert_result(foo())
-   |     -------------- ^^^^^ expected enum `Result`, found opaque type
+   |     -------------- ^^^^^ expected `Result<(), _>`, found opaque type
    |     |
    |     arguments to this function are incorrect
    |
index 074d5d58d9a301afe0a265956ca5a0991fda1c2e..3b4e130fdebde3e88c8da6f700867fb30abe5e94 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-99914.rs:9:27
    |
 LL |     t.and_then(|t| -> _ { bar(t) });
-   |                           ^^^^^^ expected enum `Result`, found opaque type
+   |                           ^^^^^^ expected `Result<_, Error>`, found opaque type
    |
 note: while checking the return type of the `async fn`
   --> $DIR/issue-99914.rs:13:23
index 5b05fb2810dff635554be485cc30b3e54faa16c6..724f3c5d6747ca06890b38ab5f9c1dc84a0637bb 100644 (file)
@@ -10,7 +10,7 @@ LL |       Anonymous(|| {
    | |     arguments to this struct are incorrect
 LL | |         3
 LL | |     })
-   | |_____^ expected closure, found a different closure
+   | |_____^ expected opaque type, found closure
    |
    = note: expected opaque type `Closure`
                   found closure `[closure@$DIR/issue-74282.rs:8:15: 8:17]`
@@ -33,7 +33,7 @@ LL | |         3
 LL | |     })
    | |      ^- help: consider using a semicolon here: `;`
    | |______|
-   |        expected `()`, found struct `Anonymous`
+   |        expected `()`, found `Anonymous`
 
 error: aborting due to 2 previous errors
 
index d6f5a1ac25b641e5cc653d68404c694976c92bd2..e5147bcea16625227f7bf63f46260847ae1a614b 100644 (file)
@@ -5,7 +5,7 @@ LL | fn can() -> impl NotObjectSafe {
    |             ------------------ expected `A` because of return type
 ...
 LL |     B
-   |     ^ expected struct `A`, found struct `B`
+   |     ^ expected `A`, found `B`
 
 error[E0308]: mismatched types
   --> $DIR/object-unsafe-trait-in-return-position-impl-trait.rs:43:5
@@ -14,7 +14,7 @@ LL | fn cat() -> impl ObjectSafe {
    |             --------------- expected `A` because of return type
 ...
 LL |     B
-   |     ^ expected struct `A`, found struct `B`
+   |     ^ expected `A`, found `B`
 
 error: aborting due to 2 previous errors
 
index c7c6ca4401266c57ba9f3c613c7dcacc482c2917..f7aff41954445f69f15e98946468a9c3f2d73ed4 100644 (file)
@@ -15,7 +15,7 @@ LL |     type Foo = impl PartialEq<(Foo, i32)>;
 LL |         fn eq(&self, _other: &(Foo, i32)) -> bool {
    |                              ^^^^^^^^^^^
    |                              |
-   |                              expected struct `Bar`, found opaque type
+   |                              expected `a::Bar`, found opaque type
    |                              help: change the parameter type to match the trait: `&(a::Bar, i32)`
    |
    = note: expected signature `fn(&a::Bar, &(a::Bar, i32)) -> _`
@@ -38,7 +38,7 @@ LL |     type Foo = impl PartialEq<(Foo, i32)>;
 LL |         fn eq(&self, _other: &(Bar, i32)) -> bool {
    |                              ^^^^^^^^^^^
    |                              |
-   |                              expected opaque type, found struct `Bar`
+   |                              expected opaque type, found `b::Bar`
    |                              help: change the parameter type to match the trait: `&(b::Foo, i32)`
    |
    = note: expected signature `fn(&b::Bar, &(b::Foo, i32)) -> _`
index 817c573c0919adea861e818e556c966c42c1d916..a56e542d8345ab29e03a42e04ef9a6ba002c51fd 100644 (file)
@@ -6,7 +6,7 @@ LL | fn foo(x: impl Debug) -> String {
    |           |
    |           this type parameter
 LL |     x
-   |     ^ expected struct `String`, found type parameter `impl Debug`
+   |     ^ expected `String`, found type parameter `impl Debug`
    |
    = note:      expected struct `String`
            found type parameter `impl Debug`
index a408877afb61c9c299b3ff14e2f39e89b649c0f7..4f2880e2f5d4914e5d4ade4c9b1bfa6a8ca57fa8 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 `[u8]`, found `str`
+   |            -----   ^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[u8]`, found `&str`
    |            |
    |            expected due to this
    |
@@ -14,7 +14,7 @@ error[E0308]: mismatched types
   --> $DIR/mismatched-types.rs:3:19
    |
 LL |     let s: &str = include_bytes!("file.txt");
-   |            ----   ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `str`, found array `[u8; 0]`
+   |            ----   ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found `&[u8; 0]`
    |            |
    |            expected due to this
    |
index 3db67cdb5370a154642161edc43cd646195c4c84..1626032ae997de1452cb1764d8cf8c2153d1242e 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     foo(s);
    |     --- ^- help: try using a conversion method: `.to_string()`
    |     |   |
-   |     |   expected struct `String`, found `&String`
+   |     |   expected `String`, found `&String`
    |     arguments to this function are incorrect
    |
 note: function defined here
@@ -35,7 +35,7 @@ error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:30:9
    |
 LL |     foo(&"aaa".to_owned());
-   |     --- ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
+   |     --- ^^^^^^^^^^^^^^^^^ expected `String`, found `&String`
    |     |
    |     arguments to this function are incorrect
    |
@@ -54,7 +54,7 @@ error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:32:9
    |
 LL |     foo(&mut "aaa".to_owned());
-   |     --- ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
+   |     --- ^^^^^^^^^^^^^^^^^^^^^ expected `String`, found `&mut String`
    |     |
    |     arguments to this function are incorrect
    |
index 886e3cd6bb794b0393e659de16a81dcf86440111..be30eef2af48fb2bb7f091240ecbe58861ca5003 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-100605.rs:4:18
    |
 LL |     takes_option(&None);
-   |     ------------ ^^^^^ expected enum `Option`, found `&Option<_>`
+   |     ------------ ^^^^^ expected `Option<&String>`, found `&Option<_>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -29,7 +29,7 @@ error[E0308]: mismatched types
 LL |     takes_option(&res);
    |     ------------ ^^^^
    |     |            |
-   |     |            expected enum `Option`, found `&Option<String>`
+   |     |            expected `Option<&String>`, found `&Option<String>`
    |     |            help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`: `res.as_ref()`
    |     arguments to this function are incorrect
    |
index 4504039097b5d78c1dadaf1234828333d9ae28c2..4be53fd09e523e0f626882795b431fe84a01b06b 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-102964.rs:5:41
    |
 LL | fn bar_function<T>(function: Foo<T>) -> RcFoo<T> {
-   |    ------------                         ^^^^^^^^ expected struct `Rc`, found `()`
+   |    ------------                         ^^^^^^^^ expected `Rc<&dyn for<'a> Fn(&'a T)>`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
    |
index ace77814a3a99d6aeffe811f76805ba85b7c579d..ef28c81d85737f12eaedacf32c148d497a7f3443 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     c.read_to(v);
    |       ------- ^
    |       |       |
-   |       |       expected `&mut [u8]`, found struct `Vec`
+   |       |       expected `&mut [u8]`, found `Vec<_>`
    |       |       help: consider mutably borrowing here: `&mut v`
    |       arguments to this method are incorrect
    |
index 81cf918a1030ba713435cad3b9f21f58823df710..9afd209773b73f435cca6ebd5a96978cea3923c7 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match a {
    |           - this expression has type `Option<Box<{integer}>>`
 LL |         Ok(a) =>
-   |         ^^^^^ expected enum `Option`, found enum `Result`
+   |         ^^^^^ expected `Option<Box<{integer}>>`, found `Result<_, _>`
    |
    = note: expected enum `Option<Box<{integer}>>`
               found enum `Result<_, _>`
index 30fb73dd37282a8b54800c39a7ffd60eba0b8d65..139c34c8880a69ecf8c44ba45c430b5a0479b258 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-13446.rs:3:26
    |
 LL | static VEC: [u32; 256] = vec![];
-   |                          ^^^^^^ expected array `[u32; 256]`, found struct `Vec`
+   |                          ^^^^^^ expected `[u32; 256]`, found `Vec<_>`
    |
    = note: expected array `[u32; 256]`
              found struct `Vec<_>`
index a420c7704af51a8b806edf4a3510a70d586ccb6e..52d4d75d29da2623d823f25707b40f6413660825 100644 (file)
@@ -9,12 +9,12 @@ pub fn main() {
         //~^ ERROR mismatched types
         //~| expected enum `Option<{integer}>`
         //~| found enum `Result<_, _>`
-        //~| expected enum `Option`, found enum `Result`
+        //~| expected `Option<{integer}>`, found `Result<_, _>`
 
         Err(e) => panic!(e)
         //~^ ERROR mismatched types
         //~| expected enum `Option<{integer}>`
         //~| found enum `Result<_, _>`
-        //~| expected enum `Option`, found enum `Result`
+        //~| expected `Option<{integer}>`, found `Result<_, _>`
     };
 }
index c78466f4e8ce1c03322bf9e144b57a4f11ea1ded..fd928e45863db026ef3097ad30056b3615badbec 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     let _x: usize = match Some(1) {
    |                           ------- this expression has type `Option<{integer}>`
 LL |         Ok(u) => u,
-   |         ^^^^^ expected enum `Option`, found enum `Result`
+   |         ^^^^^ expected `Option<{integer}>`, found `Result<_, _>`
    |
    = note: expected enum `Option<{integer}>`
               found enum `Result<_, _>`
@@ -16,7 +16,7 @@ LL |     let _x: usize = match Some(1) {
    |                           ------- this expression has type `Option<{integer}>`
 ...
 LL |         Err(e) => panic!(e)
-   |         ^^^^^^ expected enum `Option`, found enum `Result`
+   |         ^^^^^^ expected `Option<{integer}>`, found `Result<_, _>`
    |
    = note: expected enum `Option<{integer}>`
               found enum `Result<_, _>`
index 555ec9f9868c5778cd086ef5bff443551c6776eb..2ff1c1f8876cd0fa758eb1b9987171d647256556 100644 (file)
@@ -4,7 +4,7 @@ struct Vec3 { y: f32, z: f32 }
 fn make(v: Vec2) {
     let Vec3 { y: _, z: _ } = v;
     //~^ ERROR mismatched types
-    //~| expected struct `Vec2`, found struct `Vec3`
+    //~| expected `Vec2`, found `Vec3`
 }
 
 fn main() { }
index cf155f428c6a0606769b9918a0f194719319ee2b..b80c68ce47311332716c77865b9600105e02c996 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     let Vec3 { y: _, z: _ } = v;
    |         ^^^^^^^^^^^^^^^^^^^   - this expression has type `Vec2`
    |         |
-   |         expected struct `Vec2`, found struct `Vec3`
+   |         expected `Vec2`, found `Vec3`
 
 error: aborting due to previous error
 
index 0b1f4545e88043e7ec958713ecce0d8e1ac1c75e..ceb37a20e3f30d01edc56b025c9d9bd563e9804f 100644 (file)
@@ -9,6 +9,6 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected enum `Option<&[&str]>`
     //~| found enum `Option<&[&str; 1]>`
-    //~| expected slice `[&str]`, found array `[&str; 1]`
+    //~| expected `Option<&[&str]>`, found `Option<&[&str; 1]>`
     assert_eq!(msg, 3);
 }
index 660dfe9ed3d51bc7617b139fd900ba1b773f3137..598ec7e6053bea1918059368271490da2a8fa801 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-15783.rs:8:19
    |
 LL |     let msg = foo(x);
-   |               --- ^ expected slice `[&str]`, found array `[&str; 1]`
+   |               --- ^ expected `Option<&[&str]>`, found `Option<&[&str; 1]>`
    |               |
    |               arguments to this function are incorrect
    |
index 038337f5acc8f4872d0590e1f58ffbdf201ffa39..ec0d74596aa8d4938f0e6a9ac96c681360efb429 100644 (file)
@@ -5,7 +5,7 @@ LL |     let u = match e {
    |                   - this expression has type `E`
 LL |         E::B(
 LL |           Tau{t: x},
-   |           ^^^^^^^^^ expected enum `R`, found struct `Tau`
+   |           ^^^^^^^^^ expected `R`, found `Tau`
 
 error: aborting due to previous error
 
index 6878600b0298338535d7e1dd7216e62e5be0a670..0f08485e515dd058c96cc83923dbfaa8bd7162f4 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     let Slice { data: data, len: len } = "foo";
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   ----- this expression has type `&str`
    |         |
-   |         expected `str`, found struct `Slice`
+   |         expected `str`, found `Slice<_>`
    |
    = note: expected type `str`
             found struct `Slice<_>`
index 332352ca727ac2f0ccdd366b6cbfad529dbdd598..19ae7da107ca2651a11ee8e8266e57dfcba20cf0 100644 (file)
@@ -9,7 +9,7 @@ fn main() {
         //~^ ERROR mismatched types
         //~| expected unit type `()`
         //~| found struct `Slice<_>`
-        //~| expected `()`, found struct `Slice`
+        //~| expected `()`, found `Slice<_>`
         _ => unreachable!()
     }
 }
index f8ea0907099a5d0a39f4228f6978271258ff5dfb..02f9f3ea8fdf7e40ee847af8cdad1c1aa346c390 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match () {
    |           -- this expression has type `()`
 LL |         Slice { data: data, len: len } => (),
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Slice`
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Slice<_>`
    |
    = note: expected unit type `()`
                  found struct `Slice<_>`
index 767fdd5caf06a2136b4dbe907d8044d3285e0cde..1fc974b609c119170b3e21cb1451ab8c50361073 100644 (file)
@@ -4,7 +4,7 @@ error[E0061]: this function takes 2 arguments but 1 argument was supplied
 LL |     print_x(X);
    |     ^^^^^^^--- an argument of type `&str` is missing
    |
-note: expected reference, found struct `X`
+note: expected `&dyn Foo<Item = bool>`, found `X`
   --> $DIR/issue-18819.rs:16:13
    |
 LL |     print_x(X);
index 5822160107cce5479747543a07da6dfcbe2f3b62..b1c15672051d2fc47305553ee9ce8908bc5a14d8 100644 (file)
@@ -6,7 +6,7 @@ LL | impl<'a, T> Fn<(&'a T,)> for Foo {
 LL |   extern "rust-call" fn call(&self, (_,): (T,)) {}
    |                                           ^^^^
    |                                           |
-   |                                           expected `&T`, found type parameter `T`
+   |                                           expected `&'a T`, found type parameter `T`
    |                                           help: change the parameter type to match the trait: `(&'a T,)`
    |
    = note: expected signature `extern "rust-call" fn(&Foo, (&'a T,))`
@@ -20,7 +20,7 @@ LL | impl<'a, T> FnMut<(&'a T,)> for Foo {
 LL |   extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {}
    |                                                   ^^^^
    |                                                   |
-   |                                                   expected `&T`, found type parameter `T`
+   |                                                   expected `&'a T`, found type parameter `T`
    |                                                   help: change the parameter type to match the trait: `(&'a T,)`
    |
    = note: expected signature `extern "rust-call" fn(&mut Foo, (&'a T,))`
@@ -35,7 +35,7 @@ LL | impl<'a, T> FnOnce<(&'a T,)> for Foo {
 LL |   extern "rust-call" fn call_once(self, (_,): (T,)) {}
    |                                               ^^^^
    |                                               |
-   |                                               expected `&T`, found type parameter `T`
+   |                                               expected `&'a T`, found type parameter `T`
    |                                               help: change the parameter type to match the trait: `(&'a T,)`
    |
    = note: expected signature `extern "rust-call" fn(Foo, (&'a T,))`
index 6547f3a9b19aefc8db7d06b91854956e4dc42e61..4473d00fd5da2833daf8e4024434ccf71aa48c51 100644 (file)
@@ -4,7 +4,7 @@ impl Iterator for S {
     type Item = i32;
     fn next(&mut self) -> Result<i32, i32> { Ok(7) }
     //~^ ERROR method `next` has an incompatible type for trait
-    //~| expected enum `Option`, found enum `Result`
+    //~| expected `Option<i32>`, found `Result<i32, i32>`
 }
 
 fn main() {}
index 0e1beebf2931a2e01c2658a2f0264f8aed6302fd..82549288064a1caead0c7ac73226c75041aecc39 100644 (file)
@@ -4,7 +4,7 @@ error[E0053]: method `next` has an incompatible type for trait
 LL |     fn next(&mut self) -> Result<i32, i32> { Ok(7) }
    |                           ^^^^^^^^^^^^^^^^
    |                           |
-   |                           expected enum `Option`, found enum `Result`
+   |                           expected `Option<i32>`, found `Result<i32, i32>`
    |                           help: change the output type to match the trait: `Option<i32>`
    |
    = note: expected signature `fn(&mut S) -> Option<i32>`
index 1e4c8ac7c356cbd383dd9163b772da8928fa9ef3..37cc3413f7511ebc5c3fd30ff5f781d5af7343d8 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-24322.rs:8:29
    |
 LL |     let x: &fn(&B) -> u32 = &B::func;
-   |            --------------   ^^^^^^^^ expected fn pointer, found fn item
+   |            --------------   ^^^^^^^^ expected `&for<'a> fn(&'a B) -> u32`, found `&for<'a> fn(&'a B) -> u32 {B::func}`
    |            |
    |            expected due to this
    |
index 59c3f2cd114de47d92b8da23ef8a11348b0bc956..fb4cfb7b29e8b5c5a22c21608558808d61253d10 100644 (file)
@@ -4,7 +4,7 @@ fn main() {
     let mut v = Vec::new();
     foo(&mut v);
     //~^ ERROR mismatched types
-    //~| expected struct `HashSet`, found struct `Vec`
+    //~| expected `&mut HashSet<u32>`, found `&mut Vec<_>`
 }
 
 fn foo(h: &mut HashSet<u32>) {
index 982a11fef80e896fd4683c5ec6d3d2111570c84d..8b4f1dbce431d654b5fd971e9e6be0f515c3f590 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-24819.rs:5:9
    |
 LL |     foo(&mut v);
-   |     --- ^^^^^^ expected struct `HashSet`, found struct `Vec`
+   |     --- ^^^^^^ expected `&mut HashSet<u32>`, found `&mut Vec<_>`
    |     |
    |     arguments to this function are incorrect
    |
index e04de33f6ef2e22d80f29b5c5f8e7c2bf77ed0f6..adf8e779e0a043a58a9ace980b98b076be84bf50 100644 (file)
@@ -3,5 +3,5 @@
 fn main() {
     let b = [0; S];
     //~^ ERROR mismatched types
-    //~| expected `usize`, found struct `S`
+    //~| expected `usize`, found `S`
 }
index 5b7e74c1c30125aadfd360efa3a725788ba34c29..9d18045aa794c2989177fa56a3b31c581a7d8c6c 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-27008.rs:4:17
    |
 LL |     let b = [0; S];
-   |                 ^ expected `usize`, found struct `S`
+   |                 ^ expected `usize`, found `S`
 
 error: aborting due to previous error
 
index 10b0c0967c1e83740d9981177b2631a4d38c9858..b4f5b1296670f2454253c4cea49834ba0f82c778 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-32122-1.rs:16:24
    |
 LL |     let _: *const u8 = &a;
-   |            ---------   ^^ expected `u8`, found struct `Foo`
+   |            ---------   ^^ expected `*const u8`, found `&Foo`
    |            |
    |            expected due to this
    |
index 5c3dade8e20c5b2b5c037998bda5910b0bf98c26..02c335c1547fb4415cceecfe05e693203eaa29dd 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-32122-2.rs:27:24
    |
 LL |     let _: *const u8 = &a;
-   |            ---------   ^^ expected `u8`, found struct `Emm`
+   |            ---------   ^^ expected `*const u8`, found `&Emm`
    |            |
    |            expected due to this
    |
index d9e7c3b16e76ebbe13455289ddc6e8ca5a82f82d..a831cf585f4e0f2c4ef253c0d5a40e5d12209fe3 100644 (file)
@@ -7,7 +7,7 @@ LL | struct Test;
 LL |         let Test = 1;
    |             ^^^^   - this expression has type `{integer}`
    |             |
-   |             expected integer, found struct `Test`
+   |             expected integer, found `Test`
    |             `Test` is interpreted as a unit struct, not a new binding
    |             help: introduce a new binding instead: `other_test`
 
index 668eaabca4c463d450fbe59ed71e04280dd0c1e4..e7f4a4fa004ce904bac381ea547b4b86d0f5bb94 100644 (file)
@@ -2,7 +2,7 @@ error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but
   --> $DIR/issue-33941.rs:6:36
    |
 LL |     for _ in HashMap::new().iter().cloned() {}
-   |                                    ^^^^^^ expected reference, found tuple
+   |                                    ^^^^^^ expected `&_`, found `(&_, &_)`
    |
    = note: expected reference `&_`
                   found tuple `(&_, &_)`
@@ -20,7 +20,7 @@ error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but
   --> $DIR/issue-33941.rs:6:14
    |
 LL |     for _ in HashMap::new().iter().cloned() {}
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found reference
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(&_, &_)`, found `&_`
    |
    = note:  expected tuple `(&_, &_)`
            found reference `&_`
@@ -31,7 +31,7 @@ error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but
   --> $DIR/issue-33941.rs:6:14
    |
 LL |     for _ in HashMap::new().iter().cloned() {}
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found reference
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(&_, &_)`, found `&_`
    |
    = note:  expected tuple `(&_, &_)`
            found reference `&_`
index d600e934bd5775d2d543935f26df470c4e31caa6..4a2c15511fe266192e95ca5bcf96f07a0a7698d2 100644 (file)
@@ -5,7 +5,7 @@ LL | struct Foo(u32);
    | ---------- `Foo` defines a struct constructor here, which should be called
 LL |
 LL | fn test() -> Foo { Foo }
-   |              ---   ^^^ expected struct `Foo`, found struct constructor
+   |              ---   ^^^ expected `Foo`, found struct constructor
    |              |
    |              expected `Foo` because of return type
    |
index 37c9000c043daf0e01f118cb45ddd5560b5091a9..a0e52798122972fb88b749edb50fc267440ab539 100644 (file)
@@ -4,6 +4,6 @@ fn main() {
         //~^ ERROR mismatched types
         //~| expected enum `Option<_>`
         //~| found enum `Result<_, _>`
-        //~| expected enum `Option`, found enum `Result`
+        //~| expected `Option<_>`, found `Result<_, _>`
     }
 }
index 29ba44f136afa48b41a334d4cc87088b63df1819..0b0ae419e2bf9bbab0d9e3b7b421a54f371000e6 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match None {
    |           ---- this expression has type `Option<_>`
 LL |         Err(_) => ()
-   |         ^^^^^^ expected enum `Option`, found enum `Result`
+   |         ^^^^^^ expected `Option<_>`, found `Result<_, _>`
    |
    = note: expected enum `Option<_>`
               found enum `Result<_, _>`
index fa239f744fb2547b8d60bbcca6f9d7eb0c4e6bb2..afc39adec467ac548a85ae6434e67e783931f066 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-40749.rs:2:9
    |
 LL |     [0; ..10];
-   |         ^^^^ expected `usize`, found struct `RangeTo`
+   |         ^^^^ expected `usize`, found `RangeTo<{integer}>`
    |
    = note: expected type `usize`
             found struct `RangeTo<{integer}>`
index 58fd1121a6b99df48ba8ede83f2735c86a66a465..9b141e2bf99afd9f27bb5be71462731c7d35745c 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-43420-no-over-suggest.rs:8:9
    |
 LL |     foo(&a);
-   |     --- ^^ expected slice `[u16]`, found struct `Vec`
+   |     --- ^^ expected `&[u16]`, found `&Vec<u8>`
    |     |
    |     arguments to this function are incorrect
    |
index caf85d44aac5c424f0153f289b78c4e041c27318..469304e2cf70fd87173c33fb930122e0b9dfba1c 100644 (file)
@@ -4,5 +4,5 @@ fn main() {
     let foo: [u8; 4] = [1; 4];
     bar(foo);
     //~^ ERROR mismatched types
-    //~| expected `usize`, found array `[u8; 4]`
+    //~| expected `usize`, found `[u8; 4]`
 }
index 70b4ca5ec496b2c49a5a150f9e74dadc6ea5dbbc..78ee336f19a43a4d14a3c39901cc6a9598658fe4 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-4517.rs:5:9
    |
 LL |     bar(foo);
-   |     --- ^^^ expected `usize`, found array `[u8; 4]`
+   |     --- ^^^ expected `usize`, found `[u8; 4]`
    |     |
    |     arguments to this function are incorrect
    |
index 60bbfc0c6e2696336ce75aa8992697784fa8829e..a4c88fd880a9d2ec28cb9d1b942d2fb04c2abb92 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-48364.rs:2:21
    |
 LL |     b"".starts_with(stringify!(foo))
-   |         ----------- ^^^^^^^^^^^^^^^ expected slice `[u8]`, found `str`
+   |         ----------- ^^^^^^^^^^^^^^^ expected `&[u8]`, found `&str`
    |         |
    |         arguments to this method are incorrect
    |
index 634bd698d77056157113be7d86bf768eb4f11185..c8df46dc2674032f45affc625888cc48dc70a618 100644 (file)
@@ -6,5 +6,5 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected type `{integer}`
     //~| found tuple `(isize, isize)`
-    //~| expected integer, found tuple
+    //~| expected integer, found `(isize, isize)`
 }
index bbaca4ed28f5b8bc6f584a4c72e4731812210fef..1ce0333846f44e77e7e8797f7ebb8660e04b3e27 100644 (file)
@@ -7,7 +7,7 @@ LL | fn main() {
 LL |     match 42 { A => () }
    |           --   ^
    |           |    |
-   |           |    expected integer, found tuple
+   |           |    expected integer, found `(isize, isize)`
    |           |    `A` is interpreted as a constant, not a new binding
    |           |    help: introduce a new binding instead: `other_a`
    |           this expression has type `{integer}`
index 69ed4b0e4328bdb794d945d065f0d2a48a845916..53ebdec8164934e8c0a3c6bee2ed4ae005b2692b 100644 (file)
@@ -7,7 +7,7 @@ fn main() {
     match (true, false) {
         A::B => (),
 //~^ ERROR mismatched types
-//~| expected tuple, found enum `A`
+//~| expected `(bool, bool)`, found `A`
 //~| expected tuple `(bool, bool)`
 //~| found enum `A`
         _ => ()
@@ -39,7 +39,7 @@ fn main() {
     match (true, false) {
         &(true, false) => ()
 //~^ ERROR mismatched types
-//~| expected tuple, found reference
+//~| expected `(bool, bool)`, found `&_`
 //~| expected tuple `(bool, bool)`
 //~| found reference `&_`
     }
index c87a3e348a2e97f83cf094fd29b7e4bfd5ffae02..b1680aacd16563f3d443980af9a7a4f115481168 100644 (file)
@@ -7,7 +7,7 @@ LL | enum A { B, C }
 LL |     match (true, false) {
    |           ------------- this expression has type `(bool, bool)`
 LL |         A::B => (),
-   |         ^^^^ expected tuple, found enum `A`
+   |         ^^^^ expected `(bool, bool)`, found `A`
    |
    = note: expected tuple `(bool, bool)`
                found enum `A`
@@ -40,7 +40,7 @@ error[E0308]: mismatched types
 LL |     match (true, false) {
    |           ------------- this expression has type `(bool, bool)`
 LL |         box (true, false) => ()
-   |         ^^^^^^^^^^^^^^^^^ expected tuple, found struct `Box`
+   |         ^^^^^^^^^^^^^^^^^ expected `(bool, bool)`, found `Box<_>`
    |
    = note: expected tuple `(bool, bool)`
              found struct `Box<_>`
@@ -51,7 +51,7 @@ error[E0308]: mismatched types
 LL |     match (true, false) {
    |           ------------- this expression has type `(bool, bool)`
 LL |         &(true, false) => ()
-   |         ^^^^^^^^^^^^^^ expected tuple, found reference
+   |         ^^^^^^^^^^^^^^ expected `(bool, bool)`, found `&_`
    |
    = note:  expected tuple `(bool, bool)`
            found reference `&_`
index cc0726bcade32cd2b9d3d6558e428b83dbb8f5a1..7180a3d2426d109bca8556dcb9272fdd68ba132b 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: `?` operator has incompatible types
   --> $DIR/issue-51632-try-desugar-incompatible-types.rs:8:5
    |
 LL |     missing_discourses()?
-   |     ^^^^^^^^^^^^^^^^^^^^^ expected enum `Result`, found `isize`
+   |     ^^^^^^^^^^^^^^^^^^^^^ expected `Result<isize, ()>`, found `isize`
    |
    = note: `?` operator cannot convert from `isize` to `Result<isize, ()>`
    = note: expected enum `Result<isize, ()>`
index d2f8c77c0ce1122fec3b49629098b1a010021956..66800d9e929612c75137b4a6c3473fe3ac5b56df 100644 (file)
@@ -9,7 +9,7 @@ fn main() {
     for i in v {
         a = *i.to_string();
         //~^ ERROR mismatched types
-        //~| NOTE expected struct `String`, found `str`
+        //~| NOTE expected `String`, found `str`
         v2.push(a);
     }
 }
index 71d9f5b3dbbff615970a6eb724077ec3c207cf1e..e4cdb7e889bcab07ae01e27c0266e46b7d003263 100644 (file)
@@ -5,7 +5,7 @@ LL |     let mut a = String::new();
    |                 ------------- expected due to this value
 LL |     for i in v {
 LL |         a = *i.to_string();
-   |             ^^^^^^^^^^^^^^ expected struct `String`, found `str`
+   |             ^^^^^^^^^^^^^^ expected `String`, found `str`
 
 error: aborting due to previous error
 
index f5e32e78d8794f38ec9bfffc289f6de8388b0f1a..14ee962b722e8cbe1b0381840416cdf895c315de 100644 (file)
@@ -5,7 +5,7 @@ fn main() {
     match S(Either::Left(5)) {
         Either::Right(_) => {}
         //~^ ERROR mismatched types
-        //~| expected struct `S`, found enum `Either`
+        //~| expected `S`, found `Either<_, _>`
         //~| expected struct `S`
         //~| found enum `Either<_, _>`
         _ => {}
index 9d5b8d9d3fc1b9f08ba4566a337fc8ce5a3cdb85..059462a363e8e9230eb4bb0b6944014131a44f52 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match S(Either::Left(5)) {
    |           ------------------ this expression has type `S`
 LL |         Either::Right(_) => {}
-   |         ^^^^^^^^^^^^^^^^ expected struct `S`, found enum `Either`
+   |         ^^^^^^^^^^^^^^^^ expected `S`, found `Either<_, _>`
    |
    = note: expected struct `S`
                 found enum `Either<_, _>`
index 74ed5ec0fb6f161ba399c44cbfe131192c114aaf..c394e620b82fe2cf8d39b5e1f45b6c6bce0267fd 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-56943.rs:6:29
    |
 LL |     let _: issue_56943::S = issue_56943::S2;
-   |            --------------   ^^^^^^^^^^^^^^^ expected struct `S`, found struct `S2`
+   |            --------------   ^^^^^^^^^^^^^^^ expected `S`, found `S2`
    |            |
    |            expected due to this
 
index 789a1f44db267a9cf0117dadba0c9b1fa984dd7c..76f03bab6d157130574a2d95b44c1da8608579db 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     let y = match x {
    |                   - this expression has type `Box<u32>`
 LL |         S::A { a } | S::B { b: a } => a,
-   |         ^^^^^^^^^^ expected struct `Box`, found enum `S`
+   |         ^^^^^^^^^^ expected `Box<u32>`, found `S`
    |
    = note: expected struct `Box<u32>`
                 found enum `S`
@@ -15,7 +15,7 @@ error[E0308]: mismatched types
 LL |     let y = match x {
    |                   - this expression has type `Box<u32>`
 LL |         S::A { a } | S::B { b: a } => a,
-   |                      ^^^^^^^^^^^^^ expected struct `Box`, found enum `S`
+   |                      ^^^^^^^^^^^^^ expected `Box<u32>`, found `S`
    |
    = note: expected struct `Box<u32>`
                 found enum `S`
index cd277f20ef150cb9c6c973b1a9845df5b1bfeb39..38014ecce75744f90506ec2774b822c7a1d8406c 100644 (file)
@@ -7,7 +7,7 @@ LL |     let y = match x {
    |                   this expression has type `Box<T>`
    |                   help: consider dereferencing the boxed value: `*x`
 LL |         T::A(a) | T::B(a) => a,
-   |         ^^^^^^^ expected struct `Box`, found enum `T`
+   |         ^^^^^^^ expected `Box<T>`, found `T`
    |
    = note: expected struct `Box<T>`
                 found enum `T`
@@ -21,7 +21,7 @@ LL |     let y = match x {
    |                   this expression has type `Box<T>`
    |                   help: consider dereferencing the boxed value: `*x`
 LL |         T::A(a) | T::B(a) => a,
-   |                   ^^^^^^^ expected struct `Box`, found enum `T`
+   |                   ^^^^^^^ expected `Box<T>`, found `T`
    |
    = note: expected struct `Box<T>`
                 found enum `T`
@@ -35,7 +35,7 @@ LL |     let y = match x {
    |                   this expression has type `Box<S>`
    |                   help: consider dereferencing the boxed value: `*x`
 LL |         S::A { a } | S::B { b: a } => a,
-   |         ^^^^^^^^^^ expected struct `Box`, found enum `S`
+   |         ^^^^^^^^^^ expected `Box<S>`, found `S`
    |
    = note: expected struct `Box<S>`
                 found enum `S`
@@ -49,7 +49,7 @@ LL |     let y = match x {
    |                   this expression has type `Box<S>`
    |                   help: consider dereferencing the boxed value: `*x`
 LL |         S::A { a } | S::B { b: a } => a,
-   |                      ^^^^^^^^^^^^^ expected struct `Box`, found enum `S`
+   |                      ^^^^^^^^^^^^^ expected `Box<S>`, found `S`
    |
    = note: expected struct `Box<S>`
                 found enum `S`
index f9846b62a72f81d4245d651e3e633f15a83501c9..d45beefa420cbb2a460d5e6c1324e774eaf2e27c 100644 (file)
@@ -15,7 +15,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-59488.rs:14:11
    |
 LL |     foo > 12;
-   |           ^^ expected fn item, found integer
+   |           ^^ expected fn item, found `i32`
    |
    = note: expected fn item `fn() -> i32 {foo}`
                  found type `i32`
@@ -37,7 +37,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-59488.rs:18:11
    |
 LL |     bar > 13;
-   |           ^^ expected fn item, found integer
+   |           ^^ expected fn item, found `i64`
    |
    = note: expected fn item `fn(i64) -> i64 {bar}`
                  found type `i64`
index 2bc09234116b1171e2465b4492771242473480bc..eff3e6e78495e919242f9daaf69161d427de7c5b 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     foo(x.clone());
    |     --- ^^^^^^^^^
    |     |   |
-   |     |   expected `&str`, found struct `String`
+   |     |   expected `&str`, found `String`
    |     |   help: consider borrowing here: `&x`
    |     arguments to this function are incorrect
    |
index 168ececac31ebb05e4ae02b66e631b660c5be1c2..66ccfdff23664a4bf276a85a776a83e52defaa8d 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-6458-4.rs:1:20
    |
 LL | fn foo(b: bool) -> Result<bool,String> {
-   |    ---             ^^^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
+   |    ---             ^^^^^^^^^^^^^^^^^^^ expected `Result<bool, String>`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
 LL |     Err("bar".to_string());
index 37e2c3bddc8cf1dab1a2ce5da37ea3c7f4c99cea..6fde44eaf0ced447976e1fb73652f30187fe296b 100644 (file)
@@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `<Rc<Apple> as Deref>::Target == Rc<Apple>
   --> $DIR/issue-67039-unsound-pin-partialeq.rs:25:29
    |
 LL |     let _ = Pin::new(Apple) == Rc::pin(Apple);
-   |                             ^^ expected struct `Apple`, found struct `Rc`
+   |                             ^^ expected `Apple`, found `Rc<Apple>`
    |
    = note: expected struct `Apple`
               found struct `Rc<Apple>`
index 61ec5d3180cc3ea96f449bd5f5a6bf9e1be36008..570677298ffa98d41b6d7af932beecfcbb49029f 100644 (file)
@@ -22,7 +22,7 @@ error[E0308]: mismatched types
 LL | impl<T> S0<T> {
    |      - this type parameter
 LL |     const C: S0<u8> = Self(0);
-   |                       ^^^^^^^ expected `u8`, found type parameter `T`
+   |                       ^^^^^^^ expected `S0<u8>`, found `S0<T>`
    |
    = note: expected struct `S0<u8>`
               found struct `S0<T>`
@@ -89,7 +89,7 @@ error[E0308]: mismatched types
 LL | impl<T> S1<T, u8> {
    |      - this type parameter
 LL |     const C: S1<u8, u8> = Self(0, 1);
-   |                           ^^^^^^^^^^ expected `u8`, found type parameter `T`
+   |                           ^^^^^^^^^^ expected `S1<u8, u8>`, found `S1<T, u8>`
    |
    = note: expected struct `S1<u8, _>`
               found struct `S1<T, _>`
@@ -126,7 +126,7 @@ LL |     fn map<U>(x: U) -> S2<U> {
    |            |
    |            expected type parameter
 LL |         Self(x)
-   |         ^^^^^^^ expected type parameter `U`, found type parameter `T`
+   |         ^^^^^^^ expected `S2<U>`, found `S2<T>`
    |
    = note: expected struct `S2<U>`
               found struct `S2<T>`
index 27034378d3fc96ea9a7a75efa4e8cec3a2ee4788..a209f8a4249f1dc899a1cba70f6185208978ec44 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 `Box`, found `&mut BarStruct`
+   |                             --------------   ^^^^ expected `Box<BarStruct>`, found `&mut BarStruct`
    |                             |
    |                             expected `Box<BarStruct>` because of return type
    |
index 85bfbf90d9a2f283241d8cc5e1fe0381876fe4fd..c3c96c7d3f61d89311e64f719f3d21f72a3166c0 100644 (file)
@@ -5,7 +5,7 @@ fn foo(x: Whatever) {
     match x {
         Some(field) =>
 //~^ ERROR mismatched types
-//~| expected enum `Whatever`, found enum `Option`
+//~| expected `Whatever`, found `Option<_>`
 //~| expected enum `Whatever`
 //~| found enum `Option<_>`
             field.access(),
index 59e8d75e236e1e83bcdd9a0b82cb57a0546343be..e35379fd1cfef6d17ae8a2a18abdcf3ef6390f00 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match x {
    |           - this expression has type `Whatever`
 LL |         Some(field) =>
-   |         ^^^^^^^^^^^ expected enum `Whatever`, found enum `Option`
+   |         ^^^^^^^^^^^ expected `Whatever`, found `Option<_>`
    |
    = note: expected enum `Whatever`
               found enum `Option<_>`
index 2104634eb93551adb10f0e852bfc64642fffb7ee..164641ff7751228c771a94049b253359322e4918 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-71676-1.rs:43:24
    |
 LL |     let _: *const u8 = &a;
-   |            ---------   ^^ expected `u8`, found struct `Emm`
+   |            ---------   ^^ expected `*const u8`, found `&Emm`
    |            |
    |            expected due to this
    |
@@ -32,7 +32,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-71676-1.rs:49:24
    |
 LL |     let _: *const u8 = &mut a;
-   |            ---------   ^^^^^^ expected `u8`, found struct `Emm`
+   |            ---------   ^^^^^^ expected `*const u8`, found `&mut Emm`
    |            |
    |            expected due to this
    |
@@ -47,7 +47,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-71676-1.rs:52:22
    |
 LL |     let _: *mut u8 = &mut a;
-   |            -------   ^^^^^^ expected `u8`, found struct `Emm`
+   |            -------   ^^^^^^ expected `*mut u8`, found `&mut Emm`
    |            |
    |            expected due to this
    |
index 55e94ae72c77968fde1a8d42c5f81f31dc53e75a..5cd64e48ab88bd2d910cd10df46a5e5f61dc42f5 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     let () = dep::Renamed;
    |         ^^   ------------ this expression has type `Renamed`
    |         |
-   |         expected struct `Renamed`, found `()`
+   |         expected `Renamed`, found `()`
 
 error: aborting due to previous error
 
index 13749804796b2c653d3df6bb5e00ef96793960e2..32d9105b25997a58cd8949b76e5c0add3d463f80 100644 (file)
@@ -9,7 +9,7 @@ LL |     match n {
 LL |         RANGE => {}
    |         ^^^^^
    |         |
-   |         expected `i32`, found struct `RangeInclusive`
+   |         expected `i32`, found `RangeInclusive<i32>`
    |         `RANGE` is interpreted as a constant, not a new binding
    |
    = note: expected type `i32`
@@ -31,7 +31,7 @@ LL |     match n {
 LL |         RANGE2 => {}
    |         ^^^^^^
    |         |
-   |         expected `i32`, found struct `RangeInclusive`
+   |         expected `i32`, found `RangeInclusive<i32>`
    |         `RANGE2` is interpreted as a constant, not a new binding
    |
    = note: expected type `i32`
index 3074052f14f2047caac4dbffb10bd4c34468d4ff..e9fd10c6613d4d1637c2708bea6810eae9eca7ab 100644 (file)
@@ -6,7 +6,7 @@ fn main() {
     match (true, false) {
         A::B => (),
         //~^ ERROR mismatched types
-        //~| expected tuple, found enum `A`
+        //~| expected `(bool, bool)`, found `A`
         //~| expected tuple `(bool, bool)`
         //~| found enum `A`
         _ => ()
index 0d3121d60455d95c6df8c9602f338e26aca8701b..4fb1af344cda61d8a869c313395211550f8d5385 100644 (file)
@@ -7,7 +7,7 @@ LL | enum A { B, C }
 LL |     match (true, false) {
    |           ------------- this expression has type `(bool, bool)`
 LL |         A::B => (),
-   |         ^^^^ expected tuple, found enum `A`
+   |         ^^^^ expected `(bool, bool)`, found `A`
    |
    = note: expected tuple `(bool, bool)`
                found enum `A`
index 02f3bc687cba9199d276f8c042589defee90b5f1..84040e8050e965b87af60e8aa13fe80238183528 100644 (file)
@@ -24,7 +24,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"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 `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":612,"byte_end":618,"line_start":17,"line_end":17,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":622,"byte_end":622,"line_start":17,"line_end":17,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".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 `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":612,"byte_end":618,"line_start":17,"line_end":17,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":622,"byte_end":622,"line_start":17,"line_end":17,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".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":"Expected type did not match the received type.
 
@@ -52,7 +52,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"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 `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":672,"byte_end":678,"line_start":19,"line_end":19,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":682,"byte_end":682,"line_start":19,"line_end":19,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".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 `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":672,"byte_end":678,"line_start":19,"line_end":19,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":682,"byte_end":682,"line_start":19,"line_end":19,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".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":"Expected type did not match the received type.
 
@@ -80,7 +80,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"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 `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":735,"byte_end":741,"line_start":22,"line_end":22,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":746,"byte_end":746,"line_start":23,"line_end":23,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".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 `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":735,"byte_end":741,"line_start":22,"line_end":22,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":746,"byte_end":746,"line_start":23,"line_end":23,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".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":"Expected type did not match the received type.
 
@@ -108,7 +108,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"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 `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":792,"byte_end":798,"line_start":25,"line_end":25,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types
+"},"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 `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":792,"byte_end":798,"line_start":25,"line_end":25,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types
 "}
 {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors
 "}
index df6bd7286a6158492d3574f1acac4b0eca2495b7..b0f450e9ecc1407fc5175a2c06ec63ae8ce9ae07 100644 (file)
@@ -24,7 +24,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":606,"byte_end":607,"line_start":16,"line_end":16,"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 `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":597,"byte_end":603,"line_start":16,"line_end":16,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":607,"byte_end":607,"line_start":16,"line_end":16,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:16:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":606,"byte_end":607,"line_start":16,"line_end":16,"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 `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":597,"byte_end":603,"line_start":16,"line_end":16,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":607,"byte_end":607,"line_start":16,"line_end":16,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:16:22: error[E0308]: mismatched types
 "}
 {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
 
@@ -52,7 +52,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":666,"byte_end":667,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":657,"byte_end":663,"line_start":18,"line_end":18,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":667,"byte_end":667,"line_start":18,"line_end":18,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:18:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":666,"byte_end":667,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":657,"byte_end":663,"line_start":18,"line_end":18,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":667,"byte_end":667,"line_start":18,"line_end":18,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:18:22: error[E0308]: mismatched types
 "}
 {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
 
@@ -80,7 +80,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":730,"byte_end":731,"line_start":22,"line_end":22,"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 `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":720,"byte_end":726,"line_start":21,"line_end":21,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":731,"byte_end":731,"line_start":22,"line_end":22,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:22:1: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":730,"byte_end":731,"line_start":22,"line_end":22,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":720,"byte_end":726,"line_start":21,"line_end":21,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":731,"byte_end":731,"line_start":22,"line_end":22,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:22:1: error[E0308]: mismatched types
 "}
 {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
 
@@ -108,7 +108,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":786,"byte_end":794,"line_start":24,"line_end":25,"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 `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":777,"byte_end":783,"line_start":24,"line_end":24,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:24:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":786,"byte_end":794,"line_start":24,"line_end":25,"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 `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":777,"byte_end":783,"line_start":24,"line_end":24,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:24: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 0cb97aceebfd5835311787240e3c1a3fa6a2b2ed..6a015aced6f4e90a57e3a3e9d3b31b2b13908949 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-94176.rs:5:32
    |
 LL | pub fn test(a: Option<u32>) -> Option<u32> {
-   |        ----                    ^^^^^^^^^^^ expected enum `Option`, found `()`
+   |        ----                    ^^^^^^^^^^^ expected `Option<u32>`, found `()`
    |        |
    |        implicitly returns `()` as its body has no tail or `return` expression
    |
index bf78a079cdfa9fd766e270a488ae65ac63c299a0..143b838bac50000e5536c7c7600365ab0777272e 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |         let Bar::Present(z) = self else {
    |             ^^^^^^^^^^^^^^^   ---- this expression has type `&mut Foo`
    |             |
-   |             expected struct `Foo`, found enum `Bar`
+   |             expected `Foo`, found `Bar`
 
 error[E0308]: mismatched types
   --> $DIR/let-else-deref-coercion.rs:68:13
@@ -12,7 +12,7 @@ error[E0308]: mismatched types
 LL |         let Bar(z) = x;
    |             ^^^^^^   - this expression has type `&mut irrefutable::Foo`
    |             |
-   |             expected struct `Foo`, found struct `Bar`
+   |             expected `Foo`, found `Bar`
 
 error: aborting due to 2 previous errors
 
index 78551fcc434a86f81c5b763b4f4805f885724d1b..661d905cd0783551ebd4de7306f6ebfc383d3c68 100644 (file)
@@ -5,7 +5,7 @@ LL |       let Some(x) = Some(1) else {
    |  ________________________________^
 LL | |         Some(2)
 LL | |     };
-   | |_____^ expected `!`, found enum `Option`
+   | |_____^ expected `!`, found `Option<{integer}>`
    |
    = note: expected type `!`
               found enum `Option<{integer}>`
@@ -32,7 +32,7 @@ error[E0308]: `else` clause of `let...else` does not diverge
   --> $DIR/let-else-non-diverging.rs:10:32
    |
 LL |     let Some(x) = Some(1) else { Some(2) };
-   |                                ^^^^^^^^^^^ expected `!`, found enum `Option`
+   |                                ^^^^^^^^^^^ expected `!`, found `Option<{integer}>`
    |
    = note: expected type `!`
               found enum `Option<{integer}>`
@@ -43,7 +43,7 @@ error[E0308]: `else` clause of `let...else` does not diverge
   --> $DIR/let-else-non-diverging.rs:15:32
    |
 LL |     let Some(x) = Some(1) else { foo::<Uninhabited>() };
-   |                                ^^^^^^^^^^^^^^^^^^^^^^^^ expected `!`, found enum `Uninhabited`
+   |                                ^^^^^^^^^^^^^^^^^^^^^^^^ expected `!`, found `Uninhabited`
    |
    = note: expected type `!`
               found enum `Uninhabited`
index 56b9e073330a6237817715f5c4827f70d6f30fad..ada1805e7256f385172cb748716fbbbbf28241d8 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/let-else-ref-bindings.rs:16:38
    |
 LL |     let Some(ref a): Option<&[u8]> = some else { return };
-   |                                      ^^^^ expected `&[u8]`, found struct `Vec`
+   |                                      ^^^^ expected `Option<&[u8]>`, found `Option<Vec<u8>>`
    |
    = note: expected enum `Option<&[u8]>`
               found enum `Option<Vec<u8>>`
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
   --> $DIR/let-else-ref-bindings.rs:20:38
    |
 LL |     let Some(ref a): Option<&[u8]> = &some else { return };
-   |                                      ^^^^^ expected enum `Option`, found `&Option<Vec<u8>>`
+   |                                      ^^^^^ expected `Option<&[u8]>`, found `&Option<Vec<u8>>`
    |
    = note:   expected enum `Option<&[u8]>`
            found reference `&Option<Vec<u8>>`
@@ -20,7 +20,7 @@ error[E0308]: mismatched types
   --> $DIR/let-else-ref-bindings.rs:24:34
    |
 LL |     let Some(a): Option<&[u8]> = some else { return };
-   |                  -------------   ^^^^ expected `&[u8]`, found struct `Vec`
+   |                  -------------   ^^^^ expected `Option<&[u8]>`, found `Option<Vec<u8>>`
    |                  |
    |                  expected due to this
    |
@@ -31,7 +31,7 @@ error[E0308]: mismatched types
   --> $DIR/let-else-ref-bindings.rs:27:34
    |
 LL |     let Some(a): Option<&[u8]> = &some else { return };
-   |                  -------------   ^^^^^ expected enum `Option`, found `&Option<Vec<u8>>`
+   |                  -------------   ^^^^^ expected `Option<&[u8]>`, found `&Option<Vec<u8>>`
    |                  |
    |                  expected due to this
    |
@@ -42,7 +42,7 @@ error[E0308]: mismatched types
   --> $DIR/let-else-ref-bindings.rs:44:46
    |
 LL |     let Some(ref mut a): Option<&mut [u8]> = some else { return };
-   |                                              ^^^^ expected `&mut [u8]`, found struct `Vec`
+   |                                              ^^^^ expected `Option<&mut [u8]>`, found `Option<Vec<u8>>`
    |
    = note: expected enum `Option<&mut [u8]>`
               found enum `Option<Vec<u8>>`
@@ -51,7 +51,7 @@ error[E0308]: mismatched types
   --> $DIR/let-else-ref-bindings.rs:48:46
    |
 LL |     let Some(ref mut a): Option<&mut [u8]> = &mut some else { return };
-   |                                              ^^^^^^^^^ expected enum `Option`, found mutable reference
+   |                                              ^^^^^^^^^ expected `Option<&mut [u8]>`, found `&mut Option<Vec<u8>>`
    |
    = note:           expected enum `Option<&mut [u8]>`
            found mutable reference `&mut Option<Vec<u8>>`
@@ -60,7 +60,7 @@ error[E0308]: mismatched types
   --> $DIR/let-else-ref-bindings.rs:52:38
    |
 LL |     let Some(a): Option<&mut [u8]> = some else { return };
-   |                  -----------------   ^^^^ expected `&mut [u8]`, found struct `Vec`
+   |                  -----------------   ^^^^ expected `Option<&mut [u8]>`, found `Option<Vec<u8>>`
    |                  |
    |                  expected due to this
    |
@@ -71,7 +71,7 @@ error[E0308]: mismatched types
   --> $DIR/let-else-ref-bindings.rs:55:38
    |
 LL |     let Some(a): Option<&mut [u8]> = &mut some else { return };
-   |                  -----------------   ^^^^^^^^^ expected enum `Option`, found mutable reference
+   |                  -----------------   ^^^^^^^^^ expected `Option<&mut [u8]>`, found `&mut Option<Vec<u8>>`
    |                  |
    |                  expected due to this
    |
index 3b25902d757e0d8c32bfbb0808feaaeb5b81acef..535073d6ebb0f1ba20a44ec6c8716bfa05b366b2 100644 (file)
@@ -9,7 +9,7 @@ LL | |         "n" | "north" => RoomDirection::North,
 LL | |         "down" => RoomDirection::Down,
    | |                   ------------------- this and all prior arms are found to be of type `RoomDirection`
 LL | |         _ => None
-   | |              ^^^^ expected enum `RoomDirection`, found enum `Option`
+   | |              ^^^^ expected `RoomDirection`, found `Option<_>`
 LL | |     }
    | |_____- `match` arms have incompatible types
    |
index 98d39d614d0e9647e98036a3e0e357f13dd0e691..4dfacb938011569007e91b6fe2832fe04eeeb62b 100644 (file)
@@ -38,7 +38,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-26638.rs:1:69
    |
 LL | fn parse_type(iter: Box<dyn Iterator<Item=&str>+'static>) -> &str { iter.next() }
-   |                                                              ----   ^^^^^^^^^^^ expected `&str`, found enum `Option`
+   |                                                              ----   ^^^^^^^^^^^ expected `&str`, found `Option<&str>`
    |                                                              |
    |                                                              expected `&'static str` because of return type
    |
@@ -60,7 +60,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-26638.rs:5:47
    |
 LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() }
-   |                                        ----   ^^^^^^ expected `str`, found `u8`
+   |                                        ----   ^^^^^^ expected `&str`, found `&u8`
    |                                        |
    |                                        expected `&'static str` because of return type
    |
index cca8cd9bd89f16ce5e9b3aecc24c6ed5f4cf58dc..294476107ef7881a3648aaad69abe8f9b3e29cd9 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/tuple-mismatch.rs:6:20
    |
 LL |         yield ((), ());
-   |                    ^^ expected tuple, found `()`
+   |                    ^^ expected `((), ())`, found `()`
    |
    = note:  expected tuple `((), ())`
            found unit type `()`
index ccb27c3507076897e7a680350bcebce21bb98c55..5525dbb9005d3dc40bb27cd6a403314a4b8635c6 100644 (file)
@@ -167,7 +167,7 @@ error[E0308]: mismatched types
   --> $DIR/loop-break-value.rs:80:15
    |
 LL |         break (break, break);
-   |               ^^^^^^^^^^^^^^ expected `()`, found tuple
+   |               ^^^^^^^^^^^^^^ expected `()`, found `(!, !)`
    |
    = note: expected unit type `()`
                   found tuple `(!, !)`
index 4b027eba2c25ea43ed1b2f456669847b6b45b989..195192fbd82409f6290c7358eb66eb2187bf5e20 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |   match t {
    |         - this expression has type `Result<_, {integer}>`
 LL |     Some(k) => match k {
-   |     ^^^^^^^ expected enum `Result`, found enum `Option`
+   |     ^^^^^^^ expected `Result<_, {integer}>`, found `Option<_>`
    |
    = note: expected enum `Result<_, {integer}>`
               found enum `Option<_>`
@@ -20,7 +20,7 @@ LL |   match t {
    |         - this expression has type `Result<_, {integer}>`
 ...
 LL |     None => ()
-   |     ^^^^ expected enum `Result`, found enum `Option`
+   |     ^^^^ expected `Result<_, {integer}>`, found `Option<_>`
    |
    = note: expected enum `Result<_, {integer}>`
               found enum `Option<_>`
index ec1d7e21fa53caa66ac159618bcb8a93ef214d96..12f37274b6b21b489ec93b65723cfb797b156338 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match array {
    |           ----- this expression has type `[S; 1]`
 LL |         [()] => {}
-   |          ^^ expected struct `S`, found `()`
+   |          ^^ expected `S`, found `()`
 
 error: aborting due to previous error
 
index 7a54c54b98cb85c2762a4d1402797863db58159c..4da7b436ba8a82b575b939c97890d96f8db724e0 100644 (file)
@@ -5,7 +5,7 @@ fn main() {
     match (S { a: 1 }) {
         E::C(_) => (),
         //~^ ERROR mismatched types
-        //~| expected struct `S`, found enum `E`
+        //~| expected `S`, found `E`
         _ => ()
     }
 }
index a475bd5e5819c7a4e9d844e2fb9c659882203e43..fdc6fd77077e0fca4f0e1230dcc98cd980c287f3 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match (S { a: 1 }) {
    |           ------------ this expression has type `S`
 LL |         E::C(_) => (),
-   |         ^^^^^^^ expected struct `S`, found enum `E`
+   |         ^^^^^^^ expected `S`, found `E`
 
 error: aborting due to previous error
 
index a6add31d1c510707f62bbc97825f030499778137..aac873c760e75ff3cd993dcd2c354004c5925f8e 100644 (file)
@@ -5,7 +5,7 @@ LL | enum B { B }
    |          - unit variant defined here
 LL |
 LL | fn main() { let x: A = A::A; match x { B::B => { } } }
-   |                                    -   ^^^^ expected enum `A`, found enum `B`
+   |                                    -   ^^^^ expected `A`, found `B`
    |                                    |
    |                                    this expression has type `A`
 
index 31f77bdff8b1f00d63f4e312acfcec3a9ab1eb7b..25e8152d8cf50da760bfc7c1c89aeb5e135d34cc 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/match-tag-unary.rs:4:43
    |
 LL | fn main() { let x: A = A::A(0); match x { B::B(y) => { } } }
-   |                                       -   ^^^^^^^ expected enum `A`, found enum `B`
+   |                                       -   ^^^^^^^ expected `A`, found `B`
    |                                       |
    |                                       this expression has type `A`
 
index 3e73b950a14e0af982857231d4c358519371dbc1..32e269b7ad89f2d28bba1f9b835d03261a26de55 100644 (file)
@@ -21,7 +21,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-61525.rs:14:33
    |
 LL |         1.query::<dyn ToString>("")
-   |           --------------------- ^^ expected trait object `dyn ToString`, found `&str`
+   |           --------------------- ^^ expected `dyn ToString`, found `&str`
    |           |
    |           arguments to this method are incorrect
    |
index 4d3c086ff6e8c48747b7a52b115c01c0241b6f02..0466bb0a0c997dab3eca1b2e1218ae520b39fe13 100644 (file)
@@ -57,7 +57,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-90315.rs:28:8
    |
 LL |     if 1..(end + 1).is_empty() {
-   |        ^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
+   |        ^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<{integer}>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<{integer}>`
@@ -77,7 +77,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-90315.rs:34:8
    |
 LL |     if 1..(end + 1).is_sorted() {
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<{integer}>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<{integer}>`
@@ -97,7 +97,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-90315.rs:40:21
    |
 LL |     let _res: i32 = 3..6.take(2).sum();
-   |               ---   ^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `Range`
+   |               ---   ^^^^^^^^^^^^^^^^^^ expected `i32`, found `Range<{integer}>`
    |               |
    |               expected due to this
    |
@@ -119,7 +119,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-90315.rs:45:21
    |
 LL |     let _sum: i32 = 3..6.sum();
-   |               ---   ^^^^^^^^^^ expected `i32`, found struct `Range`
+   |               ---   ^^^^^^^^^^ expected `i32`, found `Range<{integer}>`
    |               |
    |               expected due to this
    |
@@ -158,7 +158,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-90315.rs:62:8
    |
 LL |     if 1..end.error_method() {
-   |        ^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
+   |        ^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<{integer}>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<{integer}>`
index f589f20d81ddff97967ffe82174910635aaf0fbb..5912b4ec2c3cb1855b4d6ca55897c35e65a821c1 100644 (file)
@@ -9,9 +9,9 @@ fn bar(&self) {}
 fn main() {
     let x = Foo;
     Foo::bar(x); //~  ERROR mismatched types
-                 //~| expected `&Foo`, found struct `Foo`
+                 //~| expected `&Foo`, found `Foo`
     Foo::bar(&42); //~  ERROR mismatched types
-                      //~| expected struct `Foo`, found integer
+                      //~| expected `&Foo`, found `&{integer}`
                       //~| expected reference `&Foo`
                       //~| found reference `&{integer}`
 }
index 01fec6fcaaeece48207829be7ef86e1ea118c0d4..32ab8dced21980d523cdbbc9a0e084579c629c96 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     Foo::bar(x);
    |     -------- ^
    |     |        |
-   |     |        expected `&Foo`, found struct `Foo`
+   |     |        expected `&Foo`, found `Foo`
    |     |        help: consider borrowing here: `&x`
    |     arguments to this function are incorrect
    |
@@ -18,7 +18,7 @@ error[E0308]: mismatched types
   --> $DIR/method-self-arg-1.rs:13:14
    |
 LL |     Foo::bar(&42);
-   |     -------- ^^^ expected struct `Foo`, found integer
+   |     -------- ^^^ expected `&Foo`, found `&{integer}`
    |     |
    |     arguments to this function are incorrect
    |
index ff1a836c9aec034b7e2cbd5e929b5a190a05b89a..6d2fb1ce9cf6287f379a057531aa4a8c5ddc3791 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn a() -> Foo {
    |           --- expected `Foo` because of return type
 LL |     Some(Foo { bar: 1 })
-   |     ^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `Option`
+   |     ^^^^^^^^^^^^^^^^^^^^ expected `Foo`, found `Option<Foo>`
    |
    = note: expected struct `Foo`
                 found enum `Option<Foo>`
@@ -15,7 +15,7 @@ error[E0308]: mismatched types
 LL | fn a2() -> Foo {
    |            --- expected `Foo` because of return type
 LL |     Ok(Foo { bar: 1})
-   |     ^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `Result`
+   |     ^^^^^^^^^^^^^^^^^ expected `Foo`, found `Result<Foo, _>`
    |
    = note: expected struct `Foo`
                 found enum `Result<Foo, _>`
@@ -26,7 +26,7 @@ error[E0308]: mismatched types
 LL | fn b() -> Option<Foo> {
    |           ----------- expected `Option<Foo>` because of return type
 LL |     Foo { bar: 1 }
-   |     ^^^^^^^^^^^^^^ expected enum `Option`, found struct `Foo`
+   |     ^^^^^^^^^^^^^^ expected `Option<Foo>`, found `Foo`
    |
    = note: expected enum `Option<Foo>`
             found struct `Foo`
@@ -41,7 +41,7 @@ error[E0308]: mismatched types
 LL | fn c() -> Result<Foo, Bar> {
    |           ---------------- expected `Result<Foo, Bar>` because of return type
 LL |     Foo { bar: 1 }
-   |     ^^^^^^^^^^^^^^ expected enum `Result`, found struct `Foo`
+   |     ^^^^^^^^^^^^^^ expected `Result<Foo, Bar>`, found `Foo`
    |
    = note: expected enum `Result<Foo, Bar>`
             found struct `Foo`
@@ -57,7 +57,7 @@ LL | fn d() -> X<X<String, String>, String> {
    |           ---------------------------- expected `X<X<String, String>, String>` because of return type
 ...
 LL |     x
-   |     ^ expected struct `String`, found integer
+   |     ^ expected `X<X<String, String>, String>`, found `X<X<String, {integer}>, {integer}>`
    |
    = note: expected struct `X<X<_, String>, String>`
               found struct `X<X<_, {integer}>, {integer}>`
@@ -69,7 +69,7 @@ LL | fn e() -> X<X<String, String>, String> {
    |           ---------------------------- expected `X<X<String, String>, String>` because of return type
 ...
 LL |     x
-   |     ^ expected struct `String`, found integer
+   |     ^ expected `X<X<String, String>, String>`, found `X<X<String, {integer}>, String>`
    |
    = note: expected struct `X<X<_, String>, _>`
               found struct `X<X<_, {integer}>, _>`
@@ -80,7 +80,7 @@ error[E0308]: mismatched types
 LL | fn f() -> String {
    |           ------ expected `String` because of return type
 LL |     1+2
-   |     ^^^ expected struct `String`, found integer
+   |     ^^^ expected `String`, found integer
    |
 help: try using a conversion method
    |
@@ -93,7 +93,7 @@ error[E0308]: mismatched types
 LL | fn g() -> String {
    |           ------ expected `String` because of return type
 LL |     -2
-   |     ^^ expected struct `String`, found integer
+   |     ^^ expected `String`, found integer
    |
 help: try using a conversion method
    |
index 2f814445bbadfed8f69e2b8571f0fa65801c89d8..54abb50d6e8c79c98d65b3df50b7858a71d49bf1 100644 (file)
@@ -6,7 +6,7 @@ LL | |         S
    | |         - expected because of this
 LL | |     } else {
 LL | |         Y
-   | |         ^ expected struct `S`, found struct `Y`
+   | |         ^ expected `S`, found `Y`
 LL | |     }
    | |_____- `if` and `else` have incompatible types
 
@@ -17,7 +17,7 @@ LL | /     match true {
 LL | |         true => S,
    | |                 - this is found to be of type `S`
 LL | |         false => Y,
-   | |                  ^ expected struct `S`, found struct `Y`
+   | |                  ^ expected `S`, found `Y`
 LL | |     }
    | |_____- `match` arms have incompatible types
 
index ac3ab8e9895c4107a277d1af53c7d47b7263bcf3..96ab3a029914eaee9184802fab7b8d9e5974f6f2 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match x {
    |           - this expression has type `&_S`
 LL |         _S(& (mut _y), _v) => {
-   |            ^^^^^^^^^^ expected `u32`, found reference
+   |            ^^^^^^^^^^ expected `u32`, found `&_`
    |
    = note:   expected type `u32`
            found reference `&_`
index 3c5e765abfbe2eefc9537f5818963b81d4cb4576..318285598a0b53e33c8cd1b2d0e8bb1746f5f0db 100644 (file)
@@ -10,7 +10,7 @@ error[E0308]: mismatched types
 LL | fn bgh(&&bar: u32) {}
    |        ^^^^^  --- expected due to this
    |        |
-   |        expected `u32`, found reference
+   |        expected `u32`, found `&_`
    |
    = note:   expected type `u32`
            found reference `&_`
index f43427f9832d03d0ebc4b989a4394269f1d74113..19335c446c3e70c75952f40ec252110b0fed738a 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn foo(&_a: Foo) {}
    |        ^^^  --- expected due to this
    |        |
-   |        expected struct `Foo`, found reference
+   |        expected `Foo`, found `&_`
    |
    = note: expected struct `Foo`
            found reference `&_`
@@ -20,7 +20,7 @@ error[E0308]: mismatched types
 LL | fn agh(&&_a: &u32) {}
    |         ^^^  ---- expected due to this
    |         |
-   |         expected `u32`, found reference
+   |         expected `u32`, found `&_`
    |
    = note:   expected type `u32`
            found reference `&_`
index d4b2c902f9b2ed4e275dc4c902a4d4acb8f1267d..57db71f889cf709f5a35ba800824c52f638826e9 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/non_zero_assigned_something.rs:2:35
    |
 LL |     let _: std::num::NonZeroU64 = 1;
-   |            --------------------   ^ expected struct `NonZeroU64`, found integer
+   |            --------------------   ^ expected `NonZeroU64`, found integer
    |            |
    |            expected due to this
    |
@@ -15,7 +15,7 @@ error[E0308]: mismatched types
   --> $DIR/non_zero_assigned_something.rs:6:43
    |
 LL |     let _: Option<std::num::NonZeroU64> = 1;
-   |            ----------------------------   ^ expected enum `Option`, found integer
+   |            ----------------------------   ^ expected `Option<NonZeroU64>`, found integer
    |            |
    |            expected due to this
    |
index 6c55f29c5d153d514e83a4656f3a275316f679ae..252e56387ba8b99eceb1508abcf5244728f72f6e 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/normalize-fn-sig.rs:14:22
    |
 LL |     needs_i32_ref_fn(foo::<()>);
-   |     ---------------- ^^^^^^^^^ expected `&i32`, found `i32`
+   |     ---------------- ^^^^^^^^^ expected fn pointer, found fn item
    |     |
    |     arguments to this function are incorrect
    |
index 63eaa3930b1c3468f66ab51308c8562563c3cf51..62824004db5bfb71400a45c6ef20d8587efb2d1d 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn _f0(&_a: u32) {}
    |        ^^^  --- expected due to this
    |        |
-   |        expected `u32`, found reference
+   |        expected `u32`, found `&_`
    |
    = note:   expected type `u32`
            found reference `&_`
@@ -41,7 +41,7 @@ error[E0308]: mismatched types
 LL | fn _f2(&&_a: &u32) {}
    |         ^^^  ---- expected due to this
    |         |
-   |         expected `u32`, found reference
+   |         expected `u32`, found `&_`
    |
    = note:   expected type `u32`
            found reference `&_`
@@ -57,7 +57,7 @@ error[E0308]: mismatched types
 LL | fn _f3(&mut &_a: &mut u32) {}
    |             ^^^  -------- expected due to this
    |             |
-   |             expected `u32`, found reference
+   |             expected `u32`, found `&_`
    |
    = note:   expected type `u32`
            found reference `&_`
@@ -106,7 +106,7 @@ LL |     let _: fn(u32) = |&_a| ();
    |                       ^--
    |                       ||
    |                       |expected due to this
-   |                       expected `u32`, found reference
+   |                       expected `u32`, found `&_`
    |
    = note:   expected type `u32`
            found reference `&_`
@@ -145,7 +145,7 @@ LL |     let _: fn(&u32) = |&&_a| ();
    |                         ^--
    |                         ||
    |                         |expected due to this
-   |                         expected `u32`, found reference
+   |                         expected `u32`, found `&_`
    |
    = note:   expected type `u32`
            found reference `&_`
@@ -162,7 +162,7 @@ LL |     let _: fn(&mut u32) = |&mut &_a| ();
    |                                 ^--
    |                                 ||
    |                                 |expected due to this
-   |                                 expected `u32`, found reference
+   |                                 expected `u32`, found `&_`
    |
    = note:   expected type `u32`
            found reference `&_`
@@ -212,7 +212,7 @@ error[E0308]: mismatched types
 LL |     let _ = |&_a: u32| ();
    |              ^^^  --- expected due to this
    |              |
-   |              expected `u32`, found reference
+   |              expected `u32`, found `&_`
    |
    = note:   expected type `u32`
            found reference `&_`
@@ -249,7 +249,7 @@ error[E0308]: mismatched types
 LL |     let _ = |&&_a: &u32| ();
    |               ^^^  ---- expected due to this
    |               |
-   |               expected `u32`, found reference
+   |               expected `u32`, found `&_`
    |
    = note:   expected type `u32`
            found reference `&_`
@@ -265,7 +265,7 @@ error[E0308]: mismatched types
 LL |     let _ = |&mut &_a: &mut u32| ();
    |                   ^^^  -------- expected due to this
    |                   |
-   |                   expected `u32`, found reference
+   |                   expected `u32`, found `&_`
    |
    = note:   expected type `u32`
            found reference `&_`
index 5e48e0955aae94e17626e04255a9771a9ec340d1..4bbeaaab9375504d7049cefa8517a83ee2fabc2a 100644 (file)
@@ -4,15 +4,15 @@ error[E0308]: mismatched types
 LL | fn foo() -> Foo {
    |             --- expected `baz::Foo` because of return type
 LL |     meh::Foo
-   |     ^^^^^^^^ expected struct `baz::Foo`, found struct `meh::Foo`
+   |     ^^^^^^^^ expected `baz::Foo`, found `meh::Foo`
    |
-   = note: struct `meh::Foo` and struct `baz::Foo` have similar names, but are actually distinct types
-note: struct `meh::Foo` is defined in module `crate::meh` of the current crate
+   = note: `meh::Foo` and `baz::Foo` have similar names, but are actually distinct types
+note: `meh::Foo` is defined in module `crate::meh` of the current crate
   --> $DIR/show_module.rs:8:5
    |
 LL |     pub struct Foo;
    |     ^^^^^^^^^^^^^^
-note: struct `baz::Foo` is defined in module `crate::blah::baz` of the current crate
+note: `baz::Foo` is defined in module `crate::blah::baz` of the current crate
   --> $DIR/show_module.rs:3:9
    |
 LL |         pub struct Foo;
index 46a383325526db3371d9a1eb99bf66d534fa1f4e..3e44fb759296a32552353f4e53d7cd328544dc51 100644 (file)
@@ -4,12 +4,12 @@ error[E0308]: mismatched types
 LL | pub fn foo() -> Option<u8> {
    |                 ---------- expected `Option<u8>` because of return type
 LL |     Some(42_u8)
-   |     ^^^^^^^^^^^ expected enum `Option`, found enum `std::option::Option`
+   |     ^^^^^^^^^^^ expected `Option<u8>`, found `std::option::Option<u8>`
    |
-   = note: enum `std::option::Option` and enum `Option` have similar names, but are actually distinct types
-note: enum `std::option::Option` is defined in crate `core`
+   = note: `std::option::Option<u8>` and `Option<u8>` have similar names, but are actually distinct types
+note: `std::option::Option<u8>` is defined in crate `core`
   --> $SRC_DIR/core/src/option.rs:LL:COL
-note: enum `Option` is defined in the current crate
+note: `Option<u8>` is defined in the current crate
   --> $DIR/similar_paths.rs:1:1
    |
 LL | enum Option<T> {
index 8a2f73945e84184d0d00e9e1e478279b15631966..80e78a4e4fa3cf315060a2b0084b79820920c5ed 100644 (file)
@@ -2,13 +2,13 @@ error[E0308]: mismatched types
   --> $DIR/similar_paths_primitive.rs:8:9
    |
 LL |     foo(true);
-   |     --- ^^^^ expected struct `bool`, found `bool`
+   |     --- ^^^^ expected `bool`, found a different `bool`
    |     |
    |     arguments to this function are incorrect
    |
-   = note: bool and struct `bool` have similar names, but are actually distinct types
+   = note: bool and `bool` have similar names, but are actually distinct types
    = note: bool is a primitive defined by the language
-note: struct `bool` is defined in the current crate
+note: `bool` is defined in the current crate
   --> $DIR/similar_paths_primitive.rs:3:1
    |
 LL | struct bool;
index f58b9c3ec16de528c6d986cd2ac8c0fb9b7acd2c..40182a75a989a5ad1e35a603c798613b50b8291c 100644 (file)
@@ -6,7 +6,7 @@ LL | |         S
    | |         - expected because of this
 LL | |     } else {
 LL | |         Y
-   | |         ^ expected struct `S`, found struct `Y`
+   | |         ^ expected `S`, found `Y`
 LL | |     }
    | |_____- `if` and `else` have incompatible types
    |
@@ -28,7 +28,7 @@ LL | /     match true {
 LL | |         true => S,
    | |                 - this is found to be of type `S`
 LL | |         false => Y,
-   | |                  ^ expected struct `S`, found struct `Y`
+   | |                  ^ expected `S`, found `Y`
 LL | |     }
    | |_____- `match` arms have incompatible types
    |
index 35871afb58b9adf60b60b44228bd010f0e1f3af8..c5d0eef10265b798cba2f2a271b146b80126dcfc 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/suggest-removing-tuple-struct-field.rs:11:13
    |
 LL |     some_fn(value.0);
-   |     ------- ^^^^^^^ expected struct `MyWrapper`, found `u32`
+   |     ------- ^^^^^^^ expected `MyWrapper`, found `u32`
    |     |
    |     arguments to this function are incorrect
    |
@@ -21,7 +21,7 @@ error[E0308]: mismatched types
   --> $DIR/suggest-removing-tuple-struct-field.rs:12:13
    |
 LL |     some_fn(my_wrapper!(123).0);
-   |     ------- ^^^^^^^^^^^^^^^^^^ expected struct `MyWrapper`, found `u32`
+   |     ------- ^^^^^^^^^^^^^^^^^^ expected `MyWrapper`, found `u32`
    |     |
    |     arguments to this function are incorrect
    |
index fdd92cbfc44370ba06c3c492ca72851eb9c5b294..e20a0aa0e2aee91cd0beb4c3129a3633db5b2555 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/wrap-suggestion-privacy.rs:12:19
    |
 LL |     needs_wrapper(0);
-   |     ------------- ^ expected struct `Wrapper`, found integer
+   |     ------------- ^ expected `Wrapper<i32>`, found integer
    |     |
    |     arguments to this function are incorrect
    |
@@ -22,7 +22,7 @@ error[E0308]: mismatched types
   --> $DIR/wrap-suggestion-privacy.rs:17:20
    |
 LL |     needs_wrapping(0);
-   |     -------------- ^ expected struct `Wrapping`, found integer
+   |     -------------- ^ expected `Wrapping<i32>`, found integer
    |     |
    |     arguments to this function are incorrect
    |
@@ -42,7 +42,7 @@ error[E0308]: mismatched types
   --> $DIR/wrap-suggestion-privacy.rs:22:17
    |
 LL |     needs_ready(Some(0));
-   |     ----------- ^^^^^^^ expected struct `Ready`, found enum `Option`
+   |     ----------- ^^^^^^^ expected `Ready<i32>`, found `Option<{integer}>`
    |     |
    |     arguments to this function are incorrect
    |
index ee739d6286a51d632330f3d7275a1e8c4a8e8b64..8401827e51f82051e403696686e0abc23a1820ec 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     f(x)
    |     - ^
    |     | |
-   |     | expected `&mut isize`, found struct `Box`
+   |     | expected `&mut isize`, found `Box<{integer}>`
    |     | help: consider mutably borrowing here: `&mut x`
    |     arguments to this function are incorrect
    |
index 52d07ae170c417a677c21e9b5f87c100276ac27d..ded13e2707f5f1c222e418315cd8e927a97c664b 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/diverging-tuple-parts-39485.rs:8:5
    |
 LL |     &panic!()
-   |     ^^^^^^^^^ expected `()`, found reference
+   |     ^^^^^^^^^ expected `()`, found `&_`
    |
    = note: expected unit type `()`
               found reference `&_`
@@ -22,7 +22,7 @@ error[E0308]: mismatched types
 LL | fn f() -> isize {
    |           ----- expected `isize` because of return type
 LL |     (return 1, return 2)
-   |     ^^^^^^^^^^^^^^^^^^^^ expected `isize`, found tuple
+   |     ^^^^^^^^^^^^^^^^^^^^ expected `isize`, found `(!, !)`
    |
    = note: expected type `isize`
              found tuple `(!, !)`
index 6277aa05eb3655b3e9a21c7b32d6989b2897c720..5ac4359c5016f436da0b891ea0eef57b021edff5 100644 (file)
@@ -3,7 +3,7 @@ fn f() -> isize {
 //~^ ERROR mismatched types
 //~| expected type `isize`
 //~| found tuple `(!, !)`
-//~| expected `isize`, found tuple
+//~| expected `isize`, found `(!, !)`
 }
 
 fn main() {}
index cd5361ffad3982110013dc95bff236bf3fcbb770..3f381b9aea9b297041752e725be6b25e196ee9c7 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn f() -> isize {
    |           ----- expected `isize` because of return type
 LL |     (return 1, return 2)
-   |     ^^^^^^^^^^^^^^^^^^^^ expected `isize`, found tuple
+   |     ^^^^^^^^^^^^^^^^^^^^ expected `isize`, found `(!, !)`
    |
    = note: expected type `isize`
              found tuple `(!, !)`
index 33b7a9185d0ebc662d414856ae590c3154f40fb7..99dfce869034323b3549a951d8f345b2f0f04179 100644 (file)
@@ -19,7 +19,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-52443.rs:2:10
    |
 LL |     [(); & { loop { continue } } ];
-   |          ^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found reference
+   |          ^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_`
    |
    = note:   expected type `usize`
            found reference `&_`
index e148b983e8e9da2836c479cc0bfd21ee3b872b8f..c3d80a425e0573a1dbb8eed2f65e2bf87c9ffc27 100644 (file)
@@ -19,7 +19,7 @@ error[E0308]: mismatched types
 LL |     0.....{loop{}1};
    |     ----^^^^^^^^^^^
    |     |   |
-   |     |   expected integer, found struct `RangeTo`
+   |     |   expected integer, found `RangeTo<{integer}>`
    |     arguments to this function are incorrect
    |
    = note: expected type `{integer}`
index 964ac9a300e8f85595f2496f3cdeb0e924ab069d..d473ad6c9c93ef197ef8208d5859ace77539da19 100644 (file)
@@ -11,5 +11,5 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected type `isize`
     //~| found enum `Option<isize>`
-    //~| expected `isize`, found enum `Option`
+    //~| expected `isize`, found `Option<isize>`
 }
index 7fc239613e2d767143bf6b977930a1e7695d9c77..26bafd31d011b72d5434af700496a317c8f6dd1f 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/noexporttypeexe.rs:10:18
    |
 LL |   let x: isize = noexporttypelib::foo();
-   |          -----   ^^^^^^^^^^^^^^^^^^^^^^ expected `isize`, found enum `Option`
+   |          -----   ^^^^^^^^^^^^^^^^^^^^^^ expected `isize`, found `Option<isize>`
    |          |
    |          expected due to this
    |
index 368782c1e0d01c43ce3e4a2d27dc7d134580add8..795c46acb5d31e40ea5b02bd853018dbd1e13786 100644 (file)
@@ -88,7 +88,7 @@ error[E0308]: mismatched types
 LL |     let (B(A(a, _) | B(a)) | A(a, A(a, _) | B(a))) = B(B(1));
    |              -                 ^                     ------- this expression has type `E<E<{integer}>>`
    |              |                 |
-   |              |                 expected integer, found enum `E`
+   |              |                 expected integer, found `E<{integer}>`
    |              first introduced with type `{integer}` here
    |
    = note: expected type `{integer}`
index 2e25d8b3e7b0da43533aa088835e82b4b30ed530..5a63e621f4a3ac8dea6ff2d5d313b685d12647ad 100644 (file)
@@ -42,7 +42,7 @@ error[E0308]: mismatched types
 LL |     let &A(_) | B(_): F = A(3);
    |         ^^^^^         - expected due to this
    |         |
-   |         expected enum `F`, found reference
+   |         expected `F`, found `&_`
    |
    = note:   expected enum `F`
            found reference `&_`
@@ -53,7 +53,7 @@ error[E0308]: mismatched types
 LL |     let &&A(_) | B(_): F = A(3);
    |         ^^^^^^         - expected due to this
    |         |
-   |         expected enum `F`, found reference
+   |         expected `F`, found `&_`
    |
    = note:   expected enum `F`
            found reference `&_`
@@ -64,7 +64,7 @@ error[E0308]: mismatched types
 LL |     let &mut A(_) | B(_): F = A(3);
    |         ^^^^^^^^^         - expected due to this
    |         |
-   |         expected enum `F`, found `&mut _`
+   |         expected `F`, found `&mut _`
    |
    = note:           expected enum `F`
            found mutable reference `&mut _`
@@ -75,7 +75,7 @@ error[E0308]: mismatched types
 LL |     let &&mut A(_) | B(_): F = A(3);
    |         ^^^^^^^^^^         - expected due to this
    |         |
-   |         expected enum `F`, found reference
+   |         expected `F`, found `&_`
    |
    = note:   expected enum `F`
            found reference `&_`
index f8ee0517533c6859ad8a4a72575708faa8d138b3..d045f4821ff35050998dadd3cfd38e3976f5da83 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-87812-path.rs:3:24
    |
 LL |         let _: usize = $f;
-   |                -----   ^^ expected `usize`, found struct `Baz`
+   |                -----   ^^ expected `usize`, found `Baz`
    |                |
    |                expected due to this
 ...
index c54f13e01852163c0545163a4a5e8be26abc8483..5b69ca5cd6dfa0b6ab4fc111d8b108a7ff13e446 100644 (file)
@@ -314,7 +314,7 @@ error[E0308]: mismatched types
 LL |     if let X.. .0 = 0 {}
    |            -   ^^   - this expression has type `u8`
    |            |   |
-   |            |   expected integer, found floating-point number
+   |            |   expected `u8`, found floating-point number
    |            this is of type `u8`
    |
    = note: expected type `u8`
@@ -351,7 +351,7 @@ error[E0308]: mismatched types
 LL |     if let X..=.0 = 0 {}
    |            -   ^^   - this expression has type `u8`
    |            |   |
-   |            |   expected integer, found floating-point number
+   |            |   expected `u8`, found floating-point number
    |            this is of type `u8`
    |
    = note: expected type `u8`
@@ -388,7 +388,7 @@ error[E0308]: mismatched types
 LL |     if let X... .0 = 0 {}
    |            -    ^^   - this expression has type `u8`
    |            |    |
-   |            |    expected integer, found floating-point number
+   |            |    expected `u8`, found floating-point number
    |            this is of type `u8`
    |
    = note: expected type `u8`
index 1366ef1bba8bfb3956ae538dc3f706ff4474da8d..d1725c60dbbea127989a3afe02dc5ad49f090fd6 100644 (file)
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
   --> $DIR/unclosed-delimiter-in-dep.rs:4:20
    |
 LL |     let _: usize = unclosed_delim_mod::new();
-   |            -----   ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found enum `Result`
+   |            -----   ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `Result<Value, ()>`
    |            |
    |            expected due to this
    |
index f064a25a9c9a45b0311276572691609b932fdf8e..67c6d6f01a17f692659565edd21d4e023b1e86f4 100644 (file)
@@ -25,7 +25,7 @@ error[E0308]: mismatched types
 LL |     for Some(Qux(_)) | None in [Some(""), None] {
    |              ^^^^^^            ---------------- this is an iterator with items of type `Option<&str>`
    |              |
-   |              expected `str`, found struct `Qux`
+   |              expected `str`, found `Qux`
 
 error: aborting due to 2 previous errors
 
index 75a231f6b4ba32fee613d9327a7bd82df5782e05..daab3a862c2e135544c43befff99dfa8d55517c0 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     let P() = U {};
    |         ^^^   ---- this expression has type `U`
    |         |
-   |         expected struct `U`, found struct `P`
+   |         expected `U`, found `P<_>`
    |
    = note: expected struct `U`
               found struct `P<_>`
index 3a61d4293b01deb5acfd6d0f532c8fcd18cbc018..029075293106795609d060efa49c28992584f85f 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match (S { f: 42 }) {
    |           ------------- this expression has type `S`
 LL |         S { f: Ok(_) } => {}
-   |                ^^^^^ expected `u8`, found enum `Result`
+   |                ^^^^^ expected `u8`, found `Result<_, _>`
    |
    = note: expected type `u8`
               found enum `Result<_, _>`
index 206713a4bfc33a77c9aaa900f46c04b194188b5d..4f482c52a98f81b2703d5918f9fae657c25464d9 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn foo(Tuple(_): String) {}
    |        ^^^^^^^^  ------ expected due to this
    |        |
-   |        expected struct `String`, found struct `Tuple`
+   |        expected `String`, found `Tuple`
 
 error: aborting due to previous error
 
index 090bd67117eab8cdad015950777c29ad481944e0..b68b69a78a2f7388316c09963e51208ea7610547 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/pat-type-err-let-stmt.rs:6:29
    |
 LL |     let Ok(0): Option<u8> = 42u8;
-   |                ----------   ^^^^ expected enum `Option`, found `u8`
+   |                ----------   ^^^^ expected `Option<u8>`, found `u8`
    |                |
    |                expected due to this
    |
@@ -19,7 +19,7 @@ error[E0308]: mismatched types
 LL |     let Ok(0): Option<u8> = 42u8;
    |         ^^^^^  ---------- expected due to this
    |         |
-   |         expected enum `Option`, found enum `Result`
+   |         expected `Option<u8>`, found `Result<_, _>`
    |
    = note: expected enum `Option<u8>`
               found enum `Result<_, _>`
@@ -30,7 +30,7 @@ error[E0308]: mismatched types
 LL |     let Ok(0): Option<u8>;
    |         ^^^^^  ---------- expected due to this
    |         |
-   |         expected enum `Option`, found enum `Result`
+   |         expected `Option<u8>`, found `Result<_, _>`
    |
    = note: expected enum `Option<u8>`
               found enum `Result<_, _>`
@@ -41,7 +41,7 @@ error[E0308]: mismatched types
 LL |     let Ok(0) = 42u8;
    |         ^^^^^   ---- this expression has type `u8`
    |         |
-   |         expected `u8`, found enum `Result`
+   |         expected `u8`, found `Result<_, _>`
    |
    = note: expected type `u8`
               found enum `Result<_, _>`
index 0702a9986fc1c2eb68ebcb9a95120e4f2bdb9910..bed949439237a1f03edbc4cc324fe9a8ba9dbbfe 100644 (file)
@@ -21,7 +21,7 @@ fn main() {
     match 'c' {
         S { .. } => (),
         //~^ ERROR mismatched types
-        //~| expected `char`, found struct `S`
+        //~| expected `char`, found `S`
 
         _ => ()
     }
index 4c2eff63ab5e839b277ef317b3b7a31b0c138ba7..e1349fb02ea768eebc398170ce0532d0d85fccf0 100644 (file)
@@ -40,7 +40,7 @@ error[E0308]: mismatched types
 LL |     match 'c' {
    |           --- this expression has type `char`
 LL |         S { .. } => (),
-   |         ^^^^^^^^ expected `char`, found struct `S`
+   |         ^^^^^^^^ expected `char`, found `S`
 
 error[E0308]: mismatched types
   --> $DIR/pattern-error-continue.rs:28:7
index 01b082bd35b02a403f599c66d3da409be39625a1..62283dfe9b64f4281769544bb9efba24bab7ffad 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match Some("foo") {
    |           ----------- this expression has type `Option<&str>`
 LL |         None::<isize> => {}
-   |         ^^^^^^^^^^^^^ expected `&str`, found `isize`
+   |         ^^^^^^^^^^^^^ expected `Option<&str>`, found `Option<isize>`
    |
    = note: expected enum `Option<&str>`
               found enum `Option<isize>`
index f1e2a9d72cec899541a3e53a911f41960f368c68..4eb00254861d5d2045f08f8791b24ab6099118ae 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match t {
    |           - this expression has type `Bar`
 LL |       Bar::T1(_, Some::<isize>(x)) => {
-   |                  ^^^^^^^^^^^^^^^^ expected struct `Vec`, found `isize`
+   |                  ^^^^^^^^^^^^^^^^ expected `Option<Vec<isize>>`, found `Option<isize>`
    |
    = note: expected enum `Option<Vec<isize>>`
               found enum `Option<isize>`
index f5a5f1ab37ae662c401f9f140a86823006520ab6..a8d0d623604060ed19cb517ca95d00f472ec6b54 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/point-to-type-err-cause-on-impl-trait-return-2.rs:9:41
    |
 LL |             let value: &bool = unsafe { &42 };
-   |                                         ^^^ expected `bool`, found integer
+   |                                         ^^^ expected `&bool`, found `&{integer}`
    |
    = note: expected reference `&bool`
               found reference `&{integer}`
index 0a0322b8a3ee2f01485a7be1456726ffa7701d69..e69cc3b8cf598c5ec063ec02af3e937779c4357b 100644 (file)
@@ -8,7 +8,7 @@ error[E0308]: mismatched types
   --> $DIR/break-token-spans.rs:14:32
    |
 LL |     let a: Option<Option<u8>>= true;
-   |            ------------------  ^^^^ expected enum `Option`, found `bool`
+   |            ------------------  ^^^^ expected `Option<Option<u8>>`, found `bool`
    |            |
    |            expected due to this
    |
index 345520d4852ae4604519da5438385d82a533e1c2..e437bb90b1dfa1843534038d476971e9094012ff 100644 (file)
@@ -7,7 +7,7 @@ LL |     // Test that constructing the `visible_parent_map` (in `cstore_impl.rs`
 LL |     std::cell::Cell::new(0)
    |     ^^^^^^^^^^^^^^^^^^^^^^^- help: consider using a semicolon here: `;`
    |     |
-   |     expected `()`, found struct `Cell`
+   |     expected `()`, found `Cell<{integer}>`
    |
    = note: expected unit type `()`
                  found struct `Cell<{integer}>`
index 422820e9d8bd5068112d82fbc78eb43b590109f4..0b4dbcba682876f3b60a8e4e2186bb8eb1f396ee 100644 (file)
@@ -12,7 +12,7 @@ error[E0308]: mismatched types
 LL | fn main() {
    |           - expected `()` because of default return type
 LL |     resolve_located_at!(a b)
-   |                           ^ expected `()`, found struct `S`
+   |                           ^ expected `()`, found `S`
    |
    = note: this error originates in the macro `resolve_located_at` (in Nightly builds, run with -Z macro-backtrace for more info)
 
index 070dc844563c9aabca3407b3442117c824d224a3..d112983848deeba4cbb3328a7c4a7ee9c1bf5752 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     take_range(std::ops::Range { start: 0, end: 1 });
    |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |          |
-   |     |          expected reference, found struct `Range`
+   |     |          expected `&_`, found `Range<{integer}>`
    |     |          help: consider borrowing here: `&std::ops::Range { start: 0, end: 1 }`
    |     arguments to this function are incorrect
    |
@@ -22,7 +22,7 @@ error[E0308]: mismatched types
 LL |     take_range(::std::ops::Range { start: 0, end: 1 });
    |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |          |
-   |     |          expected reference, found struct `Range`
+   |     |          expected `&_`, found `Range<{integer}>`
    |     |          help: consider borrowing here: `&::std::ops::Range { start: 0, end: 1 }`
    |     arguments to this function are incorrect
    |
@@ -40,7 +40,7 @@ error[E0308]: mismatched types
 LL |     take_range(std::ops::RangeFrom { start: 1 });
    |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |          |
-   |     |          expected reference, found struct `RangeFrom`
+   |     |          expected `&_`, found `RangeFrom<{integer}>`
    |     |          help: consider borrowing here: `&std::ops::RangeFrom { start: 1 }`
    |     arguments to this function are incorrect
    |
@@ -58,7 +58,7 @@ error[E0308]: mismatched types
 LL |     take_range(::std::ops::RangeFrom { start: 1 });
    |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |          |
-   |     |          expected reference, found struct `RangeFrom`
+   |     |          expected `&_`, found `RangeFrom<{integer}>`
    |     |          help: consider borrowing here: `&::std::ops::RangeFrom { start: 1 }`
    |     arguments to this function are incorrect
    |
@@ -76,7 +76,7 @@ error[E0308]: mismatched types
 LL |     take_range(std::ops::RangeFull {});
    |     ---------- ^^^^^^^^^^^^^^^^^^^^^^
    |     |          |
-   |     |          expected reference, found struct `RangeFull`
+   |     |          expected `&_`, found `RangeFull`
    |     |          help: consider borrowing here: `&std::ops::RangeFull {}`
    |     arguments to this function are incorrect
    |
@@ -94,7 +94,7 @@ error[E0308]: mismatched types
 LL |     take_range(::std::ops::RangeFull {});
    |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^
    |     |          |
-   |     |          expected reference, found struct `RangeFull`
+   |     |          expected `&_`, found `RangeFull`
    |     |          help: consider borrowing here: `&::std::ops::RangeFull {}`
    |     arguments to this function are incorrect
    |
@@ -112,7 +112,7 @@ error[E0308]: mismatched types
 LL |     take_range(std::ops::RangeInclusive::new(0, 1));
    |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |          |
-   |     |          expected reference, found struct `RangeInclusive`
+   |     |          expected `&_`, found `RangeInclusive<{integer}>`
    |     |          help: consider borrowing here: `&std::ops::RangeInclusive::new(0, 1)`
    |     arguments to this function are incorrect
    |
@@ -130,7 +130,7 @@ error[E0308]: mismatched types
 LL |     take_range(::std::ops::RangeInclusive::new(0, 1));
    |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |          |
-   |     |          expected reference, found struct `RangeInclusive`
+   |     |          expected `&_`, found `RangeInclusive<{integer}>`
    |     |          help: consider borrowing here: `&::std::ops::RangeInclusive::new(0, 1)`
    |     arguments to this function are incorrect
    |
@@ -148,7 +148,7 @@ error[E0308]: mismatched types
 LL |     take_range(std::ops::RangeTo { end: 5 });
    |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |          |
-   |     |          expected reference, found struct `RangeTo`
+   |     |          expected `&_`, found `RangeTo<{integer}>`
    |     |          help: consider borrowing here: `&std::ops::RangeTo { end: 5 }`
    |     arguments to this function are incorrect
    |
@@ -166,7 +166,7 @@ error[E0308]: mismatched types
 LL |     take_range(::std::ops::RangeTo { end: 5 });
    |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |          |
-   |     |          expected reference, found struct `RangeTo`
+   |     |          expected `&_`, found `RangeTo<{integer}>`
    |     |          help: consider borrowing here: `&::std::ops::RangeTo { end: 5 }`
    |     arguments to this function are incorrect
    |
@@ -184,7 +184,7 @@ error[E0308]: mismatched types
 LL |     take_range(std::ops::RangeToInclusive { end: 5 });
    |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |          |
-   |     |          expected reference, found struct `RangeToInclusive`
+   |     |          expected `&_`, found `RangeToInclusive<{integer}>`
    |     |          help: consider borrowing here: `&std::ops::RangeToInclusive { end: 5 }`
    |     arguments to this function are incorrect
    |
@@ -202,7 +202,7 @@ error[E0308]: mismatched types
 LL |     take_range(::std::ops::RangeToInclusive { end: 5 });
    |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |     |          |
-   |     |          expected reference, found struct `RangeToInclusive`
+   |     |          expected `&_`, found `RangeToInclusive<{integer}>`
    |     |          help: consider borrowing here: `&::std::ops::RangeToInclusive { end: 5 }`
    |     arguments to this function are incorrect
    |
index 9fb0e54a8a9bfef119f7436a480fd58205e81158..a6a9f89da749362fd4c2ca79dc748f4ca1d14a6c 100644 (file)
@@ -16,7 +16,7 @@ error[E0308]: mismatched types
 LL |     take_range(0..1);
    |     ---------- ^^^^
    |     |          |
-   |     |          expected reference, found struct `Range`
+   |     |          expected `&_`, found `Range<{integer}>`
    |     |          help: consider borrowing here: `&(0..1)`
    |     arguments to this function are incorrect
    |
@@ -34,7 +34,7 @@ error[E0308]: mismatched types
 LL |     take_range(1..);
    |     ---------- ^^^
    |     |          |
-   |     |          expected reference, found struct `RangeFrom`
+   |     |          expected `&_`, found `RangeFrom<{integer}>`
    |     |          help: consider borrowing here: `&(1..)`
    |     arguments to this function are incorrect
    |
@@ -52,7 +52,7 @@ error[E0308]: mismatched types
 LL |     take_range(..);
    |     ---------- ^^
    |     |          |
-   |     |          expected reference, found struct `RangeFull`
+   |     |          expected `&_`, found `RangeFull`
    |     |          help: consider borrowing here: `&(..)`
    |     arguments to this function are incorrect
    |
@@ -70,7 +70,7 @@ error[E0308]: mismatched types
 LL |     take_range(0..=1);
    |     ---------- ^^^^^
    |     |          |
-   |     |          expected reference, found struct `RangeInclusive`
+   |     |          expected `&_`, found `RangeInclusive<{integer}>`
    |     |          help: consider borrowing here: `&(0..=1)`
    |     arguments to this function are incorrect
    |
@@ -88,7 +88,7 @@ error[E0308]: mismatched types
 LL |     take_range(..5);
    |     ---------- ^^^
    |     |          |
-   |     |          expected reference, found struct `RangeTo`
+   |     |          expected `&_`, found `RangeTo<{integer}>`
    |     |          help: consider borrowing here: `&(..5)`
    |     arguments to this function are incorrect
    |
@@ -106,7 +106,7 @@ error[E0308]: mismatched types
 LL |     take_range(..=42);
    |     ---------- ^^^^^
    |     |          |
-   |     |          expected reference, found struct `RangeToInclusive`
+   |     |          expected `&_`, found `RangeToInclusive<{integer}>`
    |     |          help: consider borrowing here: `&(..=42)`
    |     arguments to this function are incorrect
    |
index 9eec169404cdf2e72373789c1fc88fdb1f222d6e..eda047b507a33776fe083e8520e3d984f2917091 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     take_range(0..1);
    |     ---------- ^^^^
    |     |          |
-   |     |          expected reference, found struct `Range`
+   |     |          expected `&_`, found `Range<{integer}>`
    |     |          help: consider borrowing here: `&(0..1)`
    |     arguments to this function are incorrect
    |
@@ -22,7 +22,7 @@ error[E0308]: mismatched types
 LL |     take_range(1..);
    |     ---------- ^^^
    |     |          |
-   |     |          expected reference, found struct `RangeFrom`
+   |     |          expected `&_`, found `RangeFrom<{integer}>`
    |     |          help: consider borrowing here: `&(1..)`
    |     arguments to this function are incorrect
    |
@@ -40,7 +40,7 @@ error[E0308]: mismatched types
 LL |     take_range(..);
    |     ---------- ^^
    |     |          |
-   |     |          expected reference, found struct `RangeFull`
+   |     |          expected `&_`, found `RangeFull`
    |     |          help: consider borrowing here: `&(..)`
    |     arguments to this function are incorrect
    |
@@ -58,7 +58,7 @@ error[E0308]: mismatched types
 LL |     take_range(0..=1);
    |     ---------- ^^^^^
    |     |          |
-   |     |          expected reference, found struct `RangeInclusive`
+   |     |          expected `&_`, found `RangeInclusive<{integer}>`
    |     |          help: consider borrowing here: `&(0..=1)`
    |     arguments to this function are incorrect
    |
@@ -76,7 +76,7 @@ error[E0308]: mismatched types
 LL |     take_range(..5);
    |     ---------- ^^^
    |     |          |
-   |     |          expected reference, found struct `RangeTo`
+   |     |          expected `&_`, found `RangeTo<{integer}>`
    |     |          help: consider borrowing here: `&(..5)`
    |     arguments to this function are incorrect
    |
@@ -94,7 +94,7 @@ error[E0308]: mismatched types
 LL |     take_range(..=42);
    |     ---------- ^^^^^
    |     |          |
-   |     |          expected reference, found struct `RangeToInclusive`
+   |     |          expected `&_`, found `RangeToInclusive<{integer}>`
    |     |          help: consider borrowing here: `&(..=42)`
    |     arguments to this function are incorrect
    |
index d08d9b1345d4ad516edfeedd474037174d985e6c..77595b3678ebc55062a7769eb3bc7be11507291d 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     demo(tell(1)..tell(10));
    |     ---- ^^^^^^^^^^^^^^^^^
    |     |    |
-   |     |    expected `&Range<usize>`, found struct `Range`
+   |     |    expected `&Range<usize>`, found `Range<usize>`
    |     |    help: consider borrowing here: `&(tell(1)..tell(10))`
    |     arguments to this function are incorrect
    |
@@ -22,7 +22,7 @@ error[E0308]: mismatched types
 LL |     demo(1..10);
    |     ---- ^^^^^
    |     |    |
-   |     |    expected `&Range<usize>`, found struct `Range`
+   |     |    expected `&Range<usize>`, found `Range<{integer}>`
    |     |    help: consider borrowing here: `&(1..10)`
    |     arguments to this function are incorrect
    |
index 96abff4ab413f10c10d619de7fcddde0bafd9257..18610bc5bb086c6e808369de1aa2fc48022a67f4 100644 (file)
@@ -30,5 +30,5 @@ struct G {
     }
     let g = [0; G { g: () }];
     //~^ ERROR mismatched types
-    //~| expected `usize`, found struct `G`
+    //~| expected `usize`, found `G`
 }
index e222c141f8b6a0b184d35a5509d61c96911bf536..8a1ed8f3b9c7c9d720190a23ae084b0939619df6 100644 (file)
@@ -34,7 +34,7 @@ error[E0308]: mismatched types
   --> $DIR/repeat_count.rs:31:17
    |
 LL |     let g = [0; G { g: () }];
-   |                 ^^^^^^^^^^^ expected `usize`, found struct `G`
+   |                 ^^^^^^^^^^^ expected `usize`, found `G`
 
 error[E0308]: mismatched types
   --> $DIR/repeat_count.rs:19:17
index 76c4b5914c167d3c6826ada54960a42f0dedf2ab..fffd3027afdb35a7c1c933fc8e7f6ea3a59464ca 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |   let None: isize = 42;
    |       ^^^^  ----- expected due to this
    |       |
-   |       expected `isize`, found enum `Option`
+   |       expected `isize`, found `Option<_>`
    |
    = note: expected type `isize`
               found enum `Option<_>`
index a24fe4d23ea2547e63c99936b3408afeb0db1a53..3c051429fd0e979b99ddfa3238776c8980ecb8de 100644 (file)
@@ -267,7 +267,7 @@ LL |             Fn(u8),
    |             -- `Fn` defines an enum variant constructor here, which should be called
 ...
 LL |         let _: Z = Z::Fn;
-   |                -   ^^^^^ expected enum `Z`, found enum constructor
+   |                -   ^^^^^ expected `Z`, found enum constructor
    |                |
    |                expected due to this
    |
@@ -308,7 +308,7 @@ LL |         Fn(u8),
    |         -- `Fn` defines an enum variant constructor here, which should be called
 ...
 LL |     let _: E = m::E::Fn;
-   |            -   ^^^^^^^^ expected enum `E`, found enum constructor
+   |            -   ^^^^^^^^ expected `E`, found enum constructor
    |            |
    |            expected due to this
    |
@@ -349,7 +349,7 @@ LL |         Fn(u8),
    |         -- `Fn` defines an enum variant constructor here, which should be called
 ...
 LL |     let _: E = E::Fn;
-   |            -   ^^^^^ expected enum `E`, found enum constructor
+   |            -   ^^^^^ expected `E`, found enum constructor
    |            |
    |            expected due to this
    |
index 773c9f6cd1114800768a1c43b55f97210b5ff78b..023db303dd0f18c3ece397a84a99bf27ae64f694 100644 (file)
@@ -87,7 +87,7 @@ error[E0308]: mismatched types
 LL |     match x {
    |           - this expression has type `(E, E)`
 LL |         (A, B) | (ref B, c) | (c, A) => ()
-   |             -     ^^^^^ expected enum `E`, found `&E`
+   |             -     ^^^^^ expected `E`, found `&E`
    |             |
    |             first introduced with type `E` here
    |
index 5af136e6011238497ff2b145661577b7a4ce979f..60d538eba882abcc143e5441e06a0b21b2e13dbc 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/return-type.rs:10:5
    |
 LL |     foo(4 as usize)
-   |     ^^^^^^^^^^^^^^^ expected `()`, found struct `S`
+   |     ^^^^^^^^^^^^^^^ expected `()`, found `S<usize>`
    |
    = note: expected unit type `()`
                  found struct `S<usize>`
index 9183b4599ba6dafb238f94d2aba435476ba30887..ccb208fc6c4aeabe9673c8abd35c2da48b98a67b 100644 (file)
@@ -3,7 +3,7 @@ error[E0308]: mismatched types
    |
 LL | /     if x {
 LL | |         Err(42)
-   | |         ^^^^^^^ expected `()`, found enum `Result`
+   | |         ^^^^^^^ expected `()`, found `Result<_, {integer}>`
 LL | |                 //| HELP you might have meant to return this value
 LL | |     }
    | |_____- expected this to be `()`
@@ -35,7 +35,7 @@ error[E0308]: mismatched types
    |
 LL | /     if x {
 LL | |         Err(42)
-   | |         ^^^^^^^ expected `()`, found enum `Result`
+   | |         ^^^^^^^ expected `()`, found `Result<_, {integer}>`
 LL | |                 //| HELP you might have meant to return this value
 LL | |     }
    | |_____- expected this to be `()`
index 0f567125432b2115dbf4606bbe9684ca8d3694df..fc06de90a00310907baed4fad471e5d234e0b1d4 100644 (file)
@@ -9,7 +9,7 @@ LL |     match &f {
 LL |         FOO => {},
    |         ^^^
    |         |
-   |         expected `&Foo`, found struct `Foo`
+   |         expected `&Foo`, found `Foo`
    |         `FOO` is interpreted as a constant, not a new binding
    |         help: introduce a new binding instead: `other_foo`
 
index 11bc170cdfa1ba5b5b9adc7dafcb092db0b63a8d..181f57899a91005614e349c578993d984a751474 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match &s {
    |           -- this expression has type `&&str`
 LL |             "abc" => true,
-   |             ^^^^^ expected `&str`, found `str`
+   |             ^^^^^ expected `&&str`, found `&str`
    |
    = note: expected reference `&&str`
               found reference `&'static str`
@@ -15,7 +15,7 @@ error[E0308]: mismatched types
 LL |     match &s {
    |           -- this expression has type `&&[u8]`
 LL |         b"abc" => true,
-   |         ^^^^^^ expected `&[u8]`, found array `[u8; 3]`
+   |         ^^^^^^ expected `&&[u8]`, found `&[u8; 3]`
    |
    = note: expected reference `&&[u8]`
               found reference `&'static [u8; 3]`
index f8ed156b57e399d899a083a7a7e492286471fe8f..c209caab5ecb67d66b0a6c822408e8ac4143ecc4 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 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`
+   |     ^ expected `A`, found `UninhabitedEnum`
 
 error[E0308]: mismatched types
   --> $DIR/coercions.rs:27:5
@@ -12,7 +12,7 @@ error[E0308]: mismatched types
 LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) -> A {
    |                                                                               - expected `A` because of return type
 LL |     x
-   |     ^ expected struct `A`, found struct `UninhabitedTupleStruct`
+   |     ^ expected `A`, found `UninhabitedTupleStruct`
 
 error[E0308]: mismatched types
   --> $DIR/coercions.rs:31:5
@@ -20,7 +20,7 @@ error[E0308]: mismatched types
 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`
+   |     ^ expected `A`, found `UninhabitedStruct`
 
 error[E0308]: mismatched types
   --> $DIR/coercions.rs:35:5
@@ -28,7 +28,7 @@ error[E0308]: mismatched types
 LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariants) -> A {
    |                                                                                  - expected `A` because of return type
 LL |     x
-   |     ^ expected struct `A`, found enum `UninhabitedVariants`
+   |     ^ expected `A`, found `UninhabitedVariants`
 
 error: aborting due to 4 previous errors
 
index fd2c56974bd4ac7567262ce420c41e9b72ad5750..289433edf6292282646ecde5009b0afc50fc565f 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 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`
+   |     ^ expected `A`, found `UninhabitedEnum`
 
 error[E0308]: mismatched types
   --> $DIR/coercions_same_crate.rs:34:5
@@ -12,7 +12,7 @@ error[E0308]: mismatched types
 LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) -> A {
    |                                                                               - expected `A` because of return type
 LL |     x
-   |     ^ expected struct `A`, found struct `UninhabitedTupleStruct`
+   |     ^ expected `A`, found `UninhabitedTupleStruct`
 
 error[E0308]: mismatched types
   --> $DIR/coercions_same_crate.rs:38:5
@@ -20,7 +20,7 @@ error[E0308]: mismatched types
 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`
+   |     ^ expected `A`, found `UninhabitedStruct`
 
 error[E0308]: mismatched types
   --> $DIR/coercions_same_crate.rs:42:5
@@ -28,7 +28,7 @@ error[E0308]: mismatched types
 LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariants) -> A {
    |                                                                                  - expected `A` because of return type
 LL |     x
-   |     ^ expected struct `A`, found enum `UninhabitedVariants`
+   |     ^ expected `A`, found `UninhabitedVariants`
 
 error: aborting due to 4 previous errors
 
index dd1f4826fe0516599ad798b9372422ce62d44137..4ce97a68a911a77a1ba356e8a6bd5586e9c5aeed 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |         Ok(x) if let Err(_) = x => {},
    |                      ^^^^^^   - this expression has type `Option<bool>`
    |                      |
-   |                      expected enum `Option`, found enum `Result`
+   |                      expected `Option<bool>`, found `Result<_, _>`
    |
    = note: expected enum `Option<bool>`
               found enum `Result<_, _>`
@@ -15,7 +15,7 @@ error[E0308]: mismatched types
 LL |         Ok(x) if let 0 = x => {},
    |                      ^   - this expression has type `Option<bool>`
    |                      |
-   |                      expected enum `Option`, found integer
+   |                      expected `Option<bool>`, found integer
    |
    = note: expected enum `Option<bool>`
               found type `{integer}`
index 3028f8dbdbf771e947270f6fbfa874a561dcaf7f..81933173c25c139bacb90ab71903481b2ebf2fdb 100644 (file)
@@ -1516,7 +1516,7 @@ error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:157:8
    |
 LL |     if true..(let 0 = 0) {}
-   |        ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
+   |        ^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<bool>`
@@ -1525,7 +1525,7 @@ error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:161:8
    |
 LL |     if ..(let 0 = 0) {}
-   |        ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo`
+   |        ^^^^^^^^^^^^^ expected `bool`, found `RangeTo<bool>`
    |
    = note: expected type `bool`
             found struct `RangeTo<bool>`
@@ -1534,7 +1534,7 @@ error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:165:8
    |
 LL |     if (let 0 = 0).. {}
-   |        ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom`
+   |        ^^^^^^^^^^^^^ expected `bool`, found `RangeFrom<bool>`
    |
    = note: expected type `bool`
             found struct `RangeFrom<bool>`
@@ -1545,7 +1545,7 @@ error[E0308]: mismatched types
 LL |     if let Range { start: _, end: _ } = true..true && false {}
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
    |            |
-   |            expected `bool`, found struct `Range`
+   |            expected `bool`, found `Range<_>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<_>`
@@ -1554,7 +1554,7 @@ error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:171:8
    |
 LL |     if let Range { start: _, end: _ } = true..true && false {}
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<bool>`
@@ -1565,7 +1565,7 @@ error[E0308]: mismatched types
 LL |     if let Range { start: _, end: _ } = true..true || false {}
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
    |            |
-   |            expected `bool`, found struct `Range`
+   |            expected `bool`, found `Range<_>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<_>`
@@ -1574,7 +1574,7 @@ error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:175:8
    |
 LL |     if let Range { start: _, end: _ } = true..true || false {}
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<bool>`
@@ -1585,7 +1585,7 @@ error[E0308]: mismatched types
 LL |     if let Range { start: F, end } = F..|| true {}
    |            ^^^^^^^^^^^^^^^^^^^^^^^   - this expression has type `fn() -> bool`
    |            |
-   |            expected fn pointer, found struct `Range`
+   |            expected fn pointer, found `Range<_>`
    |
    = note: expected fn pointer `fn() -> bool`
                   found struct `std::ops::Range<_>`
@@ -1607,7 +1607,7 @@ error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:182:8
    |
 LL |     if let Range { start: F, end } = F..|| true {}
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<bool>`
@@ -1618,7 +1618,7 @@ error[E0308]: mismatched types
 LL |     if let Range { start: true, end } = t..&&false {}
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^   - this expression has type `&&bool`
    |            |
-   |            expected `bool`, found struct `Range`
+   |            expected `bool`, found `Range<_>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<_>`
@@ -1639,7 +1639,7 @@ error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:190:8
    |
 LL |     if let Range { start: true, end } = t..&&false {}
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<bool>`
@@ -1710,7 +1710,7 @@ error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:249:11
    |
 LL |     while true..(let 0 = 0) {}
-   |           ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
+   |           ^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<bool>`
@@ -1719,7 +1719,7 @@ error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:253:11
    |
 LL |     while ..(let 0 = 0) {}
-   |           ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo`
+   |           ^^^^^^^^^^^^^ expected `bool`, found `RangeTo<bool>`
    |
    = note: expected type `bool`
             found struct `RangeTo<bool>`
@@ -1728,7 +1728,7 @@ error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:257:11
    |
 LL |     while (let 0 = 0).. {}
-   |           ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom`
+   |           ^^^^^^^^^^^^^ expected `bool`, found `RangeFrom<bool>`
    |
    = note: expected type `bool`
             found struct `RangeFrom<bool>`
@@ -1739,7 +1739,7 @@ error[E0308]: mismatched types
 LL |     while let Range { start: _, end: _ } = true..true && false {}
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
    |               |
-   |               expected `bool`, found struct `Range`
+   |               expected `bool`, found `Range<_>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<_>`
@@ -1748,7 +1748,7 @@ error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:263:11
    |
 LL |     while let Range { start: _, end: _ } = true..true && false {}
-   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
+   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<bool>`
@@ -1759,7 +1759,7 @@ error[E0308]: mismatched types
 LL |     while let Range { start: _, end: _ } = true..true || false {}
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
    |               |
-   |               expected `bool`, found struct `Range`
+   |               expected `bool`, found `Range<_>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<_>`
@@ -1768,7 +1768,7 @@ error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:267:11
    |
 LL |     while let Range { start: _, end: _ } = true..true || false {}
-   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
+   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<bool>`
@@ -1779,7 +1779,7 @@ error[E0308]: mismatched types
 LL |     while let Range { start: F, end } = F..|| true {}
    |               ^^^^^^^^^^^^^^^^^^^^^^^   - this expression has type `fn() -> bool`
    |               |
-   |               expected fn pointer, found struct `Range`
+   |               expected fn pointer, found `Range<_>`
    |
    = note: expected fn pointer `fn() -> bool`
                   found struct `std::ops::Range<_>`
@@ -1801,7 +1801,7 @@ error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:274:11
    |
 LL |     while let Range { start: F, end } = F..|| true {}
-   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
+   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<bool>`
@@ -1812,7 +1812,7 @@ error[E0308]: mismatched types
 LL |     while let Range { start: true, end } = t..&&false {}
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^   - this expression has type `&&bool`
    |               |
-   |               expected `bool`, found struct `Range`
+   |               expected `bool`, found `Range<_>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<_>`
@@ -1833,7 +1833,7 @@ error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:282:11
    |
 LL |     while let Range { start: true, end } = t..&&false {}
-   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
+   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<bool>`
@@ -1883,7 +1883,7 @@ error[E0308]: mismatched types
 LL |     (let Range { start: _, end: _ } = true..true || false);
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^   ---- this expression has type `bool`
    |          |
-   |          expected `bool`, found struct `Range`
+   |          expected `bool`, found `Range<_>`
    |
    = note: expected type `bool`
             found struct `std::ops::Range<_>`
index f34ccecdd45e63bb6ded49705ced491c9c5852d4..802928452709d074e8f7739d5e91edd6a352a32d 100644 (file)
@@ -106,7 +106,7 @@ error[E0308]: mismatched types
   --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:9:19
    |
 LL |     let Some(n) = opt && n == 1 else {
-   |                   ^^^ expected `bool`, found enum `Option`
+   |                   ^^^ expected `bool`, found `Option<i32>`
    |
    = note: expected type `bool`
               found enum `Option<i32>`
@@ -117,7 +117,7 @@ error[E0308]: mismatched types
 LL |     let Some(n) = opt && n == 1 else {
    |         ^^^^^^^   ------------- this expression has type `bool`
    |         |
-   |         expected `bool`, found enum `Option`
+   |         expected `bool`, found `Option<_>`
    |
    = note: expected type `bool`
               found enum `Option<_>`
@@ -126,7 +126,7 @@ error[E0308]: mismatched types
   --> $DIR/ensure-that-let-else-does-not-interact-with-let-chains.rs:15:19
    |
 LL |     let Some(n) = opt && let another = n else {
-   |                   ^^^ expected `bool`, found enum `Option`
+   |                   ^^^ expected `bool`, found `Option<i32>`
    |
    = note: expected type `bool`
               found enum `Option<i32>`
@@ -137,7 +137,7 @@ error[E0308]: mismatched types
 LL |     let Some(n) = opt && let another = n else {
    |         ^^^^^^^   ---------------------- this expression has type `bool`
    |         |
-   |         expected `bool`, found enum `Option`
+   |         expected `bool`, found `Option<_>`
    |
    = note: expected type `bool`
               found enum `Option<_>`
index 2217b8c049863e1c00389f75911005aca059e461..48e46d3d1d1aaed9419e36461184d3f9e4706da5 100644 (file)
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
   --> $DIR/feature-gate.rs:22:11
    |
 LL |         ..m1
-   |           ^^ expected struct `State2`, found struct `State1`
+   |           ^^ expected `Machine<State2>`, found `Machine<State1>`
    |
    = note: expected struct `Machine<State2>`
               found struct `Machine<State1>`
index 5957ea7c9efdd8c9d2551c16c502f52cfc73003b..831731ba4741983ac8aa2648b7359efdb43ac3df 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-92010-trait-bound-not-satisfied.rs:8:43
    |
 LL |     fn y(&self, y: f64) -> Self { P{y, .. self.clone() } }
-   |                                           ^^^^^^^^^^^^ expected struct `P`, found `&P<T>`
+   |                                           ^^^^^^^^^^^^ expected `P<T>`, found `&P<T>`
    |
    = note: expected struct `P<T>`
            found reference `&P<T>`
index 6f31b1a962078509c99bf0331838025fc38ebdca..f31b311c732d6a579e7124d1447aba8d242347d4 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/type-generic-update.rs:46:11
    |
 LL |         ..m1
-   |           ^^ expected `i32`, found `f64`
+   |           ^^ expected `Machine<'_, i32, f64>`, found `Machine<'_, f64, f64>`
    |
    = note: expected struct `Machine<'_, i32, _>`
               found struct `Machine<'_, f64, _>`
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
   --> $DIR/type-generic-update.rs:51:11
    |
 LL |         ..m1
-   |           ^^ expected `i32`, found `f64`
+   |           ^^ expected `Machine<'_, i32, i32>`, found `Machine<'_, f64, f64>`
    |
    = note: expected struct `Machine<'_, i32, i32>`
               found struct `Machine<'_, f64, f64>`
index dd7194dc2e840b897db177c1473e1ddbdec5b199..96f4e41de174bcc34b7dc7fc1dd2950e8655bdfe 100644 (file)
@@ -16,7 +16,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-61882.rs:4:22
    |
 LL |     const B: A<u8> = Self(0);
-   |                      ^^^^^^^ expected `u8`, found `bool`
+   |                      ^^^^^^^ expected `A<u8>`, found `A<bool>`
    |
    = note: expected struct `A<u8>`
               found struct `A<bool>`
index a48598ce8d5a01dd450995b54bc7e5a3ab43e869..268009f65a5c1e9c51b3ca768e87a43042caff59 100644 (file)
@@ -8,7 +8,7 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected struct `Foo<{float}, _>`
     //~| found type `{integer}`
-    //~| expected struct `Foo`, found integer
+    //~| expected `Foo<{float}, _>`, found integer
     }
 
 }
index 14f01f0ebdf7386055fcdec842f0ddce5d53b26c..83ef522ab46e87c0daad2d3cdd778cec60c23e18 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match Foo(1.1, marker::PhantomData) {
    |           ----------------------------- this expression has type `Foo<{float}, _>`
 LL |         1 => {}
-   |         ^ expected struct `Foo`, found integer
+   |         ^ expected `Foo<{float}, _>`, found integer
    |
    = note: expected struct `Foo<{float}, _>`
                 found type `{integer}`
index db784d5fe6cfc8be856bba650d3c73e750f2b061..bb30f000ea7e8514a368b153a61ee50133260a8a 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:7:20
    |
 LL |     let x: usize = String::new();
-   |            -----   ^^^^^^^^^^^^^ expected `usize`, found struct `String`
+   |            -----   ^^^^^^^^^^^^^ expected `usize`, found `String`
    |            |
    |            expected due to this
 
@@ -12,7 +12,7 @@ error[E0308]: mismatched types
 LL |     let x: &str = String::new();
    |            ----   ^^^^^^^^^^^^^
    |            |      |
-   |            |      expected `&str`, found struct `String`
+   |            |      expected `&str`, found `String`
    |            |      help: consider borrowing here: `&String::new()`
    |            expected due to this
 
@@ -63,7 +63,7 @@ error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:21:9
    |
 LL |     s = format!("foo");
-   |         ^^^^^^^^^^^^^^ expected `&mut String`, found struct `String`
+   |         ^^^^^^^^^^^^^^ expected `&mut String`, found `String`
    |
    = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
 
index aee1530851773aaa55c7cba4061fd453b9856667..8cece07cd48c2232dad657ad43dd0f2d7f1d148d 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-33884.rs:6:22
    |
 LL |     stream.write_fmt(format!("message received"))
-   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Arguments`, found struct `String`
+   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Arguments<'_>`, found `String`
    |
    = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
 
index 5d4d692b2cffb7e5c39ccc0754002018c7ca9ed1..771f21c45da68251ebc1282d6b3a0282b2fd0334 100644 (file)
@@ -80,7 +80,7 @@ error[E0308]: mismatched types
 LL |     let _ = a + b;
    |                 ^
    |                 |
-   |                 expected `&str`, found struct `String`
+   |                 expected `&str`, found `String`
    |                 help: consider borrowing here: `&b`
 
 error[E0369]: cannot add `String` to `&String`
index 61a556a931168bc2d232cfb20c5ebe08f2510519..ecccf29a107dcf5903e47ae871957647932557f3 100644 (file)
@@ -16,7 +16,7 @@ LL |     default type Output = Box<T>;
 LL |     default fn generate(self) -> Self::Output {
    |                                  ------------ expected `<T as Example>::Output` because of return type
 LL |         Box::new(self)
-   |         ^^^^^^^^^^^^^^ expected associated type, found struct `Box`
+   |         ^^^^^^^^^^^^^^ expected associated type, found `Box<T>`
    |
    = note: expected associated type `<T as Example>::Output`
                        found struct `Box<T>`
@@ -27,7 +27,7 @@ error[E0308]: mismatched types
 LL | fn trouble<T>(t: T) -> Box<T> {
    |                        ------ expected `Box<T>` because of return type
 LL |     Example::generate(t)
-   |     ^^^^^^^^^^^^^^^^^^^^ expected struct `Box`, found associated type
+   |     ^^^^^^^^^^^^^^^^^^^^ expected `Box<T>`, found associated type
    |
    = note:       expected struct `Box<T>`
            found associated type `<T as Example>::Output`
index 934ee353da292246340369d6dbea38280454e61d..24fd67ecbaacdce2bf2e1c4a6ff5945f0fbaaffd 100644 (file)
@@ -1,4 +1,4 @@
 static i: String = 10;
 //~^ ERROR mismatched types
-//~| expected struct `String`, found integer
+//~| expected `String`, found integer
 fn main() { println!("{}", i); }
index dcc1ee07cbd04581132ae4d06c6bd11b30923173..2e930f4596e04b930343c96251a34892fd09a72e 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | static i: String = 10;
    |                    ^^- help: try using a conversion method: `.to_string()`
    |                    |
-   |                    expected struct `String`, found integer
+   |                    expected `String`, found integer
 
 error: aborting due to previous error
 
index 1afff28f0b4e1dc16349d3e2ac52347908024bcd..99c8b1aa131a72db032d97e17d81a6dd0f3ebda1 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-5216.rs:3:21
    |
 LL | pub static C: S = S(f);
-   |                   - ^ expected struct `Box`, found fn item
+   |                   - ^ expected `Box<dyn FnMut() + Sync>`, found fn item
    |                   |
    |                   arguments to this struct are incorrect
    |
@@ -18,7 +18,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-5216.rs:8:19
    |
 LL | pub static D: T = g;
-   |                   ^ expected struct `Box`, found fn item
+   |                   ^ expected `Box<dyn FnMut() + Sync>`, found fn item
    |
    = note: expected struct `Box<(dyn FnMut() + Sync + 'static)>`
              found fn item `fn() {g}`
index f68939d0ec8c91b56858f119aa88816cf9640af2..ea4c7b41995e34254678c5aefccb2b34fd305138 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |         func: &foo,
    |               ^^^^
    |               |
-   |               expected fn pointer, found fn item
+   |               expected `&fn() -> Option<isize>`, found `&fn() -> Option<isize> {foo}`
    |               help: consider casting to a fn pointer: `&(foo as fn() -> Option<isize>)`
    |
    = note: expected reference `&fn() -> Option<isize>`
index 6b56cd6f3fc12cba03d0aaed7c7eea7e40936aaf..5ae7df5a2ecd1aaa40fdd46fb0a066f58c85dd9f 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/str-lit-type-mismatch.rs:2:20
    |
 LL |     let x: &[u8] = "foo";
-   |            -----   ^^^^^ expected slice `[u8]`, found `str`
+   |            -----   ^^^^^ expected `&[u8]`, found `&str`
    |            |
    |            expected due to this
    |
@@ -17,7 +17,7 @@ error[E0308]: mismatched types
   --> $DIR/str-lit-type-mismatch.rs:3:23
    |
 LL |     let y: &[u8; 4] = "baaa";
-   |            --------   ^^^^^^ expected array `[u8; 4]`, found `str`
+   |            --------   ^^^^^^ expected `&[u8; 4]`, found `&str`
    |            |
    |            expected due to this
    |
@@ -32,7 +32,7 @@ error[E0308]: mismatched types
   --> $DIR/str-lit-type-mismatch.rs:4:19
    |
 LL |     let z: &str = b"foo";
-   |            ----   ^^^^^^ expected `str`, found array `[u8; 3]`
+   |            ----   ^^^^^^ expected `&str`, found `&[u8; 3]`
    |            |
    |            expected due to this
    |
index b039ce2cc9209fc81f5e967dd762c032c5ec57c3..1299af72ba93537dca98b0a8823fb799a5135199 100644 (file)
@@ -2,25 +2,25 @@ error[E0308]: mismatched types
   --> $DIR/struct-base-wrong-type.rs:7:33
    |
 LL | static foo: Foo = Foo { a: 2, ..bar };
-   |                                 ^^^ expected struct `Foo`, found struct `Bar`
+   |                                 ^^^ expected `Foo`, found `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
+   |                                   ^ expected `Foo`, found 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`
+   |                           ^ expected `Foo`, found `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
+   |                                  ^ expected `Foo`, found integer
 
 error: aborting due to 4 previous errors
 
index b55a2cbf7527cd036d88717421bf5df326db4d66..cddc1356194bfa05b058ee9666ba75f24f048047 100644 (file)
@@ -34,7 +34,7 @@ LL | |
 LL | |             inner: u
 LL | |
 LL | |         }
-   | |_________^ expected type parameter `U`, found type parameter `T`
+   | |_________^ expected `Foo<U>`, found `Foo<T>`
    |
    = note: expected struct `Foo<U>`
               found struct `Foo<T>`
index 9b751d1b66c54d79547acb96e05a76068f2079e1..38274f8d9c0d54b70374b5add7bb0f2a4aff8f7e 100644 (file)
@@ -18,7 +18,7 @@ error[E0308]: mismatched types
   --> $DIR/struct-record-suggestion.rs:23:20
    |
 LL |     let q = B { b: 1..Default::default() };
-   |                    ^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found struct `Range`
+   |                    ^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `Range<{integer}>`
    |
    = note: expected type `u32`
             found struct `std::ops::Range<{integer}>`
index 3d64fc601df988f32052207bbcddca2a85ebed28..3e3f9ea06eff3840740fb994dcceefd010433cf0 100644 (file)
@@ -104,7 +104,7 @@ error[E0308]: mismatched types
 LL |     match (Point { x: 1, y: 2 }) {
    |           ---------------------- this expression has type `Point<{integer}>`
 LL |         PointF::<u32> { .. } => {}
-   |         ^^^^^^^^^^^^^^^^^^^^ expected integer, found `f32`
+   |         ^^^^^^^^^^^^^^^^^^^^ expected `Point<{integer}>`, found `Point<f32>`
    |
    = note: expected struct `Point<{integer}>`
               found struct `Point<f32>`
@@ -115,7 +115,7 @@ error[E0308]: mismatched types
 LL |     match (Point { x: 1, y: 2 }) {
    |           ---------------------- this expression has type `Point<{integer}>`
 LL |         PointF { .. } => {}
-   |         ^^^^^^^^^^^^^ expected integer, found `f32`
+   |         ^^^^^^^^^^^^^ expected `Point<{integer}>`, found `Point<f32>`
    |
    = note: expected struct `Point<{integer}>`
               found struct `Point<f32>`
@@ -126,7 +126,7 @@ error[E0308]: mismatched types
 LL |     match (Pair { x: 1, y: 2 }) {
    |           --------------------- this expression has type `Pair<{integer}, {integer}>`
 LL |         PairF::<u32> { .. } => {}
-   |         ^^^^^^^^^^^^^^^^^^^ expected integer, found `f32`
+   |         ^^^^^^^^^^^^^^^^^^^ expected `Pair<{integer}, {integer}>`, found `Pair<f32, u32>`
    |
    = note: expected struct `Pair<{integer}, {integer}>`
               found struct `Pair<f32, u32>`
index bc097bf6eb4515f76396ffff7b467a1721cbf5e5..e973636381600f6b6e77f00a9f9a72b815ca4f1a 100644 (file)
@@ -4,7 +4,7 @@ error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied
 LL |     let _: Option<(i32, bool)> = Some(1, 2);
    |                                  ^^^^    - argument of type `{integer}` unexpected
    |
-note: expected tuple, found integer
+note: expected `(i32, bool)`, found integer
   --> $DIR/args-instead-of-tuple-errors.rs:6:39
    |
 LL |     let _: Option<(i32, bool)> = Some(1, 2);
@@ -31,7 +31,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
 LL |     int_bool(1, 2);
    |     ^^^^^^^^    - argument of type `{integer}` unexpected
    |
-note: expected tuple, found integer
+note: expected `(i32, bool)`, found integer
   --> $DIR/args-instead-of-tuple-errors.rs:8:14
    |
 LL |     int_bool(1, 2);
@@ -65,7 +65,7 @@ error[E0308]: mismatched types
   --> $DIR/args-instead-of-tuple-errors.rs:14:34
    |
 LL |     let _: Option<(i32,)> = Some(5_usize);
-   |                             ---- ^^^^^^^ expected tuple, found `usize`
+   |                             ---- ^^^^^^^ expected `(i32,)`, found `usize`
    |                             |
    |                             arguments to this enum variant are incorrect
    |
@@ -85,7 +85,7 @@ error[E0308]: mismatched types
   --> $DIR/args-instead-of-tuple-errors.rs:17:34
    |
 LL |     let _: Option<(i32,)> = Some((5_usize));
-   |                             ---- ^^^^^^^^^ expected tuple, found `usize`
+   |                             ---- ^^^^^^^^^ expected `(i32,)`, found `usize`
    |                             |
    |                             arguments to this enum variant are incorrect
    |
index 3ed9dbf4abbc63118d9ca64344ec23a81df6f7d7..0bdf10b0d63a4338d846656ec044fdb298cd6748 100644 (file)
@@ -41,7 +41,7 @@ error[E0308]: mismatched types
   --> $DIR/args-instead-of-tuple.rs:14:34
    |
 LL |     let _: Option<(i32,)> = Some(3);
-   |                             ---- ^ expected tuple, found integer
+   |                             ---- ^ expected `(i32,)`, found integer
    |                             |
    |                             arguments to this enum variant are incorrect
    |
@@ -58,7 +58,7 @@ error[E0308]: mismatched types
   --> $DIR/args-instead-of-tuple.rs:17:34
    |
 LL |     let _: Option<(i32,)> = Some((3));
-   |                             ---- ^^^ expected tuple, found integer
+   |                             ---- ^^^ expected `(i32,)`, found integer
    |                             |
    |                             arguments to this enum variant are incorrect
    |
index deafa9f48d459e65637a79774b3e7007d2342bbb..0ee343ebf9f1114913e085a4d3b9cfb3426439f3 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:7:29
    |
 LL |     opt.map(|arg| takes_ref(arg));
-   |         ---       --------- ^^^ expected `&Foo`, found struct `Foo`
+   |         ---       --------- ^^^ expected `&Foo`, found `Foo`
    |         |         |
    |         |         arguments to this function are incorrect
    |         help: consider using `as_ref` instead: `as_ref().map`
@@ -17,7 +17,7 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:8:39
    |
 LL |     opt.and_then(|arg| Some(takes_ref(arg)));
-   |         --------            --------- ^^^ expected `&Foo`, found struct `Foo`
+   |         --------            --------- ^^^ expected `&Foo`, found `Foo`
    |         |                   |
    |         |                   arguments to this function are incorrect
    |         help: consider using `as_ref` instead: `as_ref().and_then`
@@ -32,7 +32,7 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:10:29
    |
 LL |     opt.map(|arg| takes_ref(arg));
-   |         ---       --------- ^^^ expected `&Foo`, found struct `Foo`
+   |         ---       --------- ^^^ expected `&Foo`, found `Foo`
    |         |         |
    |         |         arguments to this function are incorrect
    |         help: consider using `as_ref` instead: `as_ref().map`
@@ -47,7 +47,7 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:11:37
    |
 LL |     opt.and_then(|arg| Ok(takes_ref(arg)));
-   |         --------          --------- ^^^ expected `&Foo`, found struct `Foo`
+   |         --------          --------- ^^^ expected `&Foo`, found `Foo`
    |         |                 |
    |         |                 arguments to this function are incorrect
    |         help: consider using `as_ref` instead: `as_ref().and_then`
@@ -64,7 +64,7 @@ error[E0308]: mismatched types
 LL |     let y: Option<&usize> = x;
    |            --------------   ^
    |            |                |
-   |            |                expected enum `Option`, found `&Option<usize>`
+   |            |                expected `Option<&usize>`, found `&Option<usize>`
    |            |                help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`: `x.as_ref()`
    |            expected due to this
    |
@@ -75,7 +75,7 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:15:37
    |
 LL |     let y: Result<&usize, &usize> = x;
-   |            ----------------------   ^ expected enum `Result`, found reference
+   |            ----------------------   ^ expected `Result<&usize, &usize>`, found `&Result<usize, usize>`
    |            |
    |            expected due to this
    |
@@ -90,7 +90,7 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:19:36
    |
 LL |     let y: Result<&usize, usize> = x;
-   |            ---------------------   ^ expected enum `Result`, found reference
+   |            ---------------------   ^ expected `Result<&usize, usize>`, found `&Result<usize, usize>`
    |            |
    |            expected due to this
    |
@@ -101,7 +101,7 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:22:42
    |
 LL |     multiple_ref_opt.map(|arg| takes_ref(arg));
-   |                      ---       --------- ^^^ expected `&Foo`, found struct `Foo`
+   |                      ---       --------- ^^^ expected `&Foo`, found `Foo`
    |                      |         |
    |                      |         arguments to this function are incorrect
    |                      help: consider using `as_ref` instead: `as_ref().map`
@@ -116,7 +116,7 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:23:52
    |
 LL |     multiple_ref_opt.and_then(|arg| Some(takes_ref(arg)));
-   |                      --------            --------- ^^^ expected `&Foo`, found struct `Foo`
+   |                      --------            --------- ^^^ expected `&Foo`, found `Foo`
    |                      |                   |
    |                      |                   arguments to this function are incorrect
    |                      help: consider using `as_ref` instead: `as_ref().and_then`
@@ -131,7 +131,7 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:25:45
    |
 LL |     multiple_ref_result.map(|arg| takes_ref(arg));
-   |                         ---       --------- ^^^ expected `&Foo`, found struct `Foo`
+   |                         ---       --------- ^^^ expected `&Foo`, found `Foo`
    |                         |         |
    |                         |         arguments to this function are incorrect
    |                         help: consider using `as_ref` instead: `as_ref().map`
@@ -146,7 +146,7 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:26:53
    |
 LL |     multiple_ref_result.and_then(|arg| Ok(takes_ref(arg)));
-   |                         --------          --------- ^^^ expected `&Foo`, found struct `Foo`
+   |                         --------          --------- ^^^ expected `&Foo`, found `Foo`
    |                         |                 |
    |                         |                 arguments to this function are incorrect
    |                         help: consider using `as_ref` instead: `as_ref().and_then`
index 9ae36a06a7155d4807961d49e36d028d803bfc46..1adbc05406cbe3e15a607fec246fbed8a02cc345 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/boxed-variant-field.rs:9:31
    |
 LL |         Ty::List(elem) => foo(elem),
-   |                           --- ^^^^ expected enum `Ty`, found struct `Box`
+   |                           --- ^^^^ expected `Ty`, found `Box<Ty>`
    |                           |
    |                           arguments to this function are incorrect
    |
index 9b619ac9a3f502fcc4983655dec8070c4362bd77..9b31ee07cca7d41d783f1710f32dad100208cea7 100644 (file)
@@ -6,7 +6,7 @@ LL |     let mut x = 1i32;
 LL |     let y = Box::new(|| 1);
    |                      -- the found closure
 LL |     x = y;
-   |         ^ expected `i32`, found struct `Box`
+   |         ^ expected `i32`, found `Box<[closure@call-boxed.rs:3:22]>`
    |
    = note: expected type `i32`
             found struct `Box<[closure@$DIR/call-boxed.rs:3:22: 3:24]>`
index 965dbb9679d249d67dfcdc3b6c42ff29918e7b98..11d9b8391f6d2502e1e50121df0a4ce4008806fb 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn foo(mut s: String) -> String {
    |                          ------ expected `String` because of return type
 LL |     s.push_str("asdf")
-   |     ^^^^^^^^^^^^^^^^^^ expected struct `String`, found `()`
+   |     ^^^^^^^^^^^^^^^^^^ expected `String`, found `()`
    |
 note: method `push_str` modifies its receiver in-place
   --> $DIR/chain-method-call-mutation-in-place.rs:3:7
index 26ab515d9b4b6fd0c84c8b5c58d818ecf88fdf98..45593035b9d6000351d496c6d84bc0b68918427a 100644 (file)
@@ -26,7 +26,7 @@ error[E0308]: mismatched types
 LL | fn wut(t: &Foo) -> Foo {
    |                    --- expected `Foo` because of return type
 LL |     t.clone()
-   |     ^^^^^^^^^ expected struct `Foo`, found `&Foo`
+   |     ^^^^^^^^^ expected `Foo`, found `&Foo`
    |
 note: `Foo` does not implement `Clone`, so `&Foo` was cloned instead
   --> $DIR/clone-on-unconstrained-borrowed-type-param.rs:9:5
index c8b93f3dc48f43d8b457e65bb7b38ccaee4c37d2..f344ac06db1f8f05371485e5901be286ff693af7 100644 (file)
@@ -7,7 +7,7 @@ LL | struct foo;
 LL |     let Thing { foo } = t;
    |                 ^^^     - this expression has type `Thing`
    |                 |
-   |                 expected struct `String`, found struct `foo`
+   |                 expected `String`, found `foo`
    |                 `foo` is interpreted as a unit struct, not a new binding
    |
 help: bind the struct field to a different name instead
index a6336281b407265dd26c90a8b5b0d598679a76ea..0678081418248489f0df0a832f92c04552e73a5e 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/copied-and-cloned.rs:7:26
    |
 LL |     expect::<Option<()>>(x);
-   |     -------------------- ^ expected `()`, found `&()`
+   |     -------------------- ^ expected `Option<()>`, found `Option<&()>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -22,7 +22,7 @@ error[E0308]: mismatched types
   --> $DIR/copied-and-cloned.rs:11:30
    |
 LL |     expect::<Result<(), ()>>(x);
-   |     ------------------------ ^ expected `()`, found `&()`
+   |     ------------------------ ^ expected `Result<(), ()>`, found `Result<&(), _>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -42,7 +42,7 @@ error[E0308]: mismatched types
   --> $DIR/copied-and-cloned.rs:16:30
    |
 LL |     expect::<Option<String>>(x);
-   |     ------------------------ ^ expected struct `String`, found `&String`
+   |     ------------------------ ^ expected `Option<String>`, found `Option<&String>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -62,7 +62,7 @@ error[E0308]: mismatched types
   --> $DIR/copied-and-cloned.rs:20:34
    |
 LL |     expect::<Result<String, ()>>(x);
-   |     ---------------------------- ^ expected struct `String`, found `&String`
+   |     ---------------------------- ^ expected `Result<String, ()>`, found `Result<&String, _>`
    |     |
    |     arguments to this function are incorrect
    |
index 5dc4e64446fb279a108c543e53d3df62dd0f1da0..c6867270ad81ee770ffb64e39ec6a0dad40ea72c 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | /     intrinsic_match! {
 LL | |         "abc"
 LL | |     };
-   | |_____^ expected `&str`, found struct `String`
+   | |_____^ expected `&str`, found `String`
    |
    = note: this error originates in the macro `format` which comes from the expansion of the macro `intrinsic_match` (in Nightly builds, run with -Z macro-backtrace for more info)
 
index 67f4ac08de2c58b0e2189c9f581aa489b4b97bbc..866d3fab46e73241c46aba14abee1ce0ce108669 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/hidden-child.rs:9:26
    |
 LL |     let x: Option<i32> = 1i32;
-   |            -----------   ^^^^ expected enum `Option`, found `i32`
+   |            -----------   ^^^^ expected `Option<i32>`, found `i32`
    |            |
    |            expected due to this
    |
index d92b8127910141c9a703d6afd543a1148dfa8773..f8029e452bb777ae67a9f700218daf0a1cd21edf 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/hidden-parent.rs:6:26
    |
 LL |     let x: Option<i32> = 1i32;
-   |            -----------   ^^^^ expected enum `Option`, found `i32`
+   |            -----------   ^^^^ expected `Option<i32>`, found `i32`
    |            |
    |            expected due to this
    |
index b1e04dab8f623853794cc53cc468b1fdaf3a876d..90ea06239528356c6fe0dae5fdc58f49dea26f1a 100644 (file)
@@ -5,7 +5,7 @@ LL | fn foo<F: Future<Output=i32> + Send + 'static>(x: F) -> BoxFuture<'static,
    |        - this type parameter                            ----------------------- expected `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>` because of return type
 LL |     // We could instead use an `async` block, but this way we have no std spans.
 LL |     x
-   |     ^ expected struct `Pin`, found type parameter `F`
+   |     ^ expected `Pin<Box<...>>`, found type parameter `F`
    |
    = note:      expected struct `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>`
            found type parameter `F`
@@ -20,7 +20,7 @@ error[E0308]: mismatched types
 LL | fn bar<F: Future<Output=i32> + Send + 'static>(x: F) -> BoxFuture<'static, i32> {
    |                                                         ----------------------- expected `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>` because of return type
 LL |     Box::new(x)
-   |     ^^^^^^^^^^^ expected struct `Pin`, found struct `Box`
+   |     ^^^^^^^^^^^ expected `Pin<Box<...>>`, found `Box<F>`
    |
    = note: expected struct `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>`
               found struct `Box<F>`
@@ -32,7 +32,7 @@ error[E0308]: mismatched types
 LL | fn baz<F: Future<Output=i32> + Send + 'static>(x: F) -> BoxFuture<'static, i32> {
    |        - this type parameter
 LL |     Pin::new(x)
-   |     -------- ^ expected struct `Box`, found type parameter `F`
+   |     -------- ^ expected `Box<dyn Future<Output = ...> + Send>`, found type parameter `F`
    |     |
    |     arguments to this function are incorrect
    |     help: use `Box::pin` to pin and box this expression: `Box::pin`
@@ -74,7 +74,7 @@ LL | |         42
 LL | |     }
    | |     ^
    | |     |
-   | |_____expected struct `Pin`, found `async` block
+   | |_____expected `Pin<Box<...>>`, found `async` block
    |       arguments to this function are incorrect
    |
    = note:     expected struct `Pin<Box<dyn Future<Output = i32> + Send>>`
index b9f0f788b8c3c3f025c7ffae0c6c02837bdfb503..007bc6ecf9379191c4f103eb4b87bbc90ee282c9 100644 (file)
@@ -7,7 +7,7 @@ LL |     Fst,
 LL |     if let B::Fst = a {};
    |            ^^^^^^   - this expression has type `A`
    |            |
-   |            expected struct `A`, found enum `B`
+   |            expected `A`, found `B`
    |
 help: you might have meant to use field `b` whose type is `B`
    |
@@ -24,7 +24,7 @@ LL |     match a {
    |           - this expression has type `A`
 ...
 LL |         B::Fst => (),
-   |         ^^^^^^ expected struct `A`, found enum `B`
+   |         ^^^^^^ expected `A`, found `B`
    |
 help: you might have meant to use field `b` whose type is `B`
    |
@@ -41,7 +41,7 @@ LL |     match a {
    |           - this expression has type `A`
 ...
 LL |         B::Snd => (),
-   |         ^^^^^^ expected struct `A`, found enum `B`
+   |         ^^^^^^ expected `A`, found `B`
    |
 help: you might have meant to use field `b` whose type is `B`
    |
@@ -55,7 +55,7 @@ LL |     match foo {
    |           --- this expression has type `Foo`
 LL |
 LL |         1u32 => (),
-   |         ^^^^ expected union `Foo`, found `u32`
+   |         ^^^^ expected `Foo`, found `u32`
    |
 help: you might have meant to use field `bar` whose type is `u32`
    |
index 4cbcd31fa5ec1f6e062f15791dedcc4e2fd3916b..4f981a163741475141c46ef338dfcccf56495b3a 100644 (file)
@@ -23,7 +23,7 @@ LL | struct S(usize, usize);
    | -------- `S` defines a struct constructor here, which should be called
 ...
 LL |     let _: S = S;
-   |            -   ^ expected struct `S`, found struct constructor
+   |            -   ^ expected `S`, found struct constructor
    |            |
    |            expected due to this
    |
@@ -59,7 +59,7 @@ LL | struct V();
    | -------- `V` defines a struct constructor here, which should be called
 ...
 LL |     let _: V = V;
-   |            -   ^ expected struct `V`, found struct constructor
+   |            -   ^ expected `V`, found struct constructor
    |            |
    |            expected due to this
    |
@@ -113,7 +113,7 @@ LL |     A(usize),
    |     - `A` defines an enum variant constructor here, which should be called
 ...
 LL |     let _: E = E::A;
-   |            -   ^^^^ expected enum `E`, found enum constructor
+   |            -   ^^^^ expected `E`, found enum constructor
    |            |
    |            expected due to this
    |
index 8ed2b9c9a6330d4107496d00f2f191b233db98ac..3ea0d208cbb7fd15b0a5f2b6fcee9b13066ff5c8 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/format-borrow.rs:2:21
    |
 LL |     let a: String = &String::from("a");
-   |            ------   ^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
+   |            ------   ^^^^^^^^^^^^^^^^^^ expected `String`, found `&String`
    |            |
    |            expected due to this
    |
@@ -20,7 +20,7 @@ error[E0308]: mismatched types
   --> $DIR/format-borrow.rs:4:21
    |
 LL |     let b: String = &format!("b");
-   |            ------   ^^^^^^^^^^^^^ expected struct `String`, found `&String`
+   |            ------   ^^^^^^^^^^^^^ expected `String`, found `&String`
    |            |
    |            expected due to this
    |
@@ -38,7 +38,7 @@ error[E0308]: mismatched types
   --> $DIR/format-borrow.rs:6:21
    |
 LL |     let c: String = &mut format!("c");
-   |            ------   ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
+   |            ------   ^^^^^^^^^^^^^^^^^ expected `String`, found `&mut String`
    |            |
    |            expected due to this
    |
@@ -56,7 +56,7 @@ error[E0308]: mismatched types
   --> $DIR/format-borrow.rs:8:21
    |
 LL |     let d: String = &mut (format!("d"));
-   |            ------   ^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
+   |            ------   ^^^^^^^^^^^^^^^^^^^ expected `String`, found `&mut String`
    |            |
    |            expected due to this
    |
index d43104a2172400350e4d01a8e8036864edf0e547..704b280a985f494900d3b00dbebe48cf8996d503 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/into-convert.rs:6:16
    |
 LL |     let x: A = B;
-   |            -   ^ expected struct `A`, found struct `B`
+   |            -   ^ expected `A`, found `B`
    |            |
    |            expected due to this
    |
@@ -15,7 +15,7 @@ error[E0308]: mismatched types
   --> $DIR/into-convert.rs:10:24
    |
 LL |     let y: Arc<Path> = PathBuf::new();
-   |            ---------   ^^^^^^^^^^^^^^ expected struct `Arc`, found struct `PathBuf`
+   |            ---------   ^^^^^^^^^^^^^^ expected `Arc<Path>`, found `PathBuf`
    |            |
    |            expected due to this
    |
@@ -30,7 +30,7 @@ error[E0308]: mismatched types
   --> $DIR/into-convert.rs:14:24
    |
 LL |     let z: AtomicU32 = 1;
-   |            ---------   ^ expected struct `AtomicU32`, found integer
+   |            ---------   ^ expected `AtomicU32`, found integer
    |            |
    |            expected due to this
    |
index 6f7ecd24ca4287a24a63eae9a6292ddf2537326a..9f77ead42944fac02ea7445b5c2215a9a691f743 100644 (file)
@@ -7,7 +7,7 @@ LL | |         FakeResult::Ok(FakeResult::Ok(()))
    | |         ---------------------------------- expected because of this
 LL | |     } else {
 LL | |         FakeResult::Ok(())
-   | |         ^^^^^^^^^^^^^^^^^^ expected enum `FakeResult`, found `()`
+   | |         ^^^^^^^^^^^^^^^^^^ expected `FakeResult<FakeResult<()>>`, found `FakeResult<()>`
 LL | |     };
    | |_____- `if` and `else` have incompatible types
    |
index e2ca7771257da6e35666d06cf46c06ba55ff4dcf..2aec3c863af552667dbfccaea177d598cd6b6e69 100644 (file)
@@ -5,7 +5,7 @@ LL | /     match true {
 LL | |         true => B,
    | |                 - this is found to be of type `B`
 LL | |         false => C,
-   | |                  ^ expected struct `B`, found struct `C`
+   | |                  ^ expected `B`, found `C`
 LL | |
 LL | |     }
    | |_____- `match` arms have incompatible types
index 81758a7007c215b6ec1955fd98e7007ba3107ea7..6ae2842b2bf371ffff02549b7223416467a1bcd9 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |         let (cmp, router) = self.router.at()?;
    |             ^^^^^^^^^^^^^   ----------------- this expression has type `Match<&(for<'a> fn(&'a ()), Box<Wrapper>)>`
    |             |
-   |             expected struct `Match`, found tuple
+   |             expected `Match<&(for<'a> fn(&'a ()), ...)>`, found `(_, _)`
    |
    = note: expected struct `Match<&(for<'a> fn(&'a ()), Box<Wrapper>)>`
                found tuple `(_, _)`
index a3dbc7cb861ffe6331c9f024399570ddc1a1a538..e64a89ffe33082977ee34a92808a6adc34f2038a 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-102892.rs:15:26
    |
 LL |     let (a, b): (A, B) = &**arc; // suggests putting `&**arc` here too
-   |                 ------   ^^^^^^ expected tuple, found `&(A, B)`
+   |                 ------   ^^^^^^ expected `(A, B)`, found `&(A, B)`
    |                 |
    |                 expected due to this
    |
@@ -22,7 +22,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-102892.rs:20:32
    |
 LL |     let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
-   |                                ^^^^^^^^^^^^^^ expected tuple, found `&mut (A, B)`
+   |                                ^^^^^^^^^^^^^^ expected `(A, B)`, found `&mut (A, B)`
    |
    = note:          expected tuple `(A, B)`
            found mutable reference `&mut (A, B)`
@@ -40,7 +40,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-102892.rs:20:48
    |
 LL |     let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
-   |                                                ^^^^^^^^^^ expected struct `A`, found `&A`
+   |                                                ^^^^^^^^^^ expected `A`, found `&A`
    |
 help: consider removing the borrow
    |
index 5aa3f2af738f49d2f8b73ee67184e491af10f647..4cb4a399a7245101e26cf44b6ad8a2e03d6205f9 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-105494.rs:2:19
    |
 LL |     let _v: i32 = (1 as i32).to_string();
-   |             ---   ^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `String`
+   |             ---   ^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`
    |             |
    |             expected due to this
    |
@@ -16,7 +16,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-105494.rs:5:19
    |
 LL |     let _v: i32 = (1 as i128).to_string();
-   |             ---   ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `String`
+   |             ---   ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`
    |             |
    |             expected due to this
 
@@ -24,7 +24,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-105494.rs:7:20
    |
 LL |     let _v: &str = "foo".to_string();
-   |             ----   ^^^^^^^^^^^^^^^^^ expected `&str`, found struct `String`
+   |             ----   ^^^^^^^^^^^^^^^^^ expected `&str`, found `String`
    |             |
    |             expected due to this
    |
@@ -41,7 +41,7 @@ LL |     let mut path: String = "/usr".to_string();
    |                   ------ expected due to this type
 ...
 LL |     path = format!("{}/{}", path, folder).as_str();
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&str`
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `String`, found `&str`
    |
 help: try removing the method call
    |
index 1e66fe3af2414a01a39015fe05c49b4aad931c30..4e91dfc82d2f0e268e1b93fc347202e810b2c0ca 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-106443-sugg-clone-for-arg.rs:11:9
    |
 LL |     foo(s);
-   |     --- ^ expected struct `S`, found `&S`
+   |     --- ^ expected `S`, found `&S`
    |     |
    |     arguments to this function are incorrect
    |
@@ -20,7 +20,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-106443-sugg-clone-for-arg.rs:17:9
    |
 LL |     bar(t);
-   |     --- ^ expected struct `T`, found `&T`
+   |     --- ^ expected `T`, found `&T`
    |     |
    |     arguments to this function are incorrect
    |
index 09269ed4eee9983d6b2b605ac796e8162b712635..a67d75014171f4dfee052e76355304a9e0a49d61 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-52820.rs:12:9
    |
 LL |         guts,
-   |         ^^^^ expected struct `String`, found `&str`
+   |         ^^^^ expected `String`, found `&str`
    |
 help: try using a conversion method
    |
@@ -16,7 +16,7 @@ LL |         brains: guts.clone(),
    |                 ^^^^^-----^^
    |                 |    |
    |                 |    help: try using a conversion method: `to_string`
-   |                 expected struct `String`, found `&str`
+   |                 expected `String`, found `&str`
 
 error: aborting due to 2 previous errors
 
index 3a1b624f402f0db5ecc0576c329134de91c8419b..469a538411fb1264bcd6c264a7d6d4b03182b951 100644 (file)
@@ -5,7 +5,7 @@ LL |     let items_clone: Vec<i32> = ref_items.clone();
    |                      --------   ^^^^^^^^^^-----^^
    |                      |          |         |
    |                      |          |         help: try using a conversion method: `to_vec`
-   |                      |          expected struct `Vec`, found `&[i32]`
+   |                      |          expected `Vec<i32>`, found `&[i32]`
    |                      expected due to this
    |
    = note: expected struct `Vec<i32>`
@@ -18,7 +18,7 @@ LL |     let string: String = s.clone();
    |                 ------   ^^-----^^
    |                 |        | |
    |                 |        | help: try using a conversion method: `to_string`
-   |                 |        expected struct `String`, found `&str`
+   |                 |        expected `String`, found `&str`
    |                 expected due to this
 
 error: aborting due to 2 previous errors
index 40e4c7b78499c6174fe7328a774f3e319f04a744..43acf9549c29a776042622634df1e2984aecb1a9 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-59819.rs:28:18
    |
 LL |     let y: i32 = x;
-   |            ---   ^ expected `i32`, found struct `Foo`
+   |            ---   ^ expected `i32`, found `Foo`
    |            |
    |            expected due to this
    |
@@ -30,7 +30,7 @@ error[E0308]: mismatched types
 LL |     let g: String = f;
    |            ------   ^- help: try using a conversion method: `.to_string()`
    |            |        |
-   |            |        expected struct `String`, found struct `Bar`
+   |            |        expected `String`, found `Bar`
    |            expected due to this
 
 error: aborting due to 3 previous errors
index 885106e8429bcfcc983c89d4a9676c0a5c543b84..c73667f09cbeb11129e74a11b48cfea3e34f91c6 100644 (file)
@@ -8,7 +8,7 @@ LL | |     } else {
 LL | |         "B"
    | |         ^^^- help: try using a conversion method: `.to_string()`
    | |         |
-   | |         expected struct `String`, found `&str`
+   | |         expected `String`, found `&str`
 LL | |     };
    | |_____- `if` and `else` have incompatible types
 
index 8c9a41a202767813306bf508a328f785ad74e45c..da6f7641be53b00b8a348d253156ac0b9eabd910 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-86100-tuple-paren-comma.rs:9:22
    |
 LL |     let _x: (i32,) = (5);
-   |             ------   ^^^ expected tuple, found integer
+   |             ------   ^^^ expected `(i32,)`, found integer
    |             |
    |             expected due to this
    |
@@ -17,7 +17,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-86100-tuple-paren-comma.rs:13:9
    |
 LL |     foo((Some(3)));
-   |     --- ^^^^^^^^^ expected tuple, found enum `Option`
+   |     --- ^^^^^^^^^ expected `(_,)`, found `Option<{integer}>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -37,7 +37,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-86100-tuple-paren-comma.rs:17:22
    |
 LL |     let _s = S { _s: ("abc".to_string()) };
-   |                      ^^^^^^^^^^^^^^^^^^^ expected tuple, found struct `String`
+   |                      ^^^^^^^^^^^^^^^^^^^ expected `(String,)`, found `String`
    |
    = note: expected tuple `(String,)`
              found struct `String`
index 611f7d5ddda78574c68501208dccfc49580af855..7d1da7d24eeb807cec17ef69f2e91fd44d83b5ad 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-90213-expected-boxfuture-self-ice.rs:9:19
    |
 LL |         Self::foo(None)
-   |         --------- ^^^^ expected struct `Box`, found enum `Option`
+   |         --------- ^^^^ expected `Box<Option<S>>`, found `Option<_>`
    |         |
    |         arguments to this function are incorrect
    |
index aa2b407bf561656aeb1cd8ffd665f9f632d47f0b..a3e059e8ac646191c2daf56708b0a85d8465791f 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     match &x[..] {
    |           ------ this expression has type `&[i32]`
 LL |         [&v] => {},
-   |          ^^ expected `i32`, found reference
+   |          ^^ expected `i32`, found `&_`
    |
    = note:   expected type `i32`
            found reference `&_`
@@ -36,7 +36,7 @@ error[E0308]: mismatched types
 LL |     match y {
    |           - this expression has type `i32`
 LL |         &v => {},
-   |         ^^ expected `i32`, found reference
+   |         ^^ expected `i32`, found `&_`
    |
    = note:   expected type `i32`
            found reference `&_`
@@ -52,7 +52,7 @@ error[E0308]: mismatched types
 LL |     if let [&v] = &x[..] {}
    |             ^^    ------ this expression has type `&[i32]`
    |             |
-   |             expected `i32`, found reference
+   |             expected `i32`, found `&_`
    |
    = note:   expected type `i32`
            found reference `&_`
index 00aa7d18a968c3ecaa7758bc6a0ecab0e2edbe64..51ea5b35ae114cf5e13c46bd51e959b7f219ee3d 100644 (file)
@@ -16,7 +16,7 @@ LL | /     match c {
 LL | |         "baz" => Box::new(Baz),
    | |                  ------------- this is found to be of type `Box<Baz>`
 LL | |         _ => Box::new(Bar),
-   | |              ^^^^^^^^^^^^^ expected struct `Baz`, found struct `Bar`
+   | |              ^^^^^^^^^^^^^ expected `Box<Baz>`, found `Box<Bar>`
 LL | |     };
    | |_____- `match` arms have incompatible types
    |
@@ -39,7 +39,7 @@ error[E0308]: mismatched types
   --> $DIR/match-with-different-arm-types-as-stmt-instead-of-expr.rs:23:22
    |
 LL | fn wrong(c: &str) -> Box<dyn Foo> {
-   |    -----             ^^^^^^^^^^^^ expected struct `Box`, found `()`
+   |    -----             ^^^^^^^^^^^^ expected `Box<dyn Foo>`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
    |
index f421408944bb3b3d7656a64f7ccbbe64429395b7..54a16b8efa748b8c1fd96201e88527820c38f496 100644 (file)
@@ -16,7 +16,7 @@ error[E0308]: mismatched types
 LL |     fn method(&self) -> Option<&Vec<u8>> {
    |                         ---------------- expected `Option<&Vec<u8>>` because of return type
 LL |         self.option..as_ref().map(|x| x)
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Option`, found struct `Range`
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<&Vec<u8>>`, found `Range<Option<Vec<u8>>>`
    |
    = note: expected enum `Option<&Vec<u8>>`
             found struct `std::ops::Range<Option<Vec<u8>>>`
@@ -32,7 +32,7 @@ error[E0308]: mismatched types
 LL |     fn method2(&self) -> Option<&u8> {
    |                          ----------- expected `Option<&u8>` because of return type
 LL |         self.option..foo().get(0)
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Option`, found struct `Range`
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<&u8>`, found `Range<Option<Vec<u8>>>`
    |
    = note: expected enum `Option<&u8>`
             found struct `std::ops::Range<Option<Vec<u8>>>`
index b3cb6dd06142be65bca5fe37c3d00e0a9706edd2..b86a04c7cd3d16117632d8789b339fdbfa2eee90 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn suggestion(opt: &mut Option<String>) {
    |                    ------------------- expected due to this parameter type
 LL |     opt = None;
-   |           ^^^^ expected mutable reference, found enum `Option`
+   |           ^^^^ expected `&mut Option<String>`, found `Option<_>`
    |
    = note: expected mutable reference `&mut Option<String>`
                            found enum `Option<_>`
@@ -19,7 +19,7 @@ error[E0308]: mismatched types
 LL | fn no_suggestion(opt: &mut Result<String, ()>) {
    |                       ----------------------- expected due to this parameter type
 LL |     opt = None
-   |           ^^^^ expected mutable reference, found enum `Option`
+   |           ^^^^ expected `&mut Result<String, ()>`, found `Option<_>`
    |
    = note: expected mutable reference `&mut Result<String, ()>`
                            found enum `Option<_>`
@@ -30,7 +30,7 @@ error[E0308]: mismatched types
 LL | fn suggestion2(opt: &mut Option<String>) {
    |                     ------------------- expected due to this parameter type
 LL |     opt = Some(String::new())
-   |           ^^^^^^^^^^^^^^^^^^^ expected mutable reference, found enum `Option`
+   |           ^^^^^^^^^^^^^^^^^^^ expected `&mut Option<String>`, found `Option<String>`
    |
    = note: expected mutable reference `&mut Option<String>`
                            found enum `Option<String>`
@@ -45,7 +45,7 @@ error[E0308]: mismatched types
 LL | fn no_suggestion2(opt: &mut Option<String>) {
    |                        ------------------- expected due to this parameter type
 LL |     opt = Some(42)
-   |           ^^^^^^^^ expected mutable reference, found enum `Option`
+   |           ^^^^^^^^ expected `&mut Option<String>`, found `Option<{integer}>`
    |
    = note: expected mutable reference `&mut Option<String>`
                            found enum `Option<{integer}>`
index 4050c7be82a0af369c459b9cc5f36217cc153746..e042f07daeb1cfda4fd07d8ae3765030fa20a35b 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/option-to-bool.rs:4:16
    |
 LL |     if true && x {}
-   |        ----    ^ expected `bool`, found enum `Option`
+   |        ----    ^ expected `bool`, found `Option<i32>`
    |        |
    |        expected because this is `bool`
    |
index 9588eedc98b4ae35b9f2020b5c0ff2b2b50d09ae..fee83eb5c181597493206465fc2399350aca29b8 100644 (file)
@@ -22,7 +22,7 @@ error[E0308]: mismatched types
   --> $DIR/recover-from-semicolon-trailing-item.rs:10:20
    |
 LL |     let _: usize = S {};
-   |            -----   ^^^^ expected `usize`, found struct `S`
+   |            -----   ^^^^ expected `usize`, found `S`
    |            |
    |            expected due to this
 
@@ -30,7 +30,7 @@ error[E0308]: mismatched types
   --> $DIR/recover-from-semicolon-trailing-item.rs:12:20
    |
 LL |     let _: usize = X {};
-   |            -----   ^^^^ expected `usize`, found struct `X`
+   |            -----   ^^^^ expected `usize`, found `X`
    |            |
    |            expected due to this
 
index c14fb336773d1f79791c5ebd88cc0909c5a438dd..6f906c27ba943c0477afd63fa05ec2c45d4ce31c 100644 (file)
@@ -18,7 +18,7 @@ LL |       let s: String = if let Some(s) = opt_str {
    |  ______________________________________________^
 LL | |
 LL | |     } else {
-   | |_____^ expected struct `String`, found `()`
+   | |_____^ expected `String`, found `()`
    |
 help: consider returning the local binding `s`
    |
@@ -31,7 +31,7 @@ error[E0308]: mismatched types
   --> $DIR/return-bindings.rs:14:11
    |
 LL | fn c() -> Option<i32> {
-   |    -      ^^^^^^^^^^^ expected enum `Option`, found `()`
+   |    -      ^^^^^^^^^^^ expected `Option<i32>`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
    |
@@ -50,7 +50,7 @@ LL |       let s: String = if let Some(s) = opt_str {
    |  ______________________________________________^
 LL | |
 LL | |     } else {
-   | |_____^ expected struct `String`, found `()`
+   | |_____^ expected `String`, found `()`
    |
 help: consider returning the local binding `s`
    |
@@ -67,7 +67,7 @@ LL |       let s = if let Some(s) = opt_str {
 LL | |     } else {
    | |_____- expected because of this
 LL |           String::new()
-   |           ^^^^^^^^^^^^^ expected `()`, found struct `String`
+   |           ^^^^^^^^^^^^^ expected `()`, found `String`
    |
 help: consider returning the local binding `s`
    |
@@ -80,7 +80,7 @@ error[E0308]: mismatched types
   --> $DIR/return-bindings.rs:37:20
    |
 LL |         Some(s) => {}
-   |                    ^^ expected struct `String`, found `()`
+   |                    ^^ expected `String`, found `()`
    |
 help: consider returning the local binding `s`
    |
@@ -95,7 +95,7 @@ LL |       let s = match opt_str {
 LL | |         Some(s) => {}
    | |                    -- this is found to be of type `()`
 LL | |         None => String::new(),
-   | |                 ^^^^^^^^^^^^^ expected `()`, found struct `String`
+   | |                 ^^^^^^^^^^^^^ expected `()`, found `String`
 LL | |
 LL | |     };
    | |_____- `match` arms have incompatible types
index 94eef15f3306e90af451340d92e1dee0b2b0b47e..2956360980ec76d3c3475109ae9cbe0e7c195ebb 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/shadowed-lplace-method-2.rs:22:17
    |
 LL |     *x.foo(0) = ();
-   |     ---------   ^^ expected struct `X`, found `()`
+   |     ---------   ^^ expected `X`, found `()`
    |     |
    |     expected due to the type of this binding
    |
index 91d0d1200d4362bd3ddae84fd9c8d2b2a3d657b5..33824c4cbc750466ca45836e4d9868dcabd5f238 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/shadowed-lplace-method.rs:9:24
    |
 LL |     *rc.borrow_mut() = false;
-   |     ----------------   ^^^^^ expected struct `Rc`, found `bool`
+   |     ----------------   ^^^^^ expected `Rc<RefCell<bool>>`, found `bool`
    |     |
    |     expected due to the type of this binding
    |
index 2bdaa4e9780ebf3cae2cbd13dbe61cfa01294a11..9a4e9fef43c57823b3e5ed8bb324c3fd045fd2be 100644 (file)
@@ -8,7 +8,7 @@ LL |       let _x: Box<dyn Fn() -> Result<(), ()>> = || {
 LL | |         Err(())?;
 LL | |         Ok(())
 LL | |     };
-   | |_____^ expected struct `Box`, found closure
+   | |_____^ expected `Box<dyn Fn() -> Result<(), ()>>`, found closure
    |
    = note: expected struct `Box<dyn Fn() -> Result<(), ()>>`
              found closure `[closure@$DIR/suggest-box.rs:4:47: 4:49]`
index 9b6dba7e9e75b9d7ac273c434f16af7a88da2c04..3fb3047d866c60aed9bc132ada516aba9ac58a92 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/suggest-full-enum-variant-for-local-module.rs:9:28
    |
 LL |     let _: option::O<()> = ();
-   |            -------------   ^^ expected enum `O`, found `()`
+   |            -------------   ^^ expected `O<()>`, found `()`
    |            |
    |            expected due to this
    |
index f5d810e36f035935913a11faea3c8669b493b166..4253838eb5265f1f9a803a13a1ecc52cd069afe8 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/suggest-remove-deref.rs:13:9
    |
 LL |     foo(*hello);
-   |     --- ^^^^^^ expected reference, found struct `S`
+   |     --- ^^^^^^ expected `&_`, found `S`
    |     |
    |     arguments to this function are incorrect
    |
@@ -23,7 +23,7 @@ error[E0308]: mismatched types
   --> $DIR/suggest-remove-deref.rs:21:9
    |
 LL |     bar(*s);
-   |     --- ^^ expected `&String`, found struct `String`
+   |     --- ^^ expected `&String`, found `String`
    |     |
    |     arguments to this function are incorrect
    |
index 34eaa8322c8701e70f451c34a510a4567055d18d..8b48ee9f1247b42227532d1ea31fd514c65a698a 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/unnecessary_dot_for_floating_point_literal.rs:2:18
    |
 LL |     let _: f64 = 0..10;
-   |            ---   ^^^^^ expected `f64`, found struct `Range`
+   |            ---   ^^^^^ expected `f64`, found `Range<{integer}>`
    |            |
    |            expected due to this
    |
@@ -17,7 +17,7 @@ error[E0308]: mismatched types
   --> $DIR/unnecessary_dot_for_floating_point_literal.rs:3:18
    |
 LL |     let _: f64 = 1..;
-   |            ---   ^^^ expected `f64`, found struct `RangeFrom`
+   |            ---   ^^^ expected `f64`, found `RangeFrom<{integer}>`
    |            |
    |            expected due to this
    |
@@ -32,7 +32,7 @@ error[E0308]: mismatched types
   --> $DIR/unnecessary_dot_for_floating_point_literal.rs:4:18
    |
 LL |     let _: f64 = ..10;
-   |            ---   ^^^^ expected `f64`, found struct `RangeTo`
+   |            ---   ^^^^ expected `f64`, found `RangeTo<{integer}>`
    |            |
    |            expected due to this
    |
@@ -47,7 +47,7 @@ error[E0308]: mismatched types
   --> $DIR/unnecessary_dot_for_floating_point_literal.rs:5:18
    |
 LL |     let _: f64 = std::ops::Range { start: 0, end: 1 };
-   |            ---   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `f64`, found struct `Range`
+   |            ---   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `f64`, found `Range<{integer}>`
    |            |
    |            expected due to this
    |
index 256ec1713d4c1a182aab12c6e2dda84e58291858..1e39be460809149380e6523b82ba48b29a2db74e 100644 (file)
@@ -3,6 +3,6 @@ fn main() {
 //~^ ERROR mismatched types
 //~| expected unit type `()`
 //~| found tuple `(_, _)`
-//~| expected `()`, found tuple
+//~| expected `()`, found
     return x;
 }
index c2874ae9a14b857508c5a494d8e4b605a803127c..11d70f8a4336958f11632f6720e8df9b3565909b 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     let (x, y) = ();
    |         ^^^^^^   -- this expression has type `()`
    |         |
-   |         expected `()`, found tuple
+   |         expected `()`, found `(_, _)`
    |
    = note: expected unit type `()`
                   found tuple `(_, _)`
index 82fea0f14bd296799b3cb02c47d9ce685f1954d7..744d8483bd3deb76670384130e9c4b8785afac93 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/switched-expectations.rs:3:30
    |
 LL |     let ref string: String = var;
-   |                              ^^^ expected struct `String`, found `i32`
+   |                              ^^^ expected `String`, found `i32`
 
 error: aborting due to previous error
 
index 36e22f0b5f1a7a94e21ee5efc3590f952b8ebcdf..0e76ec246d7c3871bda750252341dd16e5c5fcfd 100644 (file)
@@ -12,5 +12,5 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected type `char`
     //~| found enum `Option<_>`
-    //~| expected `char`, found enum `Option`
+    //~| expected `char`, found `Option<_>`
 }
index 96bab152612fdd85cb1062b3c0ee2ad740bac8fa..f53abe53bf13482ee432736980b48c50fe142b0e 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/tag-that-dare-not-speak-its-name.rs:11:20
    |
 LL |     let x : char = last(y);
-   |             ----   ^^^^^^^ expected `char`, found enum `Option`
+   |             ----   ^^^^^^^ expected `char`, found `Option<_>`
    |             |
    |             expected due to this
    |
index aa801fd0a6c64b15b86dccdefbd057cf3ee98865..cfe350ef86db2a3343260ef5a1a4a3a230aa8461 100644 (file)
@@ -11,7 +11,7 @@ struct Bar {
 fn want_foo(f: Foo) {}
 fn have_bar(b: Bar) {
     want_foo(b); //~  ERROR mismatched types
-                 //~| expected struct `Foo`, found struct `Bar`
+                 //~| expected `Foo`, found `Bar`
 }
 
 fn main() {}
index d2fda09c0767f5d6db0d8fa906983d7a99454875..09df4b34bb52d01025522069d38fbbd1beacae47 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/terr-in-field.rs:13:14
    |
 LL |     want_foo(b);
-   |     -------- ^ expected struct `Foo`, found struct `Bar`
+   |     -------- ^ expected `Foo`, found `Bar`
    |     |
    |     arguments to this function are incorrect
    |
index 5a61a2fab12658fe91122d636899345189423670..8f1975374a576c2e6e40fe33b14f5a3e82c8fe19 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/terr-sorts.rs:10:14
    |
 LL |     want_foo(b);
-   |     -------- ^ expected struct `Foo`, found struct `Box`
+   |     -------- ^ expected `Foo`, found `Box<Foo>`
    |     |
    |     arguments to this function are incorrect
    |
index a11867c03a689259dde89dd3adddef9e0822414f..006cb3a7b72c7c415f81a907875e3921f4c1a617 100644 (file)
@@ -5,7 +5,7 @@ LL | impl<F, Name, P> AddClass<Name, F> for Class<P>
    |      - this type parameter
 ...
 LL |         builder.push(output);
-   |                 ---- ^^^^^^ expected type parameter `F`, found struct `Class`
+   |                 ---- ^^^^^^ expected type parameter `F`, found `Class<P>`
    |                 |
    |                 arguments to this method are incorrect
    |
index cb6e6e0769cb8d8d1611a3a796334c7a21b6059a..671a97666fdaaf3b918daa50dead665a13bfb232 100644 (file)
@@ -5,7 +5,7 @@ LL | fn crash<R, C>(input: Matrix<R, C, ()>) -> Matrix<R, C, u32>
    |                                            ----------------- expected `Matrix<R, C, u32>` because of return type
 ...
 LL |     input.into_owned()
-   |     ^^^^^^^^^^^^^^^^^^ expected `u32`, found associated type
+   |     ^^^^^^^^^^^^^^^^^^ expected `Matrix<R, C, u32>`, found `Matrix<R, C, ...>`
    |
    = note: expected struct `Matrix<_, _, u32>`
               found struct `Matrix<_, _, <() as Allocator<R, C>>::Buffer>`
index 5fa741f26fd077fcab991165fa53e51848546d67..7c6b533ef5f718e3c748c523090f6add341eccde 100644 (file)
@@ -8,7 +8,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-101739-1.rs:8:50
    |
 LL |         Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>,
-   |                                                  ^^^^^^^^^^^^^^^^ expected struct `Assume`, found `bool`
+   |                                                  ^^^^^^^^^^^^^^^^ expected `Assume`, found `bool`
 
 error: aborting due to 2 previous errors
 
index 2e20a4cca0845dff2b8ef166c3b77856456bbd0e..6849128eaddde911853f4c7f6862a71bda370405 100644 (file)
@@ -18,7 +18,7 @@ error[E0308]: mismatched types
   --> $DIR/add-tuple-within-arguments.rs:8:15
    |
 LL |     bar("hi", "hi", "hi");
-   |     ---       ^^^^ expected tuple, found `&str`
+   |     ---       ^^^^ expected `(&str,)`, found `&str`
    |     |
    |     arguments to this function are incorrect
    |
index 0a503e1fe58c1a503c2e81fb136d0e70368dd24d..75dfe716395a5f32a1348851be5a42dc777fcb27 100644 (file)
@@ -4,7 +4,7 @@ error[E0061]: this method takes 1 argument but 2 arguments were supplied
 LL |         groups.push(new_group, vec![process]);
    |                ^^^^            ------------- argument of type `Vec<&Process>` unexpected
    |
-note: expected tuple, found struct `Vec`
+note: expected `(Vec<String>, Vec<Process>)`, found `Vec<String>`
   --> $DIR/wrong_argument_ice-3.rs:9:21
    |
 LL |         groups.push(new_group, vec![process]);
index eb58ee73ca21b4f3eb8f9d9ce83c2a6b71fff389..db75a520c6587f8a9e88b1959bfb69ddcb93c206 100644 (file)
@@ -18,7 +18,7 @@ error[E0308]: mismatched types
   --> $DIR/enum-variant-priority-higher-than-other-inherent.rs:22:17
    |
 LL |     let _: u8 = <E2>::V;
-   |            --   ^^^^^^^ expected `u8`, found enum `E2`
+   |            --   ^^^^^^^ expected `u8`, found `E2`
    |            |
    |            expected due to this
 
index 92d01eb0d3d5ea0a1128208af5075fff0435b3e2..64fe15c19f4568c0ea05398d4e33a353cbfdb5dd 100644 (file)
@@ -2,7 +2,7 @@ error[E0271]: expected `fn() -> impl Future<Output = ()> {test}` to be a fn item
   --> $DIR/issue-98604.rs:9:5
    |
 LL |     Box::new(test) as AsyncFnPtr;
-   |     ^^^^^^^^^^^^^^ expected struct `Pin`, found opaque type
+   |     ^^^^^^^^^^^^^^ expected `Pin<Box<dyn Future<Output = ()>>>`, found opaque type
    |
 note: while checking the return type of the `async fn`
   --> $DIR/issue-98604.rs:5:17
index 916a58451baa2f8b5c7d0f1a3414e98ae51faa02..3a3db42c42d3859d733b9de10ee0f90c2b7381aa 100644 (file)
@@ -5,7 +5,7 @@ LL | fn hi() -> impl Sized {
    |            ---------- the found opaque type
 ...
 LL |     let b: Box<dyn Fn() -> Box<u8>> = Box::new(hi);
-   |                                       ^^^^^^^^^^^^ expected struct `Box`, found opaque type
+   |                                       ^^^^^^^^^^^^ expected `Box<u8>`, found opaque type
    |
    = note:   expected struct `Box<u8>`
            found opaque type `impl Sized`
index 7dc6efc4b1b6b97c3c39de64a5f94992ea13bdac..e9032433494a6cef42830086b579ebc1e760560e 100644 (file)
@@ -15,7 +15,7 @@ LL | type MyPrivate = impl Sized;
 LL |     fn dont_define_this(_private: MyPrivate) {}
    |                                   ^^^^^^^^^
    |                                   |
-   |                                   expected struct `Private`, found opaque type
+   |                                   expected `Private`, found opaque type
    |                                   help: change the parameter type to match the trait: `Private`
    |
 note: type in trait
index ccd05fa6bfb0957ea00688b6a4202ad9e3d2184b..72c33d16cabe0370d2df67b295030e052618c4d0 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-30225.rs:31:9
    |
 LL |     u = v; // mark $0 and $1 in a subtype relationship
-   |         ^ expected struct `A`, found struct `B`
+   |         ^ expected `A`, found `B`
 
 error: aborting due to previous error
 
index edc5aeffdcd65fda4697a7fcc12895bd9ca88f54..d6d1e1d7d02938ea824f8bb9b392186eddce8ac3 100644 (file)
@@ -2,13 +2,13 @@ error[E0308]: mismatched types
   --> $DIR/type-ascription-precedence.rs:31:7
    |
 LL |     &(S: &S);
-   |       ^ expected `&S`, found struct `S`
+   |       ^ expected `&S`, found `S`
 
 error[E0308]: mismatched types
   --> $DIR/type-ascription-precedence.rs:35:7
    |
 LL |     *(S: Z);
-   |       ^ expected struct `Z`, found struct `S`
+   |       ^ expected `Z`, found `S`
 
 error[E0614]: type `Z` cannot be dereferenced
   --> $DIR/type-ascription-precedence.rs:35:5
@@ -20,7 +20,7 @@ error[E0308]: mismatched types
   --> $DIR/type-ascription-precedence.rs:40:7
    |
 LL |     -(S: Z);
-   |       ^ expected struct `Z`, found struct `S`
+   |       ^ expected `Z`, found `S`
 
 error[E0600]: cannot apply unary operator `-` to type `Z`
   --> $DIR/type-ascription-precedence.rs:40:5
@@ -40,19 +40,19 @@ error[E0308]: mismatched types
   --> $DIR/type-ascription-precedence.rs:45:5
    |
 LL |     (S + Z): Z;
-   |     ^^^^^^^ expected struct `Z`, found struct `S`
+   |     ^^^^^^^ expected `Z`, found `S`
 
 error[E0308]: mismatched types
   --> $DIR/type-ascription-precedence.rs:49:5
    |
 LL |     (S * Z): Z;
-   |     ^^^^^^^ expected struct `Z`, found struct `S`
+   |     ^^^^^^^ expected `Z`, found `S`
 
 error[E0308]: mismatched types
   --> $DIR/type-ascription-precedence.rs:53:5
    |
 LL |     (S .. S): S;
-   |     ^^^^^^^^ expected struct `S`, found struct `Range`
+   |     ^^^^^^^^ expected `S`, found `Range<S>`
    |
    = note: expected struct `S`
               found struct `std::ops::Range<S>`
index 522d5b2e375553319b37c8bd3873e54e4896849e..778836a2e06a829c952aa4300c12377990194351 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/type-ascription-soundness.rs:7:31
    |
 LL |     let ref x = type_ascribe!(arr, &[u8]);
-   |                               ^^^ expected slice `[u8]`, found array `[u8; 3]`
+   |                               ^^^ expected `&[u8]`, found `&[u8; 3]`
    |
    = note: expected reference `&[u8]`
               found reference `&[u8; 3]`
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
   --> $DIR/type-ascription-soundness.rs:8:35
    |
 LL |     let ref mut x = type_ascribe!(arr, &[u8]);
-   |                                   ^^^ expected slice `[u8]`, found array `[u8; 3]`
+   |                                   ^^^ expected `&[u8]`, found `&[u8; 3]`
    |
    = note: expected reference `&[u8]`
               found reference `&[u8; 3]`
@@ -20,7 +20,7 @@ error[E0308]: mismatched types
   --> $DIR/type-ascription-soundness.rs:9:25
    |
 LL |     match type_ascribe!(arr, &[u8]) {
-   |                         ^^^ expected slice `[u8]`, found array `[u8; 3]`
+   |                         ^^^ expected `&[u8]`, found `&[u8; 3]`
    |
    = note: expected reference `&[u8]`
               found reference `&[u8; 3]`
@@ -29,7 +29,7 @@ error[E0308]: mismatched types
   --> $DIR/type-ascription-soundness.rs:12:30
    |
 LL |     let _len = type_ascribe!(arr, &[u8]).len();
-   |                              ^^^ expected slice `[u8]`, found array `[u8; 3]`
+   |                              ^^^ expected `&[u8]`, found `&[u8; 3]`
    |
    = note: expected reference `&[u8]`
               found reference `&[u8; 3]`
index 5992162341e6e25198d6361572f47847a70f5a9c..b2c409e07b8c770f8e8a4ca7a256d97bd115bea1 100644 (file)
@@ -5,7 +5,7 @@ LL | fn foo4(x: Result<(), A>) -> Result<(), B> {
    |                              ------------- expected `Result<(), B>` because of return type
 LL |     match true {
 LL |         true => x,
-   |                 ^ expected struct `B`, found struct `A`
+   |                 ^ expected `Result<(), B>`, found `Result<(), A>`
    |
    = note: expected enum `Result<_, B>`
               found enum `Result<_, A>`
@@ -21,7 +21,7 @@ LL | fn foo5(x: Result<(), A>) -> Result<(), B> {
    |                              ------------- expected `Result<(), B>` because of return type
 LL |     match true {
 LL |         true => return x,
-   |                        ^ expected struct `B`, found struct `A`
+   |                        ^ expected `Result<(), B>`, found `Result<(), A>`
    |
    = note: expected enum `Result<_, B>`
               found enum `Result<_, A>`
@@ -37,7 +37,7 @@ LL |       let _: Result<(), B> = {
    |  ____________________________^
 LL | |         Err(A);
 LL | |     };
-   | |_____^ expected enum `Result`, found `()`
+   | |_____^ expected `Result<(), B>`, found `()`
    |
    = note:   expected enum `Result<(), B>`
            found unit type `()`
index 550153520782c683848d4bdd0d7b2ad13d9089ec..adec2f612ae0eb0e9db7baca9dc2736fa3d0a927 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn foo1(x: Result<(), A>) -> Result<(), B> {
    |                              ------------- expected `Result<(), B>` because of return type
 LL |     x
-   |     ^ expected struct `B`, found struct `A`
+   |     ^ expected `Result<(), B>`, found `Result<(), A>`
    |
    = note: expected enum `Result<_, B>`
               found enum `Result<_, A>`
@@ -19,7 +19,7 @@ error[E0308]: mismatched types
 LL | fn foo2(x: Result<(), A>) -> Result<(), B> {
    |                              ------------- expected `Result<(), B>` because of return type
 LL |     return x;
-   |            ^ expected struct `B`, found struct `A`
+   |            ^ expected `Result<(), B>`, found `Result<(), A>`
    |
    = note: expected enum `Result<_, B>`
               found enum `Result<_, A>`
@@ -35,7 +35,7 @@ LL | fn foo3(x: Result<(), A>) -> Result<(), B> {
    |                              ------------- expected `Result<(), B>` because of return type
 LL |     if true {
 LL |         x
-   |         ^ expected struct `B`, found struct `A`
+   |         ^ expected `Result<(), B>`, found `Result<(), A>`
    |
    = note: expected enum `Result<_, B>`
               found enum `Result<_, A>`
@@ -51,7 +51,7 @@ LL | fn foo3(x: Result<(), A>) -> Result<(), B> {
    |                              ------------- expected `Result<(), B>` because of return type
 ...
 LL |         x
-   |         ^ expected struct `B`, found struct `A`
+   |         ^ expected `Result<(), B>`, found `Result<(), A>`
    |
    = note: expected enum `Result<_, B>`
               found enum `Result<_, A>`
index 13227c5e245bdf9748ab3a4f4f398e09d5ce05b2..1d2777ad69a210704a401eebeb0c558e700225ba 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/point-at-inference-2.rs:5:9
    |
 LL |     bar(v);
-   |     --- ^ expected `i32`, found `&{integer}`
+   |     --- ^ expected `Vec<i32>`, found `Vec<&{integer}>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -21,7 +21,7 @@ LL |     baz(&v);
    |          - here the type of `v` is inferred to be `Vec<&i32>`
 LL |     baz(&v);
 LL |     bar(v);
-   |     --- ^ expected `i32`, found `&i32`
+   |     --- ^ expected `Vec<i32>`, found `Vec<&i32>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -39,7 +39,7 @@ error[E0308]: mismatched types
 LL |     baz(&v);
    |          - here the type of `v` is inferred to be `Vec<&i32>`
 LL |     bar(v);
-   |     --- ^ expected `i32`, found `&i32`
+   |     --- ^ expected `Vec<i32>`, found `Vec<&i32>`
    |     |
    |     arguments to this function are incorrect
    |
index 70428fe841b9c9425127119005f37b6cb480a7d0..a76b4f90c734b491ee5a9ac93c14efb884b1ce43 100644 (file)
@@ -5,7 +5,7 @@ LL |         foo.push(i);
    |                  - this is of type `&{integer}`, which causes `foo` to be inferred as `Vec<&{integer}>`
 ...
 LL |     bar(foo);
-   |     --- ^^^ expected `i32`, found `&{integer}`
+   |     --- ^^^ expected `Vec<i32>`, found `Vec<&{integer}>`
    |     |
    |     arguments to this function are incorrect
    |
index c9cdc874c02ea0f52c7ba8e95bd55f4e45118fd8..2a59bd99450835aa07252d72d0e150b7ebe96912 100644 (file)
@@ -16,7 +16,7 @@ fn main() {
         a::try_foo(foo2);
         //~^ ERROR mismatched types
         //~| perhaps two different versions of crate `crate_a1`
-        //~| expected struct `main::a::Foo`
+        //~| expected `main::a::Foo`, found a different `main::a::Foo`
         a::try_bar(bar2);
         //~^ ERROR mismatched types
         //~| perhaps two different versions of crate `crate_a1`
index fcafd315ebf5450e5f0ea68e6281a6d52969bf46..504812f5867a6fa5e87504098eaa57ac82bec79b 100644 (file)
@@ -2,17 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch-same-crate-name.rs:16:20
    |
 LL |         a::try_foo(foo2);
-   |         ---------- ^^^^ expected struct `main::a::Foo`, found a different struct `main::a::Foo`
+   |         ---------- ^^^^ expected `main::a::Foo`, found a different `main::a::Foo`
    |         |
    |         arguments to this function are incorrect
    |
-   = note: struct `main::a::Foo` and struct `main::a::Foo` have similar names, but are actually distinct types
-note: struct `main::a::Foo` is defined in crate `crate_a2`
+   = note: `main::a::Foo` and `main::a::Foo` have similar names, but are actually distinct types
+note: `main::a::Foo` is defined in crate `crate_a2`
   --> $DIR/auxiliary/crate_a2.rs:1:1
    |
 LL | pub struct Foo;
    | ^^^^^^^^^^^^^^
-note: struct `main::a::Foo` is defined in crate `crate_a1`
+note: `main::a::Foo` is defined in crate `crate_a1`
   --> $DIR/auxiliary/crate_a1.rs:1:1
    |
 LL | pub struct Foo;
index 6c187bad0725c7d525acf6db17b4acd32982c410..67a1f893050cdaaf86716a525986f022d18039de 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:17:17
    |
 LL |     want::<foo>(f);
-   |     ----------- ^ expected struct `foo`, found `usize`
+   |     ----------- ^ expected `foo`, found `usize`
    |     |
    |     arguments to this function are incorrect
    |
@@ -16,7 +16,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:18:17
    |
 LL |     want::<bar>(f);
-   |     ----------- ^ expected struct `bar`, found `usize`
+   |     ----------- ^ expected `bar`, found `usize`
    |     |
    |     arguments to this function are incorrect
    |
@@ -30,7 +30,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:19:24
    |
 LL |     want::<Foo<usize>>(f);
-   |     ------------------ ^ expected struct `Foo`, found `usize`
+   |     ------------------ ^ expected `Foo<usize>`, found `usize`
    |     |
    |     arguments to this function are incorrect
    |
@@ -46,7 +46,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:20:27
    |
 LL |     want::<Foo<usize, B>>(f);
-   |     --------------------- ^ expected struct `Foo`, found `usize`
+   |     --------------------- ^ expected `Foo<usize, B>`, found `usize`
    |     |
    |     arguments to this function are incorrect
    |
@@ -62,7 +62,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:21:22
    |
 LL |     want::<Foo<foo>>(f);
-   |     ---------------- ^ expected struct `Foo`, found `usize`
+   |     ---------------- ^ expected `Foo<foo>`, found `usize`
    |     |
    |     arguments to this function are incorrect
    |
@@ -78,7 +78,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:22:25
    |
 LL |     want::<Foo<foo, B>>(f);
-   |     ------------------- ^ expected struct `Foo`, found `usize`
+   |     ------------------- ^ expected `Foo<foo, B>`, found `usize`
    |     |
    |     arguments to this function are incorrect
    |
@@ -94,7 +94,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:23:22
    |
 LL |     want::<Foo<bar>>(f);
-   |     ---------------- ^ expected struct `Foo`, found `usize`
+   |     ---------------- ^ expected `Foo<bar>`, found `usize`
    |     |
    |     arguments to this function are incorrect
    |
@@ -110,7 +110,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:24:25
    |
 LL |     want::<Foo<bar, B>>(f);
-   |     ------------------- ^ expected struct `Foo`, found `usize`
+   |     ------------------- ^ expected `Foo<bar, B>`, found `usize`
    |     |
    |     arguments to this function are incorrect
    |
@@ -126,7 +126,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:28:19
    |
 LL |     want::<usize>(f);
-   |     ------------- ^ expected `usize`, found struct `foo`
+   |     ------------- ^ expected `usize`, found `foo`
    |     |
    |     arguments to this function are incorrect
    |
@@ -140,7 +140,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:29:17
    |
 LL |     want::<bar>(f);
-   |     ----------- ^ expected struct `bar`, found struct `foo`
+   |     ----------- ^ expected `bar`, found `foo`
    |     |
    |     arguments to this function are incorrect
    |
@@ -154,7 +154,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:30:24
    |
 LL |     want::<Foo<usize>>(f);
-   |     ------------------ ^ expected struct `Foo`, found struct `foo`
+   |     ------------------ ^ expected `Foo<usize>`, found `foo`
    |     |
    |     arguments to this function are incorrect
    |
@@ -170,7 +170,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:31:27
    |
 LL |     want::<Foo<usize, B>>(f);
-   |     --------------------- ^ expected struct `Foo`, found struct `foo`
+   |     --------------------- ^ expected `Foo<usize, B>`, found `foo`
    |     |
    |     arguments to this function are incorrect
    |
@@ -186,7 +186,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:32:22
    |
 LL |     want::<Foo<foo>>(f);
-   |     ---------------- ^ expected struct `Foo`, found struct `foo`
+   |     ---------------- ^ expected `Foo<foo>`, found `foo`
    |     |
    |     arguments to this function are incorrect
    |
@@ -202,7 +202,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:33:25
    |
 LL |     want::<Foo<foo, B>>(f);
-   |     ------------------- ^ expected struct `Foo`, found struct `foo`
+   |     ------------------- ^ expected `Foo<foo, B>`, found `foo`
    |     |
    |     arguments to this function are incorrect
    |
@@ -218,7 +218,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:34:22
    |
 LL |     want::<Foo<bar>>(f);
-   |     ---------------- ^ expected struct `Foo`, found struct `foo`
+   |     ---------------- ^ expected `Foo<bar>`, found `foo`
    |     |
    |     arguments to this function are incorrect
    |
@@ -234,7 +234,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:35:25
    |
 LL |     want::<Foo<bar, B>>(f);
-   |     ------------------- ^ expected struct `Foo`, found struct `foo`
+   |     ------------------- ^ expected `Foo<bar, B>`, found `foo`
    |     |
    |     arguments to this function are incorrect
    |
@@ -250,7 +250,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:39:19
    |
 LL |     want::<usize>(f);
-   |     ------------- ^ expected `usize`, found struct `Foo`
+   |     ------------- ^ expected `usize`, found `Foo<foo>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -266,7 +266,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:40:17
    |
 LL |     want::<foo>(f);
-   |     ----------- ^ expected struct `foo`, found struct `Foo`
+   |     ----------- ^ expected `foo`, found `Foo<foo>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -282,7 +282,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:41:17
    |
 LL |     want::<bar>(f);
-   |     ----------- ^ expected struct `bar`, found struct `Foo`
+   |     ----------- ^ expected `bar`, found `Foo<foo>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -298,7 +298,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:42:24
    |
 LL |     want::<Foo<usize>>(f);
-   |     ------------------ ^ expected `usize`, found struct `foo`
+   |     ------------------ ^ expected `Foo<usize>`, found `Foo<foo>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -314,7 +314,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:43:27
    |
 LL |     want::<Foo<usize, B>>(f);
-   |     --------------------- ^ expected `usize`, found struct `foo`
+   |     --------------------- ^ expected `Foo<usize, B>`, found `Foo<foo>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -330,7 +330,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:44:25
    |
 LL |     want::<Foo<foo, B>>(f);
-   |     ------------------- ^ expected struct `B`, found struct `A`
+   |     ------------------- ^ expected `Foo<foo, B>`, found `Foo<foo>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -346,7 +346,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:45:22
    |
 LL |     want::<Foo<bar>>(f);
-   |     ---------------- ^ expected struct `bar`, found struct `foo`
+   |     ---------------- ^ expected `Foo<bar>`, found `Foo<foo>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -362,7 +362,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:46:25
    |
 LL |     want::<Foo<bar, B>>(f);
-   |     ------------------- ^ expected struct `bar`, found struct `foo`
+   |     ------------------- ^ expected `Foo<bar, B>`, found `Foo<foo>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -380,7 +380,7 @@ error[E0308]: mismatched types
 LL |     want::<&Foo<foo>>(f);
    |     ----------------- ^
    |     |                 |
-   |     |                 expected `&Foo<foo>`, found struct `Foo`
+   |     |                 expected `&Foo<foo>`, found `Foo<foo>`
    |     |                 help: consider borrowing here: `&f`
    |     arguments to this function are incorrect
    |
@@ -396,7 +396,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:48:26
    |
 LL |     want::<&Foo<foo, B>>(f);
-   |     -------------------- ^ expected `&Foo<foo, B>`, found struct `Foo`
+   |     -------------------- ^ expected `&Foo<foo, B>`, found `Foo<foo>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -412,7 +412,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:52:19
    |
 LL |     want::<usize>(f);
-   |     ------------- ^ expected `usize`, found struct `Foo`
+   |     ------------- ^ expected `usize`, found `Foo<foo, B>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -428,7 +428,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:53:17
    |
 LL |     want::<foo>(f);
-   |     ----------- ^ expected struct `foo`, found struct `Foo`
+   |     ----------- ^ expected `foo`, found `Foo<foo, B>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -444,7 +444,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:54:17
    |
 LL |     want::<bar>(f);
-   |     ----------- ^ expected struct `bar`, found struct `Foo`
+   |     ----------- ^ expected `bar`, found `Foo<foo, B>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -460,7 +460,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:55:24
    |
 LL |     want::<Foo<usize>>(f);
-   |     ------------------ ^ expected `usize`, found struct `foo`
+   |     ------------------ ^ expected `Foo<usize>`, found `Foo<foo, B>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -476,7 +476,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:56:27
    |
 LL |     want::<Foo<usize, B>>(f);
-   |     --------------------- ^ expected `usize`, found struct `foo`
+   |     --------------------- ^ expected `Foo<usize, B>`, found `Foo<foo, B>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -492,7 +492,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:57:22
    |
 LL |     want::<Foo<foo>>(f);
-   |     ---------------- ^ expected struct `A`, found struct `B`
+   |     ---------------- ^ expected `Foo<foo>`, found `Foo<foo, B>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -508,7 +508,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:58:22
    |
 LL |     want::<Foo<bar>>(f);
-   |     ---------------- ^ expected struct `bar`, found struct `foo`
+   |     ---------------- ^ expected `Foo<bar>`, found `Foo<foo, B>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -524,7 +524,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:59:25
    |
 LL |     want::<Foo<bar, B>>(f);
-   |     ------------------- ^ expected struct `bar`, found struct `foo`
+   |     ------------------- ^ expected `Foo<bar, B>`, found `Foo<foo, B>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -540,7 +540,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:60:23
    |
 LL |     want::<&Foo<foo>>(f);
-   |     ----------------- ^ expected `&Foo<foo>`, found struct `Foo`
+   |     ----------------- ^ expected `&Foo<foo>`, found `Foo<foo, B>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -558,7 +558,7 @@ error[E0308]: mismatched types
 LL |     want::<&Foo<foo, B>>(f);
    |     -------------------- ^
    |     |                    |
-   |     |                    expected `&Foo<foo, B>`, found struct `Foo`
+   |     |                    expected `&Foo<foo, B>`, found `Foo<foo, B>`
    |     |                    help: consider borrowing here: `&f`
    |     arguments to this function are incorrect
    |
@@ -574,7 +574,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:65:19
    |
 LL |     want::<usize>(f);
-   |     ------------- ^ expected `usize`, found struct `Foo`
+   |     ------------- ^ expected `usize`, found `Foo<foo, B, A>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -590,7 +590,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:66:17
    |
 LL |     want::<foo>(f);
-   |     ----------- ^ expected struct `foo`, found struct `Foo`
+   |     ----------- ^ expected `foo`, found `Foo<foo, B, A>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -606,7 +606,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:67:17
    |
 LL |     want::<bar>(f);
-   |     ----------- ^ expected struct `bar`, found struct `Foo`
+   |     ----------- ^ expected `bar`, found `Foo<foo, B, A>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -622,7 +622,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:68:24
    |
 LL |     want::<Foo<usize>>(f);
-   |     ------------------ ^ expected `usize`, found struct `foo`
+   |     ------------------ ^ expected `Foo<usize>`, found `Foo<foo, B, A>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -638,7 +638,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:69:27
    |
 LL |     want::<Foo<usize, B>>(f);
-   |     --------------------- ^ expected `usize`, found struct `foo`
+   |     --------------------- ^ expected `Foo<usize, B>`, found `Foo<foo, B, A>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -654,7 +654,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:70:22
    |
 LL |     want::<Foo<foo>>(f);
-   |     ---------------- ^ expected struct `A`, found struct `B`
+   |     ---------------- ^ expected `Foo<foo>`, found `Foo<foo, B, A>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -670,7 +670,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:71:25
    |
 LL |     want::<Foo<foo, B>>(f);
-   |     ------------------- ^ expected struct `B`, found struct `A`
+   |     ------------------- ^ expected `Foo<foo, B>`, found `Foo<foo, B, A>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -686,7 +686,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:72:22
    |
 LL |     want::<Foo<bar>>(f);
-   |     ---------------- ^ expected struct `bar`, found struct `foo`
+   |     ---------------- ^ expected `Foo<bar>`, found `Foo<foo, B, A>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -702,7 +702,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:73:25
    |
 LL |     want::<Foo<bar, B>>(f);
-   |     ------------------- ^ expected struct `bar`, found struct `foo`
+   |     ------------------- ^ expected `Foo<bar, B>`, found `Foo<foo, B, A>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -718,7 +718,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:74:23
    |
 LL |     want::<&Foo<foo>>(f);
-   |     ----------------- ^ expected `&Foo<foo>`, found struct `Foo`
+   |     ----------------- ^ expected `&Foo<foo>`, found `Foo<foo, B, A>`
    |     |
    |     arguments to this function are incorrect
    |
@@ -734,7 +734,7 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:75:26
    |
 LL |     want::<&Foo<foo, B>>(f);
-   |     -------------------- ^ expected `&Foo<foo, B>`, found struct `Foo`
+   |     -------------------- ^ expected `&Foo<foo, B>`, found `Foo<foo, B, A>`
    |     |
    |     arguments to this function are incorrect
    |
index e394cf8206edef45077760f28886f310e09c0e3c..b26d16da01521d41667aa8cb5880c981f94bd78b 100644 (file)
@@ -30,7 +30,7 @@ error[E0308]: mismatched types
 LL |     let mut y = x.lock().unwrap();
    |                 ----------------- expected due to this value
 LL |     y = 2;
-   |         ^ expected struct `MutexGuard`, found integer
+   |         ^ expected `MutexGuard<'_, usize>`, found integer
    |
    = note: expected struct `MutexGuard<'_, usize>`
                 found type `{integer}`
index e4c99ec8e701f99a1f72792c438a9626c947886a..882854acb1d84e3bb8335b128035109d67690cb5 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     vector.sort();
    |     ------ here the type of `vector` is inferred to be `Vec<_>`
 LL |     result.push(vector);
-   |            ---- ^^^^^^ expected integer, found struct `Vec`
+   |            ---- ^^^^^^ expected integer, found `Vec<_>`
    |            |
    |            arguments to this method are incorrect
    |
index 091502bdda34a14e48c7dd9845513152bb4dfc76..a9b5078ccdde3363992e38d398fd6259ff64fe1c 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL |     let _tis_an_instants_play: String = "'Tis a fond Ambush—";
    |                                ------   ^^^^^^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_string()`
    |                                |        |
-   |                                |        expected struct `String`, found `&str`
+   |                                |        expected `String`, found `&str`
    |                                expected due to this
 
 error[E0308]: mismatched types
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
 LL |     let _just_to_make_bliss: PathBuf = Path::new("/ern/her/own/surprise");
    |                              -------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_path_buf()`
    |                              |         |
-   |                              |         expected struct `PathBuf`, found `&Path`
+   |                              |         expected `PathBuf`, found `&Path`
    |                              expected due to this
 
 error[E0308]: mismatched types
@@ -22,14 +22,14 @@ error[E0308]: mismatched types
 LL |     let _but_should_the_play: String = 2; // Perhaps surprisingly, we suggest .to_string() here
    |                               ------   ^- help: try using a conversion method: `.to_string()`
    |                               |        |
-   |                               |        expected struct `String`, found integer
+   |                               |        expected `String`, found integer
    |                               expected due to this
 
 error[E0308]: mismatched types
   --> $DIR/conversion-methods.rs:12:47
    |
 LL |     let _prove_piercing_earnest: Vec<usize> = &[1, 2, 3];
-   |                                  ----------   ^^^^^^^^^^ expected struct `Vec`, found `&[{integer}; 3]`
+   |                                  ----------   ^^^^^^^^^^ expected `Vec<usize>`, found `&[{integer}; 3]`
    |                                  |
    |                                  expected due to this
    |
index bd6575c73d244f749380af0abe7be33553536aa5..4346e273d0d664f2d1d9af3afdbd1efff00ad6b3 100644 (file)
@@ -58,7 +58,7 @@ error[E0308]: mismatched types
 LL | fn d(x: std::sync::Mutex<&i32>) -> i32 {
    |                                    --- expected `i32` because of return type
 LL |     x.lock().unwrap()
-   |     ^^^^^^^^^^^^^^^^^ expected `i32`, found struct `MutexGuard`
+   |     ^^^^^^^^^^^^^^^^^ expected `i32`, found `MutexGuard<'_, &i32>`
    |
    = note: expected type `i32`
             found struct `MutexGuard<'_, &i32>`
index 9279e4c3901db303674d35d8ea5f23d980296d3d..4d21574700ad987e663a216dd1bb0fe5e232dac5 100644 (file)
@@ -9,5 +9,5 @@ fn clone_thing(nc: &NotClone) -> NotClone {
     nc.clone()
     //~^ ERROR mismatched type
     //~| NOTE `NotClone` does not implement `Clone`, so `&NotClone` was cloned instead
-    //~| NOTE expected struct `NotClone`, found `&NotClone`
+    //~| NOTE expected `NotClone`, found `&NotClone`
 }
index ff36e18d28301ef3b1934208e8ed2175a8ecbe9f..4539da4389b3b16c0fef5529cf66f74a71ccb6eb 100644 (file)
@@ -5,7 +5,7 @@ LL | fn clone_thing(nc: &NotClone) -> NotClone {
    |                                  -------- expected `NotClone` because of return type
 LL |
 LL |     nc.clone()
-   |     ^^^^^^^^^^ expected struct `NotClone`, found `&NotClone`
+   |     ^^^^^^^^^^ expected `NotClone`, found `&NotClone`
    |
 note: `NotClone` does not implement `Clone`, so `&NotClone` was cloned instead
   --> $DIR/explain_clone_autoref.rs:9:5
index 8b77de94e89f866aee1c72f0c916d5927e3f151d..428a0792091e650f66961e644bdfbe254f7b58f2 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: `?` operator has incompatible types
   --> $DIR/issue-100246.rs:28:24
    |
 LL |     let other: Other = downcast()?;
-   |                        ^^^^^^^^^^^ expected struct `Other`, found reference
+   |                        ^^^^^^^^^^^ expected `Other`, found `&_`
    |
    = note: `?` operator cannot convert from `&_` to `Other`
    = note: expected struct `Other`
index 876ac2c67ef3f34cf19718cff61a7a2bb65dc5a7..11d34f5b93b0c3332ca3fb8681545f1525dd6d54 100644 (file)
@@ -5,7 +5,7 @@ LL |     fn nodes<'a, I: Iterator<Item=&'a N>>(&self) -> I
    |                  - this type parameter              - expected `I` because of return type
 ...
 LL |         self.iter()
-   |         ^^^^^^^^^^^ expected type parameter `I`, found struct `Iter`
+   |         ^^^^^^^^^^^ expected type parameter `I`, found `Iter<'_, N>`
    |
    = note: expected type parameter `I`
                       found struct `std::slice::Iter<'_, N>`
@@ -22,7 +22,7 @@ error[E0308]: mismatched types
 LL |     iterate(graph);
    |     ------- ^^^^^
    |     |       |
-   |     |       expected reference, found struct `Vec`
+   |     |       expected `&_`, found `Vec<Stuff>`
    |     |       help: consider borrowing here: `&graph`
    |     arguments to this function are incorrect
    |
index f3be99f9bcb4b3e09efcd9029b355d188c5ba5ec..8346c9a0aaecccec353a2669a4b49d33cc89e119 100644 (file)
@@ -2,7 +2,7 @@ error[E0271]: expected `TakeWhile<&mut IntoIter<u8>, [closure@issue-31173.rs:7:2
   --> $DIR/issue-31173.rs:11:10
    |
 LL |         .cloned()
-   |          ^^^^^^ expected reference, found `u8`
+   |          ^^^^^^ expected `&_`, found `u8`
    |
    = note: expected reference `&_`
                    found type `u8`
index 8f5ff51fbe1007cb7e77aa405625b059df75ed5f..26fc21dda06ae503bc1873ae4b532d5f35d04da0 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-46112.rs:9:21
    |
 LL | fn main() { test(Ok(())); }
-   |                  -- ^^ expected enum `Option`, found `()`
+   |                  -- ^^ expected `Option<()>`, found `()`
    |                  |
    |                  arguments to this enum variant are incorrect
    |
index e6a0edac4b1113d3c434532953901e7b6b195d57..9e48ccefd86b95e5987c18efb743c44e1a394f85 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-50687-ice-on-borrow.rs:40:17
    |
 LL |     let _: () = Borrow::borrow(&owned);
-   |            --   ^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found reference
+   |            --   ^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `&_`
    |            |
    |            expected due to this
    |
index b92a6f2ec2b485df7c3dd8c1378f6e8f7ba5232a..dc4bc5b5f44bb4387984526635411b184754c26b 100644 (file)
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
 LL | fn ice(x: Box<dyn Iterator<Item=()>>) {
    |                                       - help: try adding a return type: `-> (dyn Iterator<Item = ()> + 'static)`
 LL |     *x
-   |     ^^ expected `()`, found trait object `dyn Iterator`
+   |     ^^ expected `()`, found `dyn Iterator`
    |
    = note: expected unit type `()`
            found trait object `(dyn Iterator<Item = ()> + 'static)`
index 5d07f9cc748ea41c8f77dd6456a32a31469a1c98..d50ed9cf13bb4b67b8d214d7f6129bfbe57673d2 100644 (file)
@@ -8,7 +8,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-67971.rs:3:24
    |
 LL | fn foo(ctx: &mut S) -> String {
-   |    ---                 ^^^^^^ expected struct `String`, found `()`
+   |    ---                 ^^^^^^ expected `String`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
 
index 24c188b3fcb70292970b746488577b841c1cd2ad..4d456ae842f626976a5161dffa8d3e1af545d0a9 100644 (file)
@@ -5,7 +5,7 @@ LL | fn mismatched_types_with_reference(x: &u32) -> &u32 {
    |                                                ---- expected `&u32` because of return type
 ...
 LL |     return "test";
-   |            ^^^^^^ expected `u32`, found `str`
+   |            ^^^^^^ expected `&u32`, found `&str`
    |
    = note: expected reference `&u32`
               found reference `&'static str`
index 09f3aee2d9ec56a51a33b9639863e6950adba45e..63936f9979f483f076311a2806e7741c6fbc3183 100644 (file)
@@ -8,7 +8,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-84768.rs:7:42
    |
 LL |     <F as FnOnce(&mut u8)>::call_once(f, 1)
-   |     ---------------------------------    ^ expected tuple, found integer
+   |     ---------------------------------    ^ expected `(&mut u8,)`, found integer
    |     |
    |     arguments to this function are incorrect
    |
index 5fa1ae1a54f722591a341779584652c702b3aef2..6b9cbe52c255300fdd61db687ba281ea477e6e70 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-89856.rs:6:20
    |
 LL |     take_str_maybe(option);
-   |     -------------- ^^^^^^ expected `str`, found struct `String`
+   |     -------------- ^^^^^^ expected `Option<&str>`, found `Option<&String>`
    |     |
    |     arguments to this function are incorrect
    |
index 32f4c8f6fdf8255def0295c2733c2fc3ae75eb03..7ca5446c2e7ab6ff488657bc6218e34019f00ddd 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-91450-inner-ty-error.rs:4:13
    |
 LL | fn foo() -> Option<_> {}
-   |    ---      ^^^^^^^^^ expected enum `Option`, found `()`
+   |    ---      ^^^^^^^^^ expected `Option<_>`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
    |
index cd778a649b621003694cd24858a3676316db0536..c3acbd2c067c5faf501321a5ede2cbd42646633c 100644 (file)
@@ -49,7 +49,7 @@ LL |   fn r({) {
 LL | /     Ok {
 LL | |         d..||_=m
 LL | |     }
-   | |_____^ expected `()`, found enum `Result`
+   | |_____^ expected `()`, found `Result<_, _>`
    |
    = note: expected unit type `()`
                    found enum `Result<_, _>`
index 4b4568b1de9b29ff8e31959d0e957681af13f7df..3a67ef0260b41932429f8df1aa3141e0d9d770fd 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-96530.rs:9:11
    |
 LL |         ..man.clone()
-   |           ^^^^^^^^^^^ expected struct `Person`, found `&Person`
+   |           ^^^^^^^^^^^ expected `Person`, found `&Person`
 
 error: aborting due to previous error
 
index 29624e08a2e805862890a8fae3ec698a3ef099f0..8b826daeede487c5da93fd4bc1e9e5f5d7c46f04 100644 (file)
@@ -2,7 +2,7 @@
 fn foo() { //~ HELP a return type might be missing here
     vec!['a'].iter().map(|c| c)
     //~^ ERROR mismatched types [E0308]
-    //~| NOTE expected `()`, found struct `Map`
+    //~| NOTE expected `()`, found `Map<Iter<'_, char>, ...>`
     //~| NOTE expected unit type `()`
     //~| HELP consider using a semicolon here
 }
index 101aee39559c3c05af984cc1602f09141be5dc41..f9a240963997bd32065540989770b40136818747 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/return_type_containing_closure.rs:3:5
    |
 LL |     vec!['a'].iter().map(|c| c)
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Map`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Map<Iter<'_, char>, ...>`
    |
    = note: expected unit type `()`
                  found struct `Map<std::slice::Iter<'_, char>, [closure@$DIR/return_type_containing_closure.rs:3:26: 3:29]>`
index 2f9cfcf8dbb5a9e5ad3724d5641fad72a2716372..718b6deed1bb13c75ddebfde2b7cb8e5de18431d 100644 (file)
@@ -14,7 +14,7 @@ fn test1() {
     //~^ ERROR mismatched types
     //~| expected struct `Foo<_>`
     //~| found struct `Bar<usize>`
-    //~| expected struct `Foo`, found struct `Bar`
+    //~| expected `Foo<_>`, found `Bar<usize>`
     let y: Foo<usize> = x;
 }
 
@@ -23,5 +23,5 @@ fn test2() {
     //~^ ERROR mismatched types
     //~| expected struct `Foo<_>`
     //~| found struct `Bar<usize>`
-    //~| expected struct `Foo`, found struct `Bar`
+    //~| expected `Foo<_>`, found `Bar<usize>`
 }
index 867412a24b282c24b3055db8f8420101ed52b0df..bf8e0bbb519c4521b241c472566755afebf61e75 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/typeck_type_placeholder_mismatch.rs:13:21
    |
 LL |     let x: Foo<_> = Bar::<usize>(PhantomData);
-   |            ------   ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found struct `Bar`
+   |            ------   ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Foo<_>`, found `Bar<usize>`
    |            |
    |            expected due to this
    |
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
   --> $DIR/typeck_type_placeholder_mismatch.rs:22:21
    |
 LL |     let x: Foo<_> = Bar::<usize>(PhantomData);
-   |            ------   ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found struct `Bar`
+   |            ------   ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Foo<_>`, found `Bar<usize>`
    |            |
    |            expected due to this
    |
index 08745eab28d16e518b37ea35d3d02aa7e06cd75a..d456c16de0dc888dd8ba32276670b341253031f3 100644 (file)
@@ -18,7 +18,7 @@ error[E0308]: mismatched types
 LL |     let x: &[u8] = vec!(1, 2, 3)[..];
    |            -----   ^^^^^^^^^^^^^^^^^
    |            |       |
-   |            |       expected `&[u8]`, found slice `[{integer}]`
+   |            |       expected `&[u8]`, found `[{integer}]`
    |            |       help: consider borrowing here: `&vec!(1, 2, 3)[..]`
    |            expected due to this
 
@@ -26,7 +26,7 @@ error[E0308]: mismatched types
   --> $DIR/suggest-borrow.rs:4:19
    |
 LL |     let x: [u8] = &vec!(1, 2, 3)[..];
-   |            ----   ^^^^^^^^^^^^^^^^^^ expected slice `[u8]`, found `&[{integer}]`
+   |            ----   ^^^^^^^^^^^^^^^^^^ expected `[u8]`, found `&[{integer}]`
    |            |
    |            expected due to this
    |
index c96c59afc5a54d77dd79d5e063e7f4710554361b..bfb7c3957f420c843d80b2f76da0bddd29c4a466 100644 (file)
@@ -9,7 +9,7 @@ LL | |         move || println!("{a}")
    | |         expected because of this
 LL | |     } else {
 LL | |         Box::new(move || println!("{}", b))
-   | |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found struct `Box`
+   | |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found `Box<[closure@box-instead-of-dyn-fn.rs:10:18]>`
 LL | |
 LL | |     }
    | |_____- `if` and `else` have incompatible types
index d18fa6456f3ee41d7a8ccc422f2a69e530b78b53..b1ad0cb5b88eabcaf330429c2cb357ea70015765 100644 (file)
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/param-mentioned-by-different-field.rs:8:25
    |
 LL |     let y: &Foo<[u8]> = &x;
-   |            ----------   ^^ expected slice `[u8]`, found array `[u8; 1]`
+   |            ----------   ^^ expected `&Foo<[u8]>`, found `&Foo<[u8; 1]>`
    |            |
    |            expected due to this
    |
index 96fc1d36b9cfaac4e5375af59a274ad08f015b4e..d2b41630976ad222830cb32a4e6c638d596f3d58 100644 (file)
@@ -5,7 +5,7 @@ LL | /     match opt() {
 LL | |         Some(()) => &S,
    | |                     -- this is found to be of type `&S`
 LL | |         None => &R,
-   | |                 ^^ expected struct `S`, found struct `R`
+   | |                 ^^ expected `&S`, found `&R`
 LL | |     }
    | |_____- `match` arms have incompatible types
    |
index 504a6032b01f9145c06fba675a50f1b79c21592d..25a92f5ec12a7522f0e59665b664565a5627cec5 100644 (file)
@@ -16,7 +16,7 @@ error[E0053]: method `mul` has an incompatible type for trait
 LL |     fn mul(self, s: f64) -> Vec2 {
    |                     ^^^
    |                     |
-   |                     expected struct `Vec2`, found `f64`
+   |                     expected `Vec2`, found `f64`
    |                     help: change the parameter type to match the trait: `Vec2`
    |
    = note: expected signature `fn(Vec2, Vec2) -> f64`
@@ -38,7 +38,7 @@ error[E0308]: mismatched types
   --> $DIR/wrong-mul-method-signature.rs:63:45
    |
 LL |     let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order
-   |                   -----------------------   ^^^ expected struct `Vec2`, found floating-point number
+   |                   -----------------------   ^^^ expected `Vec2`, found floating-point number
    |                   |
    |                   expected because this is `Vec2`
 
@@ -46,7 +46,7 @@ error[E0308]: mismatched types
   --> $DIR/wrong-mul-method-signature.rs:63:19
    |
 LL |     let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order
-   |            ----   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found `f64`
+   |            ----   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Vec2`, found `f64`
    |            |
    |            expected due to this