From 83ffda5216a9a4248221b980ee08c30ac6e517f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Wed, 13 Nov 2019 14:16:56 -0800 Subject: [PATCH 1/6] Specific labels when referring to "expected" and "found" types --- src/librustc/infer/error_reporting/mod.rs | 34 ++-- src/librustc/ty/error.rs | 31 +++ src/librustc_errors/diagnostic.rs | 76 ++++---- src/librustc_errors/diagnostic_builder.rs | 59 +++--- src/test/ui/array-break-length.stderr | 4 +- src/test/ui/array-not-vector.rs | 6 +- src/test/ui/array-not-vector.stderr | 6 +- ...ssociated-const-generic-obligations.stderr | 4 +- ...ssociated-const-impl-wrong-lifetime.stderr | 4 +- ...ted-type-projection-from-supertrait.stderr | 16 +- ...nding-to-type-defined-in-supertrait.stderr | 8 +- .../associated-types/associated-types-eq-3.rs | 4 +- .../associated-types-eq-3.stderr | 12 +- .../associated-types-eq-hr.stderr | 8 +- .../associated-types-issue-20346.stderr | 2 +- ...ated-types-multiple-types-one-trait.stderr | 8 +- .../ui/associated-types/issue-44153.stderr | 4 +- ...block-control-flow-static-semantics.stderr | 4 +- .../dont-suggest-missing-await.stderr | 4 +- .../suggest-missing-await-closure.stderr | 4 +- .../async-await/suggest-missing-await.stderr | 4 +- src/test/ui/bad/bad-const-type.rs | 4 +- src/test/ui/bad/bad-const-type.stderr | 4 +- src/test/ui/bad/bad-expr-path.stderr | 4 +- src/test/ui/bad/bad-expr-path2.stderr | 4 +- src/test/ui/bad/bad-main.stderr | 4 +- .../ui/blind/blind-item-block-middle.stderr | 2 +- .../consider-removing-last-semi.stderr | 8 +- src/test/ui/block-result/issue-13428.stderr | 8 +- src/test/ui/block-result/issue-13624.rs | 8 +- src/test/ui/block-result/issue-13624.stderr | 4 +- src/test/ui/block-result/issue-20862.stderr | 2 +- src/test/ui/block-result/issue-22645.stderr | 2 +- src/test/ui/block-result/issue-5500.rs | 2 +- src/test/ui/block-result/issue-5500.stderr | 4 +- ...regions-bound-missing-bound-in-impl.stderr | 4 +- src/test/ui/c-variadic/variadic-ffi-1.stderr | 8 +- src/test/ui/c-variadic/variadic-ffi-4.stderr | 20 +- .../expect-fn-supply-fn.stderr | 8 +- .../closure-array-break-length.stderr | 4 +- .../expect-region-supply-region.stderr | 8 +- src/test/ui/closures/closure-no-fn-1.stderr | 4 +- src/test/ui/closures/closure-no-fn-2.stderr | 4 +- .../ui/closures/closure-reform-bad.stderr | 4 +- src/test/ui/codemap_tests/tab.stderr | 4 +- .../coerce-expect-unsized-ascribed.stderr | 56 +++--- src/test/ui/coercion/coerce-mut.rs | 4 +- src/test/ui/coercion/coerce-mut.stderr | 4 +- src/test/ui/coercion/coerce-to-bang.stderr | 4 +- ...coercion-missing-tail-expected-type.stderr | 2 +- src/test/ui/coercion/coercion-slice.rs | 2 +- src/test/ui/coercion/coercion-slice.stderr | 4 +- .../reordered-type-param.stderr | 4 +- ...const-argument-cross-crate-mismatch.stderr | 8 +- .../fn-const-param-infer.stderr | 12 +- .../const-generics/raw-ptr-const-param.stderr | 4 +- .../slice-const-param-mismatch.stderr | 12 +- .../types-mismatch-const-args.stderr | 8 +- .../ui/consts/const-array-oob-arith.stderr | 8 +- .../ui/consts/const-eval/const-eval-span.rs | 2 +- .../consts/const-eval/const-eval-span.stderr | 2 +- .../ui/consts/const-tup-index-span.stderr | 4 +- src/test/ui/conversion-methods.stderr | 16 +- src/test/ui/cross/cross-borrow-trait.rs | 4 +- src/test/ui/cross/cross-borrow-trait.stderr | 4 +- src/test/ui/deref-suggestion.stderr | 40 ++-- src/test/ui/destructure-trait-ref.rs | 12 +- src/test/ui/destructure-trait-ref.stderr | 12 +- src/test/ui/did_you_mean/issue-42764.stderr | 6 +- .../did_you_mean/recursion_limit_deref.stderr | 4 +- src/test/ui/diverging-fn-tail-35849.stderr | 2 +- .../ui/diverging-tuple-parts-39485.stderr | 6 +- src/test/ui/dst/dst-bad-assign-3.rs | 4 +- src/test/ui/dst/dst-bad-assign-3.stderr | 4 +- src/test/ui/dst/dst-bad-assign.rs | 4 +- src/test/ui/dst/dst-bad-assign.stderr | 4 +- src/test/ui/dst/dst-bad-coerce1.stderr | 8 +- src/test/ui/dst/dst-bad-coerce2.stderr | 16 +- src/test/ui/dst/dst-bad-coerce4.rs | 8 +- src/test/ui/dst/dst-bad-coerce4.stderr | 8 +- src/test/ui/dst/dst-bad-coercions.stderr | 28 +-- .../elide-errors-on-mismatched-tuple.stderr | 4 +- src/test/ui/error-codes/E0271.stderr | 4 +- src/test/ui/error-codes/E0308.stderr | 4 +- src/test/ui/estr-subtyping.stderr | 4 +- ...sive_range_pattern_syntax_collision.stderr | 4 +- ...ive_range_pattern_syntax_collision2.stderr | 4 +- ...ive_range_pattern_syntax_collision3.stderr | 8 +- .../explicit-self-lifetime-mismatch.rs | 8 +- .../explicit-self-lifetime-mismatch.stderr | 8 +- src/test/ui/extern/extern-main-fn.stderr | 4 +- .../extern/extern-types-distinct-types.stderr | 4 +- src/test/ui/fn/fn-compare-mismatch.stderr | 4 +- src/test/ui/fn/fn-item-type.rs | 8 +- src/test/ui/fn/fn-item-type.stderr | 16 +- src/test/ui/fn/fn-trait-formatting.rs | 6 +- src/test/ui/fn/fn-trait-formatting.stderr | 6 +- .../fully-qualified-type-name1.rs | 2 +- .../fully-qualified-type-name1.stderr | 2 +- .../fully-qualified-type-name2.rs | 4 +- .../fully-qualified-type-name2.stderr | 4 +- .../fully-qualified-type-name4.rs | 2 +- .../fully-qualified-type-name4.stderr | 2 +- .../type-mismatch-signature-deduction.stderr | 2 +- .../generic-arg-mismatch-recover.stderr | 4 +- .../generic/generic-type-params-name-repr.rs | 24 +-- .../generic-type-params-name-repr.stderr | 24 +-- ...pe.bound_a_b_ret_a_vs_bound_a_ret_a.stderr | 4 +- .../hr-subtype.bound_a_b_vs_bound_a.stderr | 4 +- .../hr-subtype.bound_a_vs_free_x.stderr | 4 +- ...-subtype.bound_co_a_b_vs_bound_co_a.stderr | 4 +- ...ubtype.bound_co_a_co_b_ret_contra_a.stderr | 4 +- ...pe.bound_contra_a_contra_b_ret_co_a.stderr | 4 +- ...ubtype.bound_inv_a_b_vs_bound_inv_a.stderr | 4 +- ...hr-subtype.free_inv_x_vs_free_inv_y.stderr | 8 +- .../hr-subtype.free_x_vs_free_y.stderr | 4 +- src/test/ui/hrtb/hrtb-exists-forall-fn.stderr | 4 +- src/test/ui/hrtb/issue-62203-hrtb-ice.stderr | 8 +- src/test/ui/if/if-no-match-bindings.stderr | 32 ++-- src/test/ui/if/if-typeck.stderr | 2 +- src/test/ui/if/ifmt-bad-arg.stderr | 8 +- .../bound-normalization-fail.stderr | 8 +- src/test/ui/impl-trait/equality2.rs | 4 +- src/test/ui/impl-trait/equality2.stderr | 16 +- .../impl-generic-mismatch-ab.stderr | 4 +- src/test/ui/impl-trait/trait_type.stderr | 4 +- .../universal-mismatched-type.stderr | 4 +- .../universal-two-impl-traits.stderr | 4 +- .../ui/include-macros/mismatched-types.stderr | 8 +- src/test/ui/issues/issue-10176.rs | 2 +- src/test/ui/issues/issue-10176.stderr | 2 +- src/test/ui/issues/issue-10764.stderr | 4 +- src/test/ui/issues/issue-11374.stderr | 4 +- src/test/ui/issues/issue-11515.stderr | 4 +- src/test/ui/issues/issue-11844.stderr | 4 +- src/test/ui/issues/issue-12552.stderr | 8 +- src/test/ui/issues/issue-12997-2.stderr | 4 +- src/test/ui/issues/issue-13033.rs | 4 +- src/test/ui/issues/issue-13033.stderr | 4 +- src/test/ui/issues/issue-13407.stderr | 4 +- src/test/ui/issues/issue-13446.stderr | 4 +- src/test/ui/issues/issue-13466.rs | 8 +- src/test/ui/issues/issue-13466.stderr | 8 +- src/test/ui/issues/issue-13853.stderr | 8 +- src/test/ui/issues/issue-14541.rs | 4 +- src/test/ui/issues/issue-14541.stderr | 4 +- src/test/ui/issues/issue-15094.rs | 4 +- src/test/ui/issues/issue-15094.stderr | 4 +- src/test/ui/issues/issue-15783.rs | 4 +- src/test/ui/issues/issue-15783.stderr | 4 +- src/test/ui/issues/issue-15896.rs | 4 +- src/test/ui/issues/issue-15896.stderr | 4 +- src/test/ui/issues/issue-16338.rs | 2 +- src/test/ui/issues/issue-16338.stderr | 2 +- src/test/ui/issues/issue-16401.rs | 2 +- src/test/ui/issues/issue-16401.stderr | 2 +- src/test/ui/issues/issue-17033.rs | 2 +- src/test/ui/issues/issue-17033.stderr | 4 +- src/test/ui/issues/issue-17728.stderr | 4 +- src/test/ui/issues/issue-17740.rs | 8 +- src/test/ui/issues/issue-17740.stderr | 8 +- src/test/ui/issues/issue-17905-2.stderr | 8 +- src/test/ui/issues/issue-20225.stderr | 12 +- src/test/ui/issues/issue-21332.stderr | 4 +- src/test/ui/issues/issue-23589.stderr | 4 +- src/test/ui/issues/issue-24036.stderr | 6 +- src/test/ui/issues/issue-24204.stderr | 4 +- src/test/ui/issues/issue-24322.stderr | 4 +- src/test/ui/issues/issue-24819.stderr | 4 +- src/test/ui/issues/issue-27008.rs | 4 +- src/test/ui/issues/issue-27008.stderr | 2 +- src/test/ui/issues/issue-29084.rs | 2 +- src/test/ui/issues/issue-29084.stderr | 4 +- src/test/ui/issues/issue-2951.rs | 4 +- src/test/ui/issues/issue-2951.stderr | 4 +- src/test/ui/issues/issue-30225.stderr | 4 +- src/test/ui/issues/issue-31173.rs | 2 +- src/test/ui/issues/issue-31173.stderr | 4 +- src/test/ui/issues/issue-32323.stderr | 4 +- src/test/ui/issues/issue-33504.stderr | 2 +- src/test/ui/issues/issue-33941.stderr | 8 +- src/test/ui/issues/issue-34334.stderr | 2 +- src/test/ui/issues/issue-35241.stderr | 4 +- src/test/ui/issues/issue-35869.stderr | 16 +- src/test/ui/issues/issue-3680.rs | 4 +- src/test/ui/issues/issue-3680.stderr | 4 +- src/test/ui/issues/issue-37026.stderr | 4 +- src/test/ui/issues/issue-37884.stderr | 4 +- src/test/ui/issues/issue-38940.stderr | 4 +- src/test/ui/issues/issue-39970.stderr | 4 +- src/test/ui/issues/issue-40000.stderr | 4 +- src/test/ui/issues/issue-40749.rs | 2 +- src/test/ui/issues/issue-40749.stderr | 2 +- src/test/ui/issues/issue-41742.stderr | 4 +- .../issues/issue-43420-no-over-suggest.stderr | 4 +- src/test/ui/issues/issue-4517.rs | 2 +- src/test/ui/issues/issue-4517.stderr | 2 +- src/test/ui/issues/issue-46112.stderr | 2 +- src/test/ui/issues/issue-46302.stderr | 4 +- ...-consider-borrowing-cast-or-binexpr.stderr | 8 +- src/test/ui/issues/issue-48364.stderr | 4 +- src/test/ui/issues/issue-48838.stderr | 2 +- src/test/ui/issues/issue-4968.rs | 2 +- src/test/ui/issues/issue-4968.stderr | 2 +- src/test/ui/issues/issue-50600.stderr | 2 +- src/test/ui/issues/issue-50688.stderr | 2 +- src/test/ui/issues/issue-5100.rs | 20 +- src/test/ui/issues/issue-5100.stderr | 20 +- ...1632-try-desugar-incompatible-types.stderr | 2 +- src/test/ui/issues/issue-5216.stderr | 8 +- src/test/ui/issues/issue-52533-1.stderr | 4 +- src/test/ui/issues/issue-53348.rs | 2 +- src/test/ui/issues/issue-53348.stderr | 4 +- src/test/ui/issues/issue-5358-1.rs | 4 +- src/test/ui/issues/issue-5358-1.stderr | 4 +- src/test/ui/issues/issue-53692.stderr | 8 +- src/test/ui/issues/issue-56943.stderr | 4 +- src/test/ui/issues/issue-57741-1.stderr | 8 +- src/test/ui/issues/issue-57741.stderr | 16 +- src/test/ui/issues/issue-59488.stderr | 12 +- src/test/ui/issues/issue-59756.stderr | 4 +- src/test/ui/issues/issue-61106.stderr | 4 +- src/test/ui/issues/issue-61882.stderr | 4 +- src/test/ui/issues/issue-6458-4.stderr | 2 +- src/test/ui/issues/issue-7061.rs | 4 +- src/test/ui/issues/issue-7061.stderr | 4 +- src/test/ui/issues/issue-7092.rs | 4 +- src/test/ui/issues/issue-7092.stderr | 4 +- src/test/ui/issues/issue-7867.rs | 4 +- src/test/ui/issues/issue-7867.stderr | 4 +- src/test/ui/issues/issue-9575.stderr | 4 +- .../ui/json-bom-plus-crlf-multifile.stderr | 16 +- src/test/ui/json-bom-plus-crlf.stderr | 16 +- .../lifetime-bound-will-change-warning.stderr | 8 +- src/test/ui/loops/loop-break-value.stderr | 10 +- src/test/ui/lub-glb/old-lub-glb-hr.stderr | 4 +- src/test/ui/lub-glb/old-lub-glb-object.stderr | 4 +- src/test/ui/main-wrong-type.stderr | 4 +- .../match/match-arm-resolving-to-never.stderr | 4 +- .../ui/match/match-ref-mut-invariance.stderr | 4 +- .../match/match-ref-mut-let-invariance.stderr | 4 +- src/test/ui/match/match-struct.rs | 4 +- src/test/ui/match/match-struct.stderr | 4 +- src/test/ui/match/match-tag-nullary.stderr | 4 +- src/test/ui/match/match-tag-unary.stderr | 4 +- src/test/ui/methods/method-self-arg-1.rs | 8 +- src/test/ui/methods/method-self-arg-1.stderr | 8 +- src/test/ui/mismatched_types/E0053.stderr | 8 +- src/test/ui/mismatched_types/abridged.stderr | 32 ++-- .../ui/mismatched_types/issue-19109.stderr | 4 +- .../ui/mismatched_types/issue-35030.stderr | 4 +- .../ui/mismatched_types/issue-38371.stderr | 12 +- .../overloaded-calls-bad.stderr | 4 +- .../trait-bounds-cant-coerce.stderr | 4 +- .../trait-impl-fn-incompatibility.stderr | 8 +- src/test/ui/mut/mut-cross-borrowing.stderr | 4 +- src/test/ui/mut/mut-pattern-mismatched.rs | 8 +- src/test/ui/mut/mut-pattern-mismatched.stderr | 8 +- .../call-fn-never-arg-wrong-type.stderr | 4 +- .../never_type/never-assign-wrong-type.stderr | 4 +- .../ui/nll/trait-associated-constant.stderr | 4 +- src/test/ui/noexporttypeexe.rs | 2 +- src/test/ui/noexporttypeexe.stderr | 2 +- ...ifetime-default-from-rptr-box-error.stderr | 4 +- ...time-default-from-rptr-struct-error.stderr | 4 +- .../object-lifetime-default-mybox.stderr | 4 +- .../or-patterns-syntactic-fail.stderr | 4 +- src/test/ui/parser/fn-arg-doc-comment.stderr | 12 +- .../ui/parser/lex-bad-char-literals-6.stderr | 4 +- src/test/ui/parser/numeric-lifetime.stderr | 4 +- src/test/ui/parser/pat-tuple-5.stderr | 4 +- src/test/ui/parser/recover-tuple.stderr | 4 +- ...truct-literal-restrictions-in-lamda.stderr | 2 +- .../parser/unclosed-delimiter-in-dep.stderr | 2 +- .../ui/pattern/pat-tuple-overfield.stderr | 8 +- src/test/ui/pattern/pattern-error-continue.rs | 4 +- .../ui/pattern/pattern-error-continue.stderr | 2 +- .../pattern-ident-path-generics.stderr | 4 +- src/test/ui/pattern/pattern-tyvar.stderr | 4 +- ...pe-err-cause-on-impl-trait-return-2.stderr | 4 +- .../attribute-spans-preserved.stderr | 8 +- .../ui/proc-macro/attribute-with-error.stderr | 16 +- src/test/ui/proc-macro/issue-37788.stderr | 2 +- .../ui/proc-macro/nested-item-spans.stderr | 8 +- src/test/ui/proc-macro/signature.stderr | 4 +- .../ui/proc-macro/span-preservation.stderr | 4 +- src/test/ui/ptr-coercion.rs | 12 +- src/test/ui/ptr-coercion.stderr | 12 +- .../ui/range/issue-54505-no-literals.stderr | 48 ++--- src/test/ui/range/issue-54505-no-std.stderr | 24 +-- src/test/ui/range/issue-54505.stderr | 24 +-- ...ons-fn-subtyping-return-static-fail.stderr | 8 +- ...on-invariant-static-error-reporting.stderr | 4 +- ...lifetime-bounds-on-fns-where-clause.stderr | 4 +- ...lifetime-bounds-on-fns-where-clause.stderr | 4 +- src/test/ui/regions/regions-bounds.stderr | 8 +- .../regions-fn-subtyping-return-static.stderr | 4 +- ...egions-infer-invariance-due-to-decl.stderr | 4 +- ...nfer-invariance-due-to-mutability-3.stderr | 4 +- ...nfer-invariance-due-to-mutability-4.stderr | 4 +- .../ui/regions/regions-infer-not-param.rs | 8 +- .../ui/regions/regions-infer-not-param.stderr | 12 +- .../regions/regions-infer-paramd-indirect.rs | 4 +- .../regions-infer-paramd-indirect.stderr | 4 +- .../regions-lifetime-bounds-on-fns.stderr | 4 +- src/test/ui/regions/regions-trait-1.stderr | 4 +- .../regions-trait-object-subtyping.stderr | 4 +- ...ns-variance-invariant-use-covariant.stderr | 4 +- src/test/ui/reify-intrinsic.stderr | 4 +- src/test/ui/reject-specialized-drops-8142.rs | 4 +- .../ui/reject-specialized-drops-8142.stderr | 4 +- src/test/ui/repeat_count.rs | 12 +- src/test/ui/repeat_count.stderr | 6 +- src/test/ui/resolve/name-clash-nullary.stderr | 2 +- src/test/ui/resolve/privacy-enum-ctor.stderr | 12 +- src/test/ui/retslot-cast.stderr | 4 +- .../ui/return/return-from-diverging.stderr | 4 +- src/test/ui/return/return-type.stderr | 2 +- .../const.stderr | 2 +- .../rfc-2005-default-binding-mode/lit.stderr | 8 +- .../uninhabited/coercions.stderr | 16 +- .../uninhabited/coercions_same_crate.stderr | 16 +- .../disallowed-positions.stderr | 74 +++---- src/test/ui/slice-mut.rs | 4 +- src/test/ui/slice-mut.stderr | 4 +- .../slightly-nice-generic-literal-messages.rs | 2 +- ...ghtly-nice-generic-literal-messages.stderr | 4 +- src/test/ui/span/coerce-suggestions.stderr | 18 +- src/test/ui/span/issue-33884.stderr | 4 +- src/test/ui/span/issue-34264.stderr | 4 +- src/test/ui/span/issue-39018.stderr | 4 +- src/test/ui/span/move-closure.stderr | 2 +- .../specialization-default-projection.stderr | 8 +- .../specialization-default-types.stderr | 8 +- .../ui/static/static-reference-to-fn-1.stderr | 4 +- src/test/ui/str/str-array-assignment.stderr | 12 +- src/test/ui/str/str-lit-type-mismatch.stderr | 12 +- .../ui/structs/struct-base-wrong-type.stderr | 16 +- .../struct-path-self-type-mismatch.stderr | 8 +- ...structure-constructor-type-mismatch.stderr | 12 +- src/test/ui/substs-ppaux.normal.stderr | 8 +- src/test/ui/substs-ppaux.rs | 16 +- src/test/ui/substs-ppaux.verbose.stderr | 8 +- src/test/ui/suggestions/as-ref.stderr | 28 +-- ...gest-deref-inside-macro-issue-58298.stderr | 4 +- .../fn-or-tuple-struct-without-args.stderr | 34 ++-- src/test/ui/suggestions/format-borrow.stderr | 8 +- src/test/ui/suggestions/issue-52820.stderr | 8 +- src/test/ui/suggestions/issue-59819.stderr | 10 +- .../ui/suggestions/match-ergonomics.stderr | 12 +- .../suggestions/mut-ref-reassignment.stderr | 16 +- .../ui/suggestions/opaque-type-error.stderr | 4 +- ...ecover-from-semicolon-trailing-item.stderr | 8 +- src/test/ui/suggestions/suggest-box.stderr | 4 +- src/test/ui/suppressed-error.rs | 2 +- src/test/ui/suppressed-error.stderr | 2 +- src/test/ui/switched-expectations.stderr | 4 +- .../ui/tag-that-dare-not-speak-its-name.rs | 2 +- .../tag-that-dare-not-speak-its-name.stderr | 2 +- src/test/ui/terr-in-field.rs | 4 +- src/test/ui/terr-in-field.stderr | 4 +- src/test/ui/terr-sorts.rs | 4 +- src/test/ui/terr-sorts.stderr | 4 +- src/test/ui/traits/trait-bounds-sugar.stderr | 4 +- .../ui/traits/trait-impl-method-mismatch.rs | 4 +- .../traits/trait-impl-method-mismatch.stderr | 4 +- .../ui/traits/trait-matching-lifetimes.stderr | 8 +- .../ui/try-block/try-block-bad-type.stderr | 4 +- src/test/ui/tuple/tuple-arity-mismatch.rs | 8 +- src/test/ui/tuple/tuple-arity-mismatch.stderr | 8 +- .../enum-variant-generic-args.stderr | 24 +-- ...priority-higher-than-other-inherent.stderr | 2 +- ...eric_type_does_not_live_long_enough.stderr | 4 +- .../type-alias-impl-trait/issue-63279.stderr | 4 +- .../never_reveal_concrete_type.stderr | 4 +- ...o_revealing_outside_defining_module.stderr | 8 +- .../ui/type/type-ascription-precedence.stderr | 24 +-- .../ui/type/type-ascription-soundness.stderr | 16 +- .../ui/type/type-mismatch-same-crate-name.rs | 8 +- .../type/type-mismatch-same-crate-name.stderr | 8 +- src/test/ui/type/type-mismatch.stderr | 180 +++++++++--------- src/test/ui/type/type-parameter-names.rs | 4 +- src/test/ui/type/type-parameter-names.stderr | 4 +- .../type/type-params-in-different-spaces-1.rs | 4 +- .../type-params-in-different-spaces-1.stderr | 4 +- .../type-params-in-different-spaces-3.stderr | 4 +- src/test/ui/type/type-shadow.stderr | 4 +- ...e-57673-ice-on-deref-of-boxed-trait.stderr | 2 +- .../typeck_type_placeholder_mismatch.rs | 8 +- .../typeck_type_placeholder_mismatch.stderr | 8 +- src/test/ui/ufcs/ufcs-explicit-self-bad.rs | 8 +- .../ui/ufcs/ufcs-explicit-self-bad.stderr | 16 +- .../ui/unboxed-closures/issue-30904.stderr | 24 +++ src/test/ui/unsafe/unsafe-subtyping.stderr | 4 +- src/test/ui/unsafe/unsafe-trait-impl.rs | 4 +- src/test/ui/unsafe/unsafe-trait-impl.stderr | 4 +- .../variance-btree-invariant-types.stderr | 48 ++--- .../variance-contravariant-arg-object.stderr | 8 +- .../variance-covariant-arg-object.stderr | 8 +- .../variance-invariant-arg-object.stderr | 8 +- ...variance-use-contravariant-struct-1.stderr | 4 +- .../variance-use-covariant-struct-1.stderr | 4 +- .../variance-use-invariant-struct-1.stderr | 8 +- .../ui/wf/wf-unsafe-trait-obj-match.stderr | 4 +- src/test/ui/while-type-error.stderr | 2 +- src/test/ui/wrong-mul-method-signature.stderr | 20 +- 406 files changed, 1602 insertions(+), 1522 deletions(-) create mode 100644 src/test/ui/unboxed-closures/issue-30904.stderr diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs index d0f6a8a434d67..caf9f7288b99f 100644 --- a/src/librustc/infer/error_reporting/mod.rs +++ b/src/librustc/infer/error_reporting/mod.rs @@ -1197,18 +1197,25 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { }; if let Some((expected, found)) = expected_found { + let expected_label = exp_found.map(|ef| ef.expected.prefix_string()) + .unwrap_or("type".into()); + let found_label = exp_found.map(|ef| ef.found.prefix_string()) + .unwrap_or("type".into()); match (terr, is_simple_error, expected == found) { - (&TypeError::Sorts(ref values), false, true) => { - let sort_string = | a_type: Ty<'tcx> | - if let ty::Opaque(def_id, _) = a_type.kind { - format!(" (opaque type at {})", self.tcx.sess.source_map() - .mk_substr_filename(self.tcx.def_span(def_id))) - } else { - format!(" ({})", a_type.sort_string(self.tcx)) - }; + (&TypeError::Sorts(ref values), false, extra) => { + let sort_string = |ty: Ty<'tcx>| match (extra, &ty.kind) { + (true, ty::Opaque(def_id, _)) => format!( + " (opaque type at {})", + self.tcx.sess.source_map() + .mk_substr_filename(self.tcx.def_span(*def_id)), + ), + (true, _) => format!(" ({})", ty.sort_string(self.tcx)), + (false, _) => "".to_string(), + }; diag.note_expected_found_extra( - &"type", + &expected_label, expected, + &found_label, found, &sort_string(values.expected), &sort_string(values.found), @@ -1222,15 +1229,14 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { "note_type_err: exp_found={:?}, expected={:?} found={:?}", exp_found, expected, found ); - if let Some(exp_found) = exp_found { - self.suggest_as_ref_where_appropriate(span, &exp_found, diag); - } - - diag.note_expected_found(&"type", expected, found); + diag.note_expected_found(&expected_label, expected, &found_label, found); } _ => (), } } + if let Some(exp_found) = exp_found { + self.suggest_as_ref_where_appropriate(span, &exp_found, diag); + } // In some (most?) cases cause.body_id points to actual body, but in some cases // it's a actual definition. According to the comments (e.g. in diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs index febea68ddbb51..8babd0584b334 100644 --- a/src/librustc/ty/error.rs +++ b/src/librustc/ty/error.rs @@ -246,6 +246,37 @@ impl<'tcx> ty::TyS<'tcx> { ty::Error => "type error".into(), } } + + pub fn prefix_string(&self) -> Cow<'static, str> { + debug!("prefix_string {:?} {} {:?}", self, self, self.kind); + match self.kind { + ty::Infer(_) | ty::Error | ty::Bool | ty::Char | ty::Int(_) | + ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => "type".into(), + ty::Tuple(ref tys) if tys.is_empty() => "type".into(), + ty::Adt(def, _) => def.descr().into(), + ty::Foreign(_) => "extern type".into(), + ty::Array(..) => "array".into(), + ty::Slice(_) => "slice".into(), + ty::RawPtr(_) => "raw pointer".into(), + ty::Ref(.., mutbl) => match mutbl { + hir::Mutability::Mutable => "mutable reference", + _ => "reference" + }.into(), + ty::FnDef(..) => "fn item".into(), + ty::FnPtr(_) => "fn pointer".into(), + ty::Dynamic(..) => "trait".into(), + ty::Closure(..) => "closure".into(), + ty::Generator(..) => "generator".into(), + ty::GeneratorWitness(..) => "generator witness".into(), + ty::Tuple(..) => "tuple".into(), + ty::Placeholder(..) => "placeholder type".into(), + ty::Bound(..) => "bound type".into(), + ty::Projection(_) => "associated type".into(), + ty::UnnormalizedProjection(_) => "associated type".into(), + ty::Param(_) => "type parameter".into(), + ty::Opaque(..) => "opaque type".into(), + } + } } impl<'tcx> TyCtxt<'tcx> { diff --git a/src/librustc_errors/diagnostic.rs b/src/librustc_errors/diagnostic.rs index 5a09898f18fbd..35da2d29da8dc 100644 --- a/src/librustc_errors/diagnostic.rs +++ b/src/librustc_errors/diagnostic.rs @@ -143,20 +143,21 @@ impl Diagnostic { self } - pub fn note_expected_found(&mut self, - label: &dyn fmt::Display, - expected: DiagnosticStyledString, - found: DiagnosticStyledString) - -> &mut Self - { - self.note_expected_found_extra(label, expected, found, &"", &"") - } - - pub fn note_unsuccessfull_coercion(&mut self, - expected: DiagnosticStyledString, - found: DiagnosticStyledString) - -> &mut Self - { + pub fn note_expected_found( + &mut self, + expected_label: &dyn fmt::Display, + expected: DiagnosticStyledString, + found_label: &dyn fmt::Display, + found: DiagnosticStyledString, + ) -> &mut Self { + self.note_expected_found_extra(expected_label, expected, found_label, found, &"", &"") + } + + pub fn note_unsuccessfull_coercion( + &mut self, + expected: DiagnosticStyledString, + found: DiagnosticStyledString, + ) -> &mut Self { let mut msg: Vec<_> = vec![(format!("required when trying to coerce from type `"), Style::NoStyle)]; @@ -178,27 +179,38 @@ impl Diagnostic { self } - pub fn note_expected_found_extra(&mut self, - label: &dyn fmt::Display, - expected: DiagnosticStyledString, - found: DiagnosticStyledString, - expected_extra: &dyn fmt::Display, - found_extra: &dyn fmt::Display) - -> &mut Self - { - let mut msg: Vec<_> = vec![(format!("expected {} `", label), Style::NoStyle)]; + pub fn note_expected_found_extra( + &mut self, + expected_label: &dyn fmt::Display, + expected: DiagnosticStyledString, + found_label: &dyn fmt::Display, + found: DiagnosticStyledString, + expected_extra: &dyn fmt::Display, + found_extra: &dyn fmt::Display, + ) -> &mut Self { + let expected_label = format!("expected {}", expected_label); + let found_label = format!("found {}", found_label); + let (found_padding, expected_padding) = if expected_label.len() > found_label.len() { + (expected_label.len() - found_label.len(), 0) + } else { + (0, found_label.len() - expected_label.len()) + }; + let mut msg: Vec<_> = vec![( + format!("{}{} `", " ".repeat(expected_padding), expected_label), + Style::NoStyle, + )]; msg.extend(expected.0.iter() - .map(|x| match *x { - StringPart::Normal(ref s) => (s.to_owned(), Style::NoStyle), - StringPart::Highlighted(ref s) => (s.to_owned(), Style::Highlight), - })); + .map(|x| match *x { + StringPart::Normal(ref s) => (s.to_owned(), Style::NoStyle), + StringPart::Highlighted(ref s) => (s.to_owned(), Style::Highlight), + })); msg.push((format!("`{}\n", expected_extra), Style::NoStyle)); - msg.push((format!(" found {} `", label), Style::NoStyle)); + msg.push((format!("{}{} `", " ".repeat(found_padding), found_label), Style::NoStyle)); msg.extend(found.0.iter() - .map(|x| match *x { - StringPart::Normal(ref s) => (s.to_owned(), Style::NoStyle), - StringPart::Highlighted(ref s) => (s.to_owned(), Style::Highlight), - })); + .map(|x| match *x { + StringPart::Normal(ref s) => (s.to_owned(), Style::NoStyle), + StringPart::Highlighted(ref s) => (s.to_owned(), Style::Highlight), + })); msg.push((format!("`{}", found_extra), Style::NoStyle)); // For now, just attach these as notes diff --git a/src/librustc_errors/diagnostic_builder.rs b/src/librustc_errors/diagnostic_builder.rs index 40642dd14b8f7..a95c29f8c2729 100644 --- a/src/librustc_errors/diagnostic_builder.rs +++ b/src/librustc_errors/diagnostic_builder.rs @@ -195,37 +195,44 @@ impl<'a> DiagnosticBuilder<'a> { self } - forward!(pub fn note_expected_found(&mut self, - label: &dyn fmt::Display, - expected: DiagnosticStyledString, - found: DiagnosticStyledString, - ) -> &mut Self); - - forward!(pub fn note_expected_found_extra(&mut self, - label: &dyn fmt::Display, - expected: DiagnosticStyledString, - found: DiagnosticStyledString, - expected_extra: &dyn fmt::Display, - found_extra: &dyn fmt::Display, - ) -> &mut Self); - - forward!(pub fn note_unsuccessfull_coercion(&mut self, - expected: DiagnosticStyledString, - found: DiagnosticStyledString, - ) -> &mut Self); + forward!(pub fn note_expected_found( + &mut self, + expected_label: &dyn fmt::Display, + expected: DiagnosticStyledString, + found_label: &dyn fmt::Display, + found: DiagnosticStyledString, + ) -> &mut Self); + + forward!(pub fn note_expected_found_extra( + &mut self, + expected_label: &dyn fmt::Display, + expected: DiagnosticStyledString, + found_label: &dyn fmt::Display, + found: DiagnosticStyledString, + expected_extra: &dyn fmt::Display, + found_extra: &dyn fmt::Display, + ) -> &mut Self); + + forward!(pub fn note_unsuccessfull_coercion( + &mut self, + expected: DiagnosticStyledString, + found: DiagnosticStyledString, + ) -> &mut Self); forward!(pub fn note(&mut self, msg: &str) -> &mut Self); - forward!(pub fn span_note>(&mut self, - sp: S, - msg: &str, - ) -> &mut Self); + forward!(pub fn span_note>( + &mut self, + sp: S, + msg: &str, + ) -> &mut Self); forward!(pub fn warn(&mut self, msg: &str) -> &mut Self); forward!(pub fn span_warn>(&mut self, sp: S, msg: &str) -> &mut Self); forward!(pub fn help(&mut self, msg: &str) -> &mut Self); - forward!(pub fn span_help>(&mut self, - sp: S, - msg: &str, - ) -> &mut Self); + forward!(pub fn span_help>( + &mut self, + sp: S, + msg: &str, + ) -> &mut Self); pub fn multipart_suggestion( &mut self, diff --git a/src/test/ui/array-break-length.stderr b/src/test/ui/array-break-length.stderr index 45f529bafe728..1fbbb0e79bbf0 100644 --- a/src/test/ui/array-break-length.stderr +++ b/src/test/ui/array-break-length.stderr @@ -17,7 +17,7 @@ LL | |_: [_; break]| {} | ^^^^^^^^^^^^^^^^^^ expected (), found closure | = note: expected type `()` - found type `[closure@$DIR/array-break-length.rs:3:9: 3:27]` + found closure `[closure@$DIR/array-break-length.rs:3:9: 3:27]` error[E0308]: mismatched types --> $DIR/array-break-length.rs:8:9 @@ -26,7 +26,7 @@ LL | |_: [_; continue]| {} | ^^^^^^^^^^^^^^^^^^^^^ expected (), found closure | = note: expected type `()` - found type `[closure@$DIR/array-break-length.rs:8:9: 8:30]` + found closure `[closure@$DIR/array-break-length.rs:8:9: 8:30]` error: aborting due to 4 previous errors diff --git a/src/test/ui/array-not-vector.rs b/src/test/ui/array-not-vector.rs index 80b40ef25c3e0..838951c7c1d48 100644 --- a/src/test/ui/array-not-vector.rs +++ b/src/test/ui/array-not-vector.rs @@ -2,13 +2,13 @@ fn main() { let _x: i32 = [1, 2, 3]; //~^ ERROR mismatched types //~| expected type `i32` - //~| found type `[{integer}; 3]` + //~| found array `[{integer}; 3]` //~| expected i32, found array of 3 elements let x: &[i32] = &[1, 2, 3]; let _y: &i32 = x; //~^ ERROR mismatched types - //~| expected type `&i32` - //~| found type `&[i32]` + //~| expected reference `&i32` + //~| found reference `&[i32]` //~| expected i32, found slice } diff --git a/src/test/ui/array-not-vector.stderr b/src/test/ui/array-not-vector.stderr index b5a5389db093a..2a2fbe6660a35 100644 --- a/src/test/ui/array-not-vector.stderr +++ b/src/test/ui/array-not-vector.stderr @@ -5,7 +5,7 @@ LL | let _x: i32 = [1, 2, 3]; | ^^^^^^^^^ expected i32, found array of 3 elements | = note: expected type `i32` - found type `[{integer}; 3]` + found array `[{integer}; 3]` error[E0308]: mismatched types --> $DIR/array-not-vector.rs:9:20 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let _y: &i32 = x; | ^ expected i32, found slice | - = note: expected type `&i32` - found type `&[i32]` + = note: expected reference `&i32` + found reference `&[i32]` error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-const/associated-const-generic-obligations.stderr b/src/test/ui/associated-const/associated-const-generic-obligations.stderr index ca6118cb3ba98..6a48bbabe1078 100644 --- a/src/test/ui/associated-const/associated-const-generic-obligations.stderr +++ b/src/test/ui/associated-const/associated-const-generic-obligations.stderr @@ -7,8 +7,8 @@ LL | const FROM: Self::Out; LL | const FROM: &'static str = "foo"; | ^^^^^^^^^^^^ expected associated type, found reference | - = note: expected type `::Out` - found type `&'static str` + = note: expected associated type `::Out` + found reference `&'static str` = note: consider constraining the associated type `::Out` to `&'static str` or calling a method that returns `::Out` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html diff --git a/src/test/ui/associated-const/associated-const-impl-wrong-lifetime.stderr b/src/test/ui/associated-const/associated-const-impl-wrong-lifetime.stderr index 2ceab394e9558..0cce10b54a4a9 100644 --- a/src/test/ui/associated-const/associated-const-impl-wrong-lifetime.stderr +++ b/src/test/ui/associated-const/associated-const-impl-wrong-lifetime.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | const NAME: &'a str = "unit"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch | - = note: expected type `&'static str` - found type `&'a str` + = note: expected reference `&'static str` + found reference `&'a str` note: the lifetime `'a` as defined on the impl at 6:6... --> $DIR/associated-const-impl-wrong-lifetime.rs:6:6 | diff --git a/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr b/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr index 4ba4925ef1b37..483c7e7707e4f 100644 --- a/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr +++ b/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | fn b() { dent(ModelT, Blue); } | ^^^^ expected struct `Black`, found struct `Blue` | - = note: expected type `Black` - found type `Blue` + = note: expected struct `Black` + found struct `Blue` error[E0308]: mismatched types --> $DIR/associated-type-projection-from-supertrait.rs:28:23 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | fn c() { dent(ModelU, Black); } | ^^^^^ expected struct `Blue`, found struct `Black` | - = note: expected type `Blue` - found type `Black` + = note: expected struct `Blue` + found struct `Black` error[E0308]: mismatched types --> $DIR/associated-type-projection-from-supertrait.rs:32:28 @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | fn f() { ModelT.chip_paint(Blue); } | ^^^^ expected struct `Black`, found struct `Blue` | - = note: expected type `Black` - found type `Blue` + = note: expected struct `Black` + found struct `Blue` error[E0308]: mismatched types --> $DIR/associated-type-projection-from-supertrait.rs:33:28 @@ -31,8 +31,8 @@ error[E0308]: mismatched types LL | fn g() { ModelU.chip_paint(Black); } | ^^^^^ expected struct `Blue`, found struct `Black` | - = note: expected type `Blue` - found type `Black` + = note: expected struct `Blue` + found struct `Black` error: aborting due to 4 previous errors diff --git a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr index 800b762911a62..6443de5878181 100644 --- a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr +++ b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr @@ -7,8 +7,8 @@ LL | fn blue_car>(c: C) { LL | fn b() { blue_car(ModelT); } | ^^^^^^^^ expected struct `Blue`, found struct `Black` | - = note: expected type `Blue` - found type `Black` + = note: expected struct `Blue` + found struct `Black` error[E0271]: type mismatch resolving `::Color == Black` --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:32:10 @@ -19,8 +19,8 @@ LL | fn black_car>(c: C) { LL | fn c() { black_car(ModelU); } | ^^^^^^^^^ expected struct `Black`, found struct `Blue` | - = note: expected type `Black` - found type `Blue` + = note: expected struct `Black` + found struct `Blue` error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/associated-types-eq-3.rs b/src/test/ui/associated-types/associated-types-eq-3.rs index 22e04a8f15ca8..2bc302914a5bb 100644 --- a/src/test/ui/associated-types/associated-types-eq-3.rs +++ b/src/test/ui/associated-types/associated-types-eq-3.rs @@ -22,9 +22,9 @@ fn foo1>(x: I) { fn foo2(x: I) { let _: Bar = x.boo(); //~^ ERROR mismatched types - //~| expected type `Bar` - //~| found type `::A` + //~| found associated type `::A` //~| expected struct `Bar`, found associated type + //~| expected struct `Bar` } diff --git a/src/test/ui/associated-types/associated-types-eq-3.stderr b/src/test/ui/associated-types/associated-types-eq-3.stderr index 0f2bc84aa1c59..88910f6de2a3a 100644 --- a/src/test/ui/associated-types/associated-types-eq-3.stderr +++ b/src/test/ui/associated-types/associated-types-eq-3.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: Bar = x.boo(); | ^^^^^^^ expected struct `Bar`, found associated type | - = note: expected type `Bar` - found type `::A` + = note: expected struct `Bar` + found associated type `::A` = note: consider constraining the associated type `::A` to `Bar` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html @@ -18,8 +18,8 @@ LL | fn foo1>(x: I) { LL | foo1(a); | ^^^^ expected struct `Bar`, found usize | - = note: expected type `Bar` - found type `usize` + = note: expected struct `Bar` + found type `usize` error[E0271]: type mismatch resolving `::A == Bar` --> $DIR/associated-types-eq-3.rs:41:9 @@ -27,8 +27,8 @@ error[E0271]: type mismatch resolving `::A == Bar` LL | baz(&a); | ^^ expected struct `Bar`, found usize | - = note: expected type `Bar` - found type `usize` + = note: expected struct `Bar` + found type `usize` = note: required for the cast to the object type `dyn Foo` error: aborting due to 3 previous errors diff --git a/src/test/ui/associated-types/associated-types-eq-hr.stderr b/src/test/ui/associated-types/associated-types-eq-hr.stderr index a8c239389e977..6ed91b9ff473f 100644 --- a/src/test/ui/associated-types/associated-types-eq-hr.stderr +++ b/src/test/ui/associated-types/associated-types-eq-hr.stderr @@ -9,8 +9,8 @@ LL | where T : for<'x> TheTrait<&'x isize, A = &'x isize> LL | foo::(); | ^^^^^^^^^^^^^^^^^ expected isize, found usize | - = note: expected type `&isize` - found type `&usize` + = note: expected reference `&isize` + found reference `&usize` error[E0271]: type mismatch resolving `for<'x> >::A == &'x usize` --> $DIR/associated-types-eq-hr.rs:86:5 @@ -23,8 +23,8 @@ LL | where T : for<'x> TheTrait<&'x isize, A = &'x usize> LL | bar::(); | ^^^^^^^^^^^^^^^^ expected usize, found isize | - = note: expected type `&usize` - found type `&isize` + = note: expected reference `&usize` + found reference `&isize` error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize)>` is not satisfied --> $DIR/associated-types-eq-hr.rs:91:17 diff --git a/src/test/ui/associated-types/associated-types-issue-20346.stderr b/src/test/ui/associated-types/associated-types-issue-20346.stderr index f5053f6a1c0c8..cebcae44fd00c 100644 --- a/src/test/ui/associated-types/associated-types-issue-20346.stderr +++ b/src/test/ui/associated-types/associated-types-issue-20346.stderr @@ -10,7 +10,7 @@ LL | fn test_adapter>>(it: I) { LL | is_iterator_of::, _>(&adapter); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `std::option::Option`, found type parameter `T` | - = note: expected type `std::option::Option` + = note: expected enum `std::option::Option` found type `T` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr b/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr index e3a2b5edf3f1b..69596fa4b9038 100644 --- a/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr +++ b/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr @@ -7,8 +7,8 @@ LL | want_y(t); LL | fn want_y>(t: &T) { } | ------ ----- required by this bound in `want_y` | - = note: expected type `i32` - found type `::Y` + = note: expected type `i32` + found associated type `::Y` = note: consider constraining the associated type `::Y` to `i32` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html @@ -21,8 +21,8 @@ LL | want_x(t); LL | fn want_x>(t: &T) { } | ------ ----- required by this bound in `want_x` | - = note: expected type `u32` - found type `::X` + = note: expected type `u32` + found associated type `::X` = note: consider constraining the associated type `::X` to `u32` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html diff --git a/src/test/ui/associated-types/issue-44153.stderr b/src/test/ui/associated-types/issue-44153.stderr index b62a866a20be3..556fd0766c2eb 100644 --- a/src/test/ui/associated-types/issue-44153.stderr +++ b/src/test/ui/associated-types/issue-44153.stderr @@ -7,8 +7,8 @@ LL | fn visit() {} LL | <() as Visit>::visit(); | ^^^^^^^^^^^^^^^^^^^^ expected (), found &() | - = note: expected type `()` - found type `&()` + = note: expected type `()` + found reference `&()` = note: required because of the requirements on the impl of `Visit` for `()` error: aborting due to previous error diff --git a/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr b/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr index 6bef9dca265e7..bdfa0443f8cc9 100644 --- a/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr +++ b/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr @@ -73,7 +73,7 @@ LL | fn rethrow_targets_async_block_not_fn() -> Result { | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected type `std::result::Result` + = note: expected enum `std::result::Result` found type `()` error[E0308]: mismatched types @@ -84,7 +84,7 @@ LL | fn rethrow_targets_async_block_not_async_fn() -> Result { | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected type `std::result::Result` + = note: expected enum `std::result::Result` found type `()` error: aborting due to 8 previous errors diff --git a/src/test/ui/async-await/dont-suggest-missing-await.stderr b/src/test/ui/async-await/dont-suggest-missing-await.stderr index c87e0bc221de7..6f3d10d08686a 100644 --- a/src/test/ui/async-await/dont-suggest-missing-await.stderr +++ b/src/test/ui/async-await/dont-suggest-missing-await.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | take_u32(x) | ^ expected u32, found opaque type | - = note: expected type `u32` - found type `impl std::future::Future` + = note: expected type `u32` + found opaque type `impl std::future::Future` error: aborting due to previous error diff --git a/src/test/ui/async-await/suggest-missing-await-closure.stderr b/src/test/ui/async-await/suggest-missing-await-closure.stderr index 487ca6c0fc57c..56d2682636637 100644 --- a/src/test/ui/async-await/suggest-missing-await-closure.stderr +++ b/src/test/ui/async-await/suggest-missing-await-closure.stderr @@ -7,8 +7,8 @@ LL | take_u32(x) | expected u32, found opaque type | help: consider using `.await` here: `x.await` | - = note: expected type `u32` - found type `impl std::future::Future` + = note: expected type `u32` + found opaque type `impl std::future::Future` error: aborting due to previous error diff --git a/src/test/ui/async-await/suggest-missing-await.stderr b/src/test/ui/async-await/suggest-missing-await.stderr index ccca97ec204b4..e44438bfa58d8 100644 --- a/src/test/ui/async-await/suggest-missing-await.stderr +++ b/src/test/ui/async-await/suggest-missing-await.stderr @@ -7,8 +7,8 @@ LL | take_u32(x) | expected u32, found opaque type | help: consider using `.await` here: `x.await` | - = note: expected type `u32` - found type `impl std::future::Future` + = note: expected type `u32` + found opaque type `impl std::future::Future` error: aborting due to previous error diff --git a/src/test/ui/bad/bad-const-type.rs b/src/test/ui/bad/bad-const-type.rs index 8121929e09675..aacc796e2a84a 100644 --- a/src/test/ui/bad/bad-const-type.rs +++ b/src/test/ui/bad/bad-const-type.rs @@ -1,6 +1,6 @@ static i: String = 10; //~^ ERROR mismatched types -//~| expected type `std::string::String` -//~| found type `{integer}` //~| expected struct `std::string::String`, found integer +//~| expected struct `std::string::String` +//~| found type `{integer}` fn main() { println!("{}", i); } diff --git a/src/test/ui/bad/bad-const-type.stderr b/src/test/ui/bad/bad-const-type.stderr index 677dc72652e92..d3da6bd771897 100644 --- a/src/test/ui/bad/bad-const-type.stderr +++ b/src/test/ui/bad/bad-const-type.stderr @@ -7,8 +7,8 @@ LL | static i: String = 10; | expected struct `std::string::String`, found integer | help: try using a conversion method: `10.to_string()` | - = note: expected type `std::string::String` - found type `{integer}` + = note: expected struct `std::string::String` + found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/bad/bad-expr-path.stderr b/src/test/ui/bad/bad-expr-path.stderr index 15ac7f2b86f59..faba9911f866e 100644 --- a/src/test/ui/bad/bad-expr-path.stderr +++ b/src/test/ui/bad/bad-expr-path.stderr @@ -22,8 +22,8 @@ error[E0580]: main function has wrong type LL | fn main(arguments: Vec) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters | - = note: expected type `fn()` - found type `fn(std::vec::Vec)` + = note: expected fn pointer `fn()` + found fn pointer `fn(std::vec::Vec)` error: aborting due to 4 previous errors diff --git a/src/test/ui/bad/bad-expr-path2.stderr b/src/test/ui/bad/bad-expr-path2.stderr index 45723168f197b..53b6d35e8f3a2 100644 --- a/src/test/ui/bad/bad-expr-path2.stderr +++ b/src/test/ui/bad/bad-expr-path2.stderr @@ -22,8 +22,8 @@ error[E0580]: main function has wrong type LL | fn main(arguments: Vec) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters | - = note: expected type `fn()` - found type `fn(std::vec::Vec)` + = note: expected fn pointer `fn()` + found fn pointer `fn(std::vec::Vec)` error: aborting due to 4 previous errors diff --git a/src/test/ui/bad/bad-main.stderr b/src/test/ui/bad/bad-main.stderr index c7f15e7a4fa50..1e57c2488e9ef 100644 --- a/src/test/ui/bad/bad-main.stderr +++ b/src/test/ui/bad/bad-main.stderr @@ -4,8 +4,8 @@ error[E0580]: main function has wrong type LL | fn main(x: isize) { } | ^^^^^^^^^^^^^^^^^ incorrect number of function parameters | - = note: expected type `fn()` - found type `fn(isize)` + = note: expected fn pointer `fn()` + found fn pointer `fn(isize)` error: aborting due to previous error diff --git a/src/test/ui/blind/blind-item-block-middle.stderr b/src/test/ui/blind/blind-item-block-middle.stderr index 389b63c0adf93..8e6e754df5b21 100644 --- a/src/test/ui/blind/blind-item-block-middle.stderr +++ b/src/test/ui/blind/blind-item-block-middle.stderr @@ -5,7 +5,7 @@ LL | let bar = 5; | ^^^ expected integer, found struct `foo::bar` | = note: expected type `{integer}` - found type `foo::bar` + found struct `foo::bar` error: aborting due to previous error diff --git a/src/test/ui/block-result/consider-removing-last-semi.stderr b/src/test/ui/block-result/consider-removing-last-semi.stderr index f4984ca446309..b028bfd520323 100644 --- a/src/test/ui/block-result/consider-removing-last-semi.stderr +++ b/src/test/ui/block-result/consider-removing-last-semi.stderr @@ -9,8 +9,8 @@ LL | 0u8; LL | "bla".to_string(); | - help: consider removing this semicolon | - = note: expected type `std::string::String` - found type `()` + = note: expected struct `std::string::String` + found type `()` error[E0308]: mismatched types --> $DIR/consider-removing-last-semi.rs:6:11 @@ -23,8 +23,8 @@ LL | "this won't work".to_string(); LL | "removeme".to_string(); | - help: consider removing this semicolon | - = note: expected type `std::string::String` - found type `()` + = note: expected struct `std::string::String` + found type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-13428.stderr b/src/test/ui/block-result/issue-13428.stderr index f7cafab3d773b..f7b24ddbf55b9 100644 --- a/src/test/ui/block-result/issue-13428.stderr +++ b/src/test/ui/block-result/issue-13428.stderr @@ -9,8 +9,8 @@ LL | fn foo() -> String { LL | ; | - help: consider removing this semicolon | - = note: expected type `std::string::String` - found type `()` + = note: expected struct `std::string::String` + found type `()` error[E0308]: mismatched types --> $DIR/issue-13428.rs:11:13 @@ -23,8 +23,8 @@ LL | "foobar".to_string() LL | ; | - help: consider removing this semicolon | - = note: expected type `std::string::String` - found type `()` + = note: expected struct `std::string::String` + found type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-13624.rs b/src/test/ui/block-result/issue-13624.rs index 7b6a0775e1629..0eeaa77163110 100644 --- a/src/test/ui/block-result/issue-13624.rs +++ b/src/test/ui/block-result/issue-13624.rs @@ -6,9 +6,9 @@ mod a { pub fn get_enum_struct_variant() -> () { Enum::EnumStructVariant { x: 1, y: 2, z: 3 } //~^ ERROR mismatched types - //~| expected type `()` - //~| found type `a::Enum` //~| expected (), found enum `a::Enum` + //~| expected type `()` + //~| found enum `a::Enum` } } @@ -21,9 +21,9 @@ mod b { match enum_struct_variant { a::Enum::EnumStructVariant { x, y, z } => { //~^ ERROR mismatched types - //~| expected type `()` - //~| found type `a::Enum` //~| expected (), found enum `a::Enum` + //~| expected type `()` + //~| found enum `a::Enum` } } } diff --git a/src/test/ui/block-result/issue-13624.stderr b/src/test/ui/block-result/issue-13624.stderr index 417667a5354fd..81daff5b5cccc 100644 --- a/src/test/ui/block-result/issue-13624.stderr +++ b/src/test/ui/block-result/issue-13624.stderr @@ -7,7 +7,7 @@ LL | Enum::EnumStructVariant { x: 1, y: 2, z: 3 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum` | = note: expected type `()` - found type `a::Enum` + found enum `a::Enum` error[E0308]: mismatched types --> $DIR/issue-13624.rs:22:9 @@ -18,7 +18,7 @@ LL | a::Enum::EnumStructVariant { x, y, z } => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum` | = note: expected type `()` - found type `a::Enum` + found enum `a::Enum` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-20862.stderr b/src/test/ui/block-result/issue-20862.stderr index 6dc17815facd5..bcbc9b711adf6 100644 --- a/src/test/ui/block-result/issue-20862.stderr +++ b/src/test/ui/block-result/issue-20862.stderr @@ -7,7 +7,7 @@ LL | |y| x + y | ^^^^^^^^^ expected (), found closure | = note: expected type `()` - found type `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]` + found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]` error[E0618]: expected function, found `()` --> $DIR/issue-20862.rs:7:13 diff --git a/src/test/ui/block-result/issue-22645.stderr b/src/test/ui/block-result/issue-22645.stderr index d2ec0dc06bd80..379553b9e0d97 100644 --- a/src/test/ui/block-result/issue-22645.stderr +++ b/src/test/ui/block-result/issue-22645.stderr @@ -18,7 +18,7 @@ LL | b + 3 | ^^^^^ expected (), found struct `Bob` | = note: expected type `()` - found type `Bob` + found struct `Bob` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-5500.rs b/src/test/ui/block-result/issue-5500.rs index 5a549bb07ea33..0df7533e38da6 100644 --- a/src/test/ui/block-result/issue-5500.rs +++ b/src/test/ui/block-result/issue-5500.rs @@ -2,6 +2,6 @@ fn main() { &panic!() //~^ ERROR mismatched types //~| expected type `()` - //~| found type `&_` + //~| found reference `&_` //~| expected (), found reference } diff --git a/src/test/ui/block-result/issue-5500.stderr b/src/test/ui/block-result/issue-5500.stderr index 6a13b31fe932f..27e492837248b 100644 --- a/src/test/ui/block-result/issue-5500.stderr +++ b/src/test/ui/block-result/issue-5500.stderr @@ -9,8 +9,8 @@ LL | &panic!() | expected (), found reference | help: consider removing the borrow: `panic!()` | - = note: expected type `()` - found type `&_` + = note: expected type `()` + found reference `&_` error: aborting due to previous error diff --git a/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr b/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr index 52d43eae658ae..421c57fc74a0f 100644 --- a/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr +++ b/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr @@ -22,8 +22,8 @@ error[E0308]: method not compatible with trait LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch | - = note: expected type `fn(&'a isize, Inv<'c>, Inv<'c>, Inv<'d>)` - found type `fn(&'a isize, Inv<'_>, Inv<'c>, Inv<'d>)` + = note: expected fn pointer `fn(&'a isize, Inv<'c>, Inv<'c>, Inv<'d>)` + found fn pointer `fn(&'a isize, Inv<'_>, Inv<'c>, Inv<'d>)` note: the lifetime `'c` as defined on the method body at 27:24... --> $DIR/regions-bound-missing-bound-in-impl.rs:27:24 | diff --git a/src/test/ui/c-variadic/variadic-ffi-1.stderr b/src/test/ui/c-variadic/variadic-ffi-1.stderr index 73f72a177bcaa..3d1710648daa2 100644 --- a/src/test/ui/c-variadic/variadic-ffi-1.stderr +++ b/src/test/ui/c-variadic/variadic-ffi-1.stderr @@ -28,8 +28,8 @@ error[E0308]: mismatched types LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo; | ^^^ expected non-variadic fn, found variadic function | - = note: expected type `unsafe extern "C" fn(isize, u8)` - found type `unsafe extern "C" fn(isize, u8, ...) {foo}` + = note: expected fn pointer `unsafe extern "C" fn(isize, u8)` + found fn item `unsafe extern "C" fn(isize, u8, ...) {foo}` error[E0308]: mismatched types --> $DIR/variadic-ffi-1.rs:20:54 @@ -37,8 +37,8 @@ error[E0308]: mismatched types LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar; | ^^^ expected variadic fn, found non-variadic function | - = note: expected type `extern "C" fn(isize, u8, ...)` - found type `extern "C" fn(isize, u8) {bar}` + = note: expected fn pointer `extern "C" fn(isize, u8, ...)` + found fn item `extern "C" fn(isize, u8) {bar}` error[E0617]: can't pass `f32` to variadic function --> $DIR/variadic-ffi-1.rs:22:19 diff --git a/src/test/ui/c-variadic/variadic-ffi-4.stderr b/src/test/ui/c-variadic/variadic-ffi-4.stderr index 05535659161b8..c80ed5ebf5cef 100644 --- a/src/test/ui/c-variadic/variadic-ffi-4.stderr +++ b/src/test/ui/c-variadic/variadic-ffi-4.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | ap | ^^ lifetime mismatch | - = note: expected type `core::ffi::VaListImpl<'f>` - found type `core::ffi::VaListImpl<'_>` + = note: expected struct `core::ffi::VaListImpl<'f>` + found struct `core::ffi::VaListImpl<'_>` note: the scope of call-site for function at 7:78... --> $DIR/variadic-ffi-4.rs:7:78 | @@ -26,8 +26,8 @@ error[E0308]: mismatched types LL | ap | ^^ lifetime mismatch | - = note: expected type `core::ffi::VaListImpl<'static>` - found type `core::ffi::VaListImpl<'_>` + = note: expected struct `core::ffi::VaListImpl<'static>` + found struct `core::ffi::VaListImpl<'_>` note: the scope of call-site for function at 11:79... --> $DIR/variadic-ffi-4.rs:11:79 | @@ -69,8 +69,8 @@ error[E0308]: mismatched types LL | *ap0 = ap1; | ^^^ lifetime mismatch | - = note: expected type `core::ffi::VaListImpl<'_>` - found type `core::ffi::VaListImpl<'_>` + = note: expected struct `core::ffi::VaListImpl<'_>` + found struct `core::ffi::VaListImpl<'_>` note: the scope of call-site for function at 19:87... --> $DIR/variadic-ffi-4.rs:19:87 | @@ -121,8 +121,8 @@ error[E0308]: mismatched types LL | ap0 = &mut ap1; | ^^^^^^^^ lifetime mismatch | - = note: expected type `&mut core::ffi::VaListImpl<'_>` - found type `&mut core::ffi::VaListImpl<'_>` + = note: expected mutable reference `&mut core::ffi::VaListImpl<'_>` + found mutable reference `&mut core::ffi::VaListImpl<'_>` note: the scope of call-site for function at 23:83... --> $DIR/variadic-ffi-4.rs:23:83 | @@ -189,8 +189,8 @@ error[E0308]: mismatched types LL | *ap0 = ap1.clone(); | ^^^^^^^^^^^ lifetime mismatch | - = note: expected type `core::ffi::VaListImpl<'_>` - found type `core::ffi::VaListImpl<'_>` + = note: expected struct `core::ffi::VaListImpl<'_>` + found struct `core::ffi::VaListImpl<'_>` note: the scope of call-site for function at 30:87... --> $DIR/variadic-ffi-4.rs:30:87 | diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr index 8af7f882cc299..a15444207f5cd 100644 --- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr +++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); | ^^^^^^^^^^^ lifetime mismatch | - = note: expected type `fn(&u32)` - found type `fn(&'x u32)` + = note: expected fn pointer `fn(&u32)` + found fn pointer `fn(&'x u32)` note: the anonymous lifetime #2 defined on the body at 14:48... --> $DIR/expect-fn-supply-fn.rs:14:48 | @@ -23,8 +23,8 @@ error[E0308]: mismatched types LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); | ^^^^^^^^^^^ lifetime mismatch | - = note: expected type `fn(&u32)` - found type `fn(&'x u32)` + = note: expected fn pointer `fn(&u32)` + found fn pointer `fn(&'x u32)` note: the lifetime `'x` as defined on the function body at 11:36... --> $DIR/expect-fn-supply-fn.rs:11:36 | diff --git a/src/test/ui/closures/closure-array-break-length.stderr b/src/test/ui/closures/closure-array-break-length.stderr index 18da4a94e6f05..44c9ee3357560 100644 --- a/src/test/ui/closures/closure-array-break-length.stderr +++ b/src/test/ui/closures/closure-array-break-length.stderr @@ -23,7 +23,7 @@ LL | while |_: [_; continue]| {} {} | ^^^^^^^^^^^^^^^^^^^^^ expected bool, found closure | = note: expected type `bool` - found type `[closure@$DIR/closure-array-break-length.rs:4:11: 4:32]` + found closure `[closure@$DIR/closure-array-break-length.rs:4:11: 4:32]` error[E0308]: mismatched types --> $DIR/closure-array-break-length.rs:7:11 @@ -32,7 +32,7 @@ LL | while |_: [_; break]| {} {} | ^^^^^^^^^^^^^^^^^^ expected bool, found closure | = note: expected type `bool` - found type `[closure@$DIR/closure-array-break-length.rs:7:11: 7:29]` + found closure `[closure@$DIR/closure-array-break-length.rs:7:11: 7:29]` error: aborting due to 5 previous errors diff --git a/src/test/ui/closures/closure-expected-type/expect-region-supply-region.stderr b/src/test/ui/closures/closure-expected-type/expect-region-supply-region.stderr index 9f74738315a0a..eb860f9aef243 100644 --- a/src/test/ui/closures/closure-expected-type/expect-region-supply-region.stderr +++ b/src/test/ui/closures/closure-expected-type/expect-region-supply-region.stderr @@ -24,8 +24,8 @@ error[E0308]: mismatched types LL | closure_expecting_bound(|x: &'x u32| { | ^^^^^^^ lifetime mismatch | - = note: expected type `&u32` - found type `&'x u32` + = note: expected reference `&u32` + found reference `&'x u32` note: the anonymous lifetime #2 defined on the body at 37:29... --> $DIR/expect-region-supply-region.rs:37:29 | @@ -50,8 +50,8 @@ error[E0308]: mismatched types LL | closure_expecting_bound(|x: &'x u32| { | ^^^^^^^ lifetime mismatch | - = note: expected type `&u32` - found type `&'x u32` + = note: expected reference `&u32` + found reference `&'x u32` note: the lifetime `'x` as defined on the function body at 32:30... --> $DIR/expect-region-supply-region.rs:32:30 | diff --git a/src/test/ui/closures/closure-no-fn-1.stderr b/src/test/ui/closures/closure-no-fn-1.stderr index 6d07c6b035ee4..9945530a5a7fe 100644 --- a/src/test/ui/closures/closure-no-fn-1.stderr +++ b/src/test/ui/closures/closure-no-fn-1.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let foo: fn(u8) -> u8 = |v: u8| { a += v; a }; | ^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found closure | - = note: expected type `fn(u8) -> u8` - found type `[closure@$DIR/closure-no-fn-1.rs:6:29: 6:50 a:_]` + = note: expected fn pointer `fn(u8) -> u8` + found closure `[closure@$DIR/closure-no-fn-1.rs:6:29: 6:50 a:_]` error: aborting due to previous error diff --git a/src/test/ui/closures/closure-no-fn-2.stderr b/src/test/ui/closures/closure-no-fn-2.stderr index 5adcdf6058b71..f3b0d155dd9fe 100644 --- a/src/test/ui/closures/closure-no-fn-2.stderr +++ b/src/test/ui/closures/closure-no-fn-2.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let bar: fn() -> u8 = || { b }; | ^^^^^^^^ expected fn pointer, found closure | - = note: expected type `fn() -> u8` - found type `[closure@$DIR/closure-no-fn-2.rs:6:27: 6:35 b:_]` + = note: expected fn pointer `fn() -> u8` + found closure `[closure@$DIR/closure-no-fn-2.rs:6:27: 6:35 b:_]` error: aborting due to previous error diff --git a/src/test/ui/closures/closure-reform-bad.stderr b/src/test/ui/closures/closure-reform-bad.stderr index 5c5480912be43..63236cf542464 100644 --- a/src/test/ui/closures/closure-reform-bad.stderr +++ b/src/test/ui/closures/closure-reform-bad.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | call_bare(f) | ^ expected fn pointer, found closure | - = note: expected type `for<'r> fn(&'r str)` - found type `[closure@$DIR/closure-reform-bad.rs:10:13: 10:50 string:_]` + = note: expected fn pointer `for<'r> fn(&'r str)` + found closure `[closure@$DIR/closure-reform-bad.rs:10:13: 10:50 string:_]` error: aborting due to previous error diff --git a/src/test/ui/codemap_tests/tab.stderr b/src/test/ui/codemap_tests/tab.stderr index 7b3f959c1cb38..d2d52e282daa6 100644 --- a/src/test/ui/codemap_tests/tab.stderr +++ b/src/test/ui/codemap_tests/tab.stderr @@ -12,8 +12,8 @@ LL | fn foo() { LL | "bar boo" | ^^^^^^^^^^^^^^^^^^^^ expected (), found reference | - = note: expected type `()` - found type `&'static str` + = note: expected type `()` + found reference `&'static str` error: aborting due to 2 previous errors diff --git a/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr b/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr index 3b81610a06e09..acbc8339b1911 100644 --- a/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr +++ b/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _ = box { [1, 2, 3] }: Box<[i32]>; | ^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements | - = note: expected type `std::boxed::Box<[i32]>` - found type `std::boxed::Box<[i32; 3]>` + = note: expected struct `std::boxed::Box<[i32]>` + found struct `std::boxed::Box<[i32; 3]>` error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:10:13 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let _ = box if true { [1, 2, 3] } else { [1, 3, 4] }: Box<[i32]>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements | - = note: expected type `std::boxed::Box<[i32]>` - found type `std::boxed::Box<[i32; 3]>` + = note: expected struct `std::boxed::Box<[i32]>` + found struct `std::boxed::Box<[i32; 3]>` error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:11:13 @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | let _ = box match true { true => [1, 2, 3], false => [1, 3, 4] }: Box<[i32]>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements | - = note: expected type `std::boxed::Box<[i32]>` - found type `std::boxed::Box<[i32; 3]>` + = note: expected struct `std::boxed::Box<[i32]>` + found struct `std::boxed::Box<[i32; 3]>` error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:13:13 @@ -31,8 +31,8 @@ error[E0308]: mismatched types LL | let _ = box { |x| (x as u8) }: Box _>; | ^^^^^^^^^^^^^^^^^^^^^ expected trait std::ops::Fn, found closure | - = note: expected type `std::boxed::Box u8>` - found type `std::boxed::Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:13:19: 13:32]>` + = note: expected struct `std::boxed::Box u8>` + found struct `std::boxed::Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:13:19: 13:32]>` error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:14:13 @@ -40,8 +40,8 @@ error[E0308]: mismatched types LL | let _ = box if true { false } else { true }: Box; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::fmt::Debug, found bool | - = note: expected type `std::boxed::Box` - found type `std::boxed::Box` + = note: expected struct `std::boxed::Box` + found struct `std::boxed::Box` error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:15:13 @@ -49,8 +49,8 @@ error[E0308]: mismatched types LL | let _ = box match true { true => 'a', false => 'b' }: Box; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::fmt::Debug, found char | - = note: expected type `std::boxed::Box` - found type `std::boxed::Box` + = note: expected struct `std::boxed::Box` + found struct `std::boxed::Box` error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:17:13 @@ -58,8 +58,8 @@ error[E0308]: mismatched types LL | let _ = &{ [1, 2, 3] }: &[i32]; | ^^^^^^^^^^^^^^ expected slice, found array of 3 elements | - = note: expected type `&[i32]` - found type `&[i32; 3]` + = note: expected reference `&[i32]` + found reference `&[i32; 3]` error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:18:13 @@ -67,8 +67,8 @@ error[E0308]: mismatched types LL | let _ = &if true { [1, 2, 3] } else { [1, 3, 4] }: &[i32]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements | - = note: expected type `&[i32]` - found type `&[i32; 3]` + = note: expected reference `&[i32]` + found reference `&[i32; 3]` error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:19:13 @@ -76,8 +76,8 @@ error[E0308]: mismatched types LL | let _ = &match true { true => [1, 2, 3], false => [1, 3, 4] }: &[i32]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements | - = note: expected type `&[i32]` - found type `&[i32; 3]` + = note: expected reference `&[i32]` + found reference `&[i32; 3]` error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:21:13 @@ -85,8 +85,8 @@ error[E0308]: mismatched types LL | let _ = &{ |x| (x as u8) }: &dyn Fn(i32) -> _; | ^^^^^^^^^^^^^^^^^^ expected trait std::ops::Fn, found closure | - = note: expected type `&dyn std::ops::Fn(i32) -> u8` - found type `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:21:16: 21:29]` + = note: expected reference `&dyn std::ops::Fn(i32) -> u8` + found reference `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:21:16: 21:29]` error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:22:13 @@ -94,8 +94,8 @@ error[E0308]: mismatched types LL | let _ = &if true { false } else { true }: &dyn Debug; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::fmt::Debug, found bool | - = note: expected type `&dyn std::fmt::Debug` - found type `&bool` + = note: expected reference `&dyn std::fmt::Debug` + found reference `&bool` error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:23:13 @@ -103,8 +103,8 @@ error[E0308]: mismatched types LL | let _ = &match true { true => 'a', false => 'b' }: &dyn Debug; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::fmt::Debug, found char | - = note: expected type `&dyn std::fmt::Debug` - found type `&char` + = note: expected reference `&dyn std::fmt::Debug` + found reference `&char` error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:25:13 @@ -112,8 +112,8 @@ error[E0308]: mismatched types LL | let _ = Box::new([1, 2, 3]): Box<[i32]>; | ^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements | - = note: expected type `std::boxed::Box<[i32]>` - found type `std::boxed::Box<[i32; 3]>` + = note: expected struct `std::boxed::Box<[i32]>` + found struct `std::boxed::Box<[i32; 3]>` error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:26:13 @@ -121,8 +121,8 @@ error[E0308]: mismatched types LL | let _ = Box::new(|x| (x as u8)): Box _>; | ^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::ops::Fn, found closure | - = note: expected type `std::boxed::Box _>` - found type `std::boxed::Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:26:22: 26:35]>` + = note: expected struct `std::boxed::Box _>` + found struct `std::boxed::Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:26:22: 26:35]>` error: aborting due to 14 previous errors diff --git a/src/test/ui/coercion/coerce-mut.rs b/src/test/ui/coercion/coerce-mut.rs index 409fb8e86beb9..43f0b55856d3c 100644 --- a/src/test/ui/coercion/coerce-mut.rs +++ b/src/test/ui/coercion/coerce-mut.rs @@ -4,7 +4,7 @@ fn main() { let x = 0; f(&x); //~^ ERROR mismatched types - //~| expected type `&mut i32` - //~| found type `&{integer}` + //~| expected mutable reference `&mut i32` + //~| found reference `&{integer}` //~| types differ in mutability } diff --git a/src/test/ui/coercion/coerce-mut.stderr b/src/test/ui/coercion/coerce-mut.stderr index f8e3d6e60d650..2601ca5e91e5b 100644 --- a/src/test/ui/coercion/coerce-mut.stderr +++ b/src/test/ui/coercion/coerce-mut.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | f(&x); | ^^ types differ in mutability | - = note: expected type `&mut i32` - found type `&{integer}` + = note: expected mutable reference `&mut i32` + found reference `&{integer}` error: aborting due to previous error diff --git a/src/test/ui/coercion/coerce-to-bang.stderr b/src/test/ui/coercion/coerce-to-bang.stderr index a46e97da8159b..284c20b6e2884 100644 --- a/src/test/ui/coercion/coerce-to-bang.stderr +++ b/src/test/ui/coercion/coerce-to-bang.stderr @@ -49,8 +49,8 @@ error[E0308]: mismatched types LL | let x: [!; 2] = [return, 22]; | ^^^^^^^^^^^^ expected !, found integer | - = note: expected type `[!; 2]` - found type `[{integer}; 2]` + = note: expected array `[!; 2]` + found array `[{integer}; 2]` error[E0308]: mismatched types --> $DIR/coerce-to-bang.rs:55:22 diff --git a/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr b/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr index 955793e8586e7..3c44fdb195454 100644 --- a/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr +++ b/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr @@ -21,7 +21,7 @@ LL | fn foo() -> Result { LL | Ok(1); | - help: consider removing this semicolon | - = note: expected type `std::result::Result` + = note: expected enum `std::result::Result` found type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/coercion/coercion-slice.rs b/src/test/ui/coercion/coercion-slice.rs index b69edcf260637..fbfe1984b9f4a 100644 --- a/src/test/ui/coercion/coercion-slice.rs +++ b/src/test/ui/coercion/coercion-slice.rs @@ -3,6 +3,6 @@ fn main() { let _: &[i32] = [0]; //~^ ERROR mismatched types - //~| expected type `&[i32]` + //~| expected reference `&[i32]` //~| expected &[i32], found array of 1 element } diff --git a/src/test/ui/coercion/coercion-slice.stderr b/src/test/ui/coercion/coercion-slice.stderr index ccd776e987938..55523933f5472 100644 --- a/src/test/ui/coercion/coercion-slice.stderr +++ b/src/test/ui/coercion/coercion-slice.stderr @@ -7,8 +7,8 @@ LL | let _: &[i32] = [0]; | expected &[i32], found array of 1 element | help: consider borrowing here: `&[0]` | - = note: expected type `&[i32]` - found type `[{integer}; 1]` + = note: expected reference `&[i32]` + found array `[{integer}; 1]` error: aborting due to previous error diff --git a/src/test/ui/compare-method/reordered-type-param.stderr b/src/test/ui/compare-method/reordered-type-param.stderr index 326b84470d622..f1f8a663f2120 100644 --- a/src/test/ui/compare-method/reordered-type-param.stderr +++ b/src/test/ui/compare-method/reordered-type-param.stderr @@ -10,8 +10,8 @@ LL | fn b(&self, _x: G) -> G { panic!() } | | found type parameter | expected type parameter | - = note: expected type `fn(&E, F) -> F` - found type `fn(&E, G) -> G` + = note: expected fn pointer `fn(&E, F) -> F` + found fn pointer `fn(&E, G) -> G` = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr index 7090cb880fd49..8461755dbfe57 100644 --- a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr +++ b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8])); | ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements | - = note: expected type `[u8; 3]` - found type `[u8; 2]` + = note: expected array `[u8; 3]` + found array `[u8; 2]` error[E0308]: mismatched types --> $DIR/const-argument-cross-crate-mismatch.rs:8:65 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]); | ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements | - = note: expected type `[u8; 2]` - found type `[u8; 3]` + = note: expected array `[u8; 2]` + found array `[u8; 3]` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/fn-const-param-infer.stderr b/src/test/ui/const-generics/fn-const-param-infer.stderr index de0916b26bfef..d62383e1224c6 100644 --- a/src/test/ui/const-generics/fn-const-param-infer.stderr +++ b/src/test/ui/const-generics/fn-const-param-infer.stderr @@ -12,8 +12,8 @@ error[E0308]: mismatched types LL | let _: Checked<{not_one}> = Checked::<{not_two}>; | ^^^^^^^^^^^^^^^^^^^^ expected `not_one`, found `not_two` | - = note: expected type `Checked` - found type `Checked` + = note: expected struct `Checked` + found struct `Checked` error[E0308]: mismatched types --> $DIR/fn-const-param-infer.rs:20:24 @@ -21,8 +21,8 @@ error[E0308]: mismatched types LL | let _ = Checked::<{generic_arg::}>; | ^^^^^^^^^^^^^^^^^^ expected usize, found u32 | - = note: expected type `fn(usize) -> bool` - found type `fn(u32) -> bool {generic_arg::}` + = note: expected fn pointer `fn(usize) -> bool` + found fn item `fn(u32) -> bool {generic_arg::}` error[E0282]: type annotations needed --> $DIR/fn-const-param-infer.rs:22:24 @@ -36,8 +36,8 @@ error[E0308]: mismatched types LL | let _: Checked<{generic::}> = Checked::<{generic::}>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `generic::`, found `generic::` | - = note: expected type `Checked>` - found type `Checked>` + = note: expected struct `Checked>` + found struct `Checked>` error: aborting due to 4 previous errors diff --git a/src/test/ui/const-generics/raw-ptr-const-param.stderr b/src/test/ui/const-generics/raw-ptr-const-param.stderr index 75b4c0a0a3de3..ff5c59fa375ff 100644 --- a/src/test/ui/const-generics/raw-ptr-const-param.stderr +++ b/src/test/ui/const-generics/raw-ptr-const-param.stderr @@ -12,8 +12,8 @@ error[E0308]: mismatched types LL | let _: Const<{15 as *const _}> = Const::<{10 as *const _}>; | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{pointer}`, found `{pointer}` | - = note: expected type `Const<{pointer}>` - found type `Const<{pointer}>` + = note: expected struct `Const<{pointer}>` + found struct `Const<{pointer}>` error: aborting due to previous error diff --git a/src/test/ui/const-generics/slice-const-param-mismatch.stderr b/src/test/ui/const-generics/slice-const-param-mismatch.stderr index 380a70d664e05..9d11da1331585 100644 --- a/src/test/ui/const-generics/slice-const-param-mismatch.stderr +++ b/src/test/ui/const-generics/slice-const-param-mismatch.stderr @@ -12,8 +12,8 @@ error[E0308]: mismatched types LL | let _: ConstString<"Hello"> = ConstString::<"World">; | ^^^^^^^^^^^^^^^^^^^^^^ expected `"Hello"`, found `"World"` | - = note: expected type `ConstString<"Hello">` - found type `ConstString<"World">` + = note: expected struct `ConstString<"Hello">` + found struct `ConstString<"World">` error[E0308]: mismatched types --> $DIR/slice-const-param-mismatch.rs:11:33 @@ -21,8 +21,8 @@ error[E0308]: mismatched types LL | let _: ConstString<"ℇ㇈↦"> = ConstString::<"ℇ㇈↥">; | ^^^^^^^^^^^^^^^^^^^^^ expected `"ℇ㇈↦"`, found `"ℇ㇈↥"` | - = note: expected type `ConstString<"ℇ㇈↦">` - found type `ConstString<"ℇ㇈↥">` + = note: expected struct `ConstString<"ℇ㇈↦">` + found struct `ConstString<"ℇ㇈↥">` error[E0308]: mismatched types --> $DIR/slice-const-param-mismatch.rs:13:33 @@ -30,8 +30,8 @@ error[E0308]: mismatched types LL | let _: ConstBytes = ConstBytes::; | ^^^^^^^^^^^^^^^^^^^^ expected `b"AAA"`, found `b"BBB"` | - = note: expected type `ConstBytes` - found type `ConstBytes` + = note: expected struct `ConstBytes` + found struct `ConstBytes` error: aborting due to 3 previous errors diff --git a/src/test/ui/const-generics/types-mismatch-const-args.stderr b/src/test/ui/const-generics/types-mismatch-const-args.stderr index 805a3067d3b6b..c912d9d0abf09 100644 --- a/src/test/ui/const-generics/types-mismatch-const-args.stderr +++ b/src/test/ui/const-generics/types-mismatch-const-args.stderr @@ -12,8 +12,8 @@ error[E0308]: mismatched types LL | let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {4u32}, {3u32}> { data: PhantomData }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2u32`, found `4u32` | - = note: expected type `A<'_, _, 2u32, _>` - found type `A<'_, _, 4u32, _>` + = note: expected struct `A<'_, _, 2u32, _>` + found struct `A<'_, _, 4u32, _>` error[E0308]: mismatched types --> $DIR/types-mismatch-const-args.rs:15:41 @@ -21,8 +21,8 @@ error[E0308]: mismatched types LL | let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u16, found u32 | - = note: expected type `A<'a, u16, _, _>` - found type `A<'b, u32, _, _>` + = note: expected struct `A<'a, u16, _, _>` + found struct `A<'b, u32, _, _>` error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/const-array-oob-arith.stderr b/src/test/ui/consts/const-array-oob-arith.stderr index 987e7ddf4d91e..f4a4c091e78a0 100644 --- a/src/test/ui/consts/const-array-oob-arith.stderr +++ b/src/test/ui/consts/const-array-oob-arith.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | const BLUB: [i32; (ARR[0] - 40) as usize] = [5]; | ^^^ expected an array with a fixed size of 2 elements, found one with 1 element | - = note: expected type `[i32; 2]` - found type `[i32; 1]` + = note: expected array `[i32; 2]` + found array `[i32; 1]` error[E0308]: mismatched types --> $DIR/const-array-oob-arith.rs:10:44 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | const BOO: [i32; (ARR[0] - 41) as usize] = [5, 99]; | ^^^^^^^ expected an array with a fixed size of 1 element, found one with 2 elements | - = note: expected type `[i32; 1]` - found type `[i32; 2]` + = note: expected array `[i32; 1]` + found array `[i32; 2]` error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/const-eval/const-eval-span.rs b/src/test/ui/consts/const-eval/const-eval-span.rs index 59f4b138249b2..279fe7fb7fed5 100644 --- a/src/test/ui/consts/const-eval/const-eval-span.rs +++ b/src/test/ui/consts/const-eval/const-eval-span.rs @@ -9,7 +9,7 @@ enum E { V = CONSTANT, //~^ ERROR mismatched types //~| expected isize, found struct `S` - //~| found type `S` + //~| found struct `S` } fn main() {} diff --git a/src/test/ui/consts/const-eval/const-eval-span.stderr b/src/test/ui/consts/const-eval/const-eval-span.stderr index 8ff9bfe54c7be..5b046e266a2df 100644 --- a/src/test/ui/consts/const-eval/const-eval-span.stderr +++ b/src/test/ui/consts/const-eval/const-eval-span.stderr @@ -5,7 +5,7 @@ LL | V = CONSTANT, | ^^^^^^^^ expected isize, found struct `S` | = note: expected type `isize` - found type `S` + found struct `S` error: aborting due to previous error diff --git a/src/test/ui/consts/const-tup-index-span.stderr b/src/test/ui/consts/const-tup-index-span.stderr index 2c4e273004506..1d280026a0190 100644 --- a/src/test/ui/consts/const-tup-index-span.stderr +++ b/src/test/ui/consts/const-tup-index-span.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | const TUP: (usize,) = 5usize << 64; | ^^^^^^^^^^^^ expected tuple, found usize | - = note: expected type `(usize,)` - found type `usize` + = note: expected tuple `(usize,)` + found type `usize` error[E0080]: evaluation of constant value failed --> $DIR/const-tup-index-span.rs:6:18 diff --git a/src/test/ui/conversion-methods.stderr b/src/test/ui/conversion-methods.stderr index 5c666afb89a33..11384d92cb8a6 100644 --- a/src/test/ui/conversion-methods.stderr +++ b/src/test/ui/conversion-methods.stderr @@ -7,8 +7,8 @@ LL | let _tis_an_instants_play: String = "'Tis a fond Ambush—"; | expected struct `std::string::String`, found reference | help: try using a conversion method: `"'Tis a fond Ambush—".to_string()` | - = note: expected type `std::string::String` - found type `&'static str` + = note: expected struct `std::string::String` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/conversion-methods.rs:6:40 @@ -19,8 +19,8 @@ LL | let _just_to_make_bliss: PathBuf = Path::new("/ern/her/own/surprise"); | expected struct `std::path::PathBuf`, found reference | help: try using a conversion method: `Path::new("/ern/her/own/surprise").to_path_buf()` | - = note: expected type `std::path::PathBuf` - found type `&std::path::Path` + = note: expected struct `std::path::PathBuf` + found reference `&std::path::Path` error[E0308]: mismatched types --> $DIR/conversion-methods.rs:9:40 @@ -31,8 +31,8 @@ LL | let _but_should_the_play: String = 2; // Perhaps surprisingly, we sugge | expected struct `std::string::String`, found integer | help: try using a conversion method: `2.to_string()` | - = note: expected type `std::string::String` - found type `{integer}` + = note: expected struct `std::string::String` + found type `{integer}` error[E0308]: mismatched types --> $DIR/conversion-methods.rs:12:47 @@ -43,8 +43,8 @@ LL | let _prove_piercing_earnest: Vec = &[1, 2, 3]; | expected struct `std::vec::Vec`, found reference | help: try using a conversion method: `(&[1, 2, 3]).to_vec()` | - = note: expected type `std::vec::Vec` - found type `&[{integer}; 3]` + = note: expected struct `std::vec::Vec` + found reference `&[{integer}; 3]` error: aborting due to 4 previous errors diff --git a/src/test/ui/cross/cross-borrow-trait.rs b/src/test/ui/cross/cross-borrow-trait.rs index 274cdad75ec2a..ce42b696ddf8e 100644 --- a/src/test/ui/cross/cross-borrow-trait.rs +++ b/src/test/ui/cross/cross-borrow-trait.rs @@ -8,6 +8,6 @@ impl Trait for Foo {} pub fn main() { let x: Box = Box::new(Foo); let _y: &dyn Trait = x; //~ ERROR E0308 - //~| expected type `&dyn Trait` - //~| found type `std::boxed::Box` + //~| expected reference `&dyn Trait` + //~| found struct `std::boxed::Box` } diff --git a/src/test/ui/cross/cross-borrow-trait.stderr b/src/test/ui/cross/cross-borrow-trait.stderr index ada1c0204eb01..282912e076eb9 100644 --- a/src/test/ui/cross/cross-borrow-trait.stderr +++ b/src/test/ui/cross/cross-borrow-trait.stderr @@ -7,8 +7,8 @@ LL | let _y: &dyn Trait = x; | expected &dyn Trait, found struct `std::boxed::Box` | help: consider borrowing here: `&x` | - = note: expected type `&dyn Trait` - found type `std::boxed::Box` + = note: expected reference `&dyn Trait` + found struct `std::boxed::Box` error: aborting due to previous error diff --git a/src/test/ui/deref-suggestion.stderr b/src/test/ui/deref-suggestion.stderr index 9c49f541c9309..53bc3212a7fb0 100644 --- a/src/test/ui/deref-suggestion.stderr +++ b/src/test/ui/deref-suggestion.stderr @@ -7,8 +7,8 @@ LL | foo(s); | expected struct `std::string::String`, found reference | help: try using a conversion method: `s.to_string()` | - = note: expected type `std::string::String` - found type `&std::string::String` + = note: expected struct `std::string::String` + found reference `&std::string::String` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:14:10 @@ -19,8 +19,8 @@ LL | foo3(u); | expected u32, found &u32 | help: consider dereferencing the borrow: `*u` | - = note: expected type `u32` - found type `&u32` + = note: expected type `u32` + found reference `&u32` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:30:9 @@ -31,8 +31,8 @@ LL | foo(&"aaa".to_owned()); | expected struct `std::string::String`, found reference | help: consider removing the borrow: `"aaa".to_owned()` | - = note: expected type `std::string::String` - found type `&std::string::String` + = note: expected struct `std::string::String` + found reference `&std::string::String` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:32:9 @@ -43,8 +43,8 @@ LL | foo(&mut "aaa".to_owned()); | expected struct `std::string::String`, found mutable reference | help: consider removing the borrow: `"aaa".to_owned()` | - = note: expected type `std::string::String` - found type `&mut std::string::String` + = note: expected struct `std::string::String` + found mutable reference `&mut std::string::String` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:2:20 @@ -55,8 +55,8 @@ LL | ($x:expr) => { &$x } LL | foo3(borrow!(0)); | ---------- in this macro invocation | - = note: expected type `u32` - found type `&{integer}` + = note: expected type `u32` + found reference `&{integer}` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:36:5 @@ -64,8 +64,8 @@ error[E0308]: mismatched types LL | assert_eq!(3i32, &3i32); | ^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found &i32 | - = note: expected type `i32` - found type `&i32` + = note: expected type `i32` + found reference `&i32` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error[E0308]: mismatched types @@ -77,8 +77,8 @@ LL | let s = S { u }; | expected &u32, found integer | help: consider borrowing here: `u: &u` | - = note: expected type `&u32` - found type `{integer}` + = note: expected reference `&u32` + found type `{integer}` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:41:20 @@ -89,8 +89,8 @@ LL | let s = S { u: u }; | expected &u32, found integer | help: consider borrowing here: `&u` | - = note: expected type `&u32` - found type `{integer}` + = note: expected reference `&u32` + found type `{integer}` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:44:17 @@ -101,8 +101,8 @@ LL | let r = R { i }; | expected u32, found &{integer} | help: consider dereferencing the borrow: `i: *i` | - = note: expected type `u32` - found type `&{integer}` + = note: expected type `u32` + found reference `&{integer}` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:46:20 @@ -113,8 +113,8 @@ LL | let r = R { i: i }; | expected u32, found &{integer} | help: consider dereferencing the borrow: `*i` | - = note: expected type `u32` - found type `&{integer}` + = note: expected type `u32` + found reference `&{integer}` error: aborting due to 10 previous errors diff --git a/src/test/ui/destructure-trait-ref.rs b/src/test/ui/destructure-trait-ref.rs index 71cf37ca84951..1c79282639969 100644 --- a/src/test/ui/destructure-trait-ref.rs +++ b/src/test/ui/destructure-trait-ref.rs @@ -31,16 +31,16 @@ fn main() { // n > m let &&x = &1isize as &dyn T; //~^ ERROR mismatched types - //~| expected type `dyn T` - //~| found type `&_` + //~| expected trait `dyn T` + //~| found reference `&_` //~| expected trait T, found reference let &&&x = &(&1isize as &dyn T); //~^ ERROR mismatched types - //~| expected type `dyn T` - //~| found type `&_` + //~| expected trait `dyn T` + //~| found reference `&_` //~| expected trait T, found reference let box box x = box 1isize as Box; //~^ ERROR mismatched types - //~| expected type `dyn T` - //~| found type `std::boxed::Box<_>` + //~| expected trait `dyn T` + //~| found struct `std::boxed::Box<_>` } diff --git a/src/test/ui/destructure-trait-ref.stderr b/src/test/ui/destructure-trait-ref.stderr index d3ad21eb24ffb..05545a7098c97 100644 --- a/src/test/ui/destructure-trait-ref.stderr +++ b/src/test/ui/destructure-trait-ref.stderr @@ -25,8 +25,8 @@ LL | let &&x = &1isize as &dyn T; | expected trait T, found reference | help: you can probably remove the explicit borrow: `x` | - = note: expected type `dyn T` - found type `&_` + = note: expected trait `dyn T` + found reference `&_` error[E0308]: mismatched types --> $DIR/destructure-trait-ref.rs:37:11 @@ -37,8 +37,8 @@ LL | let &&&x = &(&1isize as &dyn T); | expected trait T, found reference | help: you can probably remove the explicit borrow: `x` | - = note: expected type `dyn T` - found type `&_` + = note: expected trait `dyn T` + found reference `&_` error[E0308]: mismatched types --> $DIR/destructure-trait-ref.rs:42:13 @@ -46,8 +46,8 @@ error[E0308]: mismatched types LL | let box box x = box 1isize as Box; | ^^^^^ expected trait T, found struct `std::boxed::Box` | - = note: expected type `dyn T` - found type `std::boxed::Box<_>` + = note: expected trait `dyn T` + found struct `std::boxed::Box<_>` error: aborting due to 6 previous errors diff --git a/src/test/ui/did_you_mean/issue-42764.stderr b/src/test/ui/did_you_mean/issue-42764.stderr index 0b3e44446aec2..bd913649dd070 100644 --- a/src/test/ui/did_you_mean/issue-42764.stderr +++ b/src/test/ui/did_you_mean/issue-42764.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | this_function_expects_a_double_option(n); | ^ expected enum `DoubleOption`, found usize | - = note: expected type `DoubleOption<_>` + = note: expected enum `DoubleOption<_>` found type `usize` help: try using a variant of the expected enum | @@ -19,8 +19,8 @@ error[E0308]: mismatched types LL | let _c = Context { wrapper: Payload{} }; | ^^^^^^^^^ expected struct `Wrapper`, found struct `Payload` | - = note: expected type `Wrapper` - found type `Payload` + = note: expected struct `Wrapper` + found struct `Payload` error: aborting due to 2 previous errors diff --git a/src/test/ui/did_you_mean/recursion_limit_deref.stderr b/src/test/ui/did_you_mean/recursion_limit_deref.stderr index c76efb1d00920..233474e5fe689 100644 --- a/src/test/ui/did_you_mean/recursion_limit_deref.stderr +++ b/src/test/ui/did_you_mean/recursion_limit_deref.stderr @@ -12,8 +12,8 @@ error[E0308]: mismatched types LL | let x: &Bottom = &t; | ^^ expected struct `Bottom`, found struct `Top` | - = note: expected type `&Bottom` - found type `&Top` + = note: expected reference `&Bottom` + found reference `&Top` error: aborting due to 2 previous errors diff --git a/src/test/ui/diverging-fn-tail-35849.stderr b/src/test/ui/diverging-fn-tail-35849.stderr index 383a7009e8599..ebca760e23549 100644 --- a/src/test/ui/diverging-fn-tail-35849.stderr +++ b/src/test/ui/diverging-fn-tail-35849.stderr @@ -8,7 +8,7 @@ LL | ::std::mem::transmute::(panic!()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected !, found array of 8 elements | = note: expected type `!` - found type `[u8; 8]` + found array `[u8; 8]` error: aborting due to previous error diff --git a/src/test/ui/diverging-tuple-parts-39485.stderr b/src/test/ui/diverging-tuple-parts-39485.stderr index 70eefeb329db4..72cdfad6f7771 100644 --- a/src/test/ui/diverging-tuple-parts-39485.stderr +++ b/src/test/ui/diverging-tuple-parts-39485.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | &panic!() | ^^^^^^^^^ expected (), found reference | - = note: expected type `()` - found type `&_` + = note: expected type `()` + found reference `&_` help: try adding a return type | LL | fn g() -> &_ { @@ -24,7 +24,7 @@ LL | (return 1, return 2) | ^^^^^^^^^^^^^^^^^^^^ expected isize, found tuple | = note: expected type `isize` - found type `(!, !)` + found tuple `(!, !)` error: aborting due to 2 previous errors diff --git a/src/test/ui/dst/dst-bad-assign-3.rs b/src/test/ui/dst/dst-bad-assign-3.rs index 691909a231743..8f0748f0a69bc 100644 --- a/src/test/ui/dst/dst-bad-assign-3.rs +++ b/src/test/ui/dst/dst-bad-assign-3.rs @@ -32,8 +32,8 @@ pub fn main() { let z: Box = Box::new(Bar1 {f: 36}); f5.2 = Bar1 {f: 36}; //~^ ERROR mismatched types - //~| expected type `dyn ToBar` - //~| found type `Bar1` //~| expected trait ToBar, found struct `Bar1` + //~| expected trait `dyn ToBar` + //~| found struct `Bar1` //~| ERROR the size for values of type } diff --git a/src/test/ui/dst/dst-bad-assign-3.stderr b/src/test/ui/dst/dst-bad-assign-3.stderr index 8c80ec7aac1dd..773837e7994cb 100644 --- a/src/test/ui/dst/dst-bad-assign-3.stderr +++ b/src/test/ui/dst/dst-bad-assign-3.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | f5.2 = Bar1 {f: 36}; | ^^^^^^^^^^^^ expected trait ToBar, found struct `Bar1` | - = note: expected type `dyn ToBar` - found type `Bar1` + = note: expected trait `dyn ToBar` + found struct `Bar1` error[E0277]: the size for values of type `dyn ToBar` cannot be known at compilation time --> $DIR/dst-bad-assign-3.rs:33:5 diff --git a/src/test/ui/dst/dst-bad-assign.rs b/src/test/ui/dst/dst-bad-assign.rs index 4f2648653f051..c84c61ecb0ecd 100644 --- a/src/test/ui/dst/dst-bad-assign.rs +++ b/src/test/ui/dst/dst-bad-assign.rs @@ -34,8 +34,8 @@ pub fn main() { let z: Box = Box::new(Bar1 {f: 36}); f5.ptr = Bar1 {f: 36}; //~^ ERROR mismatched types - //~| expected type `dyn ToBar` - //~| found type `Bar1` //~| expected trait ToBar, found struct `Bar1` + //~| expected trait `dyn ToBar` + //~| found struct `Bar1` //~| ERROR the size for values of type } diff --git a/src/test/ui/dst/dst-bad-assign.stderr b/src/test/ui/dst/dst-bad-assign.stderr index 849b1a62a46f5..d01cbf7a3e982 100644 --- a/src/test/ui/dst/dst-bad-assign.stderr +++ b/src/test/ui/dst/dst-bad-assign.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | f5.ptr = Bar1 {f: 36}; | ^^^^^^^^^^^^ expected trait ToBar, found struct `Bar1` | - = note: expected type `dyn ToBar` - found type `Bar1` + = note: expected trait `dyn ToBar` + found struct `Bar1` error[E0277]: the size for values of type `dyn ToBar` cannot be known at compilation time --> $DIR/dst-bad-assign.rs:35:5 diff --git a/src/test/ui/dst/dst-bad-coerce1.stderr b/src/test/ui/dst/dst-bad-coerce1.stderr index a48f37b20be97..7e9d127a9af6e 100644 --- a/src/test/ui/dst/dst-bad-coerce1.stderr +++ b/src/test/ui/dst/dst-bad-coerce1.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let f3: &Fat<[usize]> = f2; | ^^ expected slice, found array of 3 elements | - = note: expected type `&Fat<[usize]>` - found type `&Fat<[isize; 3]>` + = note: expected reference `&Fat<[usize]>` + found reference `&Fat<[isize; 3]>` error[E0277]: the trait bound `Foo: Bar` is not satisfied --> $DIR/dst-bad-coerce1.rs:22:29 @@ -21,8 +21,8 @@ error[E0308]: mismatched types LL | let f3: &([usize],) = f2; | ^^ expected slice, found array of 3 elements | - = note: expected type `&([usize],)` - found type `&([isize; 3],)` + = note: expected reference `&([usize],)` + found reference `&([isize; 3],)` error[E0277]: the trait bound `Foo: Bar` is not satisfied --> $DIR/dst-bad-coerce1.rs:34:27 diff --git a/src/test/ui/dst/dst-bad-coerce2.stderr b/src/test/ui/dst/dst-bad-coerce2.stderr index d1da9b6ca0749..e76fcb5f72d59 100644 --- a/src/test/ui/dst/dst-bad-coerce2.stderr +++ b/src/test/ui/dst/dst-bad-coerce2.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let f3: &mut Fat<[isize]> = f2; | ^^ types differ in mutability | - = note: expected type `&mut Fat<[isize]>` - found type `&Fat<[isize; 3]>` + = note: expected mutable reference `&mut Fat<[isize]>` + found reference `&Fat<[isize; 3]>` error[E0308]: mismatched types --> $DIR/dst-bad-coerce2.rs:20:33 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let f3: &mut Fat = f2; | ^^ types differ in mutability | - = note: expected type `&mut Fat` - found type `&Fat` + = note: expected mutable reference `&mut Fat` + found reference `&Fat` error[E0308]: mismatched types --> $DIR/dst-bad-coerce2.rs:25:31 @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | let f3: &mut ([isize],) = f2; | ^^ types differ in mutability | - = note: expected type `&mut ([isize],)` - found type `&([isize; 3],)` + = note: expected mutable reference `&mut ([isize],)` + found reference `&([isize; 3],)` error[E0308]: mismatched types --> $DIR/dst-bad-coerce2.rs:30:31 @@ -31,8 +31,8 @@ error[E0308]: mismatched types LL | let f3: &mut (dyn Bar,) = f2; | ^^ types differ in mutability | - = note: expected type `&mut (dyn Bar,)` - found type `&(Foo,)` + = note: expected mutable reference `&mut (dyn Bar,)` + found reference `&(Foo,)` error: aborting due to 4 previous errors diff --git a/src/test/ui/dst/dst-bad-coerce4.rs b/src/test/ui/dst/dst-bad-coerce4.rs index 9635e1e3380d4..d1c590347eda0 100644 --- a/src/test/ui/dst/dst-bad-coerce4.rs +++ b/src/test/ui/dst/dst-bad-coerce4.rs @@ -11,15 +11,15 @@ pub fn main() { let f1: &Fat<[isize]> = &Fat { ptr: [1, 2, 3] }; let f2: &Fat<[isize; 3]> = f1; //~^ ERROR mismatched types - //~| expected type `&Fat<[isize; 3]>` - //~| found type `&Fat<[isize]>` + //~| expected reference `&Fat<[isize; 3]>` + //~| found reference `&Fat<[isize]>` //~| expected array of 3 elements, found slice // Tuple with a vec of isizes. let f1: &([isize],) = &([1, 2, 3],); let f2: &([isize; 3],) = f1; //~^ ERROR mismatched types - //~| expected type `&([isize; 3],)` - //~| found type `&([isize],)` + //~| expected reference `&([isize; 3],)` + //~| found reference `&([isize],)` //~| expected array of 3 elements, found slice } diff --git a/src/test/ui/dst/dst-bad-coerce4.stderr b/src/test/ui/dst/dst-bad-coerce4.stderr index fbf59ae5c6600..fad34633da5cb 100644 --- a/src/test/ui/dst/dst-bad-coerce4.stderr +++ b/src/test/ui/dst/dst-bad-coerce4.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let f2: &Fat<[isize; 3]> = f1; | ^^ expected array of 3 elements, found slice | - = note: expected type `&Fat<[isize; 3]>` - found type `&Fat<[isize]>` + = note: expected reference `&Fat<[isize; 3]>` + found reference `&Fat<[isize]>` error[E0308]: mismatched types --> $DIR/dst-bad-coerce4.rs:20:30 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let f2: &([isize; 3],) = f1; | ^^ expected array of 3 elements, found slice | - = note: expected type `&([isize; 3],)` - found type `&([isize],)` + = note: expected reference `&([isize; 3],)` + found reference `&([isize],)` error: aborting due to 2 previous errors diff --git a/src/test/ui/dst/dst-bad-coercions.stderr b/src/test/ui/dst/dst-bad-coercions.stderr index e4bc6ee0010a2..3c6111a345bb8 100644 --- a/src/test/ui/dst/dst-bad-coercions.stderr +++ b/src/test/ui/dst/dst-bad-coercions.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let y: &S = x; | ^ expected &S, found *-ptr | - = note: expected type `&S` - found type `*const S` + = note: expected reference `&S` + found raw pointer `*const S` error[E0308]: mismatched types --> $DIR/dst-bad-coercions.rs:15:21 @@ -16,8 +16,8 @@ LL | let y: &dyn T = x; | expected &dyn T, found *-ptr | help: consider borrowing here: `&x` | - = note: expected type `&dyn T` - found type `*const S` + = note: expected reference `&dyn T` + found raw pointer `*const S` error[E0308]: mismatched types --> $DIR/dst-bad-coercions.rs:19:17 @@ -25,8 +25,8 @@ error[E0308]: mismatched types LL | let y: &S = x; | ^ expected &S, found *-ptr | - = note: expected type `&S` - found type `*mut S` + = note: expected reference `&S` + found raw pointer `*mut S` error[E0308]: mismatched types --> $DIR/dst-bad-coercions.rs:20:21 @@ -37,8 +37,8 @@ LL | let y: &dyn T = x; | expected &dyn T, found *-ptr | help: consider borrowing here: `&x` | - = note: expected type `&dyn T` - found type `*mut S` + = note: expected reference `&dyn T` + found raw pointer `*mut S` error[E0308]: mismatched types --> $DIR/dst-bad-coercions.rs:23:25 @@ -46,8 +46,8 @@ error[E0308]: mismatched types LL | let x: &mut dyn T = &S; | ^^ types differ in mutability | - = note: expected type `&mut dyn T` - found type `&S` + = note: expected mutable reference `&mut dyn T` + found reference `&S` error[E0308]: mismatched types --> $DIR/dst-bad-coercions.rs:24:25 @@ -55,8 +55,8 @@ error[E0308]: mismatched types LL | let x: *mut dyn T = &S; | ^^ types differ in mutability | - = note: expected type `*mut dyn T` - found type `&S` + = note: expected raw pointer `*mut dyn T` + found reference `&S` error[E0308]: mismatched types --> $DIR/dst-bad-coercions.rs:25:21 @@ -64,8 +64,8 @@ error[E0308]: mismatched types LL | let x: *mut S = &S; | ^^ types differ in mutability | - = note: expected type `*mut S` - found type `&S` + = note: expected raw pointer `*mut S` + found reference `&S` error: aborting due to 7 previous errors diff --git a/src/test/ui/elide-errors-on-mismatched-tuple.stderr b/src/test/ui/elide-errors-on-mismatched-tuple.stderr index 1ef9d7ae98264..122c71bebc488 100644 --- a/src/test/ui/elide-errors-on-mismatched-tuple.stderr +++ b/src/test/ui/elide-errors-on-mismatched-tuple.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let (a, b, c) = (A::new(), A::new()); // This tuple is 2 elements, should be three | ^^^^^^^^^ expected a tuple with 2 elements, found one with 3 elements | - = note: expected type `(A, A)` - found type `(_, _, _)` + = note: expected tuple `(A, A)` + found tuple `(_, _, _)` error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0271.stderr b/src/test/ui/error-codes/E0271.stderr index 378e5e3630641..2f9191b43269b 100644 --- a/src/test/ui/error-codes/E0271.stderr +++ b/src/test/ui/error-codes/E0271.stderr @@ -7,8 +7,8 @@ LL | fn foo(t: T) where T: Trait { LL | foo(3_i8); | ^^^ expected u32, found reference | - = note: expected type `u32` - found type `&'static str` + = note: expected type `u32` + found reference `&'static str` error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0308.stderr b/src/test/ui/error-codes/E0308.stderr index bd9834ceb9fef..0251c3bee6a8a 100644 --- a/src/test/ui/error-codes/E0308.stderr +++ b/src/test/ui/error-codes/E0308.stderr @@ -4,8 +4,8 @@ error[E0308]: intrinsic has wrong type LL | fn size_of(); | ^^^^^^^^^^^^^^^^ expected (), found usize | - = note: expected type `extern "rust-intrinsic" fn()` - found type `extern "rust-intrinsic" fn() -> usize` + = note: expected fn pointer `extern "rust-intrinsic" fn()` + found fn pointer `extern "rust-intrinsic" fn() -> usize` error: aborting due to previous error diff --git a/src/test/ui/estr-subtyping.stderr b/src/test/ui/estr-subtyping.stderr index 29f210803dd1d..810c52a57066b 100644 --- a/src/test/ui/estr-subtyping.stderr +++ b/src/test/ui/estr-subtyping.stderr @@ -7,8 +7,8 @@ LL | wants_uniq(x); | expected struct `std::string::String`, found &str | help: try using a conversion method: `x.to_string()` | - = note: expected type `std::string::String` - found type `&str` + = note: expected struct `std::string::String` + found reference `&str` error: aborting due to previous error diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.stderr b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.stderr index 4ecd8515ee164..2029cfaf75dfe 100644 --- a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.stderr +++ b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.stderr @@ -12,8 +12,8 @@ LL | match [5..4, 99..105, 43..44] { LL | [_, 99.., _] => {}, | ^^^^ expected struct `std::ops::Range`, found integer | - = note: expected type `std::ops::Range<{integer}>` - found type `{integer}` + = note: expected struct `std::ops::Range<{integer}>` + found type `{integer}` error: aborting due to 2 previous errors diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.stderr b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.stderr index 922d26923158b..6a88d05837a87 100644 --- a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.stderr +++ b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.stderr @@ -18,8 +18,8 @@ LL | match [5..4, 99..105, 43..44] { LL | [_, 99..] => {}, | ^^^^ expected struct `std::ops::Range`, found integer | - = note: expected type `std::ops::Range<{integer}>` - found type `{integer}` + = note: expected struct `std::ops::Range<{integer}>` + found type `{integer}` error: aborting due to 3 previous errors diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.stderr b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.stderr index 8907b875f8e11..5c49fbe4c5c94 100644 --- a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.stderr +++ b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.stderr @@ -12,8 +12,8 @@ LL | match [5..4, 99..105, 43..44] { LL | [..9, 99..100, _] => {}, | ^^^ expected struct `std::ops::Range`, found integer | - = note: expected type `std::ops::Range<{integer}>` - found type `{integer}` + = note: expected struct `std::ops::Range<{integer}>` + found type `{integer}` error[E0308]: mismatched types --> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:15 @@ -23,8 +23,8 @@ LL | match [5..4, 99..105, 43..44] { LL | [..9, 99..100, _] => {}, | ^^^^^^^ expected struct `std::ops::Range`, found integer | - = note: expected type `std::ops::Range<{integer}>` - found type `{integer}` + = note: expected struct `std::ops::Range<{integer}>` + found type `{integer}` error: aborting due to 3 previous errors diff --git a/src/test/ui/explicit/explicit-self-lifetime-mismatch.rs b/src/test/ui/explicit/explicit-self-lifetime-mismatch.rs index 9ab8e13893bc7..a9a6f50fb8ea5 100644 --- a/src/test/ui/explicit/explicit-self-lifetime-mismatch.rs +++ b/src/test/ui/explicit/explicit-self-lifetime-mismatch.rs @@ -7,12 +7,12 @@ impl<'a,'b> Foo<'a,'b> { fn bar(self: Foo<'b,'a> //~^ ERROR mismatched `self` parameter type - //~| expected type `Foo<'a, 'b>` - //~| found type `Foo<'b, 'a>` + //~| expected struct `Foo<'a, 'b>` + //~| found struct `Foo<'b, 'a>` //~| lifetime mismatch //~| ERROR mismatched `self` parameter type - //~| expected type `Foo<'a, 'b>` - //~| found type `Foo<'b, 'a>` + //~| expected struct `Foo<'a, 'b>` + //~| found struct `Foo<'b, 'a>` //~| lifetime mismatch ) {} } diff --git a/src/test/ui/explicit/explicit-self-lifetime-mismatch.stderr b/src/test/ui/explicit/explicit-self-lifetime-mismatch.stderr index cbd6422e5df76..5c976098ae3bc 100644 --- a/src/test/ui/explicit/explicit-self-lifetime-mismatch.stderr +++ b/src/test/ui/explicit/explicit-self-lifetime-mismatch.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched `self` parameter type LL | Foo<'b,'a> | ^^^^^^^^^^ lifetime mismatch | - = note: expected type `Foo<'a, 'b>` - found type `Foo<'b, 'a>` + = note: expected struct `Foo<'a, 'b>` + found struct `Foo<'b, 'a>` note: the lifetime `'b` as defined on the impl at 6:9... --> $DIR/explicit-self-lifetime-mismatch.rs:6:9 | @@ -23,8 +23,8 @@ error[E0308]: mismatched `self` parameter type LL | Foo<'b,'a> | ^^^^^^^^^^ lifetime mismatch | - = note: expected type `Foo<'a, 'b>` - found type `Foo<'b, 'a>` + = note: expected struct `Foo<'a, 'b>` + found struct `Foo<'b, 'a>` note: the lifetime `'a` as defined on the impl at 6:6... --> $DIR/explicit-self-lifetime-mismatch.rs:6:6 | diff --git a/src/test/ui/extern/extern-main-fn.stderr b/src/test/ui/extern/extern-main-fn.stderr index 14f064060a621..6f6983d42832c 100644 --- a/src/test/ui/extern/extern-main-fn.stderr +++ b/src/test/ui/extern/extern-main-fn.stderr @@ -4,8 +4,8 @@ error[E0580]: main function has wrong type LL | extern fn main() {} | ^^^^^^^^^^^^^^^^ expected "Rust" fn, found "C" fn | - = note: expected type `fn()` - found type `extern "C" fn()` + = note: expected fn pointer `fn()` + found fn pointer `extern "C" fn()` error: aborting due to previous error diff --git a/src/test/ui/extern/extern-types-distinct-types.stderr b/src/test/ui/extern/extern-types-distinct-types.stderr index eb632ee395f22..2e258d687d385 100644 --- a/src/test/ui/extern/extern-types-distinct-types.stderr +++ b/src/test/ui/extern/extern-types-distinct-types.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | r | ^ expected extern type `B`, found extern type `A` | - = note: expected type `&B` - found type `&A` + = note: expected reference `&B` + found reference `&A` error: aborting due to previous error diff --git a/src/test/ui/fn/fn-compare-mismatch.stderr b/src/test/ui/fn/fn-compare-mismatch.stderr index 8915b747b73dd..fa74d027f1eaa 100644 --- a/src/test/ui/fn/fn-compare-mismatch.stderr +++ b/src/test/ui/fn/fn-compare-mismatch.stderr @@ -21,8 +21,8 @@ error[E0308]: mismatched types LL | let x = f == g; | ^ expected fn item, found a different fn item | - = note: expected type `fn() {main::f}` - found type `fn() {main::g}` + = note: expected fn item `fn() {main::f}` + found fn item `fn() {main::g}` error: aborting due to 2 previous errors diff --git a/src/test/ui/fn/fn-item-type.rs b/src/test/ui/fn/fn-item-type.rs index e71172d722981..3ab4e8f92153b 100644 --- a/src/test/ui/fn/fn-item-type.rs +++ b/src/test/ui/fn/fn-item-type.rs @@ -12,8 +12,8 @@ impl Foo for T { /* `foo` is still default here */ } fn main() { eq(foo::, bar::); //~^ ERROR mismatched types - //~| expected type `fn(isize) -> isize {foo::}` - //~| found type `fn(isize) -> isize {bar::}` + //~| expected fn item `fn(isize) -> isize {foo::}` + //~| found fn item `fn(isize) -> isize {bar::}` //~| expected fn item, found a different fn item eq(foo::, foo::); @@ -22,8 +22,8 @@ fn main() { eq(bar::, bar::>); //~^ ERROR mismatched types - //~| expected type `fn(isize) -> isize {bar::}` - //~| found type `fn(isize) -> isize {bar::>}` + //~| expected fn item `fn(isize) -> isize {bar::}` + //~| found fn item `fn(isize) -> isize {bar::>}` //~| expected struct `std::string::String`, found struct `std::vec::Vec` // Make sure we distinguish between trait methods correctly. diff --git a/src/test/ui/fn/fn-item-type.stderr b/src/test/ui/fn/fn-item-type.stderr index d52646c0c4b4e..f6c4f735939c4 100644 --- a/src/test/ui/fn/fn-item-type.stderr +++ b/src/test/ui/fn/fn-item-type.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | eq(foo::, bar::); | ^^^^^^^^^ expected fn item, found a different fn item | - = note: expected type `fn(isize) -> isize {foo::}` - found type `fn(isize) -> isize {bar::}` + = note: expected fn item `fn(isize) -> isize {foo::}` + found fn item `fn(isize) -> isize {bar::}` error[E0308]: mismatched types --> $DIR/fn-item-type.rs:19:19 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | eq(foo::, foo::); | ^^^^^^^^^ expected u8, found i8 | - = note: expected type `fn(isize) -> isize {foo::}` - found type `fn(isize) -> isize {foo::}` + = note: expected fn item `fn(isize) -> isize {foo::}` + found fn item `fn(isize) -> isize {foo::}` error[E0308]: mismatched types --> $DIR/fn-item-type.rs:23:23 @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | eq(bar::, bar::>); | ^^^^^^^^^^^^^^ expected struct `std::string::String`, found struct `std::vec::Vec` | - = note: expected type `fn(isize) -> isize {bar::}` - found type `fn(isize) -> isize {bar::>}` + = note: expected fn item `fn(isize) -> isize {bar::}` + found fn item `fn(isize) -> isize {bar::>}` error[E0308]: mismatched types --> $DIR/fn-item-type.rs:30:26 @@ -31,8 +31,8 @@ error[E0308]: mismatched types LL | eq(::foo, ::foo); | ^^^^^^^^^^^^^^^^^ expected u8, found u16 | - = note: expected type `fn() {::foo}` - found type `fn() {::foo}` + = note: expected fn item `fn() {::foo}` + found fn item `fn() {::foo}` error: aborting due to 4 previous errors diff --git a/src/test/ui/fn/fn-trait-formatting.rs b/src/test/ui/fn/fn-trait-formatting.rs index 5c16c1a7e88b7..c74b79e3a6225 100644 --- a/src/test/ui/fn/fn-trait-formatting.rs +++ b/src/test/ui/fn/fn-trait-formatting.rs @@ -6,15 +6,15 @@ fn main() { let _: () = (box |_: isize| {}) as Box; //~^ ERROR mismatched types //~| expected type `()` - //~| found type `std::boxed::Box` + //~| found struct `std::boxed::Box` let _: () = (box |_: isize, isize| {}) as Box; //~^ ERROR mismatched types //~| expected type `()` - //~| found type `std::boxed::Box` + //~| found struct `std::boxed::Box` let _: () = (box || -> isize { unimplemented!() }) as Box isize>; //~^ ERROR mismatched types //~| expected type `()` - //~| found type `std::boxed::Box isize>` + //~| found struct `std::boxed::Box isize>` needs_fn(1); //~^ ERROR expected a `std::ops::Fn<(isize,)>` closure, found `{integer}` diff --git a/src/test/ui/fn/fn-trait-formatting.stderr b/src/test/ui/fn/fn-trait-formatting.stderr index f891b9c6439be..962a310b875d7 100644 --- a/src/test/ui/fn/fn-trait-formatting.stderr +++ b/src/test/ui/fn/fn-trait-formatting.stderr @@ -5,7 +5,7 @@ LL | let _: () = (box |_: isize| {}) as Box; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` | = note: expected type `()` - found type `std::boxed::Box` + found struct `std::boxed::Box` error[E0308]: mismatched types --> $DIR/fn-trait-formatting.rs:10:17 @@ -14,7 +14,7 @@ LL | let _: () = (box |_: isize, isize| {}) as Box; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` | = note: expected type `()` - found type `std::boxed::Box` + found struct `std::boxed::Box` error[E0308]: mismatched types --> $DIR/fn-trait-formatting.rs:14:17 @@ -23,7 +23,7 @@ LL | let _: () = (box || -> isize { unimplemented!() }) as Box isize>` + found struct `std::boxed::Box isize>` error[E0277]: expected a `std::ops::Fn<(isize,)>` closure, found `{integer}` --> $DIR/fn-trait-formatting.rs:19:14 diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name1.rs b/src/test/ui/fully-qualified-type/fully-qualified-type-name1.rs index 7e5b884103ed2..b4f9a38ff3507 100644 --- a/src/test/ui/fully-qualified-type/fully-qualified-type-name1.rs +++ b/src/test/ui/fully-qualified-type/fully-qualified-type-name1.rs @@ -4,7 +4,7 @@ fn main() { let x: Option; x = 5; //~^ ERROR mismatched types - //~| expected type `std::option::Option` + //~| expected enum `std::option::Option` //~| found type `{integer}` //~| expected enum `std::option::Option`, found integer } diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name1.stderr b/src/test/ui/fully-qualified-type/fully-qualified-type-name1.stderr index e488b1f6b0cb6..6a550b93be290 100644 --- a/src/test/ui/fully-qualified-type/fully-qualified-type-name1.stderr +++ b/src/test/ui/fully-qualified-type/fully-qualified-type-name1.stderr @@ -7,7 +7,7 @@ LL | x = 5; | expected enum `std::option::Option`, found integer | help: try using a variant of the expected enum: `Some(5)` | - = note: expected type `std::option::Option` + = note: expected enum `std::option::Option` found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.rs b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.rs index 21eda1a9012e7..af4a633090b0e 100644 --- a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.rs +++ b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.rs @@ -11,9 +11,9 @@ mod y { fn bar(x: x::Foo) -> y::Foo { return x; //~^ ERROR mismatched types - //~| expected type `y::Foo` - //~| found type `x::Foo` //~| expected enum `y::Foo`, found enum `x::Foo` + //~| expected enum `y::Foo` + //~| found enum `x::Foo` } fn main() { diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr index 47bb5e475b473..fe4579f49b910 100644 --- a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr +++ b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr @@ -6,8 +6,8 @@ LL | fn bar(x: x::Foo) -> y::Foo { LL | return x; | ^ expected enum `y::Foo`, found enum `x::Foo` | - = note: expected type `y::Foo` - found type `x::Foo` + = note: expected enum `y::Foo` + found enum `x::Foo` error: aborting due to previous error diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name4.rs b/src/test/ui/fully-qualified-type/fully-qualified-type-name4.rs index 88910a7bb20ff..c41e6c4c9f03a 100644 --- a/src/test/ui/fully-qualified-type/fully-qualified-type-name4.rs +++ b/src/test/ui/fully-qualified-type/fully-qualified-type-name4.rs @@ -5,7 +5,7 @@ use std::option::Option; fn bar(x: usize) -> Option { return x; //~^ ERROR mismatched types - //~| expected type `std::option::Option` + //~| expected enum `std::option::Option` //~| found type `usize` //~| expected enum `std::option::Option`, found usize } diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name4.stderr b/src/test/ui/fully-qualified-type/fully-qualified-type-name4.stderr index b341879ab919a..26389f4671863 100644 --- a/src/test/ui/fully-qualified-type/fully-qualified-type-name4.stderr +++ b/src/test/ui/fully-qualified-type/fully-qualified-type-name4.stderr @@ -6,7 +6,7 @@ LL | fn bar(x: usize) -> Option { LL | return x; | ^ expected enum `std::option::Option`, found usize | - = note: expected type `std::option::Option` + = note: expected enum `std::option::Option` found type `usize` error: aborting due to previous error diff --git a/src/test/ui/generator/type-mismatch-signature-deduction.stderr b/src/test/ui/generator/type-mismatch-signature-deduction.stderr index 35d3f95c3e9e4..7cae50f42f9e4 100644 --- a/src/test/ui/generator/type-mismatch-signature-deduction.stderr +++ b/src/test/ui/generator/type-mismatch-signature-deduction.stderr @@ -5,7 +5,7 @@ LL | return Ok(6); | ^^^^^ expected i32, found enum `std::result::Result` | = note: expected type `i32` - found type `std::result::Result<{integer}, _>` + found enum `std::result::Result<{integer}, _>` error: aborting due to previous error diff --git a/src/test/ui/generic/generic-arg-mismatch-recover.stderr b/src/test/ui/generic/generic-arg-mismatch-recover.stderr index fe36e807c777d..e544cd1bb3a47 100644 --- a/src/test/ui/generic/generic-arg-mismatch-recover.stderr +++ b/src/test/ui/generic/generic-arg-mismatch-recover.stderr @@ -10,8 +10,8 @@ error[E0308]: mismatched types LL | Foo::<'static, 'static, ()>(&0); | ^^ expected (), found integer | - = note: expected type `&'static ()` - found type `&{integer}` + = note: expected reference `&'static ()` + found reference `&{integer}` error[E0107]: wrong number of lifetime arguments: expected 1, found 2 --> $DIR/generic-arg-mismatch-recover.rs:9:20 diff --git a/src/test/ui/generic/generic-type-params-name-repr.rs b/src/test/ui/generic/generic-type-params-name-repr.rs index 7e074aa2a6bd4..65d409a983770 100644 --- a/src/test/ui/generic/generic-type-params-name-repr.rs +++ b/src/test/ui/generic/generic-type-params-name-repr.rs @@ -12,40 +12,40 @@ fn main() { // Ensure that the printed type doesn't include the default type params... let _: Foo = (); //~^ ERROR mismatched types - //~| expected type `Foo` - //~| found type `()` //~| expected struct `Foo`, found () + //~| expected struct `Foo` + //~| found type `()` // ...even when they're present, but the same types as the defaults. let _: Foo = (); //~^ ERROR mismatched types - //~| expected type `Foo` - //~| found type `()` //~| expected struct `Foo`, found () + //~| expected struct `Foo` + //~| found type `()` // Including cases where the default is using previous type params. let _: HashMap = (); //~^ ERROR mismatched types - //~| expected type `HashMap` - //~| found type `()` //~| expected struct `HashMap`, found () + //~| expected struct `HashMap` + //~| found type `()` let _: HashMap> = (); //~^ ERROR mismatched types - //~| expected type `HashMap` - //~| found type `()` //~| expected struct `HashMap`, found () + //~| expected struct `HashMap` + //~| found type `()` // But not when there's a different type in between. let _: Foo = (); //~^ ERROR mismatched types - //~| expected type `Foo` - //~| found type `()` //~| expected struct `Foo`, found () + //~| expected struct `Foo` + //~| found type `()` // And don't print <> at all when there's just defaults. let _: Foo = (); //~^ ERROR mismatched types - //~| expected type `Foo` - //~| found type `()` //~| expected struct `Foo`, found () + //~| expected struct `Foo` + //~| found type `()` } diff --git a/src/test/ui/generic/generic-type-params-name-repr.stderr b/src/test/ui/generic/generic-type-params-name-repr.stderr index 2aa9cafb8bf0e..86146f7e9bf7d 100644 --- a/src/test/ui/generic/generic-type-params-name-repr.stderr +++ b/src/test/ui/generic/generic-type-params-name-repr.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: Foo = (); | ^^ expected struct `Foo`, found () | - = note: expected type `Foo` - found type `()` + = note: expected struct `Foo` + found type `()` error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:20:31 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let _: Foo = (); | ^^ expected struct `Foo`, found () | - = note: expected type `Foo` - found type `()` + = note: expected struct `Foo` + found type `()` error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:27:37 @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | let _: HashMap = (); | ^^ expected struct `HashMap`, found () | - = note: expected type `HashMap` - found type `()` + = note: expected struct `HashMap` + found type `()` error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:32:51 @@ -31,8 +31,8 @@ error[E0308]: mismatched types LL | let _: HashMap> = (); | ^^ expected struct `HashMap`, found () | - = note: expected type `HashMap` - found type `()` + = note: expected struct `HashMap` + found type `()` error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:39:31 @@ -40,8 +40,8 @@ error[E0308]: mismatched types LL | let _: Foo = (); | ^^ expected struct `Foo`, found () | - = note: expected type `Foo` - found type `()` + = note: expected struct `Foo` + found type `()` error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:46:27 @@ -49,8 +49,8 @@ error[E0308]: mismatched types LL | let _: Foo = (); | ^^ expected struct `Foo`, found () | - = note: expected type `Foo` - found type `()` + = note: expected struct `Foo` + found type `()` error: aborting due to 6 previous errors diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr index 8e2b0b8c60045..c8521a54e6c75 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr @@ -8,8 +8,8 @@ LL | / check! { bound_a_b_ret_a_vs_bound_a_ret_a: (for<'a,'b> fn(&'a u32, &'b u3 LL | | for<'a> fn(&'a u32, &'a u32) -> &'a u32) } | |_________________________________________________________________________________________- in this macro invocation | - = note: expected type `std::option::Option fn(&'a u32, &'b u32) -> &'a u32>` - found type `std::option::Option fn(&'a u32, &'a u32) -> &'a u32>` + = note: expected enum `std::option::Option fn(&'a u32, &'b u32) -> &'a u32>` + found enum `std::option::Option fn(&'a u32, &'a u32) -> &'a u32>` error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr index dbb5018139076..3ad802c5450b3 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr @@ -8,8 +8,8 @@ LL | / check! { bound_a_b_vs_bound_a: (for<'a,'b> fn(&'a u32, &'b u32), LL | | for<'a> fn(&'a u32, &'a u32)) } | |__________________________________________________________________- in this macro invocation | - = note: expected type `std::option::Option fn(&'a u32, &'b u32)>` - found type `std::option::Option fn(&'a u32, &'a u32)>` + = note: expected enum `std::option::Option fn(&'a u32, &'b u32)>` + found enum `std::option::Option fn(&'a u32, &'a u32)>` error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr index db9892b48a6f7..3d09633367cda 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr @@ -8,8 +8,8 @@ LL | / check! { bound_a_vs_free_x: (for<'a> fn(&'a u32), LL | | fn(&'x u32)) } | |___________________________________________- in this macro invocation | - = note: expected type `std::option::Option fn(&'a u32)>` - found type `std::option::Option` + = note: expected enum `std::option::Option fn(&'a u32)>` + found enum `std::option::Option` error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr index e9fb73411bd39..8b623a4c0bea9 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr @@ -8,8 +8,8 @@ LL | / check! { bound_co_a_b_vs_bound_co_a: (for<'a,'b> fn(Co<'a>, Co<'b>), LL | | for<'a> fn(Co<'a>, Co<'a>)) } | |______________________________________________________________________- in this macro invocation | - = note: expected type `std::option::Option fn(Co<'a>, Co<'b>)>` - found type `std::option::Option fn(Co<'a>, Co<'a>)>` + = note: expected enum `std::option::Option fn(Co<'a>, Co<'b>)>` + found enum `std::option::Option fn(Co<'a>, Co<'a>)>` error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr index d0e80faa68e8b..f12bff696913e 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr @@ -8,8 +8,8 @@ LL | / check! { bound_co_a_co_b_ret_contra_a: (for<'a,'b> fn(Co<'a>, Co<'b>) -> LL | | for<'a> fn(Co<'a>, Co<'a>) -> Contra<'a>) } | |______________________________________________________________________________________- in this macro invocation | - = note: expected type `std::option::Option fn(Co<'a>, Co<'b>) -> Contra<'a>>` - found type `std::option::Option fn(Co<'a>, Co<'a>) -> Contra<'a>>` + = note: expected enum `std::option::Option fn(Co<'a>, Co<'b>) -> Contra<'a>>` + found enum `std::option::Option fn(Co<'a>, Co<'a>) -> Contra<'a>>` error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr index 3605ecf4f8667..37ba44cf2e9ba 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr @@ -8,8 +8,8 @@ LL | / check! { bound_contra_a_contra_b_ret_co_a: (for<'a,'b> fn(Contra<'a>, Con LL | | for<'a> fn(Contra<'a>, Contra<'a>) -> Co<'a>) } | |______________________________________________________________________________________________- in this macro invocation | - = note: expected type `std::option::Option fn(Contra<'a>, Contra<'b>) -> Co<'a>>` - found type `std::option::Option fn(Contra<'a>, Contra<'a>) -> Co<'a>>` + = note: expected enum `std::option::Option fn(Contra<'a>, Contra<'b>) -> Co<'a>>` + found enum `std::option::Option fn(Contra<'a>, Contra<'a>) -> Co<'a>>` error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr index fae6e9b5c89ca..a00bbea6d1818 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr @@ -8,8 +8,8 @@ LL | / check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>), LL | | for<'a> fn(Inv<'a>, Inv<'a>)) } | |__________________________________________________________________________- in this macro invocation | - = note: expected type `std::option::Option fn(Inv<'a>, Inv<'b>)>` - found type `std::option::Option fn(Inv<'a>, Inv<'a>)>` + = note: expected enum `std::option::Option fn(Inv<'a>, Inv<'b>)>` + found enum `std::option::Option fn(Inv<'a>, Inv<'a>)>` error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr index 76d97dd2f585d..561f35191767e 100644 --- a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr @@ -8,8 +8,8 @@ LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), LL | | fn(Inv<'y>)) } | |__________________________________________________- in this macro invocation | - = note: expected type `std::option::Option)>` - found type `std::option::Option)>` + = note: expected enum `std::option::Option)>` + found enum `std::option::Option)>` note: the lifetime `'x` as defined on the function body at 32:20... --> $DIR/hr-subtype.rs:32:20 | @@ -39,8 +39,8 @@ LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), LL | | fn(Inv<'y>)) } | |__________________________________________________- in this macro invocation | - = note: expected type `std::option::Option)>` - found type `std::option::Option)>` + = note: expected enum `std::option::Option)>` + found enum `std::option::Option)>` note: the lifetime `'x` as defined on the function body at 38:22... --> $DIR/hr-subtype.rs:38:22 | diff --git a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr index 74f4212b2468b..082627050b357 100644 --- a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr @@ -8,8 +8,8 @@ LL | / check! { free_x_vs_free_y: (fn(&'x u32), LL | | fn(&'y u32)) } | |__________________________________________- in this macro invocation | - = note: expected type `std::option::Option` - found type `std::option::Option` + = note: expected enum `std::option::Option` + found enum `std::option::Option` note: the lifetime `'x` as defined on the function body at 38:22... --> $DIR/hr-subtype.rs:38:22 | diff --git a/src/test/ui/hrtb/hrtb-exists-forall-fn.stderr b/src/test/ui/hrtb/hrtb-exists-forall-fn.stderr index d893cd606f1e4..8534ee99c1fa7 100644 --- a/src/test/ui/hrtb/hrtb-exists-forall-fn.stderr +++ b/src/test/ui/hrtb/hrtb-exists-forall-fn.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: for<'b> fn(&'b u32) = foo(); | ^^^^^ expected concrete lifetime, found bound lifetime parameter 'b | - = note: expected type `for<'b> fn(&'b u32)` - found type `fn(&u32)` + = note: expected fn pointer `for<'b> fn(&'b u32)` + found fn pointer `fn(&u32)` error: aborting due to previous error diff --git a/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr b/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr index fd6fce938b2c7..16847727aef30 100644 --- a/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr +++ b/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr @@ -4,8 +4,8 @@ error[E0271]: type mismatch resolving `for<'r> >::V` + = note: expected struct `Unit4` + found associated type `<_ as Ty<'_>>::V` = note: consider constraining the associated type `<_ as Ty<'_>>::V` to `Unit4` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html @@ -15,8 +15,8 @@ error[E0271]: type mismatch resolving `<[closure@$DIR/issue-62203-hrtb-ice.rs:42 LL | let v = Unit2.m( | ^ expected struct `Unit4`, found struct `Unit3` | - = note: expected type `Unit4` - found type `Unit3` + = note: expected struct `Unit4` + found struct `Unit3` = note: required because of the requirements on the impl of `for<'r> T0<'r, (>::V,)>` for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]>` error: aborting due to 2 previous errors diff --git a/src/test/ui/if/if-no-match-bindings.stderr b/src/test/ui/if/if-no-match-bindings.stderr index 0936f3b9e38e8..215e236f6b01e 100644 --- a/src/test/ui/if/if-no-match-bindings.stderr +++ b/src/test/ui/if/if-no-match-bindings.stderr @@ -7,8 +7,8 @@ LL | if b_ref() {} | expected bool, found &bool | help: consider dereferencing the borrow: `*b_ref()` | - = note: expected type `bool` - found type `&bool` + = note: expected type `bool` + found reference `&bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:19:8 @@ -19,8 +19,8 @@ LL | if b_mut_ref() {} | expected bool, found &mut bool | help: consider dereferencing the borrow: `*b_mut_ref()` | - = note: expected type `bool` - found type `&mut bool` + = note: expected type `bool` + found mutable reference `&mut bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:20:8 @@ -31,8 +31,8 @@ LL | if &true {} | expected bool, found &bool | help: consider removing the borrow: `true` | - = note: expected type `bool` - found type `&bool` + = note: expected type `bool` + found reference `&bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:21:8 @@ -43,8 +43,8 @@ LL | if &mut true {} | expected bool, found &mut bool | help: consider removing the borrow: `true` | - = note: expected type `bool` - found type `&mut bool` + = note: expected type `bool` + found mutable reference `&mut bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:24:11 @@ -55,8 +55,8 @@ LL | while b_ref() {} | expected bool, found &bool | help: consider dereferencing the borrow: `*b_ref()` | - = note: expected type `bool` - found type `&bool` + = note: expected type `bool` + found reference `&bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:25:11 @@ -67,8 +67,8 @@ LL | while b_mut_ref() {} | expected bool, found &mut bool | help: consider dereferencing the borrow: `*b_mut_ref()` | - = note: expected type `bool` - found type `&mut bool` + = note: expected type `bool` + found mutable reference `&mut bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:26:11 @@ -79,8 +79,8 @@ LL | while &true {} | expected bool, found &bool | help: consider removing the borrow: `true` | - = note: expected type `bool` - found type `&bool` + = note: expected type `bool` + found reference `&bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:27:11 @@ -91,8 +91,8 @@ LL | while &mut true {} | expected bool, found &mut bool | help: consider removing the borrow: `true` | - = note: expected type `bool` - found type `&mut bool` + = note: expected type `bool` + found mutable reference `&mut bool` error: aborting due to 8 previous errors diff --git a/src/test/ui/if/if-typeck.stderr b/src/test/ui/if/if-typeck.stderr index 714d3ebcdb016..2bddcc707c6e4 100644 --- a/src/test/ui/if/if-typeck.stderr +++ b/src/test/ui/if/if-typeck.stderr @@ -5,7 +5,7 @@ LL | if f { } | ^ expected bool, found fn item | = note: expected type `bool` - found type `fn() {f}` + found fn item `fn() {f}` error: aborting due to previous error diff --git a/src/test/ui/if/ifmt-bad-arg.stderr b/src/test/ui/if/ifmt-bad-arg.stderr index d65ffd8506034..2f81c3938efa8 100644 --- a/src/test/ui/if/ifmt-bad-arg.stderr +++ b/src/test/ui/if/ifmt-bad-arg.stderr @@ -302,8 +302,8 @@ error[E0308]: mismatched types LL | println!("{} {:.*} {}", 1, 3.2, 4); | ^^^ expected usize, found floating-point number | - = note: expected type `&usize` - found type `&{float}` + = note: expected reference `&usize` + found reference `&{float}` error[E0308]: mismatched types --> $DIR/ifmt-bad-arg.rs:81:35 @@ -311,8 +311,8 @@ error[E0308]: mismatched types LL | println!("{} {:07$.*} {}", 1, 3.2, 4); | ^^^ expected usize, found floating-point number | - = note: expected type `&usize` - found type `&{float}` + = note: expected reference `&usize` + found reference `&{float}` error: aborting due to 36 previous errors diff --git a/src/test/ui/impl-trait/bound-normalization-fail.stderr b/src/test/ui/impl-trait/bound-normalization-fail.stderr index 99c6a8cdd6daf..0074ac314178c 100644 --- a/src/test/ui/impl-trait/bound-normalization-fail.stderr +++ b/src/test/ui/impl-trait/bound-normalization-fail.stderr @@ -12,8 +12,8 @@ error[E0271]: type mismatch resolving ` as FooLike>::Output == () -> impl FooLike { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found associated type | - = note: expected type `()` - found type `::Assoc` + = note: expected type `()` + found associated type `::Assoc` = note: consider constraining the associated type `::Assoc` to `()` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html = note: the return type of a function must have a statically known size @@ -30,8 +30,8 @@ error[E0271]: type mismatch resolving ` as FooLike>::Output == >() -> impl FooLike { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found associated type | - = note: expected type `()` - found type `>::Assoc` + = note: expected type `()` + found associated type `>::Assoc` = note: consider constraining the associated type `>::Assoc` to `()` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html = note: the return type of a function must have a statically known size diff --git a/src/test/ui/impl-trait/equality2.rs b/src/test/ui/impl-trait/equality2.rs index a01779e8fcd89..29cd67a806d58 100644 --- a/src/test/ui/impl-trait/equality2.rs +++ b/src/test/ui/impl-trait/equality2.rs @@ -25,13 +25,13 @@ fn main() { let _: u32 = hide(0_u32); //~^ ERROR mismatched types //~| expected type `u32` - //~| found type `impl Foo` + //~| found opaque type `impl Foo` //~| expected u32, found opaque type let _: i32 = Leak::leak(hide(0_i32)); //~^ ERROR mismatched types //~| expected type `i32` - //~| found type `::T` + //~| found associated type `::T` //~| expected i32, found associated type let mut x = (hide(0_u32), hide(0_i32)); diff --git a/src/test/ui/impl-trait/equality2.stderr b/src/test/ui/impl-trait/equality2.stderr index e30e2626e9f34..de85f5f6eec9f 100644 --- a/src/test/ui/impl-trait/equality2.stderr +++ b/src/test/ui/impl-trait/equality2.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: u32 = hide(0_u32); | ^^^^^^^^^^^ expected u32, found opaque type | - = note: expected type `u32` - found type `impl Foo` + = note: expected type `u32` + found opaque type `impl Foo` error[E0308]: mismatched types --> $DIR/equality2.rs:31:18 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let _: i32 = Leak::leak(hide(0_i32)); | ^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found associated type | - = note: expected type `i32` - found type `::T` + = note: expected type `i32` + found associated type `::T` = note: consider constraining the associated type `::T` to `i32` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html @@ -24,8 +24,8 @@ error[E0308]: mismatched types LL | x = (x.1, | ^^^ expected u32, found i32 | - = note: expected type `impl Foo` (u32) - found type `impl Foo` (i32) + = note: expected opaque type `impl Foo` (u32) + found opaque type `impl Foo` (i32) error[E0308]: mismatched types --> $DIR/equality2.rs:41:10 @@ -33,8 +33,8 @@ error[E0308]: mismatched types LL | x.0); | ^^^ expected i32, found u32 | - = note: expected type `impl Foo` (i32) - found type `impl Foo` (u32) + = note: expected opaque type `impl Foo` (i32) + found opaque type `impl Foo` (u32) error: aborting due to 4 previous errors diff --git a/src/test/ui/impl-trait/impl-generic-mismatch-ab.stderr b/src/test/ui/impl-trait/impl-generic-mismatch-ab.stderr index 7cb4677a2b199..638a0093fb21d 100644 --- a/src/test/ui/impl-trait/impl-generic-mismatch-ab.stderr +++ b/src/test/ui/impl-trait/impl-generic-mismatch-ab.stderr @@ -9,8 +9,8 @@ LL | fn foo(&self, a: &impl Debug, b: &B) { } | | | expected type parameter | - = note: expected type `fn(&(), &B, &impl Debug)` - found type `fn(&(), &impl Debug, &B)` + = note: expected fn pointer `fn(&(), &B, &impl Debug)` + found fn pointer `fn(&(), &impl Debug, &B)` = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/impl-trait/trait_type.stderr b/src/test/ui/impl-trait/trait_type.stderr index 151dc68162155..d95b62e469e8c 100644 --- a/src/test/ui/impl-trait/trait_type.stderr +++ b/src/test/ui/impl-trait/trait_type.stderr @@ -4,8 +4,8 @@ error[E0053]: method `fmt` has an incompatible type for trait LL | fn fmt(&self, x: &str) -> () { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability | - = note: expected type `fn(&MyType, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>` - found type `fn(&MyType, &str)` + = note: expected fn pointer `fn(&MyType, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>` + found fn pointer `fn(&MyType, &str)` error[E0050]: method `fmt` has 1 parameter but the declaration in trait `std::fmt::Display::fmt` has 2 --> $DIR/trait_type.rs:12:11 diff --git a/src/test/ui/impl-trait/universal-mismatched-type.stderr b/src/test/ui/impl-trait/universal-mismatched-type.stderr index ae20a5aa88388..3ffa2b55712eb 100644 --- a/src/test/ui/impl-trait/universal-mismatched-type.stderr +++ b/src/test/ui/impl-trait/universal-mismatched-type.stderr @@ -8,8 +8,8 @@ LL | fn foo(x: impl Debug) -> String { LL | x | ^ expected struct `std::string::String`, found type parameter `impl Debug` | - = note: expected type `std::string::String` - found type `impl Debug` + = note: expected struct `std::string::String` + found type parameter `impl Debug` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/impl-trait/universal-two-impl-traits.stderr b/src/test/ui/impl-trait/universal-two-impl-traits.stderr index f540d319a2797..7c120235fd176 100644 --- a/src/test/ui/impl-trait/universal-two-impl-traits.stderr +++ b/src/test/ui/impl-trait/universal-two-impl-traits.stderr @@ -9,8 +9,8 @@ LL | let mut a = x; LL | a = y; | ^ expected type parameter `impl Debug`, found a different type parameter `impl Debug` | - = note: expected type `impl Debug` (type parameter `impl Debug`) - found type `impl Debug` (type parameter `impl Debug`) + = note: expected type parameter `impl Debug` (type parameter `impl Debug`) + found type parameter `impl Debug` (type parameter `impl Debug`) = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/include-macros/mismatched-types.stderr b/src/test/ui/include-macros/mismatched-types.stderr index 33204f1cfce9b..79f12356a6de4 100644 --- a/src/test/ui/include-macros/mismatched-types.stderr +++ b/src/test/ui/include-macros/mismatched-types.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let b: &[u8] = include_str!("file.txt"); | ^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found str | - = note: expected type `&[u8]` - found type `&'static str` + = note: expected reference `&[u8]` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/mismatched-types.rs:3:19 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let s: &str = include_bytes!("file.txt"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected str, found array of 0 elements | - = note: expected type `&str` - found type `&'static [u8; 0]` + = note: expected reference `&str` + found reference `&'static [u8; 0]` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-10176.rs b/src/test/ui/issues/issue-10176.rs index ff0619b489d7f..9f42214a5051b 100644 --- a/src/test/ui/issues/issue-10176.rs +++ b/src/test/ui/issues/issue-10176.rs @@ -2,7 +2,7 @@ fn f() -> isize { (return 1, return 2) //~^ ERROR mismatched types //~| expected type `isize` -//~| found type `(!, !)` +//~| found tuple `(!, !)` //~| expected isize, found tuple } diff --git a/src/test/ui/issues/issue-10176.stderr b/src/test/ui/issues/issue-10176.stderr index 45482447ebe2c..7cab5a1f7c3a5 100644 --- a/src/test/ui/issues/issue-10176.stderr +++ b/src/test/ui/issues/issue-10176.stderr @@ -7,7 +7,7 @@ LL | (return 1, return 2) | ^^^^^^^^^^^^^^^^^^^^ expected isize, found tuple | = note: expected type `isize` - found type `(!, !)` + found tuple `(!, !)` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-10764.stderr b/src/test/ui/issues/issue-10764.stderr index c5f1887b7965c..b0bafc9942ee9 100644 --- a/src/test/ui/issues/issue-10764.stderr +++ b/src/test/ui/issues/issue-10764.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | fn main() { f(bar) } | ^^^ expected "Rust" fn, found "C" fn | - = note: expected type `fn()` - found type `extern "C" fn() {bar}` + = note: expected fn pointer `fn()` + found fn item `extern "C" fn() {bar}` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-11374.stderr b/src/test/ui/issues/issue-11374.stderr index 8d7e6c81f4fce..a5b9de0a0a316 100644 --- a/src/test/ui/issues/issue-11374.stderr +++ b/src/test/ui/issues/issue-11374.stderr @@ -7,8 +7,8 @@ LL | c.read_to(v); | expected &mut [u8], found struct `std::vec::Vec` | help: consider mutably borrowing here: `&mut v` | - = note: expected type `&mut [u8]` - found type `std::vec::Vec<_>` + = note: expected mutable reference `&mut [u8]` + found struct `std::vec::Vec<_>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-11515.stderr b/src/test/ui/issues/issue-11515.stderr index 0ab0c7dba0b76..b53563d7b653c 100644 --- a/src/test/ui/issues/issue-11515.stderr +++ b/src/test/ui/issues/issue-11515.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let test = box Test { func: closure }; | ^^^^^^^ expected trait `std::ops::FnMut`, found trait `std::ops::Fn` | - = note: expected type `std::boxed::Box<(dyn std::ops::FnMut() + 'static)>` - found type `std::boxed::Box<(dyn std::ops::Fn() + 'static)>` + = note: expected struct `std::boxed::Box<(dyn std::ops::FnMut() + 'static)>` + found struct `std::boxed::Box<(dyn std::ops::Fn() + 'static)>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-11844.stderr b/src/test/ui/issues/issue-11844.stderr index 1c4321f1b4ab0..1b22d6f45cf20 100644 --- a/src/test/ui/issues/issue-11844.stderr +++ b/src/test/ui/issues/issue-11844.stderr @@ -6,8 +6,8 @@ LL | match a { LL | Ok(a) => | ^^^^^ expected enum `std::option::Option`, found enum `std::result::Result` | - = note: expected type `std::option::Option>` - found type `std::result::Result<_, _>` + = note: expected enum `std::option::Option>` + found enum `std::result::Result<_, _>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-12552.stderr b/src/test/ui/issues/issue-12552.stderr index 6eaac1b35776f..ecafef259d3c9 100644 --- a/src/test/ui/issues/issue-12552.stderr +++ b/src/test/ui/issues/issue-12552.stderr @@ -6,8 +6,8 @@ LL | match t { LL | Some(k) => match k { | ^^^^^^^ expected enum `std::result::Result`, found enum `std::option::Option` | - = note: expected type `std::result::Result<_, {integer}>` - found type `std::option::Option<_>` + = note: expected enum `std::result::Result<_, {integer}>` + found enum `std::option::Option<_>` error[E0308]: mismatched types --> $DIR/issue-12552.rs:9:5 @@ -15,8 +15,8 @@ error[E0308]: mismatched types LL | None => () | ^^^^ expected enum `std::result::Result`, found enum `std::option::Option` | - = note: expected type `std::result::Result<_, {integer}>` - found type `std::option::Option<_>` + = note: expected enum `std::result::Result<_, {integer}>` + found enum `std::option::Option<_>` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-12997-2.stderr b/src/test/ui/issues/issue-12997-2.stderr index df8c936b8242a..bac69075c83bb 100644 --- a/src/test/ui/issues/issue-12997-2.stderr +++ b/src/test/ui/issues/issue-12997-2.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | fn bar(x: isize) { } | ^^^^^^^^^^^^^^^^^^^^ expected isize, found mutable reference | - = note: expected type `isize` - found type `&mut test::Bencher` + = note: expected type `isize` + found mutable reference `&mut test::Bencher` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-13033.rs b/src/test/ui/issues/issue-13033.rs index e5274eb823d46..7631831a81a5b 100644 --- a/src/test/ui/issues/issue-13033.rs +++ b/src/test/ui/issues/issue-13033.rs @@ -7,8 +7,8 @@ struct Baz; impl Foo for Baz { fn bar(&mut self, other: &dyn Foo) {} //~^ ERROR method `bar` has an incompatible type for trait - //~| expected type `fn(&mut Baz, &mut dyn Foo)` - //~| found type `fn(&mut Baz, &dyn Foo)` + //~| expected fn pointer `fn(&mut Baz, &mut dyn Foo)` + //~| found fn pointer `fn(&mut Baz, &dyn Foo)` } fn main() {} diff --git a/src/test/ui/issues/issue-13033.stderr b/src/test/ui/issues/issue-13033.stderr index 195d0c39b2983..a8473c8a52413 100644 --- a/src/test/ui/issues/issue-13033.stderr +++ b/src/test/ui/issues/issue-13033.stderr @@ -7,8 +7,8 @@ LL | fn bar(&mut self, other: &mut dyn Foo); LL | fn bar(&mut self, other: &dyn Foo) {} | ^^^^^^^^ types differ in mutability | - = note: expected type `fn(&mut Baz, &mut dyn Foo)` - found type `fn(&mut Baz, &dyn Foo)` + = note: expected fn pointer `fn(&mut Baz, &mut dyn Foo)` + found fn pointer `fn(&mut Baz, &dyn Foo)` help: consider change the type to match the mutability in trait | LL | fn bar(&mut self, other: &mut dyn Foo) {} diff --git a/src/test/ui/issues/issue-13407.stderr b/src/test/ui/issues/issue-13407.stderr index ddd99e6a3c9a8..4c3e481564f23 100644 --- a/src/test/ui/issues/issue-13407.stderr +++ b/src/test/ui/issues/issue-13407.stderr @@ -10,8 +10,8 @@ error[E0308]: mismatched types LL | A::C = 1; | ^ expected struct `A::C`, found integer | - = note: expected type `A::C` - found type `{integer}` + = note: expected struct `A::C` + found type `{integer}` error[E0070]: invalid left-hand side expression --> $DIR/issue-13407.rs:6:5 diff --git a/src/test/ui/issues/issue-13446.stderr b/src/test/ui/issues/issue-13446.stderr index a27bfeda64c26..80a32cd276a98 100644 --- a/src/test/ui/issues/issue-13446.stderr +++ b/src/test/ui/issues/issue-13446.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | static VEC: [u32; 256] = vec![]; | ^^^^^^ expected array of 256 elements, found struct `std::vec::Vec` | - = note: expected type `[u32; 256]` - found type `std::vec::Vec<_>` + = note: expected array `[u32; 256]` + found struct `std::vec::Vec<_>` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-13466.rs b/src/test/ui/issues/issue-13466.rs index c285bfa107d4c..411e7cbeebd76 100644 --- a/src/test/ui/issues/issue-13466.rs +++ b/src/test/ui/issues/issue-13466.rs @@ -7,14 +7,14 @@ pub fn main() { let _x: usize = match Some(1) { Ok(u) => u, //~^ ERROR mismatched types - //~| expected type `std::option::Option<{integer}>` - //~| found type `std::result::Result<_, _>` + //~| expected enum `std::option::Option<{integer}>` + //~| found enum `std::result::Result<_, _>` //~| expected enum `std::option::Option`, found enum `std::result::Result` Err(e) => panic!(e) //~^ ERROR mismatched types - //~| expected type `std::option::Option<{integer}>` - //~| found type `std::result::Result<_, _>` + //~| expected enum `std::option::Option<{integer}>` + //~| found enum `std::result::Result<_, _>` //~| expected enum `std::option::Option`, found enum `std::result::Result` }; } diff --git a/src/test/ui/issues/issue-13466.stderr b/src/test/ui/issues/issue-13466.stderr index 66255891f469a..fc20615757aa8 100644 --- a/src/test/ui/issues/issue-13466.stderr +++ b/src/test/ui/issues/issue-13466.stderr @@ -6,8 +6,8 @@ LL | let _x: usize = match Some(1) { LL | Ok(u) => u, | ^^^^^ expected enum `std::option::Option`, found enum `std::result::Result` | - = note: expected type `std::option::Option<{integer}>` - found type `std::result::Result<_, _>` + = note: expected enum `std::option::Option<{integer}>` + found enum `std::result::Result<_, _>` error[E0308]: mismatched types --> $DIR/issue-13466.rs:14:9 @@ -18,8 +18,8 @@ LL | let _x: usize = match Some(1) { LL | Err(e) => panic!(e) | ^^^^^^ expected enum `std::option::Option`, found enum `std::result::Result` | - = note: expected type `std::option::Option<{integer}>` - found type `std::result::Result<_, _>` + = note: expected enum `std::option::Option<{integer}>` + found enum `std::result::Result<_, _>` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-13853.stderr b/src/test/ui/issues/issue-13853.stderr index 67721356208c0..cdb261a238e56 100644 --- a/src/test/ui/issues/issue-13853.stderr +++ b/src/test/ui/issues/issue-13853.stderr @@ -7,8 +7,8 @@ LL | fn nodes<'a, I: Iterator>(&self) -> I LL | self.iter() | ^^^^^^^^^^^ expected type parameter `I`, found struct `std::slice::Iter` | - = note: expected type `I` - found type `std::slice::Iter<'_, N>` + = note: expected type parameter `I` + found struct `std::slice::Iter<'_, N>` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters @@ -27,8 +27,8 @@ LL | iterate(graph); | expected reference, found struct `std::vec::Vec` | help: consider borrowing here: `&graph` | - = note: expected type `&_` - found type `std::vec::Vec` + = note: expected reference `&_` + found struct `std::vec::Vec` error: aborting due to 3 previous errors diff --git a/src/test/ui/issues/issue-14541.rs b/src/test/ui/issues/issue-14541.rs index 705c3d326c65c..e8d44a4a9f88d 100644 --- a/src/test/ui/issues/issue-14541.rs +++ b/src/test/ui/issues/issue-14541.rs @@ -4,9 +4,9 @@ struct Vec3 { y: f32, z: f32 } fn make(v: Vec2) { let Vec3 { y: _, z: _ } = v; //~^ ERROR mismatched types - //~| expected type `Vec2` - //~| found type `Vec3` //~| expected struct `Vec2`, found struct `Vec3` + //~| expected struct `Vec2` + //~| found struct `Vec3` } fn main() { } diff --git a/src/test/ui/issues/issue-14541.stderr b/src/test/ui/issues/issue-14541.stderr index aa0ae5ce44349..e7cae883d6bf2 100644 --- a/src/test/ui/issues/issue-14541.stderr +++ b/src/test/ui/issues/issue-14541.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let Vec3 { y: _, z: _ } = v; | ^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found struct `Vec3` | - = note: expected type `Vec2` - found type `Vec3` + = note: expected struct `Vec2` + found struct `Vec3` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-15094.rs b/src/test/ui/issues/issue-15094.rs index dea85df5efe0a..71b75a6e7e00f 100644 --- a/src/test/ui/issues/issue-15094.rs +++ b/src/test/ui/issues/issue-15094.rs @@ -10,8 +10,8 @@ impl ops::FnOnce<(),> for Debuger { type Output = (); fn call_once(self, _args: ()) { //~^ ERROR `call_once` has an incompatible type for trait - //~| expected type `extern "rust-call" fn - //~| found type `fn + //~| expected fn pointer `extern "rust-call" fn + //~| found fn pointer `fn println!("{:?}", self.x); } } diff --git a/src/test/ui/issues/issue-15094.stderr b/src/test/ui/issues/issue-15094.stderr index 07e147132f7d4..7b392fe1ac71b 100644 --- a/src/test/ui/issues/issue-15094.stderr +++ b/src/test/ui/issues/issue-15094.stderr @@ -4,8 +4,8 @@ error[E0053]: method `call_once` has an incompatible type for trait LL | fn call_once(self, _args: ()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "rust-call" fn, found "Rust" fn | - = note: expected type `extern "rust-call" fn(Debuger, ())` - found type `fn(Debuger, ())` + = note: expected fn pointer `extern "rust-call" fn(Debuger, ())` + found fn pointer `fn(Debuger, ())` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-15783.rs b/src/test/ui/issues/issue-15783.rs index 5189f550cfbd6..61cb0093b1c44 100644 --- a/src/test/ui/issues/issue-15783.rs +++ b/src/test/ui/issues/issue-15783.rs @@ -7,8 +7,8 @@ fn main() { let x = Some(&[name]); let msg = foo(x); //~^ ERROR mismatched types - //~| expected type `std::option::Option<&[&str]>` - //~| found type `std::option::Option<&[&str; 1]>` + //~| expected enum `std::option::Option<&[&str]>` + //~| found enum `std::option::Option<&[&str; 1]>` //~| expected slice, found array of 1 element assert_eq!(msg, 3); } diff --git a/src/test/ui/issues/issue-15783.stderr b/src/test/ui/issues/issue-15783.stderr index 1d54b2830d6c5..f60655b7a34d3 100644 --- a/src/test/ui/issues/issue-15783.stderr +++ b/src/test/ui/issues/issue-15783.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let msg = foo(x); | ^ expected slice, found array of 1 element | - = note: expected type `std::option::Option<&[&str]>` - found type `std::option::Option<&[&str; 1]>` + = note: expected enum `std::option::Option<&[&str]>` + found enum `std::option::Option<&[&str; 1]>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-15896.rs b/src/test/ui/issues/issue-15896.rs index 3054af7b93093..1a0a7b4b8e6d9 100644 --- a/src/test/ui/issues/issue-15896.rs +++ b/src/test/ui/issues/issue-15896.rs @@ -10,9 +10,9 @@ fn main() { E::B( Tau{t: x}, //~^ ERROR mismatched types - //~| expected type `main::R` - //~| found type `main::Tau` //~| expected enum `main::R`, found struct `main::Tau` + //~| expected enum `main::R` + //~| found struct `main::Tau` _) => x, }; } diff --git a/src/test/ui/issues/issue-15896.stderr b/src/test/ui/issues/issue-15896.stderr index de9757d5d32ed..a8227bb19c23f 100644 --- a/src/test/ui/issues/issue-15896.stderr +++ b/src/test/ui/issues/issue-15896.stderr @@ -7,8 +7,8 @@ LL | E::B( LL | Tau{t: x}, | ^^^^^^^^^ expected enum `main::R`, found struct `main::Tau` | - = note: expected type `main::R` - found type `main::Tau` + = note: expected enum `main::R` + found struct `main::Tau` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-16338.rs b/src/test/ui/issues/issue-16338.rs index 7567740f28b05..321b3576cd61f 100644 --- a/src/test/ui/issues/issue-16338.rs +++ b/src/test/ui/issues/issue-16338.rs @@ -6,5 +6,5 @@ struct Slice { fn main() { let Slice { data: data, len: len } = "foo"; //~^ ERROR mismatched types - //~| found type `Slice<_>` + //~| found struct `Slice<_>` } diff --git a/src/test/ui/issues/issue-16338.stderr b/src/test/ui/issues/issue-16338.stderr index af8c39d24ec02..cae09c2151908 100644 --- a/src/test/ui/issues/issue-16338.stderr +++ b/src/test/ui/issues/issue-16338.stderr @@ -5,7 +5,7 @@ LL | let Slice { data: data, len: len } = "foo"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected str, found struct `Slice` | = note: expected type `str` - found type `Slice<_>` + found struct `Slice<_>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-16401.rs b/src/test/ui/issues/issue-16401.rs index 7135b7d82efa6..9ed730ba2113f 100644 --- a/src/test/ui/issues/issue-16401.rs +++ b/src/test/ui/issues/issue-16401.rs @@ -8,7 +8,7 @@ fn main() { Slice { data: data, len: len } => (), //~^ ERROR mismatched types //~| expected type `()` - //~| found type `Slice<_>` + //~| found struct `Slice<_>` //~| expected (), found struct `Slice` _ => unreachable!() } diff --git a/src/test/ui/issues/issue-16401.stderr b/src/test/ui/issues/issue-16401.stderr index 1779d0befd871..e5bacc36de5e1 100644 --- a/src/test/ui/issues/issue-16401.stderr +++ b/src/test/ui/issues/issue-16401.stderr @@ -7,7 +7,7 @@ LL | Slice { data: data, len: len } => (), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `Slice` | = note: expected type `()` - found type `Slice<_>` + found struct `Slice<_>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-17033.rs b/src/test/ui/issues/issue-17033.rs index d39b5683fee93..be80dce137151 100644 --- a/src/test/ui/issues/issue-17033.rs +++ b/src/test/ui/issues/issue-17033.rs @@ -1,6 +1,6 @@ fn f<'r>(p: &'r mut fn(p: &mut ())) { (*p)(()) //~ ERROR mismatched types - //~| expected type `&mut ()` + //~| expected mutable reference `&mut ()` //~| found type `()` //~| expected &mut (), found () } diff --git a/src/test/ui/issues/issue-17033.stderr b/src/test/ui/issues/issue-17033.stderr index ba78aa2bc6a50..c84b30d721f00 100644 --- a/src/test/ui/issues/issue-17033.stderr +++ b/src/test/ui/issues/issue-17033.stderr @@ -7,8 +7,8 @@ LL | (*p)(()) | expected &mut (), found () | help: consider mutably borrowing here: `&mut ()` | - = note: expected type `&mut ()` - found type `()` + = note: expected mutable reference `&mut ()` + found type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-17728.stderr b/src/test/ui/issues/issue-17728.stderr index 945dfc26b206d..527168dbe6cc2 100644 --- a/src/test/ui/issues/issue-17728.stderr +++ b/src/test/ui/issues/issue-17728.stderr @@ -24,8 +24,8 @@ LL | | _ => None LL | | } | |_____- `match` arms have incompatible types | - = note: expected type `RoomDirection` - found type `std::option::Option<_>` + = note: expected enum `RoomDirection` + found enum `std::option::Option<_>` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-17740.rs b/src/test/ui/issues/issue-17740.rs index b47568400c3b7..3b868555fc522 100644 --- a/src/test/ui/issues/issue-17740.rs +++ b/src/test/ui/issues/issue-17740.rs @@ -5,12 +5,12 @@ struct Foo<'a> { impl <'a> Foo<'a>{ fn bar(self: &mut Foo) { //~^ mismatched `self` parameter type - //~| expected type `Foo<'a>` - //~| found type `Foo<'_>` + //~| expected struct `Foo<'a>` + //~| found struct `Foo<'_>` //~| lifetime mismatch //~| mismatched `self` parameter type - //~| expected type `Foo<'a>` - //~| found type `Foo<'_>` + //~| expected struct `Foo<'a>` + //~| found struct `Foo<'_>` //~| lifetime mismatch } } diff --git a/src/test/ui/issues/issue-17740.stderr b/src/test/ui/issues/issue-17740.stderr index d392ea3c1b861..cd1d7f821c706 100644 --- a/src/test/ui/issues/issue-17740.stderr +++ b/src/test/ui/issues/issue-17740.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched `self` parameter type LL | fn bar(self: &mut Foo) { | ^^^^^^^^ lifetime mismatch | - = note: expected type `Foo<'a>` - found type `Foo<'_>` + = note: expected struct `Foo<'a>` + found struct `Foo<'_>` note: the anonymous lifetime #2 defined on the method body at 6:5... --> $DIR/issue-17740.rs:6:5 | @@ -29,8 +29,8 @@ error[E0308]: mismatched `self` parameter type LL | fn bar(self: &mut Foo) { | ^^^^^^^^ lifetime mismatch | - = note: expected type `Foo<'a>` - found type `Foo<'_>` + = note: expected struct `Foo<'a>` + found struct `Foo<'_>` note: the lifetime `'a` as defined on the impl at 5:7... --> $DIR/issue-17740.rs:5:7 | diff --git a/src/test/ui/issues/issue-17905-2.stderr b/src/test/ui/issues/issue-17905-2.stderr index 04be62dc661bf..f347c26f066e0 100644 --- a/src/test/ui/issues/issue-17905-2.stderr +++ b/src/test/ui/issues/issue-17905-2.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched `self` parameter type LL | fn say(self: &Pair<&str, isize>) { | ^^^^^^^^^^^^^^^^^^ lifetime mismatch | - = note: expected type `Pair<&str, _>` - found type `Pair<&str, _>` + = note: expected struct `Pair<&str, _>` + found struct `Pair<&str, _>` note: the anonymous lifetime #2 defined on the method body at 8:5... --> $DIR/issue-17905-2.rs:8:5 | @@ -27,8 +27,8 @@ error[E0308]: mismatched `self` parameter type LL | fn say(self: &Pair<&str, isize>) { | ^^^^^^^^^^^^^^^^^^ lifetime mismatch | - = note: expected type `Pair<&str, _>` - found type `Pair<&str, _>` + = note: expected struct `Pair<&str, _>` + found struct `Pair<&str, _>` note: the lifetime `'_` as defined on the impl at 5:5... --> $DIR/issue-17905-2.rs:5:5 | diff --git a/src/test/ui/issues/issue-20225.stderr b/src/test/ui/issues/issue-20225.stderr index 40093b13edfe0..63b0451e01a18 100644 --- a/src/test/ui/issues/issue-20225.stderr +++ b/src/test/ui/issues/issue-20225.stderr @@ -6,8 +6,8 @@ LL | impl<'a, T> Fn<(&'a T,)> for Foo { LL | extern "rust-call" fn call(&self, (_,): (T,)) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter `T` | - = note: expected type `extern "rust-call" fn(&Foo, (&'a T,))` - found type `extern "rust-call" fn(&Foo, (T,))` + = note: expected fn pointer `extern "rust-call" fn(&Foo, (&'a T,))` + found fn pointer `extern "rust-call" fn(&Foo, (T,))` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters @@ -19,8 +19,8 @@ LL | impl<'a, T> FnMut<(&'a T,)> for Foo { LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter `T` | - = note: expected type `extern "rust-call" fn(&mut Foo, (&'a T,))` - found type `extern "rust-call" fn(&mut Foo, (T,))` + = note: expected fn pointer `extern "rust-call" fn(&mut Foo, (&'a T,))` + found fn pointer `extern "rust-call" fn(&mut Foo, (T,))` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters @@ -33,8 +33,8 @@ LL | impl<'a, T> FnOnce<(&'a T,)> for Foo { LL | extern "rust-call" fn call_once(self, (_,): (T,)) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter `T` | - = note: expected type `extern "rust-call" fn(Foo, (&'a T,))` - found type `extern "rust-call" fn(Foo, (T,))` + = note: expected fn pointer `extern "rust-call" fn(Foo, (&'a T,))` + found fn pointer `extern "rust-call" fn(Foo, (T,))` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/issues/issue-21332.stderr b/src/test/ui/issues/issue-21332.stderr index 693b2be6c0095..ace3e014647c9 100644 --- a/src/test/ui/issues/issue-21332.stderr +++ b/src/test/ui/issues/issue-21332.stderr @@ -4,8 +4,8 @@ error[E0053]: method `next` has an incompatible type for trait LL | fn next(&mut self) -> Result { Ok(7) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `std::option::Option`, found enum `std::result::Result` | - = note: expected type `fn(&mut S) -> std::option::Option` - found type `fn(&mut S) -> std::result::Result` + = note: expected fn pointer `fn(&mut S) -> std::option::Option` + found fn pointer `fn(&mut S) -> std::result::Result` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-23589.stderr b/src/test/ui/issues/issue-23589.stderr index c3b419fe939cb..8d58095ceff30 100644 --- a/src/test/ui/issues/issue-23589.stderr +++ b/src/test/ui/issues/issue-23589.stderr @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let v: Vec(&str) = vec!['1', '2']; | ^^^ expected &str, found char | - = note: expected type `&str` - found type `char` + = note: expected reference `&str` + found type `char` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-24036.stderr b/src/test/ui/issues/issue-24036.stderr index fa9935fcf619d..04817f2596abd 100644 --- a/src/test/ui/issues/issue-24036.stderr +++ b/src/test/ui/issues/issue-24036.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | x = |c| c + 1; | ^^^^^^^^^ expected closure, found a different closure | - = note: expected type `[closure@$DIR/issue-24036.rs:2:17: 2:26]` - found type `[closure@$DIR/issue-24036.rs:3:9: 3:18]` + = note: expected closure `[closure@$DIR/issue-24036.rs:2:17: 2:26]` + found closure `[closure@$DIR/issue-24036.rs:3:9: 3:18]` = note: no two closures, even if identical, have the same type = help: consider boxing your closure and/or using it as a trait object @@ -23,7 +23,7 @@ LL | | }; | |_____- `match` arms have incompatible types | = note: expected type `[closure@$DIR/issue-24036.rs:9:14: 9:23]` - found type `[closure@$DIR/issue-24036.rs:10:14: 10:23]` + found closure `[closure@$DIR/issue-24036.rs:10:14: 10:23]` = note: no two closures, even if identical, have the same type = help: consider boxing your closure and/or using it as a trait object diff --git a/src/test/ui/issues/issue-24204.stderr b/src/test/ui/issues/issue-24204.stderr index ace5b5f72fc62..3eb1f1b4f6e81 100644 --- a/src/test/ui/issues/issue-24204.stderr +++ b/src/test/ui/issues/issue-24204.stderr @@ -7,8 +7,8 @@ LL | trait Trait: Sized { LL | fn test>(b: i32) -> T where T::A: MultiDispatch { T::new(b) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found associated type | - = note: expected type `T` - found type `<::A as MultiDispatch>::O` + = note: expected type parameter `T` + found associated type `<::A as MultiDispatch>::O` = note: you might be missing a type parameter or trait bound error: aborting due to previous error diff --git a/src/test/ui/issues/issue-24322.stderr b/src/test/ui/issues/issue-24322.stderr index def373cf2c0a8..fb0c7a0d80904 100644 --- a/src/test/ui/issues/issue-24322.stderr +++ b/src/test/ui/issues/issue-24322.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let x: &fn(&B) -> u32 = &B::func; | ^^^^^^^^ expected fn pointer, found fn item | - = note: expected type `&for<'r> fn(&'r B) -> u32` - found type `&for<'r> fn(&'r B) -> u32 {B::func}` + = note: expected reference `&for<'r> fn(&'r B) -> u32` + found reference `&for<'r> fn(&'r B) -> u32 {B::func}` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-24819.stderr b/src/test/ui/issues/issue-24819.stderr index 5f1cd0a255ffa..1166a887f8696 100644 --- a/src/test/ui/issues/issue-24819.stderr +++ b/src/test/ui/issues/issue-24819.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | foo(&mut v); | ^^^^^^ expected struct `std::collections::HashSet`, found struct `std::vec::Vec` | - = note: expected type `&mut std::collections::HashSet` - found type `&mut std::vec::Vec<_>` + = note: expected mutable reference `&mut std::collections::HashSet` + found mutable reference `&mut std::vec::Vec<_>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-27008.rs b/src/test/ui/issues/issue-27008.rs index b37ea6f01ba4b..3b271a2a35bdb 100644 --- a/src/test/ui/issues/issue-27008.rs +++ b/src/test/ui/issues/issue-27008.rs @@ -3,7 +3,7 @@ struct S; fn main() { let b = [0; S]; //~^ ERROR mismatched types - //~| expected type `usize` - //~| found type `S` //~| expected usize, found struct `S` + //~| expected type `usize` + //~| found struct `S` } diff --git a/src/test/ui/issues/issue-27008.stderr b/src/test/ui/issues/issue-27008.stderr index c45d757ff0a3d..598ee741a5c8b 100644 --- a/src/test/ui/issues/issue-27008.stderr +++ b/src/test/ui/issues/issue-27008.stderr @@ -5,7 +5,7 @@ LL | let b = [0; S]; | ^ expected usize, found struct `S` | = note: expected type `usize` - found type `S` + found struct `S` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-29084.rs b/src/test/ui/issues/issue-29084.rs index 86b348d828597..4710a594b3102 100644 --- a/src/test/ui/issues/issue-29084.rs +++ b/src/test/ui/issues/issue-29084.rs @@ -5,7 +5,7 @@ macro_rules! foo { //~^ ERROR mismatched types //~| expected u8, found &mut u8 //~| expected type `u8` - //~| found type `&mut u8` + //~| found mutable reference `&mut u8` }} } diff --git a/src/test/ui/issues/issue-29084.stderr b/src/test/ui/issues/issue-29084.stderr index cb4bf6a08ef86..0a238761fc604 100644 --- a/src/test/ui/issues/issue-29084.stderr +++ b/src/test/ui/issues/issue-29084.stderr @@ -7,8 +7,8 @@ LL | bar(&mut $d); LL | foo!(0u8); | ---------- in this macro invocation | - = note: expected type `u8` - found type `&mut u8` + = note: expected type `u8` + found mutable reference `&mut u8` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-2951.rs b/src/test/ui/issues/issue-2951.rs index cc52dab02459c..1798e3e751923 100644 --- a/src/test/ui/issues/issue-2951.rs +++ b/src/test/ui/issues/issue-2951.rs @@ -2,9 +2,9 @@ fn foo(x: T, y: U) { let mut xx = x; xx = y; //~^ ERROR mismatched types - //~| expected type `T` - //~| found type `U` //~| expected type parameter `T`, found type parameter `U` + //~| expected type parameter `T` + //~| found type parameter `U` } fn main() { diff --git a/src/test/ui/issues/issue-2951.stderr b/src/test/ui/issues/issue-2951.stderr index 414571752904c..b966b33938917 100644 --- a/src/test/ui/issues/issue-2951.stderr +++ b/src/test/ui/issues/issue-2951.stderr @@ -9,8 +9,8 @@ LL | let mut xx = x; LL | xx = y; | ^ expected type parameter `T`, found type parameter `U` | - = note: expected type `T` - found type `U` + = note: expected type parameter `T` + found type parameter `U` = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/issues/issue-30225.stderr b/src/test/ui/issues/issue-30225.stderr index 64a56e3237dc3..27a567548ba29 100644 --- a/src/test/ui/issues/issue-30225.stderr +++ b/src/test/ui/issues/issue-30225.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | u = v; // mark $0 and $1 in a subtype relationship | ^ expected struct `A`, found struct `B` | - = note: expected type `A` - found type `B` + = note: expected struct `A` + found struct `B` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-31173.rs b/src/test/ui/issues/issue-31173.rs index 6df80664575f3..26195318380d2 100644 --- a/src/test/ui/issues/issue-31173.rs +++ b/src/test/ui/issues/issue-31173.rs @@ -10,7 +10,7 @@ pub fn get_tok(it: &mut IntoIter) { .cloned() //~^ ERROR type mismatch resolving //~| expected type `u8` - //~| found type `&_` + //~| found reference `&_` .collect(); //~ ERROR no method named `collect` } diff --git a/src/test/ui/issues/issue-31173.stderr b/src/test/ui/issues/issue-31173.stderr index 6d03b7810939a..0cc64d2f9c1a9 100644 --- a/src/test/ui/issues/issue-31173.stderr +++ b/src/test/ui/issues/issue-31173.stderr @@ -4,8 +4,8 @@ error[E0271]: type mismatch resolving `, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>` in the current scope --> $DIR/issue-31173.rs:14:10 diff --git a/src/test/ui/issues/issue-32323.stderr b/src/test/ui/issues/issue-32323.stderr index 9c11a02923c8c..e7ad46a4aeff8 100644 --- a/src/test/ui/issues/issue-32323.stderr +++ b/src/test/ui/issues/issue-32323.stderr @@ -6,8 +6,8 @@ LL | pub fn f<'a, T: Tr<'a>>() -> >::Out {} | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected type `>::Out` - found type `()` + = note: expected associated type `>::Out` + found type `()` = note: consider constraining the associated type `>::Out` to `()` or calling a method that returns `>::Out` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html diff --git a/src/test/ui/issues/issue-33504.stderr b/src/test/ui/issues/issue-33504.stderr index 7af555eaa2ce4..758f86d3db850 100644 --- a/src/test/ui/issues/issue-33504.stderr +++ b/src/test/ui/issues/issue-33504.stderr @@ -5,7 +5,7 @@ LL | let Test = 1; | ^^^^ expected integer, found struct `Test` | = note: expected type `{integer}` - found type `Test` + found struct `Test` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-33941.stderr b/src/test/ui/issues/issue-33941.stderr index 596921e526d96..734ae78f362db 100644 --- a/src/test/ui/issues/issue-33941.stderr +++ b/src/test/ui/issues/issue-33941.stderr @@ -4,8 +4,8 @@ error[E0271]: type mismatch resolving ` as std::iter::Iterator>::Item == &_` --> $DIR/issue-33941.rs:4:14 @@ -13,8 +13,8 @@ error[E0271]: type mismatch resolving `>` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-34334.stderr b/src/test/ui/issues/issue-34334.stderr index a3749487ac92f..c68056a8bd718 100644 --- a/src/test/ui/issues/issue-34334.stderr +++ b/src/test/ui/issues/issue-34334.stderr @@ -32,7 +32,7 @@ LL | let sr: Vec<(u32, _, _) = vec![]; | ^^^^^^ expected bool, found struct `std::vec::Vec` | = note: expected type `bool` - found type `std::vec::Vec<_>` + found struct `std::vec::Vec<_>` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error[E0070]: invalid left-hand side expression diff --git a/src/test/ui/issues/issue-35241.stderr b/src/test/ui/issues/issue-35241.stderr index 586146cbaa4ee..4a52a292ef30a 100644 --- a/src/test/ui/issues/issue-35241.stderr +++ b/src/test/ui/issues/issue-35241.stderr @@ -11,8 +11,8 @@ LL | fn test() -> Foo { Foo } | | help: use parentheses to instantiate this tuple struct: `Foo(_)` | expected `Foo` because of return type | - = note: expected type `Foo` - found type `fn(u32) -> Foo {Foo}` + = note: expected struct `Foo` + found fn item `fn(u32) -> Foo {Foo}` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-35869.stderr b/src/test/ui/issues/issue-35869.stderr index 4ef840d019f1d..f70a9c8818a4e 100644 --- a/src/test/ui/issues/issue-35869.stderr +++ b/src/test/ui/issues/issue-35869.stderr @@ -7,8 +7,8 @@ LL | fn foo(_: fn(u8) -> ()); LL | fn foo(_: fn(u16) -> ()) {} | ^^^^^^^^^^^^^ expected u8, found u16 | - = note: expected type `fn(fn(u8))` - found type `fn(fn(u16))` + = note: expected fn pointer `fn(fn(u8))` + found fn pointer `fn(fn(u16))` error[E0053]: method `bar` has an incompatible type for trait --> $DIR/issue-35869.rs:13:15 @@ -19,8 +19,8 @@ LL | fn bar(_: Option); LL | fn bar(_: Option) {} | ^^^^^^^^^^^ expected u8, found u16 | - = note: expected type `fn(std::option::Option)` - found type `fn(std::option::Option)` + = note: expected fn pointer `fn(std::option::Option)` + found fn pointer `fn(std::option::Option)` error[E0053]: method `baz` has an incompatible type for trait --> $DIR/issue-35869.rs:15:15 @@ -31,8 +31,8 @@ LL | fn baz(_: (u8, u16)); LL | fn baz(_: (u16, u16)) {} | ^^^^^^^^^^ expected u8, found u16 | - = note: expected type `fn((u8, u16))` - found type `fn((u16, u16))` + = note: expected fn pointer `fn((u8, u16))` + found fn pointer `fn((u16, u16))` error[E0053]: method `qux` has an incompatible type for trait --> $DIR/issue-35869.rs:17:17 @@ -43,8 +43,8 @@ LL | fn qux() -> u8; LL | fn qux() -> u16 { 5u16 } | ^^^ expected u8, found u16 | - = note: expected type `fn() -> u8` - found type `fn() -> u16` + = note: expected fn pointer `fn() -> u8` + found fn pointer `fn() -> u16` error: aborting due to 4 previous errors diff --git a/src/test/ui/issues/issue-3680.rs b/src/test/ui/issues/issue-3680.rs index 3604203082d89..64050c72f2ca6 100644 --- a/src/test/ui/issues/issue-3680.rs +++ b/src/test/ui/issues/issue-3680.rs @@ -2,8 +2,8 @@ fn main() { match None { Err(_) => () //~^ ERROR mismatched types - //~| expected type `std::option::Option<_>` - //~| found type `std::result::Result<_, _>` + //~| expected enum `std::option::Option<_>` + //~| found enum `std::result::Result<_, _>` //~| expected enum `std::option::Option`, found enum `std::result::Result` } } diff --git a/src/test/ui/issues/issue-3680.stderr b/src/test/ui/issues/issue-3680.stderr index 51903cfadab15..8856f0e3a4844 100644 --- a/src/test/ui/issues/issue-3680.stderr +++ b/src/test/ui/issues/issue-3680.stderr @@ -6,8 +6,8 @@ LL | match None { LL | Err(_) => () | ^^^^^^ expected enum `std::option::Option`, found enum `std::result::Result` | - = note: expected type `std::option::Option<_>` - found type `std::result::Result<_, _>` + = note: expected enum `std::option::Option<_>` + found enum `std::result::Result<_, _>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-37026.stderr b/src/test/ui/issues/issue-37026.stderr index 1f81264ffdb49..239f0a181908e 100644 --- a/src/test/ui/issues/issue-37026.stderr +++ b/src/test/ui/issues/issue-37026.stderr @@ -5,7 +5,7 @@ LL | let empty_struct::XEmpty2 = (); | ^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty2` | = note: expected type `()` - found type `empty_struct::XEmpty2` + found struct `empty_struct::XEmpty2` error[E0308]: mismatched types --> $DIR/issue-37026.rs:7:9 @@ -14,7 +14,7 @@ LL | let empty_struct::XEmpty6(..) = (); | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty6` | = note: expected type `()` - found type `empty_struct::XEmpty6` + found struct `empty_struct::XEmpty6` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-37884.stderr b/src/test/ui/issues/issue-37884.stderr index 8e75d7be066a3..61cb3d7c58f38 100644 --- a/src/test/ui/issues/issue-37884.stderr +++ b/src/test/ui/issues/issue-37884.stderr @@ -9,8 +9,8 @@ LL | | Some(&mut self.0) LL | | } | |_____^ lifetime mismatch | - = note: expected type `fn(&mut RepeatMut<'a, T>) -> std::option::Option<&mut T>` - found type `fn(&'a mut RepeatMut<'a, T>) -> std::option::Option<&mut T>` + = note: expected fn pointer `fn(&mut RepeatMut<'a, T>) -> std::option::Option<&mut T>` + found fn pointer `fn(&'a mut RepeatMut<'a, T>) -> std::option::Option<&mut T>` note: the anonymous lifetime #1 defined on the method body at 6:5... --> $DIR/issue-37884.rs:6:5 | diff --git a/src/test/ui/issues/issue-38940.stderr b/src/test/ui/issues/issue-38940.stderr index 4851c01a347b6..707fcc7e919cd 100644 --- a/src/test/ui/issues/issue-38940.stderr +++ b/src/test/ui/issues/issue-38940.stderr @@ -12,8 +12,8 @@ error[E0308]: mismatched types LL | let x: &Bottom = &t; | ^^ expected struct `Bottom`, found struct `Top` | - = note: expected type `&Bottom` - found type `&Top` + = note: expected reference `&Bottom` + found reference `&Top` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-39970.stderr b/src/test/ui/issues/issue-39970.stderr index f15f771fa9f6e..8bc62dd1b84bf 100644 --- a/src/test/ui/issues/issue-39970.stderr +++ b/src/test/ui/issues/issue-39970.stderr @@ -7,8 +7,8 @@ LL | fn visit() {} LL | <() as Visit>::visit(); | ^^^^^^^^^^^^^^^^^^^^ expected &(), found () | - = note: expected type `&()` - found type `()` + = note: expected reference `&()` + found type `()` = note: required because of the requirements on the impl of `Visit` for `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-40000.stderr b/src/test/ui/issues/issue-40000.stderr index c48fb24ea17dc..983fdb13083a1 100644 --- a/src/test/ui/issues/issue-40000.stderr +++ b/src/test/ui/issues/issue-40000.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | foo(bar); | ^^^ expected concrete lifetime, found bound lifetime parameter | - = note: expected type `std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r i32) + 'static)>` - found type `std::boxed::Box` + = note: expected struct `std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r i32) + 'static)>` + found struct `std::boxed::Box` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-40749.rs b/src/test/ui/issues/issue-40749.rs index 14908c3653e28..87ff5a650feb5 100644 --- a/src/test/ui/issues/issue-40749.rs +++ b/src/test/ui/issues/issue-40749.rs @@ -2,5 +2,5 @@ fn main() { [0; ..10]; //~^ ERROR mismatched types //~| expected type `usize` - //~| found type `std::ops::RangeTo<{integer}>` + //~| found struct `std::ops::RangeTo<{integer}>` } diff --git a/src/test/ui/issues/issue-40749.stderr b/src/test/ui/issues/issue-40749.stderr index be050d4470c0f..67d5d6be640b1 100644 --- a/src/test/ui/issues/issue-40749.stderr +++ b/src/test/ui/issues/issue-40749.stderr @@ -5,7 +5,7 @@ LL | [0; ..10]; | ^^^^ expected usize, found struct `std::ops::RangeTo` | = note: expected type `usize` - found type `std::ops::RangeTo<{integer}>` + found struct `std::ops::RangeTo<{integer}>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-41742.stderr b/src/test/ui/issues/issue-41742.stderr index f205abf55768c..a1dae867ae6fb 100644 --- a/src/test/ui/issues/issue-41742.stderr +++ b/src/test/ui/issues/issue-41742.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | H["?"].f(); | ^^^ expected u32, found reference | - = note: expected type `u32` - found type `&'static str` + = note: expected type `u32` + found reference `&'static str` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-43420-no-over-suggest.stderr b/src/test/ui/issues/issue-43420-no-over-suggest.stderr index 7a3722e4bd727..4d61788c347d5 100644 --- a/src/test/ui/issues/issue-43420-no-over-suggest.stderr +++ b/src/test/ui/issues/issue-43420-no-over-suggest.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | foo(&a); | ^^ expected slice, found struct `std::vec::Vec` | - = note: expected type `&[u16]` - found type `&std::vec::Vec` + = note: expected reference `&[u16]` + found reference `&std::vec::Vec` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-4517.rs b/src/test/ui/issues/issue-4517.rs index bbe81f3fc7820..569fdc1662a7b 100644 --- a/src/test/ui/issues/issue-4517.rs +++ b/src/test/ui/issues/issue-4517.rs @@ -5,6 +5,6 @@ fn main() { bar(foo); //~^ ERROR mismatched types //~| expected type `usize` - //~| found type `[u8; 4]` + //~| found array `[u8; 4]` //~| expected usize, found array of 4 elements } diff --git a/src/test/ui/issues/issue-4517.stderr b/src/test/ui/issues/issue-4517.stderr index 7d88e55044093..0f45e91d6f562 100644 --- a/src/test/ui/issues/issue-4517.stderr +++ b/src/test/ui/issues/issue-4517.stderr @@ -5,7 +5,7 @@ LL | bar(foo); | ^^^ expected usize, found array of 4 elements | = note: expected type `usize` - found type `[u8; 4]` + found array `[u8; 4]` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-46112.stderr b/src/test/ui/issues/issue-46112.stderr index 07e90c567480f..30ec6a966cebf 100644 --- a/src/test/ui/issues/issue-46112.stderr +++ b/src/test/ui/issues/issue-46112.stderr @@ -7,7 +7,7 @@ LL | fn main() { test(Ok(())); } | expected enum `std::option::Option`, found () | help: try using a variant of the expected enum: `Some(())` | - = note: expected type `std::option::Option<()>` + = note: expected enum `std::option::Option<()>` found type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-46302.stderr b/src/test/ui/issues/issue-46302.stderr index 8eb3a4dda34e8..221d4b6d67f71 100644 --- a/src/test/ui/issues/issue-46302.stderr +++ b/src/test/ui/issues/issue-46302.stderr @@ -7,8 +7,8 @@ LL | let u: &str = if true { s[..2] } else { s }; | expected &str, found str | help: consider borrowing here: `&s[..2]` | - = note: expected type `&str` - found type `str` + = note: expected reference `&str` + found type `str` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr b/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr index 1eeca3e75b003..dd6bef5c102c6 100644 --- a/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr +++ b/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr @@ -7,8 +7,8 @@ LL | light_flows_our_war_of_mocking_words(behold as usize); | expected &usize, found usize | help: consider borrowing here: `&(behold as usize)` | - = note: expected type `&usize` - found type `usize` + = note: expected reference `&usize` + found type `usize` error[E0308]: mismatched types --> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:14:42 @@ -19,8 +19,8 @@ LL | light_flows_our_war_of_mocking_words(with_tears + 4); | expected &usize, found usize | help: consider borrowing here: `&(with_tears + 4)` | - = note: expected type `&usize` - found type `usize` + = note: expected reference `&usize` + found type `usize` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-48364.stderr b/src/test/ui/issues/issue-48364.stderr index 7a1ba5bb19361..4e4e0e7ed94a0 100644 --- a/src/test/ui/issues/issue-48364.stderr +++ b/src/test/ui/issues/issue-48364.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | b"".starts_with(stringify!(foo)) | ^^^^^^^^^^^^^^^ expected slice, found str | - = note: expected type `&[u8]` - found type `&'static str` + = note: expected reference `&[u8]` + found reference `&'static str` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-48838.stderr b/src/test/ui/issues/issue-48838.stderr index 3007d67336b50..684e518c36f93 100644 --- a/src/test/ui/issues/issue-48838.stderr +++ b/src/test/ui/issues/issue-48838.stderr @@ -5,7 +5,7 @@ LL | Square = |x| x, | ^^^^^ expected isize, found closure | = note: expected type `isize` - found type `[closure@$DIR/issue-48838.rs:2:14: 2:19]` + found closure `[closure@$DIR/issue-48838.rs:2:14: 2:19]` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-4968.rs b/src/test/ui/issues/issue-4968.rs index 383b9ecd466fe..634bd698d7705 100644 --- a/src/test/ui/issues/issue-4968.rs +++ b/src/test/ui/issues/issue-4968.rs @@ -5,6 +5,6 @@ fn main() { match 42 { A => () } //~^ ERROR mismatched types //~| expected type `{integer}` - //~| found type `(isize, isize)` + //~| found tuple `(isize, isize)` //~| expected integer, found tuple } diff --git a/src/test/ui/issues/issue-4968.stderr b/src/test/ui/issues/issue-4968.stderr index a925783723b44..35435d0e61819 100644 --- a/src/test/ui/issues/issue-4968.stderr +++ b/src/test/ui/issues/issue-4968.stderr @@ -5,7 +5,7 @@ LL | match 42 { A => () } | ^ expected integer, found tuple | = note: expected type `{integer}` - found type `(isize, isize)` + found tuple `(isize, isize)` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-50600.stderr b/src/test/ui/issues/issue-50600.stderr index 2d97c2781c2d1..8278b0af9f283 100644 --- a/src/test/ui/issues/issue-50600.stderr +++ b/src/test/ui/issues/issue-50600.stderr @@ -5,7 +5,7 @@ LL | fn([u8; |x: u8| {}]), | ^^^^^^^^^^ expected usize, found closure | = note: expected type `usize` - found type `[closure@$DIR/issue-50600.rs:2:13: 2:23]` + found closure `[closure@$DIR/issue-50600.rs:2:13: 2:23]` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-50688.stderr b/src/test/ui/issues/issue-50688.stderr index 13eec8361ba8a..bb69744803d2f 100644 --- a/src/test/ui/issues/issue-50688.stderr +++ b/src/test/ui/issues/issue-50688.stderr @@ -5,7 +5,7 @@ LL | [1; || {}]; | ^^^^^ expected usize, found closure | = note: expected type `usize` - found type `[closure@$DIR/issue-50688.rs:2:9: 2:14]` + found closure `[closure@$DIR/issue-50688.rs:2:9: 2:14]` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-5100.rs b/src/test/ui/issues/issue-5100.rs index 505dfbb27de17..8f6928bf3798f 100644 --- a/src/test/ui/issues/issue-5100.rs +++ b/src/test/ui/issues/issue-5100.rs @@ -7,41 +7,41 @@ fn main() { match (true, false) { A::B => (), //~^ ERROR mismatched types -//~| expected type `(bool, bool)` -//~| found type `A` //~| expected tuple, found enum `A` +//~| expected tuple `(bool, bool)` +//~| found enum `A` _ => () } match (true, false) { (true, false, false) => () //~^ ERROR mismatched types -//~| expected type `(bool, bool)` -//~| found type `(_, _, _)` //~| expected a tuple with 2 elements, found one with 3 elements +//~| expected tuple `(bool, bool)` +//~| found tuple `(_, _, _)` } match (true, false) { (true, false, false) => () //~^ ERROR mismatched types -//~| expected type `(bool, bool)` -//~| found type `(_, _, _)` //~| expected a tuple with 2 elements, found one with 3 elements +//~| expected tuple `(bool, bool)` +//~| found tuple `(_, _, _)` } match (true, false) { box (true, false) => () //~^ ERROR mismatched types -//~| expected type `(bool, bool)` -//~| found type `std::boxed::Box<_>` +//~| expected tuple `(bool, bool)` +//~| found struct `std::boxed::Box<_>` } match (true, false) { &(true, false) => () //~^ ERROR mismatched types -//~| expected type `(bool, bool)` -//~| found type `&_` //~| expected tuple, found reference +//~| expected tuple `(bool, bool)` +//~| found reference `&_` } diff --git a/src/test/ui/issues/issue-5100.stderr b/src/test/ui/issues/issue-5100.stderr index b50d24671a850..60d94478b3b8a 100644 --- a/src/test/ui/issues/issue-5100.stderr +++ b/src/test/ui/issues/issue-5100.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | A::B => (), | ^^^^ expected tuple, found enum `A` | - = note: expected type `(bool, bool)` - found type `A` + = note: expected tuple `(bool, bool)` + found enum `A` error[E0308]: mismatched types --> $DIR/issue-5100.rs:17:9 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | (true, false, false) => () | ^^^^^^^^^^^^^^^^^^^^ expected a tuple with 2 elements, found one with 3 elements | - = note: expected type `(bool, bool)` - found type `(_, _, _)` + = note: expected tuple `(bool, bool)` + found tuple `(_, _, _)` error[E0308]: mismatched types --> $DIR/issue-5100.rs:25:9 @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | (true, false, false) => () | ^^^^^^^^^^^^^^^^^^^^ expected a tuple with 2 elements, found one with 3 elements | - = note: expected type `(bool, bool)` - found type `(_, _, _)` + = note: expected tuple `(bool, bool)` + found tuple `(_, _, _)` error[E0308]: mismatched types --> $DIR/issue-5100.rs:33:9 @@ -33,8 +33,8 @@ LL | match (true, false) { LL | box (true, false) => () | ^^^^^^^^^^^^^^^^^ expected tuple, found struct `std::boxed::Box` | - = note: expected type `(bool, bool)` - found type `std::boxed::Box<_>` + = note: expected tuple `(bool, bool)` + found struct `std::boxed::Box<_>` error[E0308]: mismatched types --> $DIR/issue-5100.rs:40:9 @@ -42,8 +42,8 @@ error[E0308]: mismatched types LL | &(true, false) => () | ^^^^^^^^^^^^^^ expected tuple, found reference | - = note: expected type `(bool, bool)` - found type `&_` + = note: expected tuple `(bool, bool)` + found reference `&_` error[E0618]: expected function, found `(char, char)` --> $DIR/issue-5100.rs:48:14 diff --git a/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.stderr b/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.stderr index bf45357147916..94178d512109b 100644 --- a/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.stderr +++ b/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.stderr @@ -7,7 +7,7 @@ LL | missing_discourses()? | | help: try removing this `?` | expected enum `std::result::Result`, found isize | - = note: expected type `std::result::Result` + = note: expected enum `std::result::Result` found type `isize` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-5216.stderr b/src/test/ui/issues/issue-5216.stderr index ccfe7e04a2cf9..21d9333735cc7 100644 --- a/src/test/ui/issues/issue-5216.stderr +++ b/src/test/ui/issues/issue-5216.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | pub static C: S = S(f); | ^ expected struct `std::boxed::Box`, found fn item | - = note: expected type `std::boxed::Box<(dyn std::ops::FnMut() + 'static)>` - found type `fn() {f}` + = note: expected struct `std::boxed::Box<(dyn std::ops::FnMut() + 'static)>` + found fn item `fn() {f}` error[E0308]: mismatched types --> $DIR/issue-5216.rs:8:19 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | pub static D: T = g; | ^ expected struct `std::boxed::Box`, found fn item | - = note: expected type `std::boxed::Box<(dyn std::ops::FnMut() + 'static)>` - found type `fn() {g}` + = note: expected struct `std::boxed::Box<(dyn std::ops::FnMut() + 'static)>` + found fn item `fn() {g}` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-52533-1.stderr b/src/test/ui/issues/issue-52533-1.stderr index c719c00ef2239..dd37d3e559381 100644 --- a/src/test/ui/issues/issue-52533-1.stderr +++ b/src/test/ui/issues/issue-52533-1.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | gimme(|x, y| y) | ^ lifetime mismatch | - = note: expected type `&Foo<'_, '_, u32>` - found type `&Foo<'_, '_, u32>` + = note: expected reference `&Foo<'_, '_, u32>` + found reference `&Foo<'_, '_, u32>` note: the anonymous lifetime #4 defined on the body at 9:11... --> $DIR/issue-52533-1.rs:9:11 | diff --git a/src/test/ui/issues/issue-53348.rs b/src/test/ui/issues/issue-53348.rs index 733413f0e1713..83e5ddc48261a 100644 --- a/src/test/ui/issues/issue-53348.rs +++ b/src/test/ui/issues/issue-53348.rs @@ -10,7 +10,7 @@ fn main() { a = *i.to_string(); //~^ ERROR mismatched types //~| NOTE expected struct `std::string::String`, found str - //~| NOTE expected type + //~| NOTE expected struct v2.push(a); } } diff --git a/src/test/ui/issues/issue-53348.stderr b/src/test/ui/issues/issue-53348.stderr index ca07b1de43591..949d9a2f47d3d 100644 --- a/src/test/ui/issues/issue-53348.stderr +++ b/src/test/ui/issues/issue-53348.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | a = *i.to_string(); | ^^^^^^^^^^^^^^ expected struct `std::string::String`, found str | - = note: expected type `std::string::String` - found type `str` + = note: expected struct `std::string::String` + found type `str` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-5358-1.rs b/src/test/ui/issues/issue-5358-1.rs index 6b23be2030de9..f5e32e78d8794 100644 --- a/src/test/ui/issues/issue-5358-1.rs +++ b/src/test/ui/issues/issue-5358-1.rs @@ -5,9 +5,9 @@ fn main() { match S(Either::Left(5)) { Either::Right(_) => {} //~^ ERROR mismatched types - //~| expected type `S` - //~| found type `Either<_, _>` //~| expected struct `S`, found enum `Either` + //~| expected struct `S` + //~| found enum `Either<_, _>` _ => {} } } diff --git a/src/test/ui/issues/issue-5358-1.stderr b/src/test/ui/issues/issue-5358-1.stderr index 649a0c1581a68..ec79d874d0339 100644 --- a/src/test/ui/issues/issue-5358-1.stderr +++ b/src/test/ui/issues/issue-5358-1.stderr @@ -6,8 +6,8 @@ LL | match S(Either::Left(5)) { LL | Either::Right(_) => {} | ^^^^^^^^^^^^^^^^ expected struct `S`, found enum `Either` | - = note: expected type `S` - found type `Either<_, _>` + = note: expected struct `S` + found enum `Either<_, _>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-53692.stderr b/src/test/ui/issues/issue-53692.stderr index 2928d4461c5ec..e3f2cb8c4101d 100644 --- a/src/test/ui/issues/issue-53692.stderr +++ b/src/test/ui/issues/issue-53692.stderr @@ -7,8 +7,8 @@ LL | let items_clone: Vec = ref_items.clone(); | expected struct `std::vec::Vec`, found &[i32] | help: try using a conversion method: `ref_items.to_vec()` | - = note: expected type `std::vec::Vec` - found type `&[i32]` + = note: expected struct `std::vec::Vec` + found reference `&[i32]` error[E0308]: mismatched types --> $DIR/issue-53692.rs:11:30 @@ -19,8 +19,8 @@ LL | let string: String = s.clone(); | expected struct `std::string::String`, found &str | help: try using a conversion method: `s.to_string()` | - = note: expected type `std::string::String` - found type `&str` + = note: expected struct `std::string::String` + found reference `&str` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-56943.stderr b/src/test/ui/issues/issue-56943.stderr index 27202051524c9..fc6370b2d31cb 100644 --- a/src/test/ui/issues/issue-56943.stderr +++ b/src/test/ui/issues/issue-56943.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: issue_56943::S = issue_56943::S2; | ^^^^^^^^^^^^^^^ expected struct `issue_56943::S`, found struct `issue_56943::S2` | - = note: expected type `issue_56943::S` - found type `issue_56943::S2` + = note: expected struct `issue_56943::S` + found struct `issue_56943::S2` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-57741-1.stderr b/src/test/ui/issues/issue-57741-1.stderr index d36424b83b4e1..db6fa9db8ff47 100644 --- a/src/test/ui/issues/issue-57741-1.stderr +++ b/src/test/ui/issues/issue-57741-1.stderr @@ -6,8 +6,8 @@ LL | let y = match x { LL | S::A { a } | S::B { b: a } => a, | ^^^^^^^^^^ expected struct `std::boxed::Box`, found enum `S` | - = note: expected type `std::boxed::Box` - found type `S` + = note: expected struct `std::boxed::Box` + found enum `S` error[E0308]: mismatched types --> $DIR/issue-57741-1.rs:14:22 @@ -17,8 +17,8 @@ LL | let y = match x { LL | S::A { a } | S::B { b: a } => a, | ^^^^^^^^^^^^^ expected struct `std::boxed::Box`, found enum `S` | - = note: expected type `std::boxed::Box` - found type `S` + = note: expected struct `std::boxed::Box` + found enum `S` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-57741.stderr b/src/test/ui/issues/issue-57741.stderr index a26b1d20ca3cb..c36dea7bf5547 100644 --- a/src/test/ui/issues/issue-57741.stderr +++ b/src/test/ui/issues/issue-57741.stderr @@ -9,8 +9,8 @@ LL | let y = match x { LL | T::A(a) | T::B(a) => a, | ^^^^^^^ expected struct `std::boxed::Box`, found enum `T` | - = note: expected type `std::boxed::Box` - found type `T` + = note: expected struct `std::boxed::Box` + found enum `T` error[E0308]: mismatched types --> $DIR/issue-57741.rs:20:19 @@ -23,8 +23,8 @@ LL | let y = match x { LL | T::A(a) | T::B(a) => a, | ^^^^^^^ expected struct `std::boxed::Box`, found enum `T` | - = note: expected type `std::boxed::Box` - found type `T` + = note: expected struct `std::boxed::Box` + found enum `T` error[E0308]: mismatched types --> $DIR/issue-57741.rs:27:9 @@ -37,8 +37,8 @@ LL | let y = match x { LL | S::A { a } | S::B { b: a } => a, | ^^^^^^^^^^ expected struct `std::boxed::Box`, found enum `S` | - = note: expected type `std::boxed::Box` - found type `S` + = note: expected struct `std::boxed::Box` + found enum `S` error[E0308]: mismatched types --> $DIR/issue-57741.rs:27:22 @@ -51,8 +51,8 @@ LL | let y = match x { LL | S::A { a } | S::B { b: a } => a, | ^^^^^^^^^^^^^ expected struct `std::boxed::Box`, found enum `S` | - = note: expected type `std::boxed::Box` - found type `S` + = note: expected struct `std::boxed::Box` + found enum `S` error: aborting due to 4 previous errors diff --git a/src/test/ui/issues/issue-59488.stderr b/src/test/ui/issues/issue-59488.stderr index 2397d583488e6..35ada71a1f128 100644 --- a/src/test/ui/issues/issue-59488.stderr +++ b/src/test/ui/issues/issue-59488.stderr @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | foo > 12; | ^^ expected fn item, found integer | - = note: expected type `fn() -> i32 {foo}` - found type `i32` + = note: expected fn item `fn() -> i32 {foo}` + found type `i32` error[E0369]: binary operation `>` cannot be applied to type `fn(i64) -> i64 {bar}` --> $DIR/issue-59488.rs:18:9 @@ -31,8 +31,8 @@ error[E0308]: mismatched types LL | bar > 13; | ^^ expected fn item, found integer | - = note: expected type `fn(i64) -> i64 {bar}` - found type `i64` + = note: expected fn item `fn(i64) -> i64 {bar}` + found type `i64` error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}` --> $DIR/issue-59488.rs:22:9 @@ -67,8 +67,8 @@ error[E0308]: mismatched types LL | foo > bar; | ^^^ expected fn item, found a different fn item | - = note: expected type `fn() -> i32 {foo}` - found type `fn(i64) -> i64 {bar}` + = note: expected fn item `fn() -> i32 {foo}` + found fn item `fn(i64) -> i64 {bar}` error[E0369]: binary operation `==` cannot be applied to type `fn(usize) -> Foo {Foo::Bar}` --> $DIR/issue-59488.rs:30:5 diff --git a/src/test/ui/issues/issue-59756.stderr b/src/test/ui/issues/issue-59756.stderr index d46232874fd2a..150916c03668a 100644 --- a/src/test/ui/issues/issue-59756.stderr +++ b/src/test/ui/issues/issue-59756.stderr @@ -7,8 +7,8 @@ LL | foo()? | | help: try removing this `?` | expected enum `std::result::Result`, found struct `A` | - = note: expected type `std::result::Result` - found type `A` + = note: expected enum `std::result::Result` + found struct `A` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-61106.stderr b/src/test/ui/issues/issue-61106.stderr index ca67d51492845..8690ff4731fed 100644 --- a/src/test/ui/issues/issue-61106.stderr +++ b/src/test/ui/issues/issue-61106.stderr @@ -7,8 +7,8 @@ LL | foo(x.clone()); | expected &str, found struct `std::string::String` | help: consider borrowing here: `&x` | - = note: expected type `&str` - found type `std::string::String` + = note: expected reference `&str` + found struct `std::string::String` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-61882.stderr b/src/test/ui/issues/issue-61882.stderr index a14e1a4dd4d44..dbdb14d7160ec 100644 --- a/src/test/ui/issues/issue-61882.stderr +++ b/src/test/ui/issues/issue-61882.stderr @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | const B: A = Self(0); | ^^^^^^^ expected u8, found bool | - = note: expected type `A` - found type `A` + = note: expected struct `A` + found struct `A` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-6458-4.stderr b/src/test/ui/issues/issue-6458-4.stderr index ecf729e1032b1..246b53189c80b 100644 --- a/src/test/ui/issues/issue-6458-4.stderr +++ b/src/test/ui/issues/issue-6458-4.stderr @@ -8,7 +8,7 @@ LL | fn foo(b: bool) -> Result { LL | Err("bar".to_string()); | - help: consider removing this semicolon | - = note: expected type `std::result::Result` + = note: expected enum `std::result::Result` found type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-7061.rs b/src/test/ui/issues/issue-7061.rs index 66ae90034e7f5..ef61eac7baa82 100644 --- a/src/test/ui/issues/issue-7061.rs +++ b/src/test/ui/issues/issue-7061.rs @@ -3,8 +3,8 @@ struct BarStruct; impl<'a> BarStruct { fn foo(&'a mut self) -> Box { self } //~^ ERROR mismatched types - //~| expected type `std::boxed::Box` - //~| found type `&'a mut BarStruct` + //~| expected struct `std::boxed::Box` + //~| found mutable reference `&'a mut BarStruct` } fn main() {} diff --git a/src/test/ui/issues/issue-7061.stderr b/src/test/ui/issues/issue-7061.stderr index 96c539f629ed9..223cc48c7dd61 100644 --- a/src/test/ui/issues/issue-7061.stderr +++ b/src/test/ui/issues/issue-7061.stderr @@ -6,8 +6,8 @@ LL | fn foo(&'a mut self) -> Box { self } | | | expected `std::boxed::Box` because of return type | - = note: expected type `std::boxed::Box` - found type `&'a mut BarStruct` + = note: expected struct `std::boxed::Box` + found mutable reference `&'a mut BarStruct` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-7092.rs b/src/test/ui/issues/issue-7092.rs index b49a262f896c2..09fa6c525082b 100644 --- a/src/test/ui/issues/issue-7092.rs +++ b/src/test/ui/issues/issue-7092.rs @@ -5,9 +5,9 @@ fn foo(x: Whatever) { match x { Some(field) => //~^ ERROR mismatched types -//~| expected type `Whatever` -//~| found type `std::option::Option<_>` //~| expected enum `Whatever`, found enum `std::option::Option` +//~| expected enum `Whatever` +//~| found enum `std::option::Option<_>` field.access(), } } diff --git a/src/test/ui/issues/issue-7092.stderr b/src/test/ui/issues/issue-7092.stderr index 7bb6820287487..05c00da16b1b1 100644 --- a/src/test/ui/issues/issue-7092.stderr +++ b/src/test/ui/issues/issue-7092.stderr @@ -6,8 +6,8 @@ LL | match x { LL | Some(field) => | ^^^^^^^^^^^ expected enum `Whatever`, found enum `std::option::Option` | - = note: expected type `Whatever` - found type `std::option::Option<_>` + = note: expected enum `Whatever` + found enum `std::option::Option<_>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-7867.rs b/src/test/ui/issues/issue-7867.rs index a1997fbf19aae..3074052f14f20 100644 --- a/src/test/ui/issues/issue-7867.rs +++ b/src/test/ui/issues/issue-7867.rs @@ -6,9 +6,9 @@ fn main() { match (true, false) { A::B => (), //~^ ERROR mismatched types - //~| expected type `(bool, bool)` - //~| found type `A` //~| expected tuple, found enum `A` + //~| expected tuple `(bool, bool)` + //~| found enum `A` _ => () } } diff --git a/src/test/ui/issues/issue-7867.stderr b/src/test/ui/issues/issue-7867.stderr index 1d3a0ff065913..58e82facf802e 100644 --- a/src/test/ui/issues/issue-7867.stderr +++ b/src/test/ui/issues/issue-7867.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | A::B => (), | ^^^^ expected tuple, found enum `A` | - = note: expected type `(bool, bool)` - found type `A` + = note: expected tuple `(bool, bool)` + found enum `A` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-9575.stderr b/src/test/ui/issues/issue-9575.stderr index 1483e427a6a3c..6203c2fa84ef7 100644 --- a/src/test/ui/issues/issue-9575.stderr +++ b/src/test/ui/issues/issue-9575.stderr @@ -4,8 +4,8 @@ error[E0308]: start function has wrong type LL | fn start(argc: isize, argv: *const *const u8, crate_map: *const u8) -> isize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters | - = note: expected type `fn(isize, *const *const u8) -> isize` - found type `fn(isize, *const *const u8, *const u8) -> isize` + = note: expected fn pointer `fn(isize, *const *const u8) -> isize` + found fn pointer `fn(isize, *const *const u8, *const u8) -> isize` error: aborting due to previous error diff --git a/src/test/ui/json-bom-plus-crlf-multifile.stderr b/src/test/ui/json-bom-plus-crlf-multifile.stderr index 39f6b69bbecaa..53c9682acfeeb 100644 --- a/src/test/ui/json-bom-plus-crlf-multifile.stderr +++ b/src/test/ui/json-bom-plus-crlf-multifile.stderr @@ -15,8 +15,8 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` + found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -35,8 +35,8 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` + found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -55,8 +55,8 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` + found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -75,8 +75,8 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `std::string::String` - found type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` + found type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"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 "} diff --git a/src/test/ui/json-bom-plus-crlf.stderr b/src/test/ui/json-bom-plus-crlf.stderr index d62140e4de765..6f2d1d0f234f7 100644 --- a/src/test/ui/json-bom-plus-crlf.stderr +++ b/src/test/ui/json-bom-plus-crlf.stderr @@ -15,8 +15,8 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:17:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` + found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:17:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -35,8 +35,8 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:19:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` + found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:19:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -55,8 +55,8 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:23:1: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` + found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:23:1: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -75,8 +75,8 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `std::string::String` - found type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:25:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` + found type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:25:22: error[E0308]: mismatched types "} {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors "} diff --git a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.stderr b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.stderr index b4011990b68e6..93160a1c5e515 100644 --- a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.stderr +++ b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | ref_obj(x) | ^ lifetime mismatch | - = note: expected type `&std::boxed::Box<(dyn std::ops::Fn() + 'static)>` - found type `&std::boxed::Box<(dyn std::ops::Fn() + 'a)>` + = note: expected reference `&std::boxed::Box<(dyn std::ops::Fn() + 'static)>` + found reference `&std::boxed::Box<(dyn std::ops::Fn() + 'a)>` note: the lifetime `'a` as defined on the function body at 32:10... --> $DIR/lifetime-bound-will-change-warning.rs:32:10 | @@ -19,8 +19,8 @@ error[E0308]: mismatched types LL | lib::ref_obj(x) | ^ lifetime mismatch | - = note: expected type `&std::boxed::Box<(dyn std::ops::Fn() + 'static)>` - found type `&std::boxed::Box<(dyn std::ops::Fn() + 'a)>` + = note: expected reference `&std::boxed::Box<(dyn std::ops::Fn() + 'static)>` + found reference `&std::boxed::Box<(dyn std::ops::Fn() + 'a)>` note: the lifetime `'a` as defined on the function body at 37:12... --> $DIR/lifetime-bound-will-change-warning.rs:37:12 | diff --git a/src/test/ui/loops/loop-break-value.stderr b/src/test/ui/loops/loop-break-value.stderr index b2e3ebc53ad8e..6fbede9778d45 100644 --- a/src/test/ui/loops/loop-break-value.stderr +++ b/src/test/ui/loops/loop-break-value.stderr @@ -118,8 +118,8 @@ error[E0308]: mismatched types LL | break "asdf"; | ^^^^^^ expected i32, found reference | - = note: expected type `i32` - found type `&'static str` + = note: expected type `i32` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:21:31 @@ -127,8 +127,8 @@ error[E0308]: mismatched types LL | break 'outer_loop "nope"; | ^^^^^^ expected i32, found reference | - = note: expected type `i32` - found type `&'static str` + = note: expected type `i32` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:73:26 @@ -146,7 +146,7 @@ LL | break (break, break); | ^^^^^^^^^^^^^^ expected (), found tuple | = note: expected type `()` - found type `(!, !)` + found tuple `(!, !)` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:85:15 diff --git a/src/test/ui/lub-glb/old-lub-glb-hr.stderr b/src/test/ui/lub-glb/old-lub-glb-hr.stderr index 475c1801ca129..1dce9df96df3f 100644 --- a/src/test/ui/lub-glb/old-lub-glb-hr.stderr +++ b/src/test/ui/lub-glb/old-lub-glb-hr.stderr @@ -10,8 +10,8 @@ LL | | _ => y, LL | | }; | |_____- `match` arms have incompatible types | - = note: expected type `for<'r, 's> fn(&'r u8, &'s u8)` - found type `for<'a> fn(&'a u8, &'a u8)` + = note: expected type `for<'r, 's> fn(&'r u8, &'s u8)` + found fn pointer `for<'a> fn(&'a u8, &'a u8)` error: aborting due to previous error diff --git a/src/test/ui/lub-glb/old-lub-glb-object.stderr b/src/test/ui/lub-glb/old-lub-glb-object.stderr index e02ede399e6af..18de7a40ee179 100644 --- a/src/test/ui/lub-glb/old-lub-glb-object.stderr +++ b/src/test/ui/lub-glb/old-lub-glb-object.stderr @@ -10,8 +10,8 @@ LL | | _ => y, LL | | }; | |_____- `match` arms have incompatible types | - = note: expected type `&dyn for<'a, 'b> Foo<&'a u8, &'b u8>` - found type `&dyn for<'a> Foo<&'a u8, &'a u8>` + = note: expected type `&dyn for<'a, 'b> Foo<&'a u8, &'b u8>` + found reference `&dyn for<'a> Foo<&'a u8, &'a u8>` error: aborting due to previous error diff --git a/src/test/ui/main-wrong-type.stderr b/src/test/ui/main-wrong-type.stderr index c00c67af572b7..e75d4d7acfd5e 100644 --- a/src/test/ui/main-wrong-type.stderr +++ b/src/test/ui/main-wrong-type.stderr @@ -4,8 +4,8 @@ error[E0580]: main function has wrong type LL | fn main(foo: S) { | ^^^^^^^^^^^^^^^ incorrect number of function parameters | - = note: expected type `fn()` - found type `fn(S)` + = note: expected fn pointer `fn()` + found fn pointer `fn(S)` error: aborting due to previous error diff --git a/src/test/ui/match/match-arm-resolving-to-never.stderr b/src/test/ui/match/match-arm-resolving-to-never.stderr index 24ce97f86e760..f717cf4ea75c4 100644 --- a/src/test/ui/match/match-arm-resolving-to-never.stderr +++ b/src/test/ui/match/match-arm-resolving-to-never.stderr @@ -13,8 +13,8 @@ LL | | E::F => "", LL | | }; | |_____- `match` arms have incompatible types | - = note: expected type `{integer}` - found type `&'static str` + = note: expected type `{integer}` + found reference `&'static str` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/match/match-ref-mut-invariance.stderr b/src/test/ui/match/match-ref-mut-invariance.stderr index 0a020989d6f35..3e9f729dc09f5 100644 --- a/src/test/ui/match/match-ref-mut-invariance.stderr +++ b/src/test/ui/match/match-ref-mut-invariance.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | match self.0 { ref mut x => x } | ^ lifetime mismatch | - = note: expected type `&'a mut &'a i32` - found type `&'a mut &'b i32` + = note: expected mutable reference `&'a mut &'a i32` + found mutable reference `&'a mut &'b i32` note: the lifetime `'a` as defined on the method body at 9:12... --> $DIR/match-ref-mut-invariance.rs:9:12 | diff --git a/src/test/ui/match/match-ref-mut-let-invariance.stderr b/src/test/ui/match/match-ref-mut-let-invariance.stderr index 1bea9bce11e47..303aba3422cec 100644 --- a/src/test/ui/match/match-ref-mut-let-invariance.stderr +++ b/src/test/ui/match/match-ref-mut-let-invariance.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | x | ^ lifetime mismatch | - = note: expected type `&'a mut &'a i32` - found type `&'a mut &'b i32` + = note: expected mutable reference `&'a mut &'a i32` + found mutable reference `&'a mut &'b i32` note: the lifetime `'a` as defined on the method body at 9:12... --> $DIR/match-ref-mut-let-invariance.rs:9:12 | diff --git a/src/test/ui/match/match-struct.rs b/src/test/ui/match/match-struct.rs index 5961e09a200a1..e82d9581b2d1e 100644 --- a/src/test/ui/match/match-struct.rs +++ b/src/test/ui/match/match-struct.rs @@ -5,9 +5,9 @@ fn main() { match (S { a: 1 }) { E::C(_) => (), //~^ ERROR mismatched types - //~| expected type `S` - //~| found type `E` //~| expected struct `S`, found enum `E` + //~| expected struct `S` + //~| found enum `E` _ => () } } diff --git a/src/test/ui/match/match-struct.stderr b/src/test/ui/match/match-struct.stderr index 2a24a293e9836..3d4a19a93170d 100644 --- a/src/test/ui/match/match-struct.stderr +++ b/src/test/ui/match/match-struct.stderr @@ -6,8 +6,8 @@ LL | match (S { a: 1 }) { LL | E::C(_) => (), | ^^^^^^^ expected struct `S`, found enum `E` | - = note: expected type `S` - found type `E` + = note: expected struct `S` + found enum `E` error: aborting due to previous error diff --git a/src/test/ui/match/match-tag-nullary.stderr b/src/test/ui/match/match-tag-nullary.stderr index 902ccc94dde23..5dd7b564d9dc2 100644 --- a/src/test/ui/match/match-tag-nullary.stderr +++ b/src/test/ui/match/match-tag-nullary.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | fn main() { let x: A = A::A; match x { B::B => { } } } | ^^^^ expected enum `A`, found enum `B` | - = note: expected type `A` - found type `B` + = note: expected enum `A` + found enum `B` error: aborting due to previous error diff --git a/src/test/ui/match/match-tag-unary.stderr b/src/test/ui/match/match-tag-unary.stderr index da599c3740740..833d8838e57a8 100644 --- a/src/test/ui/match/match-tag-unary.stderr +++ b/src/test/ui/match/match-tag-unary.stderr @@ -6,8 +6,8 @@ LL | fn main() { let x: A = A::A(0); match x { B::B(y) => { } } } | | | this match expression has type `A` | - = note: expected type `A` - found type `B` + = note: expected enum `A` + found enum `B` error: aborting due to previous error diff --git a/src/test/ui/methods/method-self-arg-1.rs b/src/test/ui/methods/method-self-arg-1.rs index 4a78ad780c412..169c14c0f5354 100644 --- a/src/test/ui/methods/method-self-arg-1.rs +++ b/src/test/ui/methods/method-self-arg-1.rs @@ -9,11 +9,11 @@ impl Foo { fn main() { let x = Foo; Foo::bar(x); //~ ERROR mismatched types - //~| expected type `&Foo` - //~| found type `Foo` //~| expected &Foo, found struct `Foo` + //~| expected reference `&Foo` + //~| found struct `Foo` Foo::bar(&42); //~ ERROR mismatched types - //~| expected type `&Foo` - //~| found type `&{integer}` //~| expected struct `Foo`, found integer + //~| expected reference `&Foo` + //~| found reference `&{integer}` } diff --git a/src/test/ui/methods/method-self-arg-1.stderr b/src/test/ui/methods/method-self-arg-1.stderr index 8485a5403ff85..e0cb0915fe109 100644 --- a/src/test/ui/methods/method-self-arg-1.stderr +++ b/src/test/ui/methods/method-self-arg-1.stderr @@ -7,8 +7,8 @@ LL | Foo::bar(x); | expected &Foo, found struct `Foo` | help: consider borrowing here: `&x` | - = note: expected type `&Foo` - found type `Foo` + = note: expected reference `&Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/method-self-arg-1.rs:15:14 @@ -16,8 +16,8 @@ error[E0308]: mismatched types LL | Foo::bar(&42); | ^^^ expected struct `Foo`, found integer | - = note: expected type `&Foo` - found type `&{integer}` + = note: expected reference `&Foo` + found reference `&{integer}` error: aborting due to 2 previous errors diff --git a/src/test/ui/mismatched_types/E0053.stderr b/src/test/ui/mismatched_types/E0053.stderr index 582772d6fb368..4e6af20db1b94 100644 --- a/src/test/ui/mismatched_types/E0053.stderr +++ b/src/test/ui/mismatched_types/E0053.stderr @@ -7,8 +7,8 @@ LL | fn foo(x: u16); LL | fn foo(x: i16) { } | ^^^ expected u16, found i16 | - = note: expected type `fn(u16)` - found type `fn(i16)` + = note: expected fn pointer `fn(u16)` + found fn pointer `fn(i16)` error[E0053]: method `bar` has an incompatible type for trait --> $DIR/E0053.rs:11:12 @@ -19,8 +19,8 @@ LL | fn bar(&self); LL | fn bar(&mut self) { } | ^^^^^^^^^ types differ in mutability | - = note: expected type `fn(&Bar)` - found type `fn(&mut Bar)` + = note: expected fn pointer `fn(&Bar)` + found fn pointer `fn(&mut Bar)` help: consider change the type to match the mutability in trait | LL | fn bar(&self) { } diff --git a/src/test/ui/mismatched_types/abridged.stderr b/src/test/ui/mismatched_types/abridged.stderr index ded12d89c099d..81cc8e29e49c5 100644 --- a/src/test/ui/mismatched_types/abridged.stderr +++ b/src/test/ui/mismatched_types/abridged.stderr @@ -6,8 +6,8 @@ LL | fn a() -> Foo { LL | Some(Foo { bar: 1 }) | ^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `std::option::Option` | - = note: expected type `Foo` - found type `std::option::Option` + = note: expected struct `Foo` + found enum `std::option::Option` error[E0308]: mismatched types --> $DIR/abridged.rs:20:5 @@ -17,8 +17,8 @@ LL | fn a2() -> Foo { LL | Ok(Foo { bar: 1}) | ^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `std::result::Result` | - = note: expected type `Foo` - found type `std::result::Result` + = note: expected struct `Foo` + found enum `std::result::Result` error[E0308]: mismatched types --> $DIR/abridged.rs:24:5 @@ -28,8 +28,8 @@ LL | fn b() -> Option { LL | Foo { bar: 1 } | ^^^^^^^^^^^^^^ expected enum `std::option::Option`, found struct `Foo` | - = note: expected type `std::option::Option` - found type `Foo` + = note: expected enum `std::option::Option` + found struct `Foo` error[E0308]: mismatched types --> $DIR/abridged.rs:28:5 @@ -39,8 +39,8 @@ LL | fn c() -> Result { LL | Foo { bar: 1 } | ^^^^^^^^^^^^^^ expected enum `std::result::Result`, found struct `Foo` | - = note: expected type `std::result::Result` - found type `Foo` + = note: expected enum `std::result::Result` + found struct `Foo` error[E0308]: mismatched types --> $DIR/abridged.rs:39:5 @@ -51,8 +51,8 @@ LL | fn d() -> X, String> { LL | x | ^ expected struct `std::string::String`, found integer | - = note: expected type `X, std::string::String>` - found type `X, {integer}>` + = note: expected struct `X, std::string::String>` + found struct `X, {integer}>` error[E0308]: mismatched types --> $DIR/abridged.rs:50:5 @@ -63,8 +63,8 @@ LL | fn e() -> X, String> { LL | x | ^ expected struct `std::string::String`, found integer | - = note: expected type `X, _>` - found type `X, _>` + = note: expected struct `X, _>` + found struct `X, _>` error[E0308]: mismatched types --> $DIR/abridged.rs:54:5 @@ -77,8 +77,8 @@ LL | 1+2 | expected struct `std::string::String`, found integer | help: try using a conversion method: `(1+2).to_string()` | - = note: expected type `std::string::String` - found type `{integer}` + = note: expected struct `std::string::String` + found type `{integer}` error[E0308]: mismatched types --> $DIR/abridged.rs:59:5 @@ -91,8 +91,8 @@ LL | -2 | expected struct `std::string::String`, found integer | help: try using a conversion method: `(-2).to_string()` | - = note: expected type `std::string::String` - found type `{integer}` + = note: expected struct `std::string::String` + found type `{integer}` error: aborting due to 8 previous errors diff --git a/src/test/ui/mismatched_types/issue-19109.stderr b/src/test/ui/mismatched_types/issue-19109.stderr index b826ca66c683a..350dd69a1fd78 100644 --- a/src/test/ui/mismatched_types/issue-19109.stderr +++ b/src/test/ui/mismatched_types/issue-19109.stderr @@ -6,8 +6,8 @@ LL | fn function(t: &mut dyn Trait) { LL | t as *mut dyn Trait | ^^^^^^^^^^^^^^^^^^^ expected (), found *-ptr | - = note: expected type `()` - found type `*mut dyn Trait` + = note: expected type `()` + found raw pointer `*mut dyn Trait` error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/issue-35030.stderr b/src/test/ui/mismatched_types/issue-35030.stderr index 39eca93f88d1c..c01f5d3ca4b94 100644 --- a/src/test/ui/mismatched_types/issue-35030.stderr +++ b/src/test/ui/mismatched_types/issue-35030.stderr @@ -7,8 +7,8 @@ LL | fn parse(text: &str) -> Option { LL | Some(true) | ^^^^ expected type parameter `bool`, found bool | - = note: expected type `bool` (type parameter `bool`) - found type `bool` (bool) + = note: expected type parameter `bool` (type parameter `bool`) + found type `bool` (bool) = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/mismatched_types/issue-38371.stderr b/src/test/ui/mismatched_types/issue-38371.stderr index 79a0807c33721..48a123fd28a13 100644 --- a/src/test/ui/mismatched_types/issue-38371.stderr +++ b/src/test/ui/mismatched_types/issue-38371.stderr @@ -7,8 +7,8 @@ LL | fn foo(&foo: Foo) { | expected struct `Foo`, found reference | help: did you mean `foo`: `&Foo` | - = note: expected type `Foo` - found type `&_` + = note: expected struct `Foo` + found reference `&_` error[E0308]: mismatched types --> $DIR/issue-38371.rs:18:9 @@ -19,8 +19,8 @@ LL | fn agh(&&bar: &u32) { | expected u32, found reference | help: you can probably remove the explicit borrow: `bar` | - = note: expected type `u32` - found type `&_` + = note: expected type `u32` + found reference `&_` error[E0308]: mismatched types --> $DIR/issue-38371.rs:21:8 @@ -28,8 +28,8 @@ error[E0308]: mismatched types LL | fn bgh(&&bar: u32) { | ^^^^^ expected u32, found reference | - = note: expected type `u32` - found type `&_` + = note: expected type `u32` + found reference `&_` error[E0529]: expected an array or slice, found `u32` --> $DIR/issue-38371.rs:24:9 diff --git a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr index bcb316e2bfb3f..b5daf195ef78a 100644 --- a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr +++ b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let ans = s("what"); | ^^^^^^ expected isize, found reference | - = note: expected type `isize` - found type `&'static str` + = note: expected type `isize` + found reference `&'static str` error[E0057]: this function takes 1 parameter but 0 parameters were supplied --> $DIR/overloaded-calls-bad.rs:29:15 diff --git a/src/test/ui/mismatched_types/trait-bounds-cant-coerce.stderr b/src/test/ui/mismatched_types/trait-bounds-cant-coerce.stderr index 6475cce5aa62f..d9dd186624fb0 100644 --- a/src/test/ui/mismatched_types/trait-bounds-cant-coerce.stderr +++ b/src/test/ui/mismatched_types/trait-bounds-cant-coerce.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | a(x); | ^ expected trait `Foo + std::marker::Send`, found trait `Foo` | - = note: expected type `std::boxed::Box<(dyn Foo + std::marker::Send + 'static)>` - found type `std::boxed::Box<(dyn Foo + 'static)>` + = note: expected struct `std::boxed::Box<(dyn Foo + std::marker::Send + 'static)>` + found struct `std::boxed::Box<(dyn Foo + 'static)>` error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr b/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr index 8ea3567b948ce..050bb326130d5 100644 --- a/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr +++ b/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr @@ -7,8 +7,8 @@ LL | fn foo(x: u16); LL | fn foo(x: i16) { } | ^^^ expected u16, found i16 | - = note: expected type `fn(u16)` - found type `fn(i16)` + = note: expected fn pointer `fn(u16)` + found fn pointer `fn(i16)` error[E0053]: method `bar` has an incompatible type for trait --> $DIR/trait-impl-fn-incompatibility.rs:12:28 @@ -19,8 +19,8 @@ LL | fn bar(&mut self, bar: &mut Bar); LL | fn bar(&mut self, bar: &Bar) { } | ^^^^ types differ in mutability | - = note: expected type `fn(&mut Bar, &mut Bar)` - found type `fn(&mut Bar, &Bar)` + = note: expected fn pointer `fn(&mut Bar, &mut Bar)` + found fn pointer `fn(&mut Bar, &Bar)` help: consider change the type to match the mutability in trait | LL | fn bar(&mut self, bar: &mut Bar) { } diff --git a/src/test/ui/mut/mut-cross-borrowing.stderr b/src/test/ui/mut/mut-cross-borrowing.stderr index e2eea195dafb8..d79d230ca9602 100644 --- a/src/test/ui/mut/mut-cross-borrowing.stderr +++ b/src/test/ui/mut/mut-cross-borrowing.stderr @@ -7,8 +7,8 @@ LL | f(x) | expected &mut isize, found struct `std::boxed::Box` | help: consider mutably borrowing here: `&mut x` | - = note: expected type `&mut isize` - found type `std::boxed::Box<{integer}>` + = note: expected mutable reference `&mut isize` + found struct `std::boxed::Box<{integer}>` error: aborting due to previous error diff --git a/src/test/ui/mut/mut-pattern-mismatched.rs b/src/test/ui/mut/mut-pattern-mismatched.rs index 17bf75419b7ac..700261fe40b65 100644 --- a/src/test/ui/mut/mut-pattern-mismatched.rs +++ b/src/test/ui/mut/mut-pattern-mismatched.rs @@ -4,8 +4,8 @@ fn main() { // (separate lines to ensure the spans are accurate) let &_ //~ ERROR mismatched types - //~| expected type `&mut {integer}` - //~| found type `&_` + //~| expected mutable reference `&mut {integer}` + //~| found reference `&_` //~| types differ in mutability = foo; let &mut _ = foo; @@ -13,8 +13,8 @@ fn main() { let bar = &1; let &_ = bar; let &mut _ //~ ERROR mismatched types - //~| expected type `&{integer}` - //~| found type `&mut _` + //~| expected reference `&{integer}` + //~| found mutable reference `&mut _` //~| types differ in mutability = bar; } diff --git a/src/test/ui/mut/mut-pattern-mismatched.stderr b/src/test/ui/mut/mut-pattern-mismatched.stderr index d1adc9915196d..ccc8ac1278c63 100644 --- a/src/test/ui/mut/mut-pattern-mismatched.stderr +++ b/src/test/ui/mut/mut-pattern-mismatched.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let &_ | ^^ types differ in mutability | - = note: expected type `&mut {integer}` - found type `&_` + = note: expected mutable reference `&mut {integer}` + found reference `&_` error[E0308]: mismatched types --> $DIR/mut-pattern-mismatched.rs:15:9 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let &mut _ | ^^^^^^ types differ in mutability | - = note: expected type `&{integer}` - found type `&mut _` + = note: expected reference `&{integer}` + found mutable reference `&mut _` error: aborting due to 2 previous errors diff --git a/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr b/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr index 7a50fd367d2d5..cf3952bca11dc 100644 --- a/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr +++ b/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | foo("wow"); | ^^^^^ expected !, found reference | - = note: expected type `!` - found type `&'static str` + = note: expected type `!` + found reference `&'static str` error: aborting due to previous error diff --git a/src/test/ui/never_type/never-assign-wrong-type.stderr b/src/test/ui/never_type/never-assign-wrong-type.stderr index da2e77d023d19..fcdb9ef6c9211 100644 --- a/src/test/ui/never_type/never-assign-wrong-type.stderr +++ b/src/test/ui/never_type/never-assign-wrong-type.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let x: ! = "hello"; | ^^^^^^^ expected !, found reference | - = note: expected type `!` - found type `&'static str` + = note: expected type `!` + found reference `&'static str` error: aborting due to previous error diff --git a/src/test/ui/nll/trait-associated-constant.stderr b/src/test/ui/nll/trait-associated-constant.stderr index ecf9748af9ea3..5158420c73782 100644 --- a/src/test/ui/nll/trait-associated-constant.stderr +++ b/src/test/ui/nll/trait-associated-constant.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | const AC: Option<&'c str> = None; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch | - = note: expected type `std::option::Option<&'b str>` - found type `std::option::Option<&'c str>` + = note: expected enum `std::option::Option<&'b str>` + found enum `std::option::Option<&'c str>` note: the lifetime `'c` as defined on the impl at 20:18... --> $DIR/trait-associated-constant.rs:20:18 | diff --git a/src/test/ui/noexporttypeexe.rs b/src/test/ui/noexporttypeexe.rs index 651c92830ed8a..d3c04fc562fd2 100644 --- a/src/test/ui/noexporttypeexe.rs +++ b/src/test/ui/noexporttypeexe.rs @@ -10,6 +10,6 @@ fn main() { let x: isize = noexporttypelib::foo(); //~^ ERROR mismatched types //~| expected type `isize` - //~| found type `std::option::Option` + //~| found enum `std::option::Option` //~| expected isize, found enum `std::option::Option` } diff --git a/src/test/ui/noexporttypeexe.stderr b/src/test/ui/noexporttypeexe.stderr index 329787fe74444..3def891110d9e 100644 --- a/src/test/ui/noexporttypeexe.stderr +++ b/src/test/ui/noexporttypeexe.stderr @@ -5,7 +5,7 @@ LL | let x: isize = noexporttypelib::foo(); | ^^^^^^^^^^^^^^^^^^^^^^ expected isize, found enum `std::option::Option` | = note: expected type `isize` - found type `std::option::Option` + found enum `std::option::Option` error: aborting due to previous error diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.stderr index 99f0ce0602b11..86ec58d3f068a 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | ss.t = t; | ^ lifetime mismatch | - = note: expected type `&'a std::boxed::Box<(dyn Test + 'static)>` - found type `&'a std::boxed::Box<(dyn Test + 'a)>` + = note: expected reference `&'a std::boxed::Box<(dyn Test + 'static)>` + found reference `&'a std::boxed::Box<(dyn Test + 'a)>` note: the lifetime `'a` as defined on the function body at 14:6... --> $DIR/object-lifetime-default-from-rptr-box-error.rs:14:6 | diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.stderr index 07d4d8c8ed40b..65f8a32f06dd2 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | ss.t = t; | ^ lifetime mismatch | - = note: expected type `&'a MyBox<(dyn Test + 'static)>` - found type `&'a MyBox<(dyn Test + 'a)>` + = note: expected reference `&'a MyBox<(dyn Test + 'static)>` + found reference `&'a MyBox<(dyn Test + 'a)>` note: the lifetime `'a` as defined on the function body at 20:6... --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:20:6 | diff --git a/src/test/ui/object-lifetime/object-lifetime-default-mybox.stderr b/src/test/ui/object-lifetime/object-lifetime-default-mybox.stderr index 89579fb1df3df..404717ff55e5e 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-mybox.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-mybox.stderr @@ -16,8 +16,8 @@ error[E0308]: mismatched types LL | load0(ss) | ^^ lifetime mismatch | - = note: expected type `&MyBox<(dyn SomeTrait + 'static)>` - found type `&MyBox<(dyn SomeTrait + 'a)>` + = note: expected reference `&MyBox<(dyn SomeTrait + 'static)>` + found reference `&MyBox<(dyn SomeTrait + 'a)>` note: the lifetime `'a` as defined on the function body at 30:10... --> $DIR/object-lifetime-default-mybox.rs:30:10 | diff --git a/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr b/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr index 6d08b47c058ed..5985b2aecfc20 100644 --- a/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr +++ b/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr @@ -123,8 +123,8 @@ LL | let recovery_witness: String = 0; | expected struct `std::string::String`, found integer | help: try using a conversion method: `0.to_string()` | - = note: expected type `std::string::String` - found type `{integer}` + = note: expected struct `std::string::String` + found type `{integer}` error: aborting due to 16 previous errors diff --git a/src/test/ui/parser/fn-arg-doc-comment.stderr b/src/test/ui/parser/fn-arg-doc-comment.stderr index 669785af45f93..9554cf42ee383 100644 --- a/src/test/ui/parser/fn-arg-doc-comment.stderr +++ b/src/test/ui/parser/fn-arg-doc-comment.stderr @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | f("", ""); | ^^ expected u8, found reference | - = note: expected type `u8` - found type `&'static str` + = note: expected type `u8` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/fn-arg-doc-comment.rs:18:11 @@ -31,8 +31,8 @@ error[E0308]: mismatched types LL | f("", ""); | ^^ expected u8, found reference | - = note: expected type `u8` - found type `&'static str` + = note: expected type `u8` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/fn-arg-doc-comment.rs:25:9 @@ -40,8 +40,8 @@ error[E0308]: mismatched types LL | bar(""); | ^^ expected i32, found reference | - = note: expected type `i32` - found type `&'static str` + = note: expected type `i32` + found reference `&'static str` error: aborting due to 6 previous errors diff --git a/src/test/ui/parser/lex-bad-char-literals-6.stderr b/src/test/ui/parser/lex-bad-char-literals-6.stderr index 662cf2657e7b5..fbd1fc28dd6e7 100644 --- a/src/test/ui/parser/lex-bad-char-literals-6.stderr +++ b/src/test/ui/parser/lex-bad-char-literals-6.stderr @@ -45,8 +45,8 @@ error[E0308]: mismatched types LL | let a: usize = ""; | ^^ expected usize, found reference | - = note: expected type `usize` - found type `&'static str` + = note: expected type `usize` + found reference `&'static str` error[E0277]: can't compare `&str` with `char` --> $DIR/lex-bad-char-literals-6.rs:12:10 diff --git a/src/test/ui/parser/numeric-lifetime.stderr b/src/test/ui/parser/numeric-lifetime.stderr index 4018b24aac175..4a7a28825ffc2 100644 --- a/src/test/ui/parser/numeric-lifetime.stderr +++ b/src/test/ui/parser/numeric-lifetime.stderr @@ -16,8 +16,8 @@ error[E0308]: mismatched types LL | let x: usize = ""; | ^^ expected usize, found reference | - = note: expected type `usize` - found type `&'static str` + = note: expected type `usize` + found reference `&'static str` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/pat-tuple-5.stderr b/src/test/ui/parser/pat-tuple-5.stderr index 09ebdc29a2161..3513b516ea81a 100644 --- a/src/test/ui/parser/pat-tuple-5.stderr +++ b/src/test/ui/parser/pat-tuple-5.stderr @@ -21,8 +21,8 @@ LL | match (0, 1) { LL | (PAT ..) => {} | ^^^^^^ expected tuple, found u8 | - = note: expected type `({integer}, {integer})` - found type `u8` + = note: expected tuple `({integer}, {integer})` + found type `u8` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/recover-tuple.stderr b/src/test/ui/parser/recover-tuple.stderr index 4252fc1fd1e1b..70eefd8a1701e 100644 --- a/src/test/ui/parser/recover-tuple.stderr +++ b/src/test/ui/parser/recover-tuple.stderr @@ -10,8 +10,8 @@ error[E0308]: mismatched types LL | let y: usize = ""; | ^^ expected usize, found reference | - = note: expected type `usize` - found type `&'static str` + = note: expected type `usize` + found reference `&'static str` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr b/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr index 38f4a986e12d4..5f70588c0b206 100644 --- a/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr +++ b/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr @@ -24,7 +24,7 @@ LL | | }.hi() { | |__________^ expected bool, found closure | = note: expected type `bool` - found type `[closure@$DIR/struct-literal-restrictions-in-lamda.rs:12:11: 14:11]` + found closure `[closure@$DIR/struct-literal-restrictions-in-lamda.rs:12:11: 14:11]` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/unclosed-delimiter-in-dep.stderr b/src/test/ui/parser/unclosed-delimiter-in-dep.stderr index 818f61b4d2229..c4a9251b1b1db 100644 --- a/src/test/ui/parser/unclosed-delimiter-in-dep.stderr +++ b/src/test/ui/parser/unclosed-delimiter-in-dep.stderr @@ -16,7 +16,7 @@ LL | let _: usize = unclosed_delim_mod::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected usize, found enum `std::result::Result` | = note: expected type `usize` - found type `std::result::Result` + found enum `std::result::Result` error: aborting due to 2 previous errors diff --git a/src/test/ui/pattern/pat-tuple-overfield.stderr b/src/test/ui/pattern/pat-tuple-overfield.stderr index e64b6efb08da8..25d02b8627cbc 100644 --- a/src/test/ui/pattern/pat-tuple-overfield.stderr +++ b/src/test/ui/pattern/pat-tuple-overfield.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | (1, 2, 3, 4) => {} | ^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements | - = note: expected type `({integer}, {integer}, {integer})` - found type `(_, _, _, _)` + = note: expected tuple `({integer}, {integer}, {integer})` + found tuple `(_, _, _, _)` error[E0308]: mismatched types --> $DIR/pat-tuple-overfield.rs:6:9 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | (1, 2, .., 3, 4) => {} | ^^^^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements | - = note: expected type `({integer}, {integer}, {integer})` - found type `(_, _, _, _)` + = note: expected tuple `({integer}, {integer}, {integer})` + found tuple `(_, _, _, _)` error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields --> $DIR/pat-tuple-overfield.rs:10:9 diff --git a/src/test/ui/pattern/pattern-error-continue.rs b/src/test/ui/pattern/pattern-error-continue.rs index 79cc4b552a717..f21da3b55dc35 100644 --- a/src/test/ui/pattern/pattern-error-continue.rs +++ b/src/test/ui/pattern/pattern-error-continue.rs @@ -21,9 +21,9 @@ fn main() { match 'c' { S { .. } => (), //~^ ERROR mismatched types - //~| expected type `char` - //~| found type `S` //~| expected char, found struct `S` + //~| expected type `char` + //~| found struct `S` _ => () } diff --git a/src/test/ui/pattern/pattern-error-continue.stderr b/src/test/ui/pattern/pattern-error-continue.stderr index 5a7dab30d83be..c8d80043fdbef 100644 --- a/src/test/ui/pattern/pattern-error-continue.stderr +++ b/src/test/ui/pattern/pattern-error-continue.stderr @@ -33,7 +33,7 @@ LL | S { .. } => (), | ^^^^^^^^ expected char, found struct `S` | = note: expected type `char` - found type `S` + found struct `S` error[E0308]: mismatched types --> $DIR/pattern-error-continue.rs:30:7 diff --git a/src/test/ui/pattern/pattern-ident-path-generics.stderr b/src/test/ui/pattern/pattern-ident-path-generics.stderr index bfc10c5f86652..4805b0f2d57a2 100644 --- a/src/test/ui/pattern/pattern-ident-path-generics.stderr +++ b/src/test/ui/pattern/pattern-ident-path-generics.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | None:: => {} | ^^^^^^^^^^^^^ expected &str, found isize | - = note: expected type `std::option::Option<&str>` - found type `std::option::Option` + = note: expected enum `std::option::Option<&str>` + found enum `std::option::Option` error: aborting due to previous error diff --git a/src/test/ui/pattern/pattern-tyvar.stderr b/src/test/ui/pattern/pattern-tyvar.stderr index 548347034671c..54e0e5b53a438 100644 --- a/src/test/ui/pattern/pattern-tyvar.stderr +++ b/src/test/ui/pattern/pattern-tyvar.stderr @@ -6,8 +6,8 @@ LL | match t { LL | Bar::T1(_, Some::(x)) => { | ^^^^^^^^^^^^^^^^ expected struct `std::vec::Vec`, found isize | - = note: expected type `std::option::Option>` - found type `std::option::Option` + = note: expected enum `std::option::Option>` + found enum `std::option::Option` error: aborting due to previous error diff --git a/src/test/ui/point-to-type-err-cause-on-impl-trait-return-2.stderr b/src/test/ui/point-to-type-err-cause-on-impl-trait-return-2.stderr index edaa60e5b8d8b..c61f9a7039b25 100644 --- a/src/test/ui/point-to-type-err-cause-on-impl-trait-return-2.stderr +++ b/src/test/ui/point-to-type-err-cause-on-impl-trait-return-2.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let value: &bool = unsafe { &42 }; | ^^^ expected bool, found integer | - = note: expected type `&bool` - found type `&{integer}` + = note: expected reference `&bool` + found reference `&{integer}` error: aborting due to previous error diff --git a/src/test/ui/proc-macro/attribute-spans-preserved.stderr b/src/test/ui/proc-macro/attribute-spans-preserved.stderr index 6c571dbdb4769..e8e3b488209e8 100644 --- a/src/test/ui/proc-macro/attribute-spans-preserved.stderr +++ b/src/test/ui/proc-macro/attribute-spans-preserved.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | #[ foo ( let y: u32 = "z"; ) ] | ^^^ expected u32, found reference | - = note: expected type `u32` - found type `&'static str` + = note: expected type `u32` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/attribute-spans-preserved.rs:8:23 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | #[ bar { let x: u32 = "y"; } ] | ^^^ expected u32, found reference | - = note: expected type `u32` - found type `&'static str` + = note: expected type `u32` + found reference `&'static str` error: aborting due to 2 previous errors diff --git a/src/test/ui/proc-macro/attribute-with-error.stderr b/src/test/ui/proc-macro/attribute-with-error.stderr index 937d47ff08979..73d0e2ef66e77 100644 --- a/src/test/ui/proc-macro/attribute-with-error.stderr +++ b/src/test/ui/proc-macro/attribute-with-error.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let a: i32 = "foo"; | ^^^^^ expected i32, found reference | - = note: expected type `i32` - found type `&'static str` + = note: expected type `i32` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:12:18 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let b: i32 = "f'oo"; | ^^^^^^ expected i32, found reference | - = note: expected type `i32` - found type `&'static str` + = note: expected type `i32` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:25:22 @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | let a: i32 = "foo"; | ^^^^^ expected i32, found reference | - = note: expected type `i32` - found type `&'static str` + = note: expected type `i32` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:35:22 @@ -31,8 +31,8 @@ error[E0308]: mismatched types LL | let a: i32 = "foo"; | ^^^^^ expected i32, found reference | - = note: expected type `i32` - found type `&'static str` + = note: expected type `i32` + found reference `&'static str` error: aborting due to 4 previous errors diff --git a/src/test/ui/proc-macro/issue-37788.stderr b/src/test/ui/proc-macro/issue-37788.stderr index 0727e8c8ed168..6a75f229a0dfd 100644 --- a/src/test/ui/proc-macro/issue-37788.stderr +++ b/src/test/ui/proc-macro/issue-37788.stderr @@ -10,7 +10,7 @@ LL | std::cell::Cell::new(0) | expected (), found struct `std::cell::Cell` | = note: expected type `()` - found type `std::cell::Cell<{integer}>` + found struct `std::cell::Cell<{integer}>` error: aborting due to previous error diff --git a/src/test/ui/proc-macro/nested-item-spans.stderr b/src/test/ui/proc-macro/nested-item-spans.stderr index bef80311f38e5..b8776c29057c1 100644 --- a/src/test/ui/proc-macro/nested-item-spans.stderr +++ b/src/test/ui/proc-macro/nested-item-spans.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let x: u32 = "x"; | ^^^ expected u32, found reference | - = note: expected type `u32` - found type `&'static str` + = note: expected type `u32` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/nested-item-spans.rs:18:22 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let x: u32 = "x"; | ^^^ expected u32, found reference | - = note: expected type `u32` - found type `&'static str` + = note: expected type `u32` + found reference `&'static str` error: aborting due to 2 previous errors diff --git a/src/test/ui/proc-macro/signature.stderr b/src/test/ui/proc-macro/signature.stderr index 4743e3031a34c..6ebc99601c41f 100644 --- a/src/test/ui/proc-macro/signature.stderr +++ b/src/test/ui/proc-macro/signature.stderr @@ -7,8 +7,8 @@ LL | | loop {} LL | | } | |_^ expected normal fn, found unsafe fn | - = note: expected type `fn(proc_macro::TokenStream) -> proc_macro::TokenStream` - found type `unsafe extern "C" fn(i32, u32) -> u32 {foo}` + = note: expected fn pointer `fn(proc_macro::TokenStream) -> proc_macro::TokenStream` + found fn item `unsafe extern "C" fn(i32, u32) -> u32 {foo}` error: aborting due to previous error diff --git a/src/test/ui/proc-macro/span-preservation.stderr b/src/test/ui/proc-macro/span-preservation.stderr index 545c2fa5f40e4..f3b4f2bcd3d30 100644 --- a/src/test/ui/proc-macro/span-preservation.stderr +++ b/src/test/ui/proc-macro/span-preservation.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let x: usize = "hello"; | ^^^^^^^ expected usize, found reference | - = note: expected type `usize` - found type `&'static str` + = note: expected type `usize` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/span-preservation.rs:17:29 diff --git a/src/test/ui/ptr-coercion.rs b/src/test/ui/ptr-coercion.rs index d1ef88b50e30c..193899034c7b4 100644 --- a/src/test/ui/ptr-coercion.rs +++ b/src/test/ui/ptr-coercion.rs @@ -5,19 +5,19 @@ pub fn main() { // *const -> *mut let x: *const isize = &42; let x: *mut isize = x; //~ ERROR mismatched types - //~| expected type `*mut isize` - //~| found type `*const isize` + //~| expected raw pointer `*mut isize` + //~| found raw pointer `*const isize` //~| types differ in mutability // & -> *mut let x: *mut isize = &42; //~ ERROR mismatched types - //~| expected type `*mut isize` - //~| found type `&isize` + //~| expected raw pointer `*mut isize` + //~| found reference `&isize` //~| types differ in mutability let x: *const isize = &42; let x: *mut isize = x; //~ ERROR mismatched types - //~| expected type `*mut isize` - //~| found type `*const isize` + //~| expected raw pointer `*mut isize` + //~| found raw pointer `*const isize` //~| types differ in mutability } diff --git a/src/test/ui/ptr-coercion.stderr b/src/test/ui/ptr-coercion.stderr index 019241d6874aa..49dc4b36268c4 100644 --- a/src/test/ui/ptr-coercion.stderr +++ b/src/test/ui/ptr-coercion.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let x: *mut isize = x; | ^ types differ in mutability | - = note: expected type `*mut isize` - found type `*const isize` + = note: expected raw pointer `*mut isize` + found raw pointer `*const isize` error[E0308]: mismatched types --> $DIR/ptr-coercion.rs:13:25 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let x: *mut isize = &42; | ^^^ types differ in mutability | - = note: expected type `*mut isize` - found type `&isize` + = note: expected raw pointer `*mut isize` + found reference `&isize` error[E0308]: mismatched types --> $DIR/ptr-coercion.rs:19:25 @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | let x: *mut isize = x; | ^ types differ in mutability | - = note: expected type `*mut isize` - found type `*const isize` + = note: expected raw pointer `*mut isize` + found raw pointer `*const isize` error: aborting due to 3 previous errors diff --git a/src/test/ui/range/issue-54505-no-literals.stderr b/src/test/ui/range/issue-54505-no-literals.stderr index b8811c98d21bd..c49093343c0cd 100644 --- a/src/test/ui/range/issue-54505-no-literals.stderr +++ b/src/test/ui/range/issue-54505-no-literals.stderr @@ -7,8 +7,8 @@ LL | take_range(std::ops::Range { start: 0, end: 1 }); | expected reference, found struct `std::ops::Range` | help: consider borrowing here: `&std::ops::Range { start: 0, end: 1 }` | - = note: expected type `&_` - found type `std::ops::Range<{integer}>` + = note: expected reference `&_` + found struct `std::ops::Range<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:21:16 @@ -19,8 +19,8 @@ LL | take_range(::std::ops::Range { start: 0, end: 1 }); | expected reference, found struct `std::ops::Range` | help: consider borrowing here: `&::std::ops::Range { start: 0, end: 1 }` | - = note: expected type `&_` - found type `std::ops::Range<{integer}>` + = note: expected reference `&_` + found struct `std::ops::Range<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:26:16 @@ -31,8 +31,8 @@ LL | take_range(std::ops::RangeFrom { start: 1 }); | expected reference, found struct `std::ops::RangeFrom` | help: consider borrowing here: `&std::ops::RangeFrom { start: 1 }` | - = note: expected type `&_` - found type `std::ops::RangeFrom<{integer}>` + = note: expected reference `&_` + found struct `std::ops::RangeFrom<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:31:16 @@ -43,8 +43,8 @@ LL | take_range(::std::ops::RangeFrom { start: 1 }); | expected reference, found struct `std::ops::RangeFrom` | help: consider borrowing here: `&::std::ops::RangeFrom { start: 1 }` | - = note: expected type `&_` - found type `std::ops::RangeFrom<{integer}>` + = note: expected reference `&_` + found struct `std::ops::RangeFrom<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:36:16 @@ -55,8 +55,8 @@ LL | take_range(std::ops::RangeFull {}); | expected reference, found struct `std::ops::RangeFull` | help: consider borrowing here: `&std::ops::RangeFull {}` | - = note: expected type `&_` - found type `std::ops::RangeFull` + = note: expected reference `&_` + found struct `std::ops::RangeFull` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:41:16 @@ -67,8 +67,8 @@ LL | take_range(::std::ops::RangeFull {}); | expected reference, found struct `std::ops::RangeFull` | help: consider borrowing here: `&::std::ops::RangeFull {}` | - = note: expected type `&_` - found type `std::ops::RangeFull` + = note: expected reference `&_` + found struct `std::ops::RangeFull` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:46:16 @@ -79,8 +79,8 @@ LL | take_range(std::ops::RangeInclusive::new(0, 1)); | expected reference, found struct `std::ops::RangeInclusive` | help: consider borrowing here: `&std::ops::RangeInclusive::new(0, 1)` | - = note: expected type `&_` - found type `std::ops::RangeInclusive<{integer}>` + = note: expected reference `&_` + found struct `std::ops::RangeInclusive<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:51:16 @@ -91,8 +91,8 @@ LL | take_range(::std::ops::RangeInclusive::new(0, 1)); | expected reference, found struct `std::ops::RangeInclusive` | help: consider borrowing here: `&::std::ops::RangeInclusive::new(0, 1)` | - = note: expected type `&_` - found type `std::ops::RangeInclusive<{integer}>` + = note: expected reference `&_` + found struct `std::ops::RangeInclusive<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:56:16 @@ -103,8 +103,8 @@ LL | take_range(std::ops::RangeTo { end: 5 }); | expected reference, found struct `std::ops::RangeTo` | help: consider borrowing here: `&std::ops::RangeTo { end: 5 }` | - = note: expected type `&_` - found type `std::ops::RangeTo<{integer}>` + = note: expected reference `&_` + found struct `std::ops::RangeTo<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:61:16 @@ -115,8 +115,8 @@ LL | take_range(::std::ops::RangeTo { end: 5 }); | expected reference, found struct `std::ops::RangeTo` | help: consider borrowing here: `&::std::ops::RangeTo { end: 5 }` | - = note: expected type `&_` - found type `std::ops::RangeTo<{integer}>` + = note: expected reference `&_` + found struct `std::ops::RangeTo<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:66:16 @@ -127,8 +127,8 @@ LL | take_range(std::ops::RangeToInclusive { end: 5 }); | expected reference, found struct `std::ops::RangeToInclusive` | help: consider borrowing here: `&std::ops::RangeToInclusive { end: 5 }` | - = note: expected type `&_` - found type `std::ops::RangeToInclusive<{integer}>` + = note: expected reference `&_` + found struct `std::ops::RangeToInclusive<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-literals.rs:71:16 @@ -139,8 +139,8 @@ LL | take_range(::std::ops::RangeToInclusive { end: 5 }); | expected reference, found struct `std::ops::RangeToInclusive` | help: consider borrowing here: `&::std::ops::RangeToInclusive { end: 5 }` | - = note: expected type `&_` - found type `std::ops::RangeToInclusive<{integer}>` + = note: expected reference `&_` + found struct `std::ops::RangeToInclusive<{integer}>` error: aborting due to 12 previous errors diff --git a/src/test/ui/range/issue-54505-no-std.stderr b/src/test/ui/range/issue-54505-no-std.stderr index 4922e59953c9c..aead80fa500a9 100644 --- a/src/test/ui/range/issue-54505-no-std.stderr +++ b/src/test/ui/range/issue-54505-no-std.stderr @@ -9,8 +9,8 @@ LL | take_range(0..1); | expected reference, found struct `core::ops::Range` | help: consider borrowing here: `&(0..1)` | - = note: expected type `&_` - found type `core::ops::Range<{integer}>` + = note: expected reference `&_` + found struct `core::ops::Range<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-std.rs:33:16 @@ -21,8 +21,8 @@ LL | take_range(1..); | expected reference, found struct `core::ops::RangeFrom` | help: consider borrowing here: `&(1..)` | - = note: expected type `&_` - found type `core::ops::RangeFrom<{integer}>` + = note: expected reference `&_` + found struct `core::ops::RangeFrom<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-std.rs:38:16 @@ -33,8 +33,8 @@ LL | take_range(..); | expected reference, found struct `core::ops::RangeFull` | help: consider borrowing here: `&(..)` | - = note: expected type `&_` - found type `core::ops::RangeFull` + = note: expected reference `&_` + found struct `core::ops::RangeFull` error[E0308]: mismatched types --> $DIR/issue-54505-no-std.rs:43:16 @@ -45,8 +45,8 @@ LL | take_range(0..=1); | expected reference, found struct `core::ops::RangeInclusive` | help: consider borrowing here: `&(0..=1)` | - = note: expected type `&_` - found type `core::ops::RangeInclusive<{integer}>` + = note: expected reference `&_` + found struct `core::ops::RangeInclusive<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-std.rs:48:16 @@ -57,8 +57,8 @@ LL | take_range(..5); | expected reference, found struct `core::ops::RangeTo` | help: consider borrowing here: `&(..5)` | - = note: expected type `&_` - found type `core::ops::RangeTo<{integer}>` + = note: expected reference `&_` + found struct `core::ops::RangeTo<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505-no-std.rs:53:16 @@ -69,8 +69,8 @@ LL | take_range(..=42); | expected reference, found struct `core::ops::RangeToInclusive` | help: consider borrowing here: `&(..=42)` | - = note: expected type `&_` - found type `core::ops::RangeToInclusive<{integer}>` + = note: expected reference `&_` + found struct `core::ops::RangeToInclusive<{integer}>` error: aborting due to 7 previous errors diff --git a/src/test/ui/range/issue-54505.stderr b/src/test/ui/range/issue-54505.stderr index d6e1fb0cef238..9949ff85671ca 100644 --- a/src/test/ui/range/issue-54505.stderr +++ b/src/test/ui/range/issue-54505.stderr @@ -7,8 +7,8 @@ LL | take_range(0..1); | expected reference, found struct `std::ops::Range` | help: consider borrowing here: `&(0..1)` | - = note: expected type `&_` - found type `std::ops::Range<{integer}>` + = note: expected reference `&_` + found struct `std::ops::Range<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505.rs:19:16 @@ -19,8 +19,8 @@ LL | take_range(1..); | expected reference, found struct `std::ops::RangeFrom` | help: consider borrowing here: `&(1..)` | - = note: expected type `&_` - found type `std::ops::RangeFrom<{integer}>` + = note: expected reference `&_` + found struct `std::ops::RangeFrom<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505.rs:24:16 @@ -31,8 +31,8 @@ LL | take_range(..); | expected reference, found struct `std::ops::RangeFull` | help: consider borrowing here: `&(..)` | - = note: expected type `&_` - found type `std::ops::RangeFull` + = note: expected reference `&_` + found struct `std::ops::RangeFull` error[E0308]: mismatched types --> $DIR/issue-54505.rs:29:16 @@ -43,8 +43,8 @@ LL | take_range(0..=1); | expected reference, found struct `std::ops::RangeInclusive` | help: consider borrowing here: `&(0..=1)` | - = note: expected type `&_` - found type `std::ops::RangeInclusive<{integer}>` + = note: expected reference `&_` + found struct `std::ops::RangeInclusive<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505.rs:34:16 @@ -55,8 +55,8 @@ LL | take_range(..5); | expected reference, found struct `std::ops::RangeTo` | help: consider borrowing here: `&(..5)` | - = note: expected type `&_` - found type `std::ops::RangeTo<{integer}>` + = note: expected reference `&_` + found struct `std::ops::RangeTo<{integer}>` error[E0308]: mismatched types --> $DIR/issue-54505.rs:39:16 @@ -67,8 +67,8 @@ LL | take_range(..=42); | expected reference, found struct `std::ops::RangeToInclusive` | help: consider borrowing here: `&(..=42)` | - = note: expected type `&_` - found type `std::ops::RangeToInclusive<{integer}>` + = note: expected reference `&_` + found struct `std::ops::RangeToInclusive<{integer}>` error: aborting due to 6 previous errors diff --git a/src/test/ui/regions-fn-subtyping-return-static-fail.stderr b/src/test/ui/regions-fn-subtyping-return-static-fail.stderr index 35478a7db860a..27704b3e0a8c7 100644 --- a/src/test/ui/regions-fn-subtyping-return-static-fail.stderr +++ b/src/test/ui/regions-fn-subtyping-return-static-fail.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | want_F(bar); | ^^^ expected concrete lifetime, found bound lifetime parameter 'cx | - = note: expected type `for<'cx> fn(&'cx S) -> &'cx S` - found type `for<'a> fn(&'a S) -> &S {bar::<'_>}` + = note: expected fn pointer `for<'cx> fn(&'cx S) -> &'cx S` + found fn item `for<'a> fn(&'a S) -> &S {bar::<'_>}` error[E0308]: mismatched types --> $DIR/regions-fn-subtyping-return-static-fail.rs:48:12 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | want_G(baz); | ^^^ expected concrete lifetime, found bound lifetime parameter 'cx | - = note: expected type `for<'cx> fn(&'cx S) -> &'static S` - found type `for<'r> fn(&'r S) -> &'r S {baz}` + = note: expected fn pointer `for<'cx> fn(&'cx S) -> &'static S` + found fn item `for<'r> fn(&'r S) -> &'r S {baz}` error: aborting due to 2 previous errors diff --git a/src/test/ui/regions/region-invariant-static-error-reporting.stderr b/src/test/ui/regions/region-invariant-static-error-reporting.stderr index 8358a7988c808..381bad4210f89 100644 --- a/src/test/ui/regions/region-invariant-static-error-reporting.stderr +++ b/src/test/ui/regions/region-invariant-static-error-reporting.stderr @@ -11,8 +11,8 @@ LL | | mk_static() LL | | }; | |_____- if and else have incompatible types | - = note: expected type `Invariant<'a>` - found type `Invariant<'static>` + = note: expected struct `Invariant<'a>` + found struct `Invariant<'static>` note: the lifetime `'a` as defined on the function body at 13:10... --> $DIR/region-invariant-static-error-reporting.rs:13:10 | diff --git a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr index 36c66451cfaf6..d2608e09ac551 100644 --- a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr +++ b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | let _: fn(&mut &isize, &mut &isize) = a; | ^ expected concrete lifetime, found bound lifetime parameter | - = note: expected type `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` - found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` + = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` + found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` error: aborting due to 3 previous errors diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr index a366bd2e5c2d7..fa39d800b0ecd 100644 --- a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr +++ b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr @@ -33,8 +33,8 @@ error[E0308]: mismatched types LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a; | ^ expected concrete lifetime, found bound lifetime parameter | - = note: expected type `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)` - found type `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}` + = note: expected fn pointer `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)` + found fn item `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}` error: aborting due to 4 previous errors diff --git a/src/test/ui/regions/regions-bounds.stderr b/src/test/ui/regions/regions-bounds.stderr index a15710b86c06e..a4eebab38639e 100644 --- a/src/test/ui/regions/regions-bounds.stderr +++ b/src/test/ui/regions/regions-bounds.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | return e; | ^ lifetime mismatch | - = note: expected type `TupleStruct<'b>` - found type `TupleStruct<'a>` + = note: expected struct `TupleStruct<'b>` + found struct `TupleStruct<'a>` note: the lifetime `'a` as defined on the function body at 8:10... --> $DIR/regions-bounds.rs:8:10 | @@ -23,8 +23,8 @@ error[E0308]: mismatched types LL | return e; | ^ lifetime mismatch | - = note: expected type `Struct<'b>` - found type `Struct<'a>` + = note: expected struct `Struct<'b>` + found struct `Struct<'a>` note: the lifetime `'a` as defined on the function body at 12:10... --> $DIR/regions-bounds.rs:12:10 | diff --git a/src/test/ui/regions/regions-fn-subtyping-return-static.stderr b/src/test/ui/regions/regions-fn-subtyping-return-static.stderr index cda5ce273bd99..a8a7e97e6acf6 100644 --- a/src/test/ui/regions/regions-fn-subtyping-return-static.stderr +++ b/src/test/ui/regions/regions-fn-subtyping-return-static.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | want_F(bar); | ^^^ expected concrete lifetime, found bound lifetime parameter 'cx | - = note: expected type `for<'cx> fn(&'cx S) -> &'cx S` - found type `for<'a> fn(&'a S) -> &S {bar::<'_>}` + = note: expected fn pointer `for<'cx> fn(&'cx S) -> &'cx S` + found fn item `for<'a> fn(&'a S) -> &S {bar::<'_>}` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-decl.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-decl.stderr index f4e223bbf6f9b..4de380ad03b5b 100644 --- a/src/test/ui/regions/regions-infer-invariance-due-to-decl.stderr +++ b/src/test/ui/regions/regions-infer-invariance-due-to-decl.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | b_isize | ^^^^^^^ lifetime mismatch | - = note: expected type `Invariant<'static>` - found type `Invariant<'r>` + = note: expected struct `Invariant<'static>` + found struct `Invariant<'r>` note: the lifetime `'r` as defined on the function body at 11:23... --> $DIR/regions-infer-invariance-due-to-decl.rs:11:23 | diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.stderr index 6322244fcf937..a98d2f0222e65 100644 --- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.stderr +++ b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | b_isize | ^^^^^^^ lifetime mismatch | - = note: expected type `Invariant<'static>` - found type `Invariant<'r>` + = note: expected struct `Invariant<'static>` + found struct `Invariant<'r>` note: the lifetime `'r` as defined on the function body at 9:23... --> $DIR/regions-infer-invariance-due-to-mutability-3.rs:9:23 | diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.stderr index 7baae69945f9c..deb08ff862cc2 100644 --- a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.stderr +++ b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | b_isize | ^^^^^^^ lifetime mismatch | - = note: expected type `Invariant<'static>` - found type `Invariant<'r>` + = note: expected struct `Invariant<'static>` + found struct `Invariant<'r>` note: the lifetime `'r` as defined on the function body at 9:23... --> $DIR/regions-infer-invariance-due-to-mutability-4.rs:9:23 | diff --git a/src/test/ui/regions/regions-infer-not-param.rs b/src/test/ui/regions/regions-infer-not-param.rs index d1744f8a51eee..7643be64d5b23 100644 --- a/src/test/ui/regions/regions-infer-not-param.rs +++ b/src/test/ui/regions/regions-infer-not-param.rs @@ -17,10 +17,10 @@ fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p } //~ ERROR mismatched ty fn take_indirect1(p: Indirect1) -> Indirect1 { p } fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } //~ ERROR mismatched types -//~| expected type `Indirect2<'b>` -//~| found type `Indirect2<'a>` +//~| expected struct `Indirect2<'b>` +//~| found struct `Indirect2<'a>` //~| ERROR mismatched types -//~| expected type `Indirect2<'b>` -//~| found type `Indirect2<'a>` +//~| expected struct `Indirect2<'b>` +//~| found struct `Indirect2<'a>` fn main() {} diff --git a/src/test/ui/regions/regions-infer-not-param.stderr b/src/test/ui/regions/regions-infer-not-param.stderr index 6365769430f36..a6e2047559cce 100644 --- a/src/test/ui/regions/regions-infer-not-param.stderr +++ b/src/test/ui/regions/regions-infer-not-param.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p } | ^ lifetime mismatch | - = note: expected type `Direct<'b>` - found type `Direct<'a>` + = note: expected struct `Direct<'b>` + found struct `Direct<'a>` note: the lifetime `'a` as defined on the function body at 15:16... --> $DIR/regions-infer-not-param.rs:15:16 | @@ -23,8 +23,8 @@ error[E0308]: mismatched types LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } | ^ lifetime mismatch | - = note: expected type `Indirect2<'b>` - found type `Indirect2<'a>` + = note: expected struct `Indirect2<'b>` + found struct `Indirect2<'a>` note: the lifetime `'a` as defined on the function body at 19:19... --> $DIR/regions-infer-not-param.rs:19:19 | @@ -42,8 +42,8 @@ error[E0308]: mismatched types LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } | ^ lifetime mismatch | - = note: expected type `Indirect2<'b>` - found type `Indirect2<'a>` + = note: expected struct `Indirect2<'b>` + found struct `Indirect2<'a>` note: the lifetime `'b` as defined on the function body at 19:22... --> $DIR/regions-infer-not-param.rs:19:22 | diff --git a/src/test/ui/regions/regions-infer-paramd-indirect.rs b/src/test/ui/regions/regions-infer-paramd-indirect.rs index 0fb1824aa5d7a..beb88e81bc1d2 100644 --- a/src/test/ui/regions/regions-infer-paramd-indirect.rs +++ b/src/test/ui/regions/regions-infer-paramd-indirect.rs @@ -21,8 +21,8 @@ impl<'a> SetF<'a> for C<'a> { fn set_f_bad(&mut self, b: Box) { self.f = b; //~^ ERROR mismatched types - //~| expected type `std::boxed::Box>` - //~| found type `std::boxed::Box>` + //~| expected struct `std::boxed::Box>` + //~| found struct `std::boxed::Box>` //~| lifetime mismatch } } diff --git a/src/test/ui/regions/regions-infer-paramd-indirect.stderr b/src/test/ui/regions/regions-infer-paramd-indirect.stderr index b1fd337b8d04b..1497c3ed92564 100644 --- a/src/test/ui/regions/regions-infer-paramd-indirect.stderr +++ b/src/test/ui/regions/regions-infer-paramd-indirect.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | self.f = b; | ^ lifetime mismatch | - = note: expected type `std::boxed::Box>` - found type `std::boxed::Box>` + = note: expected struct `std::boxed::Box>` + found struct `std::boxed::Box>` note: the anonymous lifetime #2 defined on the method body at 21:5... --> $DIR/regions-infer-paramd-indirect.rs:21:5 | diff --git a/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr index e260fccf8488c..a251bb7eb1afd 100644 --- a/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr +++ b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | let _: fn(&mut &isize, &mut &isize) = a; | ^ expected concrete lifetime, found bound lifetime parameter | - = note: expected type `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` - found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` + = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` + found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` error: aborting due to 3 previous errors diff --git a/src/test/ui/regions/regions-trait-1.stderr b/src/test/ui/regions/regions-trait-1.stderr index f835c005ff969..60ac7c09f0414 100644 --- a/src/test/ui/regions/regions-trait-1.stderr +++ b/src/test/ui/regions/regions-trait-1.stderr @@ -4,8 +4,8 @@ error[E0308]: method not compatible with trait LL | fn get_ctxt(&self) -> &'a Ctxt { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch | - = note: expected type `fn(&HasCtxt<'a>) -> &Ctxt` - found type `fn(&HasCtxt<'a>) -> &'a Ctxt` + = note: expected fn pointer `fn(&HasCtxt<'a>) -> &Ctxt` + found fn pointer `fn(&HasCtxt<'a>) -> &'a Ctxt` note: the lifetime `'a` as defined on the impl at 12:6... --> $DIR/regions-trait-1.rs:12:6 | diff --git a/src/test/ui/regions/regions-trait-object-subtyping.stderr b/src/test/ui/regions/regions-trait-object-subtyping.stderr index b7c7f93149dcf..ef69f2535dc1e 100644 --- a/src/test/ui/regions/regions-trait-object-subtyping.stderr +++ b/src/test/ui/regions/regions-trait-object-subtyping.stderr @@ -46,8 +46,8 @@ error[E0308]: mismatched types LL | x | ^ lifetime mismatch | - = note: expected type `Wrapper<&'b mut (dyn Dummy + 'b)>` - found type `Wrapper<&'a mut (dyn Dummy + 'a)>` + = note: expected struct `Wrapper<&'b mut (dyn Dummy + 'b)>` + found struct `Wrapper<&'a mut (dyn Dummy + 'a)>` note: the lifetime `'b` as defined on the function body at 20:15... --> $DIR/regions-trait-object-subtyping.rs:20:15 | diff --git a/src/test/ui/regions/regions-variance-invariant-use-covariant.stderr b/src/test/ui/regions/regions-variance-invariant-use-covariant.stderr index aae519c5df2e9..e7a5db671bf6b 100644 --- a/src/test/ui/regions/regions-variance-invariant-use-covariant.stderr +++ b/src/test/ui/regions/regions-variance-invariant-use-covariant.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: Invariant<'static> = c; | ^ lifetime mismatch | - = note: expected type `Invariant<'static>` - found type `Invariant<'b>` + = note: expected struct `Invariant<'static>` + found struct `Invariant<'b>` note: the lifetime `'b` as defined on the function body at 11:9... --> $DIR/regions-variance-invariant-use-covariant.rs:11:9 | diff --git a/src/test/ui/reify-intrinsic.stderr b/src/test/ui/reify-intrinsic.stderr index 4a1bd77cf7ee9..da43327897538 100644 --- a/src/test/ui/reify-intrinsic.stderr +++ b/src/test/ui/reify-intrinsic.stderr @@ -7,8 +7,8 @@ LL | let _: unsafe extern "rust-intrinsic" fn(isize) -> usize = std::mem::tr | cannot coerce intrinsics to function pointers | help: use parentheses to call this function: `std::mem::transmute(...)` | - = note: expected type `unsafe extern "rust-intrinsic" fn(isize) -> usize` - found type `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}` + = note: expected fn pointer `unsafe extern "rust-intrinsic" fn(isize) -> usize` + found fn item `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}` error[E0606]: casting `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}` as `unsafe extern "rust-intrinsic" fn(isize) -> usize` is invalid --> $DIR/reify-intrinsic.rs:11:13 diff --git a/src/test/ui/reject-specialized-drops-8142.rs b/src/test/ui/reject-specialized-drops-8142.rs index b3cb83f94e053..655b42f5f8fbc 100644 --- a/src/test/ui/reject-specialized-drops-8142.rs +++ b/src/test/ui/reject-specialized-drops-8142.rs @@ -28,8 +28,8 @@ impl<'ml> Drop for M<'ml> { fn drop(&mut self) { } } // AC impl Drop for N<'static> { fn drop(&mut self) { } } // REJECT //~^ ERROR mismatched types -//~| expected type `N<'n>` -//~| found type `N<'static>` +//~| expected struct `N<'n>` +//~| found struct `N<'static>` impl Drop for O { fn drop(&mut self) { } } // ACCEPT diff --git a/src/test/ui/reject-specialized-drops-8142.stderr b/src/test/ui/reject-specialized-drops-8142.stderr index 609a40163a30c..e55f0232ff94b 100644 --- a/src/test/ui/reject-specialized-drops-8142.stderr +++ b/src/test/ui/reject-specialized-drops-8142.stderr @@ -32,8 +32,8 @@ error[E0308]: mismatched types LL | impl Drop for N<'static> { fn drop(&mut self) { } } // REJECT | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch | - = note: expected type `N<'n>` - found type `N<'static>` + = note: expected struct `N<'n>` + found struct `N<'static>` note: the lifetime `'n` as defined on the struct at 8:10... --> $DIR/reject-specialized-drops-8142.rs:8:10 | diff --git a/src/test/ui/repeat_count.rs b/src/test/ui/repeat_count.rs index c42dc8c99719d..fd9c495101526 100644 --- a/src/test/ui/repeat_count.rs +++ b/src/test/ui/repeat_count.rs @@ -6,22 +6,22 @@ fn main() { //~^ ERROR attempt to use a non-constant value in a constant [E0435] let b = [0; ()]; //~^ ERROR mismatched types + //~| expected usize, found () //~| expected type `usize` //~| found type `()` - //~| expected usize, found () let c = [0; true]; //~^ ERROR mismatched types //~| expected usize, found bool let d = [0; 0.5]; //~^ ERROR mismatched types + //~| expected usize, found floating-point number //~| expected type `usize` //~| found type `{float}` - //~| expected usize, found floating-point number let e = [0; "foo"]; //~^ ERROR mismatched types - //~| expected type `usize` - //~| found type `&'static str` //~| expected usize, found reference + //~| expected type `usize` + //~| found reference `&'static str` let f = [0; -4_isize]; //~^ ERROR mismatched types //~| expected usize, found isize @@ -33,7 +33,7 @@ fn main() { } let g = [0; G { g: () }]; //~^ ERROR mismatched types - //~| expected type `usize` - //~| found type `main::G` //~| expected usize, found struct `main::G` + //~| expected type `usize` + //~| found struct `main::G` } diff --git a/src/test/ui/repeat_count.stderr b/src/test/ui/repeat_count.stderr index aae79dfbb3fae..ff79a711ae1e8 100644 --- a/src/test/ui/repeat_count.stderr +++ b/src/test/ui/repeat_count.stderr @@ -34,8 +34,8 @@ error[E0308]: mismatched types LL | let e = [0; "foo"]; | ^^^^^ expected usize, found reference | - = note: expected type `usize` - found type `&'static str` + = note: expected type `usize` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/repeat_count.rs:25:17 @@ -66,7 +66,7 @@ LL | let g = [0; G { g: () }]; | ^^^^^^^^^^^ expected usize, found struct `main::G` | = note: expected type `usize` - found type `main::G` + found struct `main::G` error: aborting due to 8 previous errors diff --git a/src/test/ui/resolve/name-clash-nullary.stderr b/src/test/ui/resolve/name-clash-nullary.stderr index 51793f426d6d4..7977d7cd20f97 100644 --- a/src/test/ui/resolve/name-clash-nullary.stderr +++ b/src/test/ui/resolve/name-clash-nullary.stderr @@ -5,7 +5,7 @@ LL | let None: isize = 42; | ^^^^ expected isize, found enum `std::option::Option` | = note: expected type `isize` - found type `std::option::Option<_>` + found enum `std::option::Option<_>` error: aborting due to previous error diff --git a/src/test/ui/resolve/privacy-enum-ctor.stderr b/src/test/ui/resolve/privacy-enum-ctor.stderr index 8a450ab85e926..12270e4264483 100644 --- a/src/test/ui/resolve/privacy-enum-ctor.stderr +++ b/src/test/ui/resolve/privacy-enum-ctor.stderr @@ -285,8 +285,8 @@ LL | let _: Z = Z::Fn; | expected enum `m::n::Z`, found fn item | help: use parentheses to instantiate this tuple variant: `Z::Fn(_)` | - = note: expected type `m::n::Z` - found type `fn(u8) -> m::n::Z {m::n::Z::Fn}` + = note: expected enum `m::n::Z` + found fn item `fn(u8) -> m::n::Z {m::n::Z::Fn}` error[E0618]: expected function, found enum variant `Z::Unit` --> $DIR/privacy-enum-ctor.rs:31:17 @@ -316,8 +316,8 @@ LL | let _: E = m::E::Fn; | expected enum `m::E`, found fn item | help: use parentheses to instantiate this tuple variant: `m::E::Fn(_)` | - = note: expected type `m::E` - found type `fn(u8) -> m::E {m::E::Fn}` + = note: expected enum `m::E` + found fn item `fn(u8) -> m::E {m::E::Fn}` error[E0618]: expected function, found enum variant `m::E::Unit` --> $DIR/privacy-enum-ctor.rs:47:16 @@ -347,8 +347,8 @@ LL | let _: E = E::Fn; | expected enum `m::E`, found fn item | help: use parentheses to instantiate this tuple variant: `E::Fn(_)` | - = note: expected type `m::E` - found type `fn(u8) -> m::E {m::E::Fn}` + = note: expected enum `m::E` + found fn item `fn(u8) -> m::E {m::E::Fn}` error[E0618]: expected function, found enum variant `E::Unit` --> $DIR/privacy-enum-ctor.rs:55:16 diff --git a/src/test/ui/retslot-cast.stderr b/src/test/ui/retslot-cast.stderr index a1169910ae7e2..cdef304cdc85f 100644 --- a/src/test/ui/retslot-cast.stderr +++ b/src/test/ui/retslot-cast.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | inner(x) | ^^^^^^^^ expected trait `std::iter::Iterator`, found trait `std::iter::Iterator + std::marker::Send` | - = note: expected type `std::option::Option<&dyn std::iter::Iterator>` - found type `std::option::Option<&dyn std::iter::Iterator + std::marker::Send>` + = note: expected enum `std::option::Option<&dyn std::iter::Iterator>` + found enum `std::option::Option<&dyn std::iter::Iterator + std::marker::Send>` error: aborting due to previous error diff --git a/src/test/ui/return/return-from-diverging.stderr b/src/test/ui/return/return-from-diverging.stderr index 3dd029c14c0fd..31f86bdf15de6 100644 --- a/src/test/ui/return/return-from-diverging.stderr +++ b/src/test/ui/return/return-from-diverging.stderr @@ -6,8 +6,8 @@ LL | fn fail() -> ! { LL | return "wow"; | ^^^^^ expected !, found reference | - = note: expected type `!` - found type `&'static str` + = note: expected type `!` + found reference `&'static str` error: aborting due to previous error diff --git a/src/test/ui/return/return-type.stderr b/src/test/ui/return/return-type.stderr index 6eeec41b94c54..feb8a95d3c8b6 100644 --- a/src/test/ui/return/return-type.stderr +++ b/src/test/ui/return/return-type.stderr @@ -5,7 +5,7 @@ LL | foo(4 as usize) | ^^^^^^^^^^^^^^^ expected (), found struct `S` | = note: expected type `()` - found type `S` + found struct `S` help: try adding a semicolon | LL | foo(4 as usize); diff --git a/src/test/ui/rfc-2005-default-binding-mode/const.stderr b/src/test/ui/rfc-2005-default-binding-mode/const.stderr index 210b4f6be63d0..e536ed50de153 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/const.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/const.stderr @@ -5,7 +5,7 @@ LL | FOO => {}, | ^^^ expected &Foo, found struct `Foo` | = note: expected type `&Foo` - found type `Foo` + found struct `Foo` error: aborting due to previous error diff --git a/src/test/ui/rfc-2005-default-binding-mode/lit.stderr b/src/test/ui/rfc-2005-default-binding-mode/lit.stderr index 9be1876b7145b..f8df0b4ada082 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/lit.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/lit.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | "abc" => true, | ^^^^^ expected &str, found str | - = note: expected type `&&str` - found type `&'static str` + = note: expected type `&&str` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/lit.rs:16:9 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | b"abc" => true, | ^^^^^^ expected &[u8], found array of 3 elements | - = note: expected type `&&[u8]` - found type `&'static [u8; 3]` + = note: expected type `&&[u8]` + found reference `&'static [u8; 3]` error: aborting due to 2 previous errors diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr index d05ee1d39ec35..0a597eaa1ffcd 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr @@ -6,8 +6,8 @@ LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A { LL | x | ^ expected struct `A`, found enum `uninhabited::UninhabitedEnum` | - = note: expected type `A` - found type `uninhabited::UninhabitedEnum` + = note: expected struct `A` + found enum `uninhabited::UninhabitedEnum` error[E0308]: mismatched types --> $DIR/coercions.rs:27:5 @@ -17,8 +17,8 @@ LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) LL | x | ^ expected struct `A`, found struct `uninhabited::UninhabitedTupleStruct` | - = note: expected type `A` - found type `uninhabited::UninhabitedTupleStruct` + = note: expected struct `A` + found struct `uninhabited::UninhabitedTupleStruct` error[E0308]: mismatched types --> $DIR/coercions.rs:31:5 @@ -28,8 +28,8 @@ LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A { LL | x | ^ expected struct `A`, found struct `uninhabited::UninhabitedStruct` | - = note: expected type `A` - found type `uninhabited::UninhabitedStruct` + = note: expected struct `A` + found struct `uninhabited::UninhabitedStruct` error[E0308]: mismatched types --> $DIR/coercions.rs:35:5 @@ -39,8 +39,8 @@ LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariant LL | x | ^ expected struct `A`, found enum `uninhabited::UninhabitedVariants` | - = note: expected type `A` - found type `uninhabited::UninhabitedVariants` + = note: expected struct `A` + found enum `uninhabited::UninhabitedVariants` error: aborting due to 4 previous errors diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr index a07473dade22c..6d7383b38960b 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr @@ -6,8 +6,8 @@ LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A { LL | x | ^ expected struct `A`, found enum `UninhabitedEnum` | - = note: expected type `A` - found type `UninhabitedEnum` + = note: expected struct `A` + found enum `UninhabitedEnum` error[E0308]: mismatched types --> $DIR/coercions_same_crate.rs:34:5 @@ -17,8 +17,8 @@ LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) LL | x | ^ expected struct `A`, found struct `UninhabitedTupleStruct` | - = note: expected type `A` - found type `UninhabitedTupleStruct` + = note: expected struct `A` + found struct `UninhabitedTupleStruct` error[E0308]: mismatched types --> $DIR/coercions_same_crate.rs:38:5 @@ -28,8 +28,8 @@ LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A { LL | x | ^ expected struct `A`, found struct `UninhabitedStruct` | - = note: expected type `A` - found type `UninhabitedStruct` + = note: expected struct `A` + found struct `UninhabitedStruct` error[E0308]: mismatched types --> $DIR/coercions_same_crate.rs:42:5 @@ -39,8 +39,8 @@ LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariant LL | x | ^ expected struct `A`, found enum `UninhabitedVariants` | - = note: expected type `A` - found type `UninhabitedVariants` + = note: expected struct `A` + found enum `UninhabitedVariants` error: aborting due to 4 previous errors diff --git a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr index aa7c342819e80..41f0ca2ed5a61 100644 --- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr +++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr @@ -540,8 +540,8 @@ LL | if &let 0 = 0 {} | expected bool, found &bool | help: consider removing the borrow: `let 0 = 0` | - = note: expected type `bool` - found type `&bool` + = note: expected type `bool` + found reference `&bool` error[E0614]: type `bool` cannot be dereferenced --> $DIR/disallowed-positions.rs:36:8 @@ -594,7 +594,7 @@ LL | if true..(let 0 = 0) {} | ^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range` + found struct `std::ops::Range` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:61:8 @@ -603,7 +603,7 @@ LL | if ..(let 0 = 0) {} | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeTo` | = note: expected type `bool` - found type `std::ops::RangeTo` + found struct `std::ops::RangeTo` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:63:8 @@ -612,7 +612,7 @@ LL | if (let 0 = 0).. {} | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeFrom` | = note: expected type `bool` - found type `std::ops::RangeFrom` + found struct `std::ops::RangeFrom` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:67:12 @@ -623,7 +623,7 @@ LL | if let Range { start: _, end: _ } = true..true && false {} | expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range<_>` + found struct `std::ops::Range<_>` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:67:8 @@ -632,7 +632,7 @@ LL | if let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range` + found struct `std::ops::Range` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:71:12 @@ -643,7 +643,7 @@ LL | if let Range { start: _, end: _ } = true..true || false {} | expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range<_>` + found struct `std::ops::Range<_>` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:71:8 @@ -652,7 +652,7 @@ LL | if let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range` + found struct `std::ops::Range` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:78:12 @@ -660,8 +660,8 @@ error[E0308]: mismatched types LL | if let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range` | - = note: expected type `fn() -> bool` - found type `std::ops::Range<_>` + = note: expected fn pointer `fn() -> bool` + found struct `std::ops::Range<_>` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:78:41 @@ -670,7 +670,7 @@ LL | if let Range { start: F, end } = F..|| true {} | ^^^^^^^ expected bool, found closure | = note: expected type `bool` - found type `[closure@$DIR/disallowed-positions.rs:78:41: 78:48]` + found closure `[closure@$DIR/disallowed-positions.rs:78:41: 78:48]` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:78:8 @@ -679,7 +679,7 @@ LL | if let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range` + found struct `std::ops::Range` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:86:12 @@ -690,7 +690,7 @@ LL | if let Range { start: true, end } = t..&&false {} | expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range<_>` + found struct `std::ops::Range<_>` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:86:44 @@ -698,8 +698,8 @@ error[E0308]: mismatched types LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^ expected bool, found &&bool | - = note: expected type `bool` - found type `&&bool` + = note: expected type `bool` + found reference `&&bool` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:86:8 @@ -708,7 +708,7 @@ LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range` + found struct `std::ops::Range` error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try` --> $DIR/disallowed-positions.rs:42:20 @@ -728,8 +728,8 @@ LL | while &let 0 = 0 {} | expected bool, found &bool | help: consider removing the borrow: `let 0 = 0` | - = note: expected type `bool` - found type `&bool` + = note: expected type `bool` + found reference `&bool` error[E0614]: type `bool` cannot be dereferenced --> $DIR/disallowed-positions.rs:100:11 @@ -782,7 +782,7 @@ LL | while true..(let 0 = 0) {} | ^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range` + found struct `std::ops::Range` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:125:11 @@ -791,7 +791,7 @@ LL | while ..(let 0 = 0) {} | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeTo` | = note: expected type `bool` - found type `std::ops::RangeTo` + found struct `std::ops::RangeTo` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:127:11 @@ -800,7 +800,7 @@ LL | while (let 0 = 0).. {} | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeFrom` | = note: expected type `bool` - found type `std::ops::RangeFrom` + found struct `std::ops::RangeFrom` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:131:15 @@ -811,7 +811,7 @@ LL | while let Range { start: _, end: _ } = true..true && false {} | expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range<_>` + found struct `std::ops::Range<_>` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:131:11 @@ -820,7 +820,7 @@ LL | while let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range` + found struct `std::ops::Range` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:135:15 @@ -831,7 +831,7 @@ LL | while let Range { start: _, end: _ } = true..true || false {} | expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range<_>` + found struct `std::ops::Range<_>` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:135:11 @@ -840,7 +840,7 @@ LL | while let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range` + found struct `std::ops::Range` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:142:15 @@ -848,8 +848,8 @@ error[E0308]: mismatched types LL | while let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range` | - = note: expected type `fn() -> bool` - found type `std::ops::Range<_>` + = note: expected fn pointer `fn() -> bool` + found struct `std::ops::Range<_>` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:142:44 @@ -858,7 +858,7 @@ LL | while let Range { start: F, end } = F..|| true {} | ^^^^^^^ expected bool, found closure | = note: expected type `bool` - found type `[closure@$DIR/disallowed-positions.rs:142:44: 142:51]` + found closure `[closure@$DIR/disallowed-positions.rs:142:44: 142:51]` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:142:11 @@ -867,7 +867,7 @@ LL | while let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range` + found struct `std::ops::Range` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:150:15 @@ -878,7 +878,7 @@ LL | while let Range { start: true, end } = t..&&false {} | expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range<_>` + found struct `std::ops::Range<_>` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:150:47 @@ -886,8 +886,8 @@ error[E0308]: mismatched types LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^ expected bool, found &&bool | - = note: expected type `bool` - found type `&&bool` + = note: expected type `bool` + found reference `&&bool` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:150:11 @@ -896,7 +896,7 @@ LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range` + found struct `std::ops::Range` error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try` --> $DIR/disallowed-positions.rs:106:23 @@ -948,7 +948,7 @@ LL | (let Range { start: _, end: _ } = true..true || false); | expected bool, found struct `std::ops::Range` | = note: expected type `bool` - found type `std::ops::Range<_>` + found struct `std::ops::Range<_>` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:207:5 @@ -959,8 +959,8 @@ LL | fn outside_if_and_while_expr() { LL | &let 0 = 0 | ^^^^^^^^^^ expected (), found &bool | - = note: expected type `()` - found type `&bool` + = note: expected type `()` + found reference `&bool` error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try` --> $DIR/disallowed-positions.rs:179:17 diff --git a/src/test/ui/slice-mut.rs b/src/test/ui/slice-mut.rs index dc5ef58eb33c8..e9989f0f48131 100644 --- a/src/test/ui/slice-mut.rs +++ b/src/test/ui/slice-mut.rs @@ -6,7 +6,7 @@ fn main() { let y: &mut[_] = &x[2..4]; //~^ ERROR mismatched types - //~| expected type `&mut [_]` - //~| found type `&[isize]` + //~| expected mutable reference `&mut [_]` + //~| found reference `&[isize]` //~| types differ in mutability } diff --git a/src/test/ui/slice-mut.stderr b/src/test/ui/slice-mut.stderr index e99d83d0fed38..c1c5f316e958b 100644 --- a/src/test/ui/slice-mut.stderr +++ b/src/test/ui/slice-mut.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let y: &mut[_] = &x[2..4]; | ^^^^^^^^ types differ in mutability | - = note: expected type `&mut [_]` - found type `&[isize]` + = note: expected mutable reference `&mut [_]` + found reference `&[isize]` error: aborting due to previous error diff --git a/src/test/ui/slightly-nice-generic-literal-messages.rs b/src/test/ui/slightly-nice-generic-literal-messages.rs index cd0ee174af528..a48598ce8d5a0 100644 --- a/src/test/ui/slightly-nice-generic-literal-messages.rs +++ b/src/test/ui/slightly-nice-generic-literal-messages.rs @@ -6,7 +6,7 @@ fn main() { match Foo(1.1, marker::PhantomData) { 1 => {} //~^ ERROR mismatched types - //~| expected type `Foo<{float}, _>` + //~| expected struct `Foo<{float}, _>` //~| found type `{integer}` //~| expected struct `Foo`, found integer } diff --git a/src/test/ui/slightly-nice-generic-literal-messages.stderr b/src/test/ui/slightly-nice-generic-literal-messages.stderr index 76ebc007df34f..61eabed950423 100644 --- a/src/test/ui/slightly-nice-generic-literal-messages.stderr +++ b/src/test/ui/slightly-nice-generic-literal-messages.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | 1 => {} | ^ expected struct `Foo`, found integer | - = note: expected type `Foo<{float}, _>` - found type `{integer}` + = note: expected struct `Foo<{float}, _>` + found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/span/coerce-suggestions.stderr b/src/test/ui/span/coerce-suggestions.stderr index 0d15a2a753ed0..84b92a7c04add 100644 --- a/src/test/ui/span/coerce-suggestions.stderr +++ b/src/test/ui/span/coerce-suggestions.stderr @@ -5,7 +5,7 @@ LL | let x: usize = String::new(); | ^^^^^^^^^^^^^ expected usize, found struct `std::string::String` | = note: expected type `usize` - found type `std::string::String` + found struct `std::string::String` error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:9:19 @@ -16,8 +16,8 @@ LL | let x: &str = String::new(); | expected &str, found struct `std::string::String` | help: consider borrowing here: `&String::new()` | - = note: expected type `&str` - found type `std::string::String` + = note: expected reference `&str` + found struct `std::string::String` error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:12:10 @@ -25,8 +25,8 @@ error[E0308]: mismatched types LL | test(&y); | ^^ types differ in mutability | - = note: expected type `&mut std::string::String` - found type `&std::string::String` + = note: expected mutable reference `&mut std::string::String` + found reference `&std::string::String` error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:14:11 @@ -34,8 +34,8 @@ error[E0308]: mismatched types LL | test2(&y); | ^^ types differ in mutability | - = note: expected type `&mut i32` - found type `&std::string::String` + = note: expected mutable reference `&mut i32` + found reference `&std::string::String` error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:17:9 @@ -52,8 +52,8 @@ error[E0308]: mismatched types LL | s = format!("foo"); | ^^^^^^^^^^^^^^ expected mutable reference, found struct `std::string::String` | - = note: expected type `&mut std::string::String` - found type `std::string::String` + = note: expected mutable reference `&mut std::string::String` + found struct `std::string::String` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to 6 previous errors diff --git a/src/test/ui/span/issue-33884.stderr b/src/test/ui/span/issue-33884.stderr index e59440b363f51..4cb2fc24a0549 100644 --- a/src/test/ui/span/issue-33884.stderr +++ b/src/test/ui/span/issue-33884.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | stream.write_fmt(format!("message received")) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::fmt::Arguments`, found struct `std::string::String` | - = note: expected type `std::fmt::Arguments<'_>` - found type `std::string::String` + = note: expected struct `std::fmt::Arguments<'_>` + found struct `std::string::String` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/span/issue-34264.stderr b/src/test/ui/span/issue-34264.stderr index 26d686f6f5055..a9cf323c99057 100644 --- a/src/test/ui/span/issue-34264.stderr +++ b/src/test/ui/span/issue-34264.stderr @@ -57,8 +57,8 @@ error[E0308]: mismatched types LL | bar("", ""); | ^^ expected usize, found reference | - = note: expected type `usize` - found type `&'static str` + = note: expected type `usize` + found reference `&'static str` error[E0061]: this function takes 2 parameters but 3 parameters were supplied --> $DIR/issue-34264.rs:10:5 diff --git a/src/test/ui/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr index 2ce5b0c11712a..8ce1dfb11bca2 100644 --- a/src/test/ui/span/issue-39018.stderr +++ b/src/test/ui/span/issue-39018.stderr @@ -73,8 +73,8 @@ LL | let _ = a + b; | expected &str, found struct `std::string::String` | help: consider borrowing here: `&b` | - = note: expected type `&str` - found type `std::string::String` + = note: expected reference `&str` + found struct `std::string::String` error[E0369]: binary operation `+` cannot be applied to type `&std::string::String` --> $DIR/issue-39018.rs:30:15 diff --git a/src/test/ui/span/move-closure.stderr b/src/test/ui/span/move-closure.stderr index e2226b197aeb8..e628428436d51 100644 --- a/src/test/ui/span/move-closure.stderr +++ b/src/test/ui/span/move-closure.stderr @@ -5,7 +5,7 @@ LL | let x: () = move || (); | ^^^^^^^^^^ expected (), found closure | = note: expected type `()` - found type `[closure@$DIR/move-closure.rs:5:17: 5:27]` + found closure `[closure@$DIR/move-closure.rs:5:17: 5:27]` error: aborting due to previous error diff --git a/src/test/ui/specialization/specialization-default-projection.stderr b/src/test/ui/specialization/specialization-default-projection.stderr index 43cebd7f9c245..6ee634d4d1cba 100644 --- a/src/test/ui/specialization/specialization-default-projection.stderr +++ b/src/test/ui/specialization/specialization-default-projection.stderr @@ -7,8 +7,8 @@ LL | fn generic() -> ::Assoc { LL | () | ^^ expected associated type, found () | - = note: expected type `::Assoc` - found type `()` + = note: expected associated type `::Assoc` + found type `()` = note: consider constraining the associated type `::Assoc` to `()` or calling a method that returns `::Assoc` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html @@ -23,8 +23,8 @@ LL | generic::<()>() | | | expected (), found associated type | - = note: expected type `()` - found type `<() as Foo>::Assoc` + = note: expected type `()` + found associated type `<() as Foo>::Assoc` = note: consider constraining the associated type `<() as Foo>::Assoc` to `()` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html diff --git a/src/test/ui/specialization/specialization-default-types.stderr b/src/test/ui/specialization/specialization-default-types.stderr index 932087421fbcb..257c114252cfc 100644 --- a/src/test/ui/specialization/specialization-default-types.stderr +++ b/src/test/ui/specialization/specialization-default-types.stderr @@ -6,8 +6,8 @@ LL | default fn generate(self) -> Self::Output { LL | Box::new(self) | ^^^^^^^^^^^^^^ expected associated type, found struct `std::boxed::Box` | - = note: expected type `::Output` - found type `std::boxed::Box` + = note: expected associated type `::Output` + found struct `std::boxed::Box` = note: consider constraining the associated type `::Output` to `std::boxed::Box` or calling a method that returns `::Output` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html @@ -19,8 +19,8 @@ LL | fn trouble(t: T) -> Box { LL | Example::generate(t) | ^^^^^^^^^^^^^^^^^^^^ expected struct `std::boxed::Box`, found associated type | - = note: expected type `std::boxed::Box` - found type `::Output` + = note: expected struct `std::boxed::Box` + found associated type `::Output` = note: consider constraining the associated type `::Output` to `std::boxed::Box` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html diff --git a/src/test/ui/static/static-reference-to-fn-1.stderr b/src/test/ui/static/static-reference-to-fn-1.stderr index f6d2385ac69af..77ab62c321ca1 100644 --- a/src/test/ui/static/static-reference-to-fn-1.stderr +++ b/src/test/ui/static/static-reference-to-fn-1.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | func: &foo, | ^^^^ expected fn pointer, found fn item | - = note: expected type `&fn() -> std::option::Option` - found type `&fn() -> std::option::Option {foo}` + = note: expected reference `&fn() -> std::option::Option` + found reference `&fn() -> std::option::Option {foo}` error: aborting due to previous error diff --git a/src/test/ui/str/str-array-assignment.stderr b/src/test/ui/str/str-array-assignment.stderr index ecd5fb4412967..9f790d3365939 100644 --- a/src/test/ui/str/str-array-assignment.stderr +++ b/src/test/ui/str/str-array-assignment.stderr @@ -6,8 +6,8 @@ LL | let t = if true { s[..2] } else { s }; | | | expected because of this | - = note: expected type `str` - found type `&str` + = note: expected type `str` + found reference `&str` error[E0308]: mismatched types --> $DIR/str-array-assignment.rs:5:27 @@ -18,8 +18,8 @@ LL | let u: &str = if true { s[..2] } else { s }; | expected &str, found str | help: consider borrowing here: `&s[..2]` | - = note: expected type `&str` - found type `str` + = note: expected reference `&str` + found type `str` error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/str-array-assignment.rs:7:7 @@ -43,8 +43,8 @@ LL | let w: &str = s[..2]; | expected &str, found str | help: consider borrowing here: `&s[..2]` | - = note: expected type `&str` - found type `str` + = note: expected reference `&str` + found type `str` error: aborting due to 4 previous errors diff --git a/src/test/ui/str/str-lit-type-mismatch.stderr b/src/test/ui/str/str-lit-type-mismatch.stderr index ef40faa8e26eb..e328bb33c837b 100644 --- a/src/test/ui/str/str-lit-type-mismatch.stderr +++ b/src/test/ui/str/str-lit-type-mismatch.stderr @@ -7,8 +7,8 @@ LL | let x: &[u8] = "foo"; | expected slice, found str | help: consider adding a leading `b`: `b"foo"` | - = note: expected type `&[u8]` - found type `&'static str` + = note: expected reference `&[u8]` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/str-lit-type-mismatch.rs:3:23 @@ -19,8 +19,8 @@ LL | let y: &[u8; 4] = "baaa"; | expected array of 4 elements, found str | help: consider adding a leading `b`: `b"baaa"` | - = note: expected type `&[u8; 4]` - found type `&'static str` + = note: expected reference `&[u8; 4]` + found reference `&'static str` error[E0308]: mismatched types --> $DIR/str-lit-type-mismatch.rs:4:19 @@ -31,8 +31,8 @@ LL | let z: &str = b"foo"; | expected str, found array of 3 elements | help: consider removing the leading `b`: `"foo"` | - = note: expected type `&str` - found type `&'static [u8; 3]` + = note: expected reference `&str` + found reference `&'static [u8; 3]` error: aborting due to 3 previous errors diff --git a/src/test/ui/structs/struct-base-wrong-type.stderr b/src/test/ui/structs/struct-base-wrong-type.stderr index a0216305f3115..c0bd9bda45185 100644 --- a/src/test/ui/structs/struct-base-wrong-type.stderr +++ b/src/test/ui/structs/struct-base-wrong-type.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | static foo: Foo = Foo { a: 2, ..bar }; | ^^^ expected struct `Foo`, found struct `Bar` | - = note: expected type `Foo` - found type `Bar` + = note: expected struct `Foo` + found struct `Bar` error[E0308]: mismatched types --> $DIR/struct-base-wrong-type.rs:8:35 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | static foo_i: Foo = Foo { a: 2, ..4 }; | ^ expected struct `Foo`, found integer | - = note: expected type `Foo` - found type `{integer}` + = note: expected struct `Foo` + found type `{integer}` error[E0308]: mismatched types --> $DIR/struct-base-wrong-type.rs:12:27 @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | let f = Foo { a: 2, ..b }; | ^ expected struct `Foo`, found struct `Bar` | - = note: expected type `Foo` - found type `Bar` + = note: expected struct `Foo` + found struct `Bar` error[E0308]: mismatched types --> $DIR/struct-base-wrong-type.rs:13:34 @@ -31,8 +31,8 @@ error[E0308]: mismatched types LL | let f__isize = Foo { a: 2, ..4 }; | ^ expected struct `Foo`, found integer | - = note: expected type `Foo` - found type `{integer}` + = note: expected struct `Foo` + found type `{integer}` error: aborting due to 4 previous errors diff --git a/src/test/ui/structs/struct-path-self-type-mismatch.stderr b/src/test/ui/structs/struct-path-self-type-mismatch.stderr index 687d610baf8cf..63232a249f43d 100644 --- a/src/test/ui/structs/struct-path-self-type-mismatch.stderr +++ b/src/test/ui/structs/struct-path-self-type-mismatch.stderr @@ -15,8 +15,8 @@ LL | fn new(u: U) -> Foo { LL | inner: u | ^ expected type parameter `T`, found type parameter `U` | - = note: expected type `T` - found type `U` + = note: expected type parameter `T` + found type parameter `U` = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters @@ -36,8 +36,8 @@ LL | | LL | | } | |_________^ expected type parameter `U`, found type parameter `T` | - = note: expected type `Foo` - found type `Foo` + = note: expected struct `Foo` + found struct `Foo` = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/structs/structure-constructor-type-mismatch.stderr b/src/test/ui/structs/structure-constructor-type-mismatch.stderr index 62d872bb3e4d6..4a78fa3896ffa 100644 --- a/src/test/ui/structs/structure-constructor-type-mismatch.stderr +++ b/src/test/ui/structs/structure-constructor-type-mismatch.stderr @@ -114,8 +114,8 @@ LL | match (Point { x: 1, y: 2 }) { LL | PointF:: { .. } => {} | ^^^^^^^^^^^^^^^^^^^^ expected integer, found f32 | - = note: expected type `Point<{integer}>` - found type `Point` + = note: expected struct `Point<{integer}>` + found struct `Point` error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:59:9 @@ -125,8 +125,8 @@ LL | match (Point { x: 1, y: 2 }) { LL | PointF { .. } => {} | ^^^^^^^^^^^^^ expected integer, found f32 | - = note: expected type `Point<{integer}>` - found type `Point` + = note: expected struct `Point<{integer}>` + found struct `Point` error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:67:9 @@ -136,8 +136,8 @@ LL | match (Pair { x: 1, y: 2 }) { LL | PairF:: { .. } => {} | ^^^^^^^^^^^^^^^^^^^ expected integer, found f32 | - = note: expected type `Pair<{integer}, {integer}>` - found type `Pair` + = note: expected struct `Pair<{integer}, {integer}>` + found struct `Pair` error: aborting due to 13 previous errors diff --git a/src/test/ui/substs-ppaux.normal.stderr b/src/test/ui/substs-ppaux.normal.stderr index cb55203c88e31..6c732ddceefe6 100644 --- a/src/test/ui/substs-ppaux.normal.stderr +++ b/src/test/ui/substs-ppaux.normal.stderr @@ -11,7 +11,7 @@ LL | let x: () = >::bar::<'static, char>; | help: use parentheses to call this function: `>::bar::<'static, char>()` | = note: expected type `()` - found type `fn() {>::bar::<'static, char>}` + found fn item `fn() {>::bar::<'static, char>}` error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:25:17 @@ -26,7 +26,7 @@ LL | let x: () = >::bar::<'static, char>; | help: use parentheses to call this function: `>::bar::<'static, char>()` | = note: expected type `()` - found type `fn() {>::bar::<'static, char>}` + found fn item `fn() {>::bar::<'static, char>}` error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:33:17 @@ -41,7 +41,7 @@ LL | let x: () = >::baz; | help: use parentheses to call this function: `>::baz()` | = note: expected type `()` - found type `fn() {>::baz}` + found fn item `fn() {>::baz}` error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:41:17 @@ -56,7 +56,7 @@ LL | let x: () = foo::<'static>; | help: use parentheses to call this function: `foo::<'static>()` | = note: expected type `()` - found type `fn() {foo::<'static>}` + found fn item `fn() {foo::<'static>}` error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/substs-ppaux.rs:49:5 diff --git a/src/test/ui/substs-ppaux.rs b/src/test/ui/substs-ppaux.rs index 129ebd43594ce..b5b4740603a47 100644 --- a/src/test/ui/substs-ppaux.rs +++ b/src/test/ui/substs-ppaux.rs @@ -16,35 +16,35 @@ fn foo<'z>() where &'z (): Sized { let x: () = >::bar::<'static, char>; //[verbose]~^ ERROR mismatched types //[verbose]~| expected type `()` - //[verbose]~| found type `fn() {>::bar::}` + //[verbose]~| found fn item `fn() {>::bar::}` //[normal]~^^^^ ERROR mismatched types //[normal]~| expected type `()` - //[normal]~| found type `fn() {>::bar::<'static, char>}` + //[normal]~| found fn item `fn() {>::bar::<'static, char>}` let x: () = >::bar::<'static, char>; //[verbose]~^ ERROR mismatched types //[verbose]~| expected type `()` - //[verbose]~| found type `fn() {>::bar::}` + //[verbose]~| found fn item `fn() {>::bar::}` //[normal]~^^^^ ERROR mismatched types //[normal]~| expected type `()` - //[normal]~| found type `fn() {>::bar::<'static, char>}` + //[normal]~| found fn item `fn() {>::bar::<'static, char>}` let x: () = >::baz; //[verbose]~^ ERROR mismatched types //[verbose]~| expected type `()` - //[verbose]~| found type `fn() {>::baz}` + //[verbose]~| found fn item `fn() {>::baz}` //[normal]~^^^^ ERROR mismatched types //[normal]~| expected type `()` - //[normal]~| found type `fn() {>::baz}` + //[normal]~| found fn item `fn() {>::baz}` let x: () = foo::<'static>; //[verbose]~^ ERROR mismatched types //[verbose]~| expected type `()` - //[verbose]~| found type `fn() {foo::}` + //[verbose]~| found fn item `fn() {foo::}` //[normal]~^^^^ ERROR mismatched types //[normal]~| expected type `()` - //[normal]~| found type `fn() {foo::<'static>}` + //[normal]~| found fn item `fn() {foo::<'static>}` >::bar; //[verbose]~^ ERROR the size for values of type diff --git a/src/test/ui/substs-ppaux.verbose.stderr b/src/test/ui/substs-ppaux.verbose.stderr index cafcba97b92c8..b2f647cac24b3 100644 --- a/src/test/ui/substs-ppaux.verbose.stderr +++ b/src/test/ui/substs-ppaux.verbose.stderr @@ -11,7 +11,7 @@ LL | let x: () = >::bar::<'static, char>; | help: use parentheses to call this function: `>::bar::<'static, char>()` | = note: expected type `()` - found type `fn() {>::bar::}` + found fn item `fn() {>::bar::}` error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:25:17 @@ -26,7 +26,7 @@ LL | let x: () = >::bar::<'static, char>; | help: use parentheses to call this function: `>::bar::<'static, char>()` | = note: expected type `()` - found type `fn() {>::bar::}` + found fn item `fn() {>::bar::}` error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:33:17 @@ -41,7 +41,7 @@ LL | let x: () = >::baz; | help: use parentheses to call this function: `>::baz()` | = note: expected type `()` - found type `fn() {>::baz}` + found fn item `fn() {>::baz}` error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:41:17 @@ -56,7 +56,7 @@ LL | let x: () = foo::<'static>; | help: use parentheses to call this function: `foo::<'static>()` | = note: expected type `()` - found type `fn() {foo::}` + found fn item `fn() {foo::}` error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/substs-ppaux.rs:49:5 diff --git a/src/test/ui/suggestions/as-ref.stderr b/src/test/ui/suggestions/as-ref.stderr index 8143acc957b4c..d01c37351951f 100644 --- a/src/test/ui/suggestions/as-ref.stderr +++ b/src/test/ui/suggestions/as-ref.stderr @@ -6,8 +6,8 @@ LL | opt.map(|arg| takes_ref(arg)); | | | help: consider using `as_ref` instead: `as_ref().map` | - = note: expected type `&Foo` - found type `Foo` + = note: expected reference `&Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/as-ref.rs:8:37 @@ -17,8 +17,8 @@ LL | opt.and_then(|arg| Some(takes_ref(arg))); | | | help: consider using `as_ref` instead: `as_ref().and_then` | - = note: expected type `&Foo` - found type `Foo` + = note: expected reference `&Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/as-ref.rs:11:27 @@ -28,8 +28,8 @@ LL | opt.map(|arg| takes_ref(arg)); | | | help: consider using `as_ref` instead: `as_ref().map` | - = note: expected type `&Foo` - found type `Foo` + = note: expected reference `&Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/as-ref.rs:13:35 @@ -39,8 +39,8 @@ LL | opt.and_then(|arg| Ok(takes_ref(arg))); | | | help: consider using `as_ref` instead: `as_ref().and_then` | - = note: expected type `&Foo` - found type `Foo` + = note: expected reference `&Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/as-ref.rs:16:27 @@ -51,8 +51,8 @@ LL | let y: Option<&usize> = x; | expected enum `std::option::Option`, found reference | help: you can convert from `&Option` to `Option<&T>` using `.as_ref()`: `x.as_ref()` | - = note: expected type `std::option::Option<&usize>` - found type `&std::option::Option` + = note: expected enum `std::option::Option<&usize>` + found reference `&std::option::Option` error[E0308]: mismatched types --> $DIR/as-ref.rs:19:35 @@ -60,8 +60,8 @@ error[E0308]: mismatched types LL | let y: Result<&usize, &usize> = x; | ^ expected enum `std::result::Result`, found reference | - = note: expected type `std::result::Result<&usize, &usize>` - found type `&std::result::Result` + = note: expected enum `std::result::Result<&usize, &usize>` + found reference `&std::result::Result` help: you can convert from `&Result` to `Result<&T, &E>` using `.as_ref()` | LL | let y: Result<&usize, &usize> = x.as_ref(); @@ -73,8 +73,8 @@ error[E0308]: mismatched types LL | let y: Result<&usize, usize> = x; | ^ expected enum `std::result::Result`, found reference | - = note: expected type `std::result::Result<&usize, usize>` - found type `&std::result::Result` + = note: expected enum `std::result::Result<&usize, usize>` + found reference `&std::result::Result` error: aborting due to 7 previous errors diff --git a/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr b/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr index bc7a7247a1283..66f6bf91cc289 100644 --- a/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr +++ b/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr @@ -9,8 +9,8 @@ LL | | }; | |______expected &str, found struct `std::string::String` | in this macro invocation | - = note: expected type `&str` - found type `std::string::String` + = note: expected reference `&str` + found struct `std::string::String` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr index 56810a4915869..18e5c63ff48cf 100644 --- a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr +++ b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr @@ -25,7 +25,7 @@ LL | let _: usize = foo; | help: use parentheses to call this function: `foo(a, b)` | = note: expected type `usize` - found type `fn(usize, usize) -> usize {foo}` + found fn item `fn(usize, usize) -> usize {foo}` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:30:16 @@ -39,8 +39,8 @@ LL | let _: S = S; | expected struct `S`, found fn item | help: use parentheses to instantiate this tuple struct: `S(_, _)` | - = note: expected type `S` - found type `fn(usize, usize) -> S {S}` + = note: expected struct `S` + found fn item `fn(usize, usize) -> S {S}` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:31:20 @@ -55,7 +55,7 @@ LL | let _: usize = bar; | help: use parentheses to call this function: `bar()` | = note: expected type `usize` - found type `fn() -> usize {bar}` + found fn item `fn() -> usize {bar}` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:32:16 @@ -69,8 +69,8 @@ LL | let _: V = V; | expected struct `V`, found fn item | help: use parentheses to instantiate this tuple struct: `V()` | - = note: expected type `V` - found type `fn() -> V {V}` + = note: expected struct `V` + found fn item `fn() -> V {V}` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:33:20 @@ -85,7 +85,7 @@ LL | let _: usize = T::baz; | help: use parentheses to call this function: `T::baz(x, y)` | = note: expected type `usize` - found type `fn(usize, usize) -> usize {<_ as T>::baz}` + found fn item `fn(usize, usize) -> usize {<_ as T>::baz}` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:34:20 @@ -100,7 +100,7 @@ LL | let _: usize = T::bat; | help: use parentheses to call this function: `T::bat(x)` | = note: expected type `usize` - found type `fn(usize) -> usize {<_ as T>::bat}` + found fn item `fn(usize) -> usize {<_ as T>::bat}` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:35:16 @@ -114,8 +114,8 @@ LL | let _: E = E::A; | expected enum `E`, found fn item | help: use parentheses to instantiate this tuple variant: `E::A(_)` | - = note: expected type `E` - found type `fn(usize) -> E {E::A}` + = note: expected enum `E` + found fn item `fn(usize) -> E {E::A}` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:37:20 @@ -130,7 +130,7 @@ LL | let _: usize = X::baz; | help: use parentheses to call this function: `X::baz(x, y)` | = note: expected type `usize` - found type `fn(usize, usize) -> usize {::baz}` + found fn item `fn(usize, usize) -> usize {::baz}` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:38:20 @@ -145,7 +145,7 @@ LL | let _: usize = X::bat; | help: use parentheses to call this function: `X::bat(x)` | = note: expected type `usize` - found type `fn(usize) -> usize {::bat}` + found fn item `fn(usize) -> usize {::bat}` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:39:20 @@ -160,7 +160,7 @@ LL | let _: usize = X::bax; | help: use parentheses to call this function: `X::bax(x)` | = note: expected type `usize` - found type `fn(usize) -> usize {::bax}` + found fn item `fn(usize) -> usize {::bax}` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:40:20 @@ -175,7 +175,7 @@ LL | let _: usize = X::bach; | help: use parentheses to call this function: `X::bach(x)` | = note: expected type `usize` - found type `fn(usize) -> usize {::bach}` + found fn item `fn(usize) -> usize {::bach}` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:41:20 @@ -190,7 +190,7 @@ LL | let _: usize = X::ban; | help: use parentheses to call this function: `X::ban(_)` | = note: expected type `usize` - found type `for<'r> fn(&'r X) -> usize {::ban}` + found fn item `for<'r> fn(&'r X) -> usize {::ban}` error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:42:20 @@ -205,7 +205,7 @@ LL | let _: usize = X::bal; | help: use parentheses to call this function: `X::bal(_)` | = note: expected type `usize` - found type `for<'r> fn(&'r X) -> usize {::bal}` + found fn item `for<'r> fn(&'r X) -> usize {::bal}` error[E0615]: attempted to take value of method `ban` on type `X` --> $DIR/fn-or-tuple-struct-without-args.rs:43:22 @@ -231,7 +231,7 @@ LL | let _: usize = closure; | help: use parentheses to call this closure: `closure()` | = note: expected type `usize` - found type `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:24]` + found closure `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:24]` error: aborting due to 17 previous errors diff --git a/src/test/ui/suggestions/format-borrow.stderr b/src/test/ui/suggestions/format-borrow.stderr index 44bb11faa7f38..7f1cec2d21881 100644 --- a/src/test/ui/suggestions/format-borrow.stderr +++ b/src/test/ui/suggestions/format-borrow.stderr @@ -7,8 +7,8 @@ LL | let a: String = &String::from("a"); | expected struct `std::string::String`, found reference | help: consider removing the borrow: `String::from("a")` | - = note: expected type `std::string::String` - found type `&std::string::String` + = note: expected struct `std::string::String` + found reference `&std::string::String` error[E0308]: mismatched types --> $DIR/format-borrow.rs:4:21 @@ -19,8 +19,8 @@ LL | let b: String = &format!("b"); | expected struct `std::string::String`, found reference | help: consider removing the borrow: `format!("b")` | - = note: expected type `std::string::String` - found type `&std::string::String` + = note: expected struct `std::string::String` + found reference `&std::string::String` error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/issue-52820.stderr b/src/test/ui/suggestions/issue-52820.stderr index fb568aca250e7..0b064d196750e 100644 --- a/src/test/ui/suggestions/issue-52820.stderr +++ b/src/test/ui/suggestions/issue-52820.stderr @@ -7,8 +7,8 @@ LL | guts, | expected struct `std::string::String`, found &str | help: try using a conversion method: `guts: guts.to_string()` | - = note: expected type `std::string::String` - found type `&str` + = note: expected struct `std::string::String` + found reference `&str` error[E0308]: mismatched types --> $DIR/issue-52820.rs:10:17 @@ -19,8 +19,8 @@ LL | brains: guts.clone(), | expected struct `std::string::String`, found &str | help: try using a conversion method: `guts.to_string()` | - = note: expected type `std::string::String` - found type `&str` + = note: expected struct `std::string::String` + found reference `&str` error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/issue-59819.stderr b/src/test/ui/suggestions/issue-59819.stderr index 66898115cbd6d..b04ab374f0f0f 100644 --- a/src/test/ui/suggestions/issue-59819.stderr +++ b/src/test/ui/suggestions/issue-59819.stderr @@ -8,7 +8,7 @@ LL | let y: i32 = x; | help: consider dereferencing the type: `*x` | = note: expected type `i32` - found type `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/issue-59819.rs:30:18 @@ -19,8 +19,8 @@ LL | let b: i32 = a; | expected i32, found &{integer} | help: consider dereferencing the borrow: `*a` | - = note: expected type `i32` - found type `&{integer}` + = note: expected type `i32` + found reference `&{integer}` error[E0308]: mismatched types --> $DIR/issue-59819.rs:34:21 @@ -31,8 +31,8 @@ LL | let g: String = f; | expected struct `std::string::String`, found struct `Bar` | help: try using a conversion method: `f.to_string()` | - = note: expected type `std::string::String` - found type `Bar` + = note: expected struct `std::string::String` + found struct `Bar` error: aborting due to 3 previous errors diff --git a/src/test/ui/suggestions/match-ergonomics.stderr b/src/test/ui/suggestions/match-ergonomics.stderr index b7497be6ceb36..54aebb3bba262 100644 --- a/src/test/ui/suggestions/match-ergonomics.stderr +++ b/src/test/ui/suggestions/match-ergonomics.stderr @@ -7,8 +7,8 @@ LL | [&v] => {}, | expected i32, found reference | help: you can probably remove the explicit borrow: `v` | - = note: expected type `i32` - found type `&_` + = note: expected type `i32` + found reference `&_` error[E0529]: expected an array or slice, found `std::vec::Vec` --> $DIR/match-ergonomics.rs:8:9 @@ -31,8 +31,8 @@ LL | &v => {}, | expected i32, found reference | help: you can probably remove the explicit borrow: `v` | - = note: expected type `i32` - found type `&_` + = note: expected type `i32` + found reference `&_` error[E0308]: mismatched types --> $DIR/match-ergonomics.rs:40:13 @@ -43,8 +43,8 @@ LL | if let [&v] = &x[..] {} | expected i32, found reference | help: you can probably remove the explicit borrow: `v` | - = note: expected type `i32` - found type `&_` + = note: expected type `i32` + found reference `&_` error: aborting due to 5 previous errors diff --git a/src/test/ui/suggestions/mut-ref-reassignment.stderr b/src/test/ui/suggestions/mut-ref-reassignment.stderr index 66b78a1b14015..e7748008494c0 100644 --- a/src/test/ui/suggestions/mut-ref-reassignment.stderr +++ b/src/test/ui/suggestions/mut-ref-reassignment.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | opt = None; | ^^^^ expected mutable reference, found enum `std::option::Option` | - = note: expected type `&mut std::option::Option` - found type `std::option::Option<_>` + = note: expected mutable reference `&mut std::option::Option` + found enum `std::option::Option<_>` help: consider dereferencing here to assign to the mutable borrowed piece of memory | LL | *opt = None; @@ -17,8 +17,8 @@ error[E0308]: mismatched types LL | opt = None | ^^^^ expected mutable reference, found enum `std::option::Option` | - = note: expected type `&mut std::result::Result` - found type `std::option::Option<_>` + = note: expected mutable reference `&mut std::result::Result` + found enum `std::option::Option<_>` error[E0308]: mismatched types --> $DIR/mut-ref-reassignment.rs:10:11 @@ -26,8 +26,8 @@ error[E0308]: mismatched types LL | opt = Some(String::new()) | ^^^^^^^^^^^^^^^^^^^ expected mutable reference, found enum `std::option::Option` | - = note: expected type `&mut std::option::Option` - found type `std::option::Option` + = note: expected mutable reference `&mut std::option::Option` + found enum `std::option::Option` help: consider dereferencing here to assign to the mutable borrowed piece of memory | LL | *opt = Some(String::new()) @@ -39,8 +39,8 @@ error[E0308]: mismatched types LL | opt = Some(42) | ^^^^^^^^ expected mutable reference, found enum `std::option::Option` | - = note: expected type `&mut std::option::Option` - found type `std::option::Option<{integer}>` + = note: expected mutable reference `&mut std::option::Option` + found enum `std::option::Option<{integer}>` error: aborting due to 4 previous errors diff --git a/src/test/ui/suggestions/opaque-type-error.stderr b/src/test/ui/suggestions/opaque-type-error.stderr index 450cbd4799fdc..e7bf84a41137a 100644 --- a/src/test/ui/suggestions/opaque-type-error.stderr +++ b/src/test/ui/suggestions/opaque-type-error.stderr @@ -10,8 +10,8 @@ LL | | thing_two() LL | | }.await | |_____- if and else have incompatible types | - = note: expected type `impl std::future::Future` (opaque type at <$DIR/opaque-type-error.rs:8:19>) - found type `impl std::future::Future` (opaque type at <$DIR/opaque-type-error.rs:12:19>) + = note: expected type `impl std::future::Future` (opaque type at <$DIR/opaque-type-error.rs:8:19>) + found opaque type `impl std::future::Future` (opaque type at <$DIR/opaque-type-error.rs:12:19>) = note: distinct uses of `impl Trait` result in different opaque types = help: if both `Future`s have the same `Output` type, consider `.await`ing on both of them diff --git a/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr b/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr index 9a47a1efb752a..36548a3dfcbfa 100644 --- a/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr +++ b/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr @@ -25,7 +25,7 @@ LL | let _: usize = S {}; | ^^^^ expected usize, found struct `S` | = note: expected type `usize` - found type `S` + found struct `S` error[E0308]: mismatched types --> $DIR/recover-from-semicolon-trailing-item.rs:12:20 @@ -34,7 +34,7 @@ LL | let _: usize = X {}; | ^^^^ expected usize, found struct `main::X` | = note: expected type `usize` - found type `main::X` + found struct `main::X` error[E0308]: mismatched types --> $DIR/recover-from-semicolon-trailing-item.rs:14:9 @@ -42,8 +42,8 @@ error[E0308]: mismatched types LL | foo(""); | ^^ expected usize, found reference | - = note: expected type `usize` - found type `&'static str` + = note: expected type `usize` + found reference `&'static str` error: aborting due to 6 previous errors diff --git a/src/test/ui/suggestions/suggest-box.stderr b/src/test/ui/suggestions/suggest-box.stderr index 50c106d63a02b..cda6d5254e7ad 100644 --- a/src/test/ui/suggestions/suggest-box.stderr +++ b/src/test/ui/suggestions/suggest-box.stderr @@ -8,8 +8,8 @@ LL | | Ok(()) LL | | }; | |_____^ expected struct `std::boxed::Box`, found closure | - = note: expected type `std::boxed::Box std::result::Result<(), ()>>` - found type `[closure@$DIR/suggest-box.rs:4:47: 7:6]` + = note: expected struct `std::boxed::Box std::result::Result<(), ()>>` + found closure `[closure@$DIR/suggest-box.rs:4:47: 7:6]` = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html help: store this in the heap by calling `Box::new` | diff --git a/src/test/ui/suppressed-error.rs b/src/test/ui/suppressed-error.rs index cf3dce8e224c3..7bb704367f30b 100644 --- a/src/test/ui/suppressed-error.rs +++ b/src/test/ui/suppressed-error.rs @@ -2,7 +2,7 @@ fn main() { let (x, y) = (); //~^ ERROR mismatched types //~| expected type `()` -//~| found type `(_, _)` +//~| found tuple `(_, _)` //~| expected (), found tuple return x; } diff --git a/src/test/ui/suppressed-error.stderr b/src/test/ui/suppressed-error.stderr index 85e1deb3cde0c..0d0ca4d5f73a4 100644 --- a/src/test/ui/suppressed-error.stderr +++ b/src/test/ui/suppressed-error.stderr @@ -5,7 +5,7 @@ LL | let (x, y) = (); | ^^^^^^ expected (), found tuple | = note: expected type `()` - found type `(_, _)` + found tuple `(_, _)` error: aborting due to previous error diff --git a/src/test/ui/switched-expectations.stderr b/src/test/ui/switched-expectations.stderr index 043d130051d77..b38c0d9309980 100644 --- a/src/test/ui/switched-expectations.stderr +++ b/src/test/ui/switched-expectations.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let ref string: String = var; | ^^^ expected struct `std::string::String`, found i32 | - = note: expected type `std::string::String` - found type `i32` + = note: expected struct `std::string::String` + found type `i32` error: aborting due to previous error diff --git a/src/test/ui/tag-that-dare-not-speak-its-name.rs b/src/test/ui/tag-that-dare-not-speak-its-name.rs index 9f47b2e9b9f41..ebe81c314a892 100644 --- a/src/test/ui/tag-that-dare-not-speak-its-name.rs +++ b/src/test/ui/tag-that-dare-not-speak-its-name.rs @@ -11,6 +11,6 @@ fn main() { let x : char = last(y); //~^ ERROR mismatched types //~| expected type `char` - //~| found type `std::option::Option<_>` + //~| found enum `std::option::Option<_>` //~| expected char, found enum `std::option::Option` } diff --git a/src/test/ui/tag-that-dare-not-speak-its-name.stderr b/src/test/ui/tag-that-dare-not-speak-its-name.stderr index 23e3d66526215..c71474ab26639 100644 --- a/src/test/ui/tag-that-dare-not-speak-its-name.stderr +++ b/src/test/ui/tag-that-dare-not-speak-its-name.stderr @@ -5,7 +5,7 @@ LL | let x : char = last(y); | ^^^^^^^ expected char, found enum `std::option::Option` | = note: expected type `char` - found type `std::option::Option<_>` + found enum `std::option::Option<_>` error: aborting due to previous error diff --git a/src/test/ui/terr-in-field.rs b/src/test/ui/terr-in-field.rs index 388c13d28ccf9..80834985471d5 100644 --- a/src/test/ui/terr-in-field.rs +++ b/src/test/ui/terr-in-field.rs @@ -11,9 +11,9 @@ struct Bar { fn want_foo(f: Foo) {} fn have_bar(b: Bar) { want_foo(b); //~ ERROR mismatched types - //~| expected type `Foo` - //~| found type `Bar` //~| expected struct `Foo`, found struct `Bar` + //~| expected struct `Foo` + //~| found struct `Bar` } fn main() {} diff --git a/src/test/ui/terr-in-field.stderr b/src/test/ui/terr-in-field.stderr index 91c3b3014a200..ef6412a633bab 100644 --- a/src/test/ui/terr-in-field.stderr +++ b/src/test/ui/terr-in-field.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | want_foo(b); | ^ expected struct `Foo`, found struct `Bar` | - = note: expected type `Foo` - found type `Bar` + = note: expected struct `Foo` + found struct `Bar` error: aborting due to previous error diff --git a/src/test/ui/terr-sorts.rs b/src/test/ui/terr-sorts.rs index 4bec5614e499c..f91185fd7c678 100644 --- a/src/test/ui/terr-sorts.rs +++ b/src/test/ui/terr-sorts.rs @@ -8,8 +8,8 @@ type Bar = Box; fn want_foo(f: Foo) {} fn have_bar(b: Bar) { want_foo(b); //~ ERROR mismatched types - //~| expected type `Foo` - //~| found type `std::boxed::Box` + //~| expected struct `Foo` + //~| found struct `std::boxed::Box` } fn main() {} diff --git a/src/test/ui/terr-sorts.stderr b/src/test/ui/terr-sorts.stderr index 05b9fb43fe1bc..2f7cc66f1050c 100644 --- a/src/test/ui/terr-sorts.stderr +++ b/src/test/ui/terr-sorts.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | want_foo(b); | ^ expected struct `Foo`, found struct `std::boxed::Box` | - = note: expected type `Foo` - found type `std::boxed::Box` + = note: expected struct `Foo` + found struct `std::boxed::Box` error: aborting due to previous error diff --git a/src/test/ui/traits/trait-bounds-sugar.stderr b/src/test/ui/traits/trait-bounds-sugar.stderr index 2aa025cb7a682..5ee8be51dd5c9 100644 --- a/src/test/ui/traits/trait-bounds-sugar.stderr +++ b/src/test/ui/traits/trait-bounds-sugar.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | a(x); | ^ expected trait `Foo + std::marker::Send`, found trait `Foo + std::marker::Sync` | - = note: expected type `std::boxed::Box<(dyn Foo + std::marker::Send + 'static)>` - found type `std::boxed::Box<(dyn Foo + std::marker::Sync + 'static)>` + = note: expected struct `std::boxed::Box<(dyn Foo + std::marker::Send + 'static)>` + found struct `std::boxed::Box<(dyn Foo + std::marker::Sync + 'static)>` error: aborting due to previous error diff --git a/src/test/ui/traits/trait-impl-method-mismatch.rs b/src/test/ui/traits/trait-impl-method-mismatch.rs index 886e92604a0be..683b1c1aa43e6 100644 --- a/src/test/ui/traits/trait-impl-method-mismatch.rs +++ b/src/test/ui/traits/trait-impl-method-mismatch.rs @@ -6,8 +6,8 @@ impl Mumbo for usize { // Cannot have a larger effect than the trait: unsafe fn jumbo(&self, x: &usize) { *self + *x; } //~^ ERROR method `jumbo` has an incompatible type for trait - //~| expected type `fn - //~| found type `unsafe fn + //~| expected fn pointer `fn + //~| found fn pointer `unsafe fn } fn main() {} diff --git a/src/test/ui/traits/trait-impl-method-mismatch.stderr b/src/test/ui/traits/trait-impl-method-mismatch.stderr index 3e86c97f5c123..52e4918624168 100644 --- a/src/test/ui/traits/trait-impl-method-mismatch.stderr +++ b/src/test/ui/traits/trait-impl-method-mismatch.stderr @@ -7,8 +7,8 @@ LL | fn jumbo(&self, x: &usize) -> usize; LL | unsafe fn jumbo(&self, x: &usize) { *self + *x; } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected normal fn, found unsafe fn | - = note: expected type `fn(&usize, &usize) -> usize` - found type `unsafe fn(&usize, &usize)` + = note: expected fn pointer `fn(&usize, &usize) -> usize` + found fn pointer `unsafe fn(&usize, &usize)` error: aborting due to previous error diff --git a/src/test/ui/traits/trait-matching-lifetimes.stderr b/src/test/ui/traits/trait-matching-lifetimes.stderr index e1ccde3c9d14a..17ebdb7c82592 100644 --- a/src/test/ui/traits/trait-matching-lifetimes.stderr +++ b/src/test/ui/traits/trait-matching-lifetimes.stderr @@ -4,8 +4,8 @@ error[E0308]: method not compatible with trait LL | fn foo(x: Foo<'b,'a>) { | ^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch | - = note: expected type `fn(Foo<'a, 'b>)` - found type `fn(Foo<'b, 'a>)` + = note: expected fn pointer `fn(Foo<'a, 'b>)` + found fn pointer `fn(Foo<'b, 'a>)` note: the lifetime `'b` as defined on the impl at 13:9... --> $DIR/trait-matching-lifetimes.rs:13:9 | @@ -23,8 +23,8 @@ error[E0308]: method not compatible with trait LL | fn foo(x: Foo<'b,'a>) { | ^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch | - = note: expected type `fn(Foo<'a, 'b>)` - found type `fn(Foo<'b, 'a>)` + = note: expected fn pointer `fn(Foo<'a, 'b>)` + found fn pointer `fn(Foo<'b, 'a>)` note: the lifetime `'a` as defined on the impl at 13:6... --> $DIR/trait-matching-lifetimes.rs:13:6 | diff --git a/src/test/ui/try-block/try-block-bad-type.stderr b/src/test/ui/try-block/try-block-bad-type.stderr index e1c2c6b675e9b..ecef3b5353f4e 100644 --- a/src/test/ui/try-block/try-block-bad-type.stderr +++ b/src/test/ui/try-block/try-block-bad-type.stderr @@ -19,8 +19,8 @@ error[E0271]: type mismatch resolving ` as std::op LL | "" | ^^ expected i32, found &str | - = note: expected type `i32` - found type `&str` + = note: expected type `i32` + found reference `&str` error[E0271]: type mismatch resolving ` as std::ops::Try>::Ok == ()` --> $DIR/try-block-bad-type.rs:15:39 diff --git a/src/test/ui/tuple/tuple-arity-mismatch.rs b/src/test/ui/tuple/tuple-arity-mismatch.rs index 4f505c05a6a2c..f1e525c93e17f 100644 --- a/src/test/ui/tuple/tuple-arity-mismatch.rs +++ b/src/test/ui/tuple/tuple-arity-mismatch.rs @@ -5,13 +5,13 @@ fn first((value, _): (isize, f64)) -> isize { value } fn main() { let y = first ((1,2.0,3)); //~^ ERROR mismatched types - //~| expected type `(isize, f64)` - //~| found type `(isize, f64, {integer})` + //~| expected tuple `(isize, f64)` + //~| found tuple `(isize, f64, {integer})` //~| expected a tuple with 2 elements, found one with 3 elements let y = first ((1,)); //~^ ERROR mismatched types - //~| expected type `(isize, f64)` - //~| found type `(isize,)` + //~| expected tuple `(isize, f64)` + //~| found tuple `(isize,)` //~| expected a tuple with 2 elements, found one with 1 element } diff --git a/src/test/ui/tuple/tuple-arity-mismatch.stderr b/src/test/ui/tuple/tuple-arity-mismatch.stderr index 6946a60c59af9..10bcedaf4aa9a 100644 --- a/src/test/ui/tuple/tuple-arity-mismatch.stderr +++ b/src/test/ui/tuple/tuple-arity-mismatch.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let y = first ((1,2.0,3)); | ^^^^^^^^^ expected a tuple with 2 elements, found one with 3 elements | - = note: expected type `(isize, f64)` - found type `(isize, f64, {integer})` + = note: expected tuple `(isize, f64)` + found tuple `(isize, f64, {integer})` error[E0308]: mismatched types --> $DIR/tuple-arity-mismatch.rs:12:20 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let y = first ((1,)); | ^^^^ expected a tuple with 2 elements, found one with 1 element | - = note: expected type `(isize, f64)` - found type `(isize,)` + = note: expected tuple `(isize, f64)` + found tuple `(isize,)` error: aborting due to 2 previous errors diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr index 9e44e208f0ee4..e158224d89a0e 100644 --- a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr +++ b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr @@ -7,8 +7,8 @@ LL | fn ts_variant() { LL | Self::TSVariant(()); | ^^ expected type parameter `T`, found () | - = note: expected type `T` - found type `()` + = note: expected type parameter `T` + found type `()` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters @@ -33,8 +33,8 @@ LL | impl Enum { LL | Self::<()>::TSVariant(()); | ^^ expected type parameter `T`, found () | - = note: expected type `T` - found type `()` + = note: expected type parameter `T` + found type `()` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters @@ -59,8 +59,8 @@ LL | impl Enum { LL | Self::SVariant { v: () }; | ^^ expected type parameter `T`, found () | - = note: expected type `T` - found type `()` + = note: expected type parameter `T` + found type `()` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters @@ -79,8 +79,8 @@ LL | impl Enum { LL | Self::SVariant::<()> { v: () }; | ^^ expected type parameter `T`, found () | - = note: expected type `T` - found type `()` + = note: expected type parameter `T` + found type `()` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters @@ -99,8 +99,8 @@ LL | impl Enum { LL | Self::<()>::SVariant { v: () }; | ^^ expected type parameter `T`, found () | - = note: expected type `T` - found type `()` + = note: expected type parameter `T` + found type `()` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters @@ -125,8 +125,8 @@ LL | impl Enum { LL | Self::<()>::SVariant::<()> { v: () }; | ^^ expected type parameter `T`, found () | - = note: expected type `T` - found type `()` + = note: expected type parameter `T` + found type `()` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr index 0394ddab46cda..e6e82f4969230 100644 --- a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr +++ b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr @@ -14,7 +14,7 @@ LL | let _: u8 = ::V; | ^^^^^^^ expected u8, found enum `E2` | = note: expected type `u8` - found type `E2` + found enum `E2` error: aborting due to 2 previous errors diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr index d9600f1d1d6bc..c1237e7e6df7e 100644 --- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr @@ -10,8 +10,8 @@ error[E0308]: mismatched types LL | let z: i32 = x; | ^ expected i32, found opaque type | - = note: expected type `i32` - found type `WrongGeneric::<&{integer}>` + = note: expected type `i32` + found opaque type `WrongGeneric::<&{integer}>` error[E0310]: the parameter type `T` may not live long enough --> $DIR/generic_type_does_not_live_long_enough.rs:9:1 diff --git a/src/test/ui/type-alias-impl-trait/issue-63279.stderr b/src/test/ui/type-alias-impl-trait/issue-63279.stderr index a5065241fc74d..7232bae93d248 100644 --- a/src/test/ui/type-alias-impl-trait/issue-63279.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-63279.stderr @@ -4,8 +4,8 @@ error[E0271]: type mismatch resolving `<[closure@$DIR/issue-63279.rs:6:5: 6:28] LL | type Closure = impl FnOnce(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found () | - = note: expected type `Closure` - found type `()` + = note: expected opaque type `Closure` + found type `()` = note: the return type of a function must have a statically known size error: aborting due to previous error diff --git a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr index 7c195f1fad006..0a6d454a67f43 100644 --- a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr +++ b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: &'static str = x; | ^ expected reference, found opaque type | - = note: expected type `&'static str` - found type `NoReveal` + = note: expected reference `&'static str` + found opaque type `NoReveal` error[E0605]: non-primitive cast: `NoReveal` as `&'static str` --> $DIR/never_reveal_concrete_type.rs:14:13 diff --git a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr index 5e5826978fc7e..366d6bad37a5f 100644 --- a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr +++ b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: &str = bomp(); | ^^^^^^ expected &str, found opaque type | - = note: expected type `&str` - found type `Boo` + = note: expected reference `&str` + found opaque type `Boo` error[E0308]: mismatched types --> $DIR/no_revealing_outside_defining_module.rs:19:5 @@ -15,8 +15,8 @@ LL | fn bomp() -> boo::Boo { LL | "" | ^^ expected opaque type, found reference | - = note: expected type `Boo` - found type `&'static str` + = note: expected opaque type `Boo` + found reference `&'static str` error: aborting due to 2 previous errors diff --git a/src/test/ui/type/type-ascription-precedence.stderr b/src/test/ui/type/type-ascription-precedence.stderr index aecb0f8738785..ebb9c4199dc70 100644 --- a/src/test/ui/type/type-ascription-precedence.stderr +++ b/src/test/ui/type/type-ascription-precedence.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | &(S: &S); | ^ expected &S, found struct `S` | - = note: expected type `&S` - found type `S` + = note: expected reference `&S` + found struct `S` error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:35:7 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | *(S: Z); | ^ expected struct `Z`, found struct `S` | - = note: expected type `Z` - found type `S` + = note: expected struct `Z` + found struct `S` error[E0614]: type `Z` cannot be dereferenced --> $DIR/type-ascription-precedence.rs:35:5 @@ -28,8 +28,8 @@ error[E0308]: mismatched types LL | -(S: Z); | ^ expected struct `Z`, found struct `S` | - = note: expected type `Z` - found type `S` + = note: expected struct `Z` + found struct `S` error[E0600]: cannot apply unary operator `-` to type `Z` --> $DIR/type-ascription-precedence.rs:40:5 @@ -45,8 +45,8 @@ error[E0308]: mismatched types LL | (S + Z): Z; | ^^^^^^^ expected struct `Z`, found struct `S` | - = note: expected type `Z` - found type `S` + = note: expected struct `Z` + found struct `S` error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:49:5 @@ -54,8 +54,8 @@ error[E0308]: mismatched types LL | (S * Z): Z; | ^^^^^^^ expected struct `Z`, found struct `S` | - = note: expected type `Z` - found type `S` + = note: expected struct `Z` + found struct `S` error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:53:5 @@ -63,8 +63,8 @@ error[E0308]: mismatched types LL | (S .. S): S; | ^^^^^^^^ expected struct `S`, found struct `std::ops::Range` | - = note: expected type `S` - found type `std::ops::Range` + = note: expected struct `S` + found struct `std::ops::Range` error: aborting due to 8 previous errors diff --git a/src/test/ui/type/type-ascription-soundness.stderr b/src/test/ui/type/type-ascription-soundness.stderr index 150e19020fea4..d8803cad0113b 100644 --- a/src/test/ui/type/type-ascription-soundness.stderr +++ b/src/test/ui/type/type-ascription-soundness.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let ref x = arr: &[u8]; | ^^^ expected slice, found array of 3 elements | - = note: expected type `&[u8]` - found type `&[u8; 3]` + = note: expected reference `&[u8]` + found reference `&[u8; 3]` error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:8:21 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let ref mut x = arr: &[u8]; | ^^^ expected slice, found array of 3 elements | - = note: expected type `&[u8]` - found type `&[u8; 3]` + = note: expected reference `&[u8]` + found reference `&[u8; 3]` error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:9:11 @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | match arr: &[u8] { | ^^^ expected slice, found array of 3 elements | - = note: expected type `&[u8]` - found type `&[u8; 3]` + = note: expected reference `&[u8]` + found reference `&[u8; 3]` error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:12:17 @@ -31,8 +31,8 @@ error[E0308]: mismatched types LL | let _len = (arr: &[u8]).len(); | ^^^ expected slice, found array of 3 elements | - = note: expected type `&[u8]` - found type `&[u8; 3]` + = note: expected reference `&[u8]` + found reference `&[u8; 3]` error: aborting due to 4 previous errors diff --git a/src/test/ui/type/type-mismatch-same-crate-name.rs b/src/test/ui/type/type-mismatch-same-crate-name.rs index 61e6bd219209f..88daffde504a5 100644 --- a/src/test/ui/type/type-mismatch-same-crate-name.rs +++ b/src/test/ui/type/type-mismatch-same-crate-name.rs @@ -17,13 +17,13 @@ fn main() { //~^ ERROR mismatched types //~| Perhaps two different versions of crate `crate_a1` //~| expected struct `main::a::Foo` - //~| expected type `main::a::Foo` - //~| found type `main::a::Foo` + //~| expected struct `main::a::Foo` + //~| found struct `main::a::Foo` a::try_bar(bar2); //~^ ERROR mismatched types //~| Perhaps two different versions of crate `crate_a1` //~| expected trait `main::a::Bar` - //~| expected type `std::boxed::Box<(dyn main::a::Bar + 'static)>` - //~| found type `std::boxed::Box` + //~| expected struct `std::boxed::Box<(dyn main::a::Bar + 'static)>` + //~| found struct `std::boxed::Box` } } diff --git a/src/test/ui/type/type-mismatch-same-crate-name.stderr b/src/test/ui/type/type-mismatch-same-crate-name.stderr index ed07b602e3e3e..db53344a07e7c 100644 --- a/src/test/ui/type/type-mismatch-same-crate-name.stderr +++ b/src/test/ui/type/type-mismatch-same-crate-name.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | a::try_foo(foo2); | ^^^^ expected struct `main::a::Foo`, found a different struct `main::a::Foo` | - = note: expected type `main::a::Foo` (struct `main::a::Foo`) - found type `main::a::Foo` (struct `main::a::Foo`) + = note: expected struct `main::a::Foo` (struct `main::a::Foo`) + found struct `main::a::Foo` (struct `main::a::Foo`) note: Perhaps two different versions of crate `crate_a1` are being used? --> $DIR/type-mismatch-same-crate-name.rs:16:20 | @@ -18,8 +18,8 @@ error[E0308]: mismatched types LL | a::try_bar(bar2); | ^^^^ expected trait `main::a::Bar`, found a different trait `main::a::Bar` | - = note: expected type `std::boxed::Box<(dyn main::a::Bar + 'static)>` - found type `std::boxed::Box` + = note: expected struct `std::boxed::Box<(dyn main::a::Bar + 'static)>` + found struct `std::boxed::Box` note: Perhaps two different versions of crate `crate_a1` are being used? --> $DIR/type-mismatch-same-crate-name.rs:22:20 | diff --git a/src/test/ui/type/type-mismatch.stderr b/src/test/ui/type/type-mismatch.stderr index 7aea9db6167a3..2d9481e5a4102 100644 --- a/src/test/ui/type/type-mismatch.stderr +++ b/src/test/ui/type/type-mismatch.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | want::(f); | ^ expected struct `foo`, found usize | - = note: expected type `foo` - found type `usize` + = note: expected struct `foo` + found type `usize` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:18:17 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | want::(f); | ^ expected struct `bar`, found usize | - = note: expected type `bar` - found type `usize` + = note: expected struct `bar` + found type `usize` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:19:24 @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `Foo`, found usize | - = note: expected type `Foo` - found type `usize` + = note: expected struct `Foo` + found type `usize` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:20:27 @@ -31,8 +31,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `Foo`, found usize | - = note: expected type `Foo` - found type `usize` + = note: expected struct `Foo` + found type `usize` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:21:22 @@ -40,8 +40,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `Foo`, found usize | - = note: expected type `Foo` - found type `usize` + = note: expected struct `Foo` + found type `usize` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:22:25 @@ -49,8 +49,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `Foo`, found usize | - = note: expected type `Foo` - found type `usize` + = note: expected struct `Foo` + found type `usize` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:23:22 @@ -58,8 +58,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `Foo`, found usize | - = note: expected type `Foo` - found type `usize` + = note: expected struct `Foo` + found type `usize` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:24:25 @@ -67,8 +67,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `Foo`, found usize | - = note: expected type `Foo` - found type `usize` + = note: expected struct `Foo` + found type `usize` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:28:19 @@ -77,7 +77,7 @@ LL | want::(f); | ^ expected usize, found struct `foo` | = note: expected type `usize` - found type `foo` + found struct `foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:29:17 @@ -85,8 +85,8 @@ error[E0308]: mismatched types LL | want::(f); | ^ expected struct `bar`, found struct `foo` | - = note: expected type `bar` - found type `foo` + = note: expected struct `bar` + found struct `foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:30:24 @@ -94,8 +94,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `Foo`, found struct `foo` | - = note: expected type `Foo` - found type `foo` + = note: expected struct `Foo` + found struct `foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:31:27 @@ -103,8 +103,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `Foo`, found struct `foo` | - = note: expected type `Foo` - found type `foo` + = note: expected struct `Foo` + found struct `foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:32:22 @@ -112,8 +112,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `Foo`, found struct `foo` | - = note: expected type `Foo` - found type `foo` + = note: expected struct `Foo` + found struct `foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:33:25 @@ -121,8 +121,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `Foo`, found struct `foo` | - = note: expected type `Foo` - found type `foo` + = note: expected struct `Foo` + found struct `foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:34:22 @@ -130,8 +130,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `Foo`, found struct `foo` | - = note: expected type `Foo` - found type `foo` + = note: expected struct `Foo` + found struct `foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:35:25 @@ -139,8 +139,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `Foo`, found struct `foo` | - = note: expected type `Foo` - found type `foo` + = note: expected struct `Foo` + found struct `foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:39:19 @@ -149,7 +149,7 @@ LL | want::(f); | ^ expected usize, found struct `Foo` | = note: expected type `usize` - found type `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:40:17 @@ -157,8 +157,8 @@ error[E0308]: mismatched types LL | want::(f); | ^ expected struct `foo`, found struct `Foo` | - = note: expected type `foo` - found type `Foo` + = note: expected struct `foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:41:17 @@ -166,8 +166,8 @@ error[E0308]: mismatched types LL | want::(f); | ^ expected struct `bar`, found struct `Foo` | - = note: expected type `bar` - found type `Foo` + = note: expected struct `bar` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:42:24 @@ -175,8 +175,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected usize, found struct `foo` | - = note: expected type `Foo` - found type `Foo` + = note: expected struct `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:43:27 @@ -184,8 +184,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected usize, found struct `foo` | - = note: expected type `Foo` - found type `Foo` + = note: expected struct `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:44:25 @@ -193,8 +193,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `B`, found struct `A` | - = note: expected type `Foo<_, B>` - found type `Foo<_, A>` + = note: expected struct `Foo<_, B>` + found struct `Foo<_, A>` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:45:22 @@ -202,8 +202,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `bar`, found struct `foo` | - = note: expected type `Foo` - found type `Foo` + = note: expected struct `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:46:25 @@ -211,8 +211,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `bar`, found struct `foo` | - = note: expected type `Foo` - found type `Foo` + = note: expected struct `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:47:23 @@ -223,8 +223,8 @@ LL | want::<&Foo>(f); | expected &Foo, found struct `Foo` | help: consider borrowing here: `&f` | - = note: expected type `&Foo` - found type `Foo` + = note: expected reference `&Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:48:26 @@ -232,8 +232,8 @@ error[E0308]: mismatched types LL | want::<&Foo>(f); | ^ expected reference, found struct `Foo` | - = note: expected type `&Foo` - found type `Foo` + = note: expected reference `&Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:52:19 @@ -242,7 +242,7 @@ LL | want::(f); | ^ expected usize, found struct `Foo` | = note: expected type `usize` - found type `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:53:17 @@ -250,8 +250,8 @@ error[E0308]: mismatched types LL | want::(f); | ^ expected struct `foo`, found struct `Foo` | - = note: expected type `foo` - found type `Foo` + = note: expected struct `foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:54:17 @@ -259,8 +259,8 @@ error[E0308]: mismatched types LL | want::(f); | ^ expected struct `bar`, found struct `Foo` | - = note: expected type `bar` - found type `Foo` + = note: expected struct `bar` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:55:24 @@ -268,8 +268,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected usize, found struct `foo` | - = note: expected type `Foo` - found type `Foo` + = note: expected struct `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:56:27 @@ -277,8 +277,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected usize, found struct `foo` | - = note: expected type `Foo` - found type `Foo` + = note: expected struct `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:57:22 @@ -286,8 +286,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `A`, found struct `B` | - = note: expected type `Foo<_, A>` - found type `Foo<_, B>` + = note: expected struct `Foo<_, A>` + found struct `Foo<_, B>` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:58:22 @@ -295,8 +295,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `bar`, found struct `foo` | - = note: expected type `Foo` - found type `Foo` + = note: expected struct `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:59:25 @@ -304,8 +304,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `bar`, found struct `foo` | - = note: expected type `Foo` - found type `Foo` + = note: expected struct `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:60:23 @@ -313,8 +313,8 @@ error[E0308]: mismatched types LL | want::<&Foo>(f); | ^ expected &Foo, found struct `Foo` | - = note: expected type `&Foo` - found type `Foo` + = note: expected reference `&Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:61:26 @@ -325,8 +325,8 @@ LL | want::<&Foo>(f); | expected reference, found struct `Foo` | help: consider borrowing here: `&f` | - = note: expected type `&Foo` - found type `Foo` + = note: expected reference `&Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:65:19 @@ -335,7 +335,7 @@ LL | want::(f); | ^ expected usize, found struct `Foo` | = note: expected type `usize` - found type `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:66:17 @@ -343,8 +343,8 @@ error[E0308]: mismatched types LL | want::(f); | ^ expected struct `foo`, found struct `Foo` | - = note: expected type `foo` - found type `Foo` + = note: expected struct `foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:67:17 @@ -352,8 +352,8 @@ error[E0308]: mismatched types LL | want::(f); | ^ expected struct `bar`, found struct `Foo` | - = note: expected type `bar` - found type `Foo` + = note: expected struct `bar` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:68:24 @@ -361,8 +361,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected usize, found struct `foo` | - = note: expected type `Foo` - found type `Foo` + = note: expected struct `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:69:27 @@ -370,8 +370,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected usize, found struct `foo` | - = note: expected type `Foo` - found type `Foo` + = note: expected struct `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:70:22 @@ -379,8 +379,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `A`, found struct `B` | - = note: expected type `Foo<_, A, B>` - found type `Foo<_, B, A>` + = note: expected struct `Foo<_, A, B>` + found struct `Foo<_, B, A>` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:71:25 @@ -388,8 +388,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `B`, found struct `A` | - = note: expected type `Foo<_, _, B>` - found type `Foo<_, _, A>` + = note: expected struct `Foo<_, _, B>` + found struct `Foo<_, _, A>` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:72:22 @@ -397,8 +397,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `bar`, found struct `foo` | - = note: expected type `Foo` - found type `Foo` + = note: expected struct `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:73:25 @@ -406,8 +406,8 @@ error[E0308]: mismatched types LL | want::>(f); | ^ expected struct `bar`, found struct `foo` | - = note: expected type `Foo` - found type `Foo` + = note: expected struct `Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:74:23 @@ -415,8 +415,8 @@ error[E0308]: mismatched types LL | want::<&Foo>(f); | ^ expected &Foo, found struct `Foo` | - = note: expected type `&Foo` - found type `Foo` + = note: expected reference `&Foo` + found struct `Foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:75:26 @@ -424,8 +424,8 @@ error[E0308]: mismatched types LL | want::<&Foo>(f); | ^ expected reference, found struct `Foo` | - = note: expected type `&Foo` - found type `Foo` + = note: expected reference `&Foo` + found struct `Foo` error: aborting due to 47 previous errors diff --git a/src/test/ui/type/type-parameter-names.rs b/src/test/ui/type/type-parameter-names.rs index 825766463453b..b54a3fae0c1a1 100644 --- a/src/test/ui/type/type-parameter-names.rs +++ b/src/test/ui/type/type-parameter-names.rs @@ -4,9 +4,9 @@ fn foo(x: Foo) -> Bar { x //~^ ERROR mismatched types -//~| expected type `Bar` -//~| found type `Foo` //~| expected type parameter `Bar`, found type parameter `Foo` +//~| expected type parameter `Bar` +//~| found type parameter `Foo` } fn main() {} diff --git a/src/test/ui/type/type-parameter-names.stderr b/src/test/ui/type/type-parameter-names.stderr index 78d6989a3363d..f0ca8afca4e74 100644 --- a/src/test/ui/type/type-parameter-names.stderr +++ b/src/test/ui/type/type-parameter-names.stderr @@ -9,8 +9,8 @@ LL | fn foo(x: Foo) -> Bar { LL | x | ^ expected type parameter `Bar`, found type parameter `Foo` | - = note: expected type `Bar` - found type `Foo` + = note: expected type parameter `Bar` + found type parameter `Foo` = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/type/type-params-in-different-spaces-1.rs b/src/test/ui/type/type-params-in-different-spaces-1.rs index d2dce7006b763..6efd14d378532 100644 --- a/src/test/ui/type/type-params-in-different-spaces-1.rs +++ b/src/test/ui/type/type-params-in-different-spaces-1.rs @@ -3,9 +3,9 @@ use std::ops::Add; trait BrokenAdd: Copy + Add { fn broken_add(&self, rhs: T) -> Self { *self + rhs //~ ERROR mismatched types - //~| expected type `Self` - //~| found type `T` //~| expected type parameter `Self`, found type parameter `T` + //~| expected type parameter `Self` + //~| found type parameter `T` } } diff --git a/src/test/ui/type/type-params-in-different-spaces-1.stderr b/src/test/ui/type/type-params-in-different-spaces-1.stderr index d2c6b7304ff3c..eeb09a9f02ea3 100644 --- a/src/test/ui/type/type-params-in-different-spaces-1.stderr +++ b/src/test/ui/type/type-params-in-different-spaces-1.stderr @@ -12,8 +12,8 @@ LL | | } LL | | } | |_- expected type parameter | - = note: expected type `Self` - found type `T` + = note: expected type parameter `Self` + found type parameter `T` = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/type/type-params-in-different-spaces-3.stderr b/src/test/ui/type/type-params-in-different-spaces-3.stderr index ec5d6372792b3..880c138d28762 100644 --- a/src/test/ui/type/type-params-in-different-spaces-3.stderr +++ b/src/test/ui/type/type-params-in-different-spaces-3.stderr @@ -12,8 +12,8 @@ LL | | } LL | | } | |_- expected type parameter | - = note: expected type `Self` - found type `X` + = note: expected type parameter `Self` + found type parameter `X` = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/type/type-shadow.stderr b/src/test/ui/type/type-shadow.stderr index f15bdc16d5144..56185e048a320 100644 --- a/src/test/ui/type/type-shadow.stderr +++ b/src/test/ui/type/type-shadow.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let y: Y = "hello"; | ^^^^^^^ expected isize, found reference | - = note: expected type `isize` - found type `&'static str` + = note: expected type `isize` + found reference `&'static str` error: aborting due to previous error diff --git a/src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr b/src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr index d41086186f8d7..d155744836eaf 100644 --- a/src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr +++ b/src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr @@ -7,7 +7,7 @@ LL | *x | ^^ expected (), found trait std::iter::Iterator | = note: expected type `()` - found type `(dyn std::iter::Iterator + 'static)` + found trait `(dyn std::iter::Iterator + 'static)` error: aborting due to previous error diff --git a/src/test/ui/typeck/typeck_type_placeholder_mismatch.rs b/src/test/ui/typeck/typeck_type_placeholder_mismatch.rs index ec978e45b8251..2f9cfcf8dbb5a 100644 --- a/src/test/ui/typeck/typeck_type_placeholder_mismatch.rs +++ b/src/test/ui/typeck/typeck_type_placeholder_mismatch.rs @@ -12,8 +12,8 @@ pub fn main() { fn test1() { let x: Foo<_> = Bar::(PhantomData); //~^ ERROR mismatched types - //~| expected type `Foo<_>` - //~| found type `Bar` + //~| expected struct `Foo<_>` + //~| found struct `Bar` //~| expected struct `Foo`, found struct `Bar` let y: Foo = x; } @@ -21,7 +21,7 @@ fn test1() { fn test2() { let x: Foo<_> = Bar::(PhantomData); //~^ ERROR mismatched types - //~| expected type `Foo<_>` - //~| found type `Bar` + //~| expected struct `Foo<_>` + //~| found struct `Bar` //~| expected struct `Foo`, found struct `Bar` } diff --git a/src/test/ui/typeck/typeck_type_placeholder_mismatch.stderr b/src/test/ui/typeck/typeck_type_placeholder_mismatch.stderr index 89114874824d6..1f6f89a6eb1cd 100644 --- a/src/test/ui/typeck/typeck_type_placeholder_mismatch.stderr +++ b/src/test/ui/typeck/typeck_type_placeholder_mismatch.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let x: Foo<_> = Bar::(PhantomData); | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found struct `Bar` | - = note: expected type `Foo<_>` - found type `Bar` + = note: expected struct `Foo<_>` + found struct `Bar` error[E0308]: mismatched types --> $DIR/typeck_type_placeholder_mismatch.rs:22:21 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let x: Foo<_> = Bar::(PhantomData); | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found struct `Bar` | - = note: expected type `Foo<_>` - found type `Bar` + = note: expected struct `Foo<_>` + found struct `Bar` error: aborting due to 2 previous errors diff --git a/src/test/ui/ufcs/ufcs-explicit-self-bad.rs b/src/test/ui/ufcs/ufcs-explicit-self-bad.rs index bdb8e197fbe49..e836d33976a93 100644 --- a/src/test/ui/ufcs/ufcs-explicit-self-bad.rs +++ b/src/test/ui/ufcs/ufcs-explicit-self-bad.rs @@ -38,12 +38,12 @@ impl<'a, T> SomeTrait for &'a Bar { //~^ ERROR mismatched `self` parameter type fn dummy3(self: &&Bar) {} //~^ ERROR mismatched `self` parameter type - //~| expected type `&'a Bar` - //~| found type `&Bar` + //~| expected reference `&'a Bar` + //~| found reference `&Bar` //~| lifetime mismatch //~| ERROR mismatched `self` parameter type - //~| expected type `&'a Bar` - //~| found type `&Bar` + //~| expected reference `&'a Bar` + //~| found reference `&Bar` //~| lifetime mismatch } diff --git a/src/test/ui/ufcs/ufcs-explicit-self-bad.stderr b/src/test/ui/ufcs/ufcs-explicit-self-bad.stderr index de3a997a19ed8..d1232ad3f320c 100644 --- a/src/test/ui/ufcs/ufcs-explicit-self-bad.stderr +++ b/src/test/ui/ufcs/ufcs-explicit-self-bad.stderr @@ -31,8 +31,8 @@ error[E0308]: mismatched `self` parameter type LL | fn dummy2(self: &Bar) {} | ^^^^^^^ lifetime mismatch | - = note: expected type `&'a Bar` - found type `&Bar` + = note: expected reference `&'a Bar` + found reference `&Bar` note: the anonymous lifetime #1 defined on the method body at 37:5... --> $DIR/ufcs-explicit-self-bad.rs:37:5 | @@ -50,8 +50,8 @@ error[E0308]: mismatched `self` parameter type LL | fn dummy2(self: &Bar) {} | ^^^^^^^ lifetime mismatch | - = note: expected type `&'a Bar` - found type `&Bar` + = note: expected reference `&'a Bar` + found reference `&Bar` note: the lifetime `'a` as defined on the impl at 35:6... --> $DIR/ufcs-explicit-self-bad.rs:35:6 | @@ -69,8 +69,8 @@ error[E0308]: mismatched `self` parameter type LL | fn dummy3(self: &&Bar) {} | ^^^^^^^^ lifetime mismatch | - = note: expected type `&'a Bar` - found type `&Bar` + = note: expected reference `&'a Bar` + found reference `&Bar` note: the anonymous lifetime #2 defined on the method body at 39:5... --> $DIR/ufcs-explicit-self-bad.rs:39:5 | @@ -88,8 +88,8 @@ error[E0308]: mismatched `self` parameter type LL | fn dummy3(self: &&Bar) {} | ^^^^^^^^ lifetime mismatch | - = note: expected type `&'a Bar` - found type `&Bar` + = note: expected reference `&'a Bar` + found reference `&Bar` note: the lifetime `'a` as defined on the impl at 35:6... --> $DIR/ufcs-explicit-self-bad.rs:35:6 | diff --git a/src/test/ui/unboxed-closures/issue-30904.stderr b/src/test/ui/unboxed-closures/issue-30904.stderr new file mode 100644 index 0000000000000..aa0e05e94203a --- /dev/null +++ b/src/test/ui/unboxed-closures/issue-30904.stderr @@ -0,0 +1,24 @@ +error[E0308]: mismatched types + --> $DIR/issue-30904.rs:20:45 + | +LL | let _: for<'a> fn(&'a str) -> Str<'a> = Str; + | ^^^ expected concrete lifetime, found bound lifetime parameter 'a + | + = note: expected fn pointer `for<'a> fn(&'a str) -> Str<'a>` + found fn item `fn(&str) -> Str<'_> {Str::<'_>}` + +error[E0631]: type mismatch in function arguments + --> $DIR/issue-30904.rs:26:10 + | +LL | fn test FnOnce<(&'x str,)>>(_: F) {} + | ---- -------------------------- required by this bound in `test` +... +LL | struct Str<'a>(&'a str); + | ------------------------ found signature of `fn(&str) -> _` +... +LL | test(Str); + | ^^^ expected signature of `for<'x> fn(&'x str) -> _` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/unsafe/unsafe-subtyping.stderr b/src/test/ui/unsafe/unsafe-subtyping.stderr index cac5ee07089e8..b3e789cc0d91d 100644 --- a/src/test/ui/unsafe/unsafe-subtyping.stderr +++ b/src/test/ui/unsafe/unsafe-subtyping.stderr @@ -6,8 +6,8 @@ LL | fn foo(x: Option) -> Option { LL | x | ^ expected unsafe fn, found normal fn | - = note: expected type `std::option::Option` - found type `std::option::Option` + = note: expected enum `std::option::Option` + found enum `std::option::Option` error: aborting due to previous error diff --git a/src/test/ui/unsafe/unsafe-trait-impl.rs b/src/test/ui/unsafe/unsafe-trait-impl.rs index 7b76e006907ae..97ee97cb5c0df 100644 --- a/src/test/ui/unsafe/unsafe-trait-impl.rs +++ b/src/test/ui/unsafe/unsafe-trait-impl.rs @@ -7,8 +7,8 @@ trait Foo { impl Foo for u32 { fn len(&self) -> u32 { *self } //~^ ERROR method `len` has an incompatible type for trait - //~| expected type `unsafe fn(&u32) -> u32` - //~| found type `fn(&u32) -> u32` + //~| expected fn pointer `unsafe fn(&u32) -> u32` + //~| found fn pointer `fn(&u32) -> u32` } fn main() { } diff --git a/src/test/ui/unsafe/unsafe-trait-impl.stderr b/src/test/ui/unsafe/unsafe-trait-impl.stderr index 4e93d235757e2..567be27555cf1 100644 --- a/src/test/ui/unsafe/unsafe-trait-impl.stderr +++ b/src/test/ui/unsafe/unsafe-trait-impl.stderr @@ -7,8 +7,8 @@ LL | unsafe fn len(&self) -> u32; LL | fn len(&self) -> u32 { *self } | ^^^^^^^^^^^^^^^^^^^^ expected unsafe fn, found normal fn | - = note: expected type `unsafe fn(&u32) -> u32` - found type `fn(&u32) -> u32` + = note: expected fn pointer `unsafe fn(&u32) -> u32` + found fn pointer `fn(&u32) -> u32` error: aborting due to previous error diff --git a/src/test/ui/variance/variance-btree-invariant-types.stderr b/src/test/ui/variance/variance-btree-invariant-types.stderr index 0f93927683ea6..8172a019b65ed 100644 --- a/src/test/ui/variance/variance-btree-invariant-types.stderr +++ b/src/test/ui/variance/variance-btree-invariant-types.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `std::collections::btree_map::IterMut<'_, &'new (), _>` - found type `std::collections::btree_map::IterMut<'_, &'static (), _>` + = note: expected struct `std::collections::btree_map::IterMut<'_, &'new (), _>` + found struct `std::collections::btree_map::IterMut<'_, &'static (), _>` note: the lifetime `'new` as defined on the function body at 3:21... --> $DIR/variance-btree-invariant-types.rs:3:21 | @@ -19,8 +19,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `std::collections::btree_map::IterMut<'_, _, &'new ()>` - found type `std::collections::btree_map::IterMut<'_, _, &'static ()>` + = note: expected struct `std::collections::btree_map::IterMut<'_, _, &'new ()>` + found struct `std::collections::btree_map::IterMut<'_, _, &'static ()>` note: the lifetime `'new` as defined on the function body at 6:21... --> $DIR/variance-btree-invariant-types.rs:6:21 | @@ -34,8 +34,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `std::collections::btree_map::IterMut<'_, &'static (), _>` - found type `std::collections::btree_map::IterMut<'_, &'new (), _>` + = note: expected struct `std::collections::btree_map::IterMut<'_, &'static (), _>` + found struct `std::collections::btree_map::IterMut<'_, &'new (), _>` note: the lifetime `'new` as defined on the function body at 9:24... --> $DIR/variance-btree-invariant-types.rs:9:24 | @@ -49,8 +49,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `std::collections::btree_map::IterMut<'_, _, &'static ()>` - found type `std::collections::btree_map::IterMut<'_, _, &'new ()>` + = note: expected struct `std::collections::btree_map::IterMut<'_, _, &'static ()>` + found struct `std::collections::btree_map::IterMut<'_, _, &'new ()>` note: the lifetime `'new` as defined on the function body at 12:24... --> $DIR/variance-btree-invariant-types.rs:12:24 | @@ -64,8 +64,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `std::collections::btree_map::OccupiedEntry<'_, &'new (), _>` - found type `std::collections::btree_map::OccupiedEntry<'_, &'static (), _>` + = note: expected struct `std::collections::btree_map::OccupiedEntry<'_, &'new (), _>` + found struct `std::collections::btree_map::OccupiedEntry<'_, &'static (), _>` note: the lifetime `'new` as defined on the function body at 16:20... --> $DIR/variance-btree-invariant-types.rs:16:20 | @@ -79,8 +79,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `std::collections::btree_map::OccupiedEntry<'_, _, &'new ()>` - found type `std::collections::btree_map::OccupiedEntry<'_, _, &'static ()>` + = note: expected struct `std::collections::btree_map::OccupiedEntry<'_, _, &'new ()>` + found struct `std::collections::btree_map::OccupiedEntry<'_, _, &'static ()>` note: the lifetime `'new` as defined on the function body at 20:20... --> $DIR/variance-btree-invariant-types.rs:20:20 | @@ -94,8 +94,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `std::collections::btree_map::OccupiedEntry<'_, &'static (), _>` - found type `std::collections::btree_map::OccupiedEntry<'_, &'new (), _>` + = note: expected struct `std::collections::btree_map::OccupiedEntry<'_, &'static (), _>` + found struct `std::collections::btree_map::OccupiedEntry<'_, &'new (), _>` note: the lifetime `'new` as defined on the function body at 24:23... --> $DIR/variance-btree-invariant-types.rs:24:23 | @@ -109,8 +109,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `std::collections::btree_map::OccupiedEntry<'_, _, &'static ()>` - found type `std::collections::btree_map::OccupiedEntry<'_, _, &'new ()>` + = note: expected struct `std::collections::btree_map::OccupiedEntry<'_, _, &'static ()>` + found struct `std::collections::btree_map::OccupiedEntry<'_, _, &'new ()>` note: the lifetime `'new` as defined on the function body at 28:23... --> $DIR/variance-btree-invariant-types.rs:28:23 | @@ -124,8 +124,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `std::collections::btree_map::VacantEntry<'_, &'new (), _>` - found type `std::collections::btree_map::VacantEntry<'_, &'static (), _>` + = note: expected struct `std::collections::btree_map::VacantEntry<'_, &'new (), _>` + found struct `std::collections::btree_map::VacantEntry<'_, &'static (), _>` note: the lifetime `'new` as defined on the function body at 33:20... --> $DIR/variance-btree-invariant-types.rs:33:20 | @@ -139,8 +139,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `std::collections::btree_map::VacantEntry<'_, _, &'new ()>` - found type `std::collections::btree_map::VacantEntry<'_, _, &'static ()>` + = note: expected struct `std::collections::btree_map::VacantEntry<'_, _, &'new ()>` + found struct `std::collections::btree_map::VacantEntry<'_, _, &'static ()>` note: the lifetime `'new` as defined on the function body at 37:20... --> $DIR/variance-btree-invariant-types.rs:37:20 | @@ -154,8 +154,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `std::collections::btree_map::VacantEntry<'_, &'static (), _>` - found type `std::collections::btree_map::VacantEntry<'_, &'new (), _>` + = note: expected struct `std::collections::btree_map::VacantEntry<'_, &'static (), _>` + found struct `std::collections::btree_map::VacantEntry<'_, &'new (), _>` note: the lifetime `'new` as defined on the function body at 41:23... --> $DIR/variance-btree-invariant-types.rs:41:23 | @@ -169,8 +169,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `std::collections::btree_map::VacantEntry<'_, _, &'static ()>` - found type `std::collections::btree_map::VacantEntry<'_, _, &'new ()>` + = note: expected struct `std::collections::btree_map::VacantEntry<'_, _, &'static ()>` + found struct `std::collections::btree_map::VacantEntry<'_, _, &'new ()>` note: the lifetime `'new` as defined on the function body at 45:23... --> $DIR/variance-btree-invariant-types.rs:45:23 | diff --git a/src/test/ui/variance/variance-contravariant-arg-object.stderr b/src/test/ui/variance/variance-contravariant-arg-object.stderr index 27017e5dc47d6..67ce9bc134672 100644 --- a/src/test/ui/variance/variance-contravariant-arg-object.stderr +++ b/src/test/ui/variance/variance-contravariant-arg-object.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `dyn Get<&'min i32>` - found type `dyn Get<&'max i32>` + = note: expected trait `dyn Get<&'min i32>` + found trait `dyn Get<&'max i32>` note: the lifetime `'min` as defined on the function body at 10:21... --> $DIR/variance-contravariant-arg-object.rs:10:21 | @@ -23,8 +23,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `dyn Get<&'max i32>` - found type `dyn Get<&'min i32>` + = note: expected trait `dyn Get<&'max i32>` + found trait `dyn Get<&'min i32>` note: the lifetime `'min` as defined on the function body at 17:21... --> $DIR/variance-contravariant-arg-object.rs:17:21 | diff --git a/src/test/ui/variance/variance-covariant-arg-object.stderr b/src/test/ui/variance/variance-covariant-arg-object.stderr index b986edb809f6c..f66c0f20ba154 100644 --- a/src/test/ui/variance/variance-covariant-arg-object.stderr +++ b/src/test/ui/variance/variance-covariant-arg-object.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `dyn Get<&'min i32>` - found type `dyn Get<&'max i32>` + = note: expected trait `dyn Get<&'min i32>` + found trait `dyn Get<&'max i32>` note: the lifetime `'min` as defined on the function body at 10:21... --> $DIR/variance-covariant-arg-object.rs:10:21 | @@ -23,8 +23,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `dyn Get<&'max i32>` - found type `dyn Get<&'min i32>` + = note: expected trait `dyn Get<&'max i32>` + found trait `dyn Get<&'min i32>` note: the lifetime `'min` as defined on the function body at 18:21... --> $DIR/variance-covariant-arg-object.rs:18:21 | diff --git a/src/test/ui/variance/variance-invariant-arg-object.stderr b/src/test/ui/variance/variance-invariant-arg-object.stderr index 8ff1e23e8add8..8ae7240b2827e 100644 --- a/src/test/ui/variance/variance-invariant-arg-object.stderr +++ b/src/test/ui/variance/variance-invariant-arg-object.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `dyn Get<&'min i32>` - found type `dyn Get<&'max i32>` + = note: expected trait `dyn Get<&'min i32>` + found trait `dyn Get<&'max i32>` note: the lifetime `'min` as defined on the function body at 7:21... --> $DIR/variance-invariant-arg-object.rs:7:21 | @@ -23,8 +23,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `dyn Get<&'max i32>` - found type `dyn Get<&'min i32>` + = note: expected trait `dyn Get<&'max i32>` + found trait `dyn Get<&'min i32>` note: the lifetime `'min` as defined on the function body at 14:21... --> $DIR/variance-invariant-arg-object.rs:14:21 | diff --git a/src/test/ui/variance/variance-use-contravariant-struct-1.stderr b/src/test/ui/variance/variance-use-contravariant-struct-1.stderr index 618f56da512d6..423c9a601f456 100644 --- a/src/test/ui/variance/variance-use-contravariant-struct-1.stderr +++ b/src/test/ui/variance/variance-use-contravariant-struct-1.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `SomeStruct<&'min ()>` - found type `SomeStruct<&'max ()>` + = note: expected struct `SomeStruct<&'min ()>` + found struct `SomeStruct<&'max ()>` note: the lifetime `'min` as defined on the function body at 8:8... --> $DIR/variance-use-contravariant-struct-1.rs:8:8 | diff --git a/src/test/ui/variance/variance-use-covariant-struct-1.stderr b/src/test/ui/variance/variance-use-covariant-struct-1.stderr index 0b3a8dcfc86f4..3f9224804bdd0 100644 --- a/src/test/ui/variance/variance-use-covariant-struct-1.stderr +++ b/src/test/ui/variance/variance-use-covariant-struct-1.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `SomeStruct<&'max ()>` - found type `SomeStruct<&'min ()>` + = note: expected struct `SomeStruct<&'max ()>` + found struct `SomeStruct<&'min ()>` note: the lifetime `'min` as defined on the function body at 6:8... --> $DIR/variance-use-covariant-struct-1.rs:6:8 | diff --git a/src/test/ui/variance/variance-use-invariant-struct-1.stderr b/src/test/ui/variance/variance-use-invariant-struct-1.stderr index 31deefb535e94..7063f1c9c8f97 100644 --- a/src/test/ui/variance/variance-use-invariant-struct-1.stderr +++ b/src/test/ui/variance/variance-use-invariant-struct-1.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `SomeStruct<&'min ()>` - found type `SomeStruct<&'max ()>` + = note: expected struct `SomeStruct<&'min ()>` + found struct `SomeStruct<&'max ()>` note: the lifetime `'min` as defined on the function body at 8:8... --> $DIR/variance-use-invariant-struct-1.rs:8:8 | @@ -23,8 +23,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected type `SomeStruct<&'max ()>` - found type `SomeStruct<&'min ()>` + = note: expected struct `SomeStruct<&'max ()>` + found struct `SomeStruct<&'min ()>` note: the lifetime `'min` as defined on the function body at 15:8... --> $DIR/variance-use-invariant-struct-1.rs:15:8 | diff --git a/src/test/ui/wf/wf-unsafe-trait-obj-match.stderr b/src/test/ui/wf/wf-unsafe-trait-obj-match.stderr index 185b1e6c36b55..d5799ccc8348e 100644 --- a/src/test/ui/wf/wf-unsafe-trait-obj-match.stderr +++ b/src/test/ui/wf/wf-unsafe-trait-obj-match.stderr @@ -9,8 +9,8 @@ LL | | None => &R, LL | | } | |_____- `match` arms have incompatible types | - = note: expected type `&S` - found type `&R` + = note: expected type `&S` + found reference `&R` error[E0038]: the trait `Trait` cannot be made into an object --> $DIR/wf-unsafe-trait-obj-match.rs:26:21 diff --git a/src/test/ui/while-type-error.stderr b/src/test/ui/while-type-error.stderr index 15169673fe925..850fcedf39ffa 100644 --- a/src/test/ui/while-type-error.stderr +++ b/src/test/ui/while-type-error.stderr @@ -5,7 +5,7 @@ LL | fn main() { while main { } } | ^^^^ expected bool, found fn item | = note: expected type `bool` - found type `fn() {main}` + found fn item `fn() {main}` error: aborting due to previous error diff --git a/src/test/ui/wrong-mul-method-signature.stderr b/src/test/ui/wrong-mul-method-signature.stderr index 2317bf8e8293c..61c976b773af4 100644 --- a/src/test/ui/wrong-mul-method-signature.stderr +++ b/src/test/ui/wrong-mul-method-signature.stderr @@ -4,8 +4,8 @@ error[E0053]: method `mul` has an incompatible type for trait LL | fn mul(self, s: &f64) -> Vec1 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected f64, found &f64 | - = note: expected type `fn(Vec1, f64) -> Vec1` - found type `fn(Vec1, &f64) -> Vec1` + = note: expected fn pointer `fn(Vec1, f64) -> Vec1` + found fn pointer `fn(Vec1, &f64) -> Vec1` error[E0053]: method `mul` has an incompatible type for trait --> $DIR/wrong-mul-method-signature.rs:33:5 @@ -13,8 +13,8 @@ error[E0053]: method `mul` has an incompatible type for trait LL | fn mul(self, s: f64) -> Vec2 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found f64 | - = note: expected type `fn(Vec2, Vec2) -> f64` - found type `fn(Vec2, f64) -> Vec2` + = note: expected fn pointer `fn(Vec2, Vec2) -> f64` + found fn pointer `fn(Vec2, f64) -> Vec2` error[E0053]: method `mul` has an incompatible type for trait --> $DIR/wrong-mul-method-signature.rs:52:5 @@ -22,8 +22,8 @@ error[E0053]: method `mul` has an incompatible type for trait LL | fn mul(self, s: f64) -> f64 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found f64 | - = note: expected type `fn(Vec3, f64) -> i32` - found type `fn(Vec3, f64) -> f64` + = note: expected fn pointer `fn(Vec3, f64) -> i32` + found fn pointer `fn(Vec3, f64) -> f64` error[E0308]: mismatched types --> $DIR/wrong-mul-method-signature.rs:63:45 @@ -31,8 +31,8 @@ error[E0308]: mismatched types LL | let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order | ^^^ expected struct `Vec2`, found floating-point number | - = note: expected type `Vec2` - found type `{float}` + = note: expected struct `Vec2` + found type `{float}` error[E0308]: mismatched types --> $DIR/wrong-mul-method-signature.rs:63:19 @@ -40,8 +40,8 @@ error[E0308]: mismatched types LL | let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found f64 | - = note: expected type `Vec2` - found type `f64` + = note: expected struct `Vec2` + found type `f64` error: aborting due to 5 previous errors From b2e6aef0731990c98a6fb7ac6f890aa359a5e9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Thu, 14 Nov 2019 14:08:08 -0800 Subject: [PATCH 2/6] review comments: tweak prefix strings --- src/librustc/ty/error.rs | 8 ++-- src/test/ui/arg-type-mismatch.stderr | 4 +- src/test/ui/array-break-length.stderr | 8 ++-- .../ui/associated-types/issue-44153.stderr | 4 +- ...point-at-type-on-obligation-failure.stderr | 4 +- ...block-control-flow-static-semantics.stderr | 24 +++++----- .../block-expression-remove-semicolon.stderr | 4 +- .../block-must-not-have-result-do.stderr | 4 +- .../block-must-not-have-result-res.stderr | 4 +- .../block-must-not-have-result-while.rs | 2 +- .../block-must-not-have-result-while.stderr | 4 +- .../consider-removing-last-semi.stderr | 4 +- src/test/ui/block-result/issue-11714.stderr | 4 +- src/test/ui/block-result/issue-13428.stderr | 4 +- src/test/ui/block-result/issue-13624.rs | 4 +- src/test/ui/block-result/issue-13624.stderr | 8 ++-- src/test/ui/block-result/issue-20862.stderr | 4 +- src/test/ui/block-result/issue-22645.stderr | 4 +- src/test/ui/block-result/issue-5500.rs | 2 +- src/test/ui/block-result/issue-5500.stderr | 4 +- .../unexpected-return-on-unit.stderr | 4 +- src/test/ui/break-while-condition.stderr | 12 ++--- src/test/ui/codemap_tests/tab.stderr | 4 +- ...coercion-missing-tail-expected-type.stderr | 8 ++-- src/test/ui/destructure-trait-ref.rs | 6 +-- src/test/ui/destructure-trait-ref.stderr | 12 ++--- .../ui/diverging-tuple-parts-39485.stderr | 4 +- src/test/ui/dst/dst-bad-assign-3.rs | 2 +- src/test/ui/dst/dst-bad-assign-3.stderr | 4 +- src/test/ui/dst/dst-bad-assign.rs | 2 +- src/test/ui/dst/dst-bad-assign.stderr | 4 +- src/test/ui/error-codes/E0070.stderr | 4 +- src/test/ui/fn/fn-trait-formatting.rs | 6 +-- src/test/ui/fn/fn-trait-formatting.stderr | 12 ++--- .../generic/generic-type-params-name-repr.rs | 12 ++--- .../generic-type-params-name-repr.stderr | 12 ++--- src/test/ui/if-else-type-mismatch.stderr | 12 ++--- .../ui/if/if-without-else-as-fn-expr.stderr | 24 +++++----- src/test/ui/if/if-without-else-result.rs | 2 +- src/test/ui/if/if-without-else-result.stderr | 4 +- src/test/ui/issues/issue-11319.stderr | 4 +- src/test/ui/issues/issue-16401.rs | 2 +- src/test/ui/issues/issue-16401.stderr | 4 +- src/test/ui/issues/issue-17033.rs | 2 +- src/test/ui/issues/issue-17033.stderr | 2 +- src/test/ui/issues/issue-17728.nll.stderr | 4 +- src/test/ui/issues/issue-19991.rs | 2 +- src/test/ui/issues/issue-19991.stderr | 4 +- src/test/ui/issues/issue-22684.stderr | 4 +- src/test/ui/issues/issue-27042.stderr | 16 +++---- src/test/ui/issues/issue-32323.stderr | 2 +- src/test/ui/issues/issue-37026.stderr | 8 ++-- src/test/ui/issues/issue-37665.stderr | 4 +- src/test/ui/issues/issue-39970.stderr | 2 +- src/test/ui/issues/issue-41549.stderr | 4 +- src/test/ui/issues/issue-4201.rs | 2 +- src/test/ui/issues/issue-4201.stderr | 4 +- src/test/ui/issues/issue-43162.stderr | 4 +- src/test/ui/issues/issue-44023.stderr | 4 +- src/test/ui/issues/issue-46112.stderr | 4 +- src/test/ui/issues/issue-47486.stderr | 4 +- src/test/ui/issues/issue-50577.stderr | 4 +- src/test/ui/issues/issue-50585.stderr | 4 +- src/test/ui/issues/issue-6458-4.stderr | 4 +- .../ui/json-bom-plus-crlf-multifile.stderr | 2 +- src/test/ui/json-bom-plus-crlf.stderr | 2 +- .../liveness-closure-require-ret.stderr | 4 +- .../ui/liveness/liveness-forgot-ret.stderr | 4 +- .../ui/liveness/liveness-issue-2163.stderr | 4 +- .../ui/liveness/liveness-missing-ret2.stderr | 4 +- .../liveness-return-last-stmt-semi.stderr | 16 +++---- src/test/ui/loops/loop-break-value.stderr | 20 ++++---- .../ui/loops/loop-labeled-break-value.stderr | 12 ++--- .../ui/loops/loop-properly-diverging-2.stderr | 4 +- .../ui/match/match-type-err-first-arm.stderr | 4 +- ...e-trait-object-with-separate-params.stderr | 20 ++++---- src/test/ui/mir-unpretty.stderr | 4 +- .../for-loop-has-unit-body.stderr | 4 +- .../ui/mismatched_types/issue-19109.stderr | 4 +- src/test/ui/mismatched_types/main.stderr | 4 +- src/test/ui/missing/missing-return.stderr | 4 +- .../ui/or-patterns/consistent-bindings.stderr | 4 +- src/test/ui/output-type-mismatch.stderr | 4 +- src/test/ui/parser/expr-as-stmt.stderr | 16 +++---- src/test/ui/parser/issue-33413.stderr | 4 +- src/test/ui/parser/issue-62881.stderr | 4 +- src/test/ui/parser/issue-62895.stderr | 4 +- src/test/ui/parser/match-vec-invalid.stderr | 4 +- src/test/ui/parser/pat-lt-bracket-6.stderr | 4 +- src/test/ui/parser/pat-lt-bracket-7.stderr | 4 +- src/test/ui/parser/pat-tuple-4.stderr | 4 +- ...recover-for-loop-parens-around-head.stderr | 4 +- .../ui/parser/recover-from-homoglyph.stderr | 4 +- .../ui/parser/recover-missing-semi.stderr | 8 ++-- src/test/ui/pattern/pat-tuple-bad-type.stderr | 4 +- src/test/ui/proc-macro/issue-37788.stderr | 4 +- .../ui/proc-macro/span-preservation.stderr | 4 +- ...time-bounds-on-fns-where-clause.nll.stderr | 4 +- ...time-bounds-on-fns-where-clause.nll.stderr | 4 +- .../regions-lifetime-bounds-on-fns.nll.stderr | 4 +- src/test/ui/repeat_count.rs | 2 +- src/test/ui/repeat_count.stderr | 4 +- src/test/ui/return/return-type.stderr | 4 +- .../disallowed-positions.stderr | 12 ++--- src/test/ui/span/move-closure.stderr | 4 +- .../specialization-default-projection.stderr | 4 +- .../ui/struct-literal-variant-in-if.stderr | 8 ++-- src/test/ui/substs-ppaux.normal.stderr | 16 +++---- src/test/ui/substs-ppaux.rs | 16 +++---- src/test/ui/substs-ppaux.verbose.stderr | 16 +++---- .../ui/suggestions/match-needing-semi.stderr | 8 ++-- src/test/ui/suppressed-error.rs | 2 +- src/test/ui/suppressed-error.stderr | 4 +- .../non-whitespace-trimming-2.stderr | 4 +- .../non-whitespace-trimming-unicode.stderr | 4 +- .../non-whitespace-trimming.stderr | 4 +- .../whitespace-trimming-2.stderr | 4 +- .../terminal-width/whitespace-trimming.stderr | 4 +- .../ui/try-block/try-block-bad-type.stderr | 4 +- .../ui/try-block/try-block-type-error.stderr | 4 +- .../enum-variant-generic-args.stderr | 12 ++--- ..._type_does_not_live_long_enough.nll.stderr | 4 +- .../type-alias-impl-trait/issue-63279.stderr | 2 +- .../assignment-expected-bool.stderr | 48 +++++++++---------- .../type/type-check/assignment-in-if.stderr | 24 +++++----- src/test/ui/type/type-error-break-tail.stderr | 4 +- ...e-57673-ice-on-deref-of-boxed-trait.stderr | 4 +- .../variance-contravariant-arg-object.stderr | 8 ++-- .../variance-covariant-arg-object.stderr | 8 ++-- .../variance-invariant-arg-object.stderr | 8 ++-- 130 files changed, 407 insertions(+), 407 deletions(-) diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs index 8babd0584b334..09a833baca93f 100644 --- a/src/librustc/ty/error.rs +++ b/src/librustc/ty/error.rs @@ -252,7 +252,7 @@ impl<'tcx> ty::TyS<'tcx> { match self.kind { ty::Infer(_) | ty::Error | ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => "type".into(), - ty::Tuple(ref tys) if tys.is_empty() => "type".into(), + ty::Tuple(ref tys) if tys.is_empty() => "unit type".into(), ty::Adt(def, _) => def.descr().into(), ty::Foreign(_) => "extern type".into(), ty::Array(..) => "array".into(), @@ -264,13 +264,13 @@ impl<'tcx> ty::TyS<'tcx> { }.into(), ty::FnDef(..) => "fn item".into(), ty::FnPtr(_) => "fn pointer".into(), - ty::Dynamic(..) => "trait".into(), + ty::Dynamic(..) => "trait object".into(), ty::Closure(..) => "closure".into(), ty::Generator(..) => "generator".into(), ty::GeneratorWitness(..) => "generator witness".into(), ty::Tuple(..) => "tuple".into(), - ty::Placeholder(..) => "placeholder type".into(), - ty::Bound(..) => "bound type".into(), + ty::Placeholder(..) => "higher-ranked type".into(), + ty::Bound(..) => "bound type variable".into(), ty::Projection(_) => "associated type".into(), ty::UnnormalizedProjection(_) => "associated type".into(), ty::Param(_) => "type parameter".into(), diff --git a/src/test/ui/arg-type-mismatch.stderr b/src/test/ui/arg-type-mismatch.stderr index d41abd1aa816d..95aa36ebb89f9 100644 --- a/src/test/ui/arg-type-mismatch.stderr +++ b/src/test/ui/arg-type-mismatch.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | fn main() { let i: (); i = f(()); } | ^^ expected isize, found () | - = note: expected type `isize` - found type `()` + = note: expected type `isize` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/array-break-length.stderr b/src/test/ui/array-break-length.stderr index 1fbbb0e79bbf0..971b3685b90a1 100644 --- a/src/test/ui/array-break-length.stderr +++ b/src/test/ui/array-break-length.stderr @@ -16,8 +16,8 @@ error[E0308]: mismatched types LL | |_: [_; break]| {} | ^^^^^^^^^^^^^^^^^^ expected (), found closure | - = note: expected type `()` - found closure `[closure@$DIR/array-break-length.rs:3:9: 3:27]` + = note: expected unit type `()` + found closure `[closure@$DIR/array-break-length.rs:3:9: 3:27]` error[E0308]: mismatched types --> $DIR/array-break-length.rs:8:9 @@ -25,8 +25,8 @@ error[E0308]: mismatched types LL | |_: [_; continue]| {} | ^^^^^^^^^^^^^^^^^^^^^ expected (), found closure | - = note: expected type `()` - found closure `[closure@$DIR/array-break-length.rs:8:9: 8:30]` + = note: expected unit type `()` + found closure `[closure@$DIR/array-break-length.rs:8:9: 8:30]` error: aborting due to 4 previous errors diff --git a/src/test/ui/associated-types/issue-44153.stderr b/src/test/ui/associated-types/issue-44153.stderr index 556fd0766c2eb..7751d20f3527a 100644 --- a/src/test/ui/associated-types/issue-44153.stderr +++ b/src/test/ui/associated-types/issue-44153.stderr @@ -7,8 +7,8 @@ LL | fn visit() {} LL | <() as Visit>::visit(); | ^^^^^^^^^^^^^^^^^^^^ expected (), found &() | - = note: expected type `()` - found reference `&()` + = note: expected unit type `()` + found reference `&()` = note: required because of the requirements on the impl of `Visit` for `()` error: aborting due to previous error diff --git a/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr b/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr index e4bd39c8ba62c..ceb811f7e0143 100644 --- a/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr +++ b/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr @@ -9,8 +9,8 @@ LL | impl Bar for Foo { LL | type Ok = (); | ^^^^^^^^^^^^^ expected u32, found () | - = note: expected type `u32` - found type `()` + = note: expected type `u32` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr b/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr index bdfa0443f8cc9..832f00642e3a5 100644 --- a/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr +++ b/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr @@ -26,8 +26,8 @@ LL | fn return_targets_async_block_not_fn() -> u8 { | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected type `u8` - found type `()` + = note: expected type `u8` + found unit type `()` error[E0271]: type mismatch resolving `::Output == ()` --> $DIR/async-block-control-flow-static-semantics.rs:18:39 @@ -35,8 +35,8 @@ error[E0271]: type mismatch resolving ` = █ | ^^^^^^ expected (), found u8 | - = note: expected type `()` - found type `u8` + = note: expected unit type `()` + found type `u8` = note: required for the cast to the object type `dyn std::future::Future` error[E0308]: mismatched types @@ -52,8 +52,8 @@ LL | | LL | | } | |_^ expected u8, found () | - = note: expected type `u8` - found type `()` + = note: expected type `u8` + found unit type `()` error[E0271]: type mismatch resolving `::Output == ()` --> $DIR/async-block-control-flow-static-semantics.rs:27:39 @@ -61,8 +61,8 @@ error[E0271]: type mismatch resolving ` = █ | ^^^^^^ expected (), found u8 | - = note: expected type `()` - found type `u8` + = note: expected unit type `()` + found type `u8` = note: required for the cast to the object type `dyn std::future::Future` error[E0308]: mismatched types @@ -73,8 +73,8 @@ LL | fn rethrow_targets_async_block_not_fn() -> Result { | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected enum `std::result::Result` - found type `()` + = note: expected enum `std::result::Result` + found unit type `()` error[E0308]: mismatched types --> $DIR/async-block-control-flow-static-semantics.rs:57:50 @@ -84,8 +84,8 @@ LL | fn rethrow_targets_async_block_not_async_fn() -> Result { | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected enum `std::result::Result` - found type `()` + = note: expected enum `std::result::Result` + found unit type `()` error: aborting due to 8 previous errors diff --git a/src/test/ui/block-expression-remove-semicolon.stderr b/src/test/ui/block-expression-remove-semicolon.stderr index 51942f3d920f5..29a53bed7d744 100644 --- a/src/test/ui/block-expression-remove-semicolon.stderr +++ b/src/test/ui/block-expression-remove-semicolon.stderr @@ -9,8 +9,8 @@ LL | | foo(); LL | | }; | |_____^ expected i32, found () | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/block-result/block-must-not-have-result-do.stderr b/src/test/ui/block-result/block-must-not-have-result-do.stderr index 5981b8b60794c..11f9db6937e12 100644 --- a/src/test/ui/block-result/block-must-not-have-result-do.stderr +++ b/src/test/ui/block-result/block-must-not-have-result-do.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | true | ^^^^ expected (), found bool | - = note: expected type `()` - found type `bool` + = note: expected unit type `()` + found type `bool` error: aborting due to previous error diff --git a/src/test/ui/block-result/block-must-not-have-result-res.stderr b/src/test/ui/block-result/block-must-not-have-result-res.stderr index 8a41f8b8e3dff..ba80ce2d6b14a 100644 --- a/src/test/ui/block-result/block-must-not-have-result-res.stderr +++ b/src/test/ui/block-result/block-must-not-have-result-res.stderr @@ -6,8 +6,8 @@ LL | fn drop(&mut self) { LL | true | ^^^^ expected (), found bool | - = note: expected type `()` - found type `bool` + = note: expected unit type `()` + found type `bool` error: aborting due to previous error diff --git a/src/test/ui/block-result/block-must-not-have-result-while.rs b/src/test/ui/block-result/block-must-not-have-result-while.rs index 108b9bc9e9b29..42b439cd3208e 100644 --- a/src/test/ui/block-result/block-must-not-have-result-while.rs +++ b/src/test/ui/block-result/block-must-not-have-result-while.rs @@ -1,7 +1,7 @@ fn main() { while true { //~ WARN denote infinite loops with true //~ ERROR mismatched types - //~| expected type `()` + //~| expected unit type `()` //~| found type `bool` //~| expected (), found bool } diff --git a/src/test/ui/block-result/block-must-not-have-result-while.stderr b/src/test/ui/block-result/block-must-not-have-result-while.stderr index 44f62875ef1c4..d19ae3af657c0 100644 --- a/src/test/ui/block-result/block-must-not-have-result-while.stderr +++ b/src/test/ui/block-result/block-must-not-have-result-while.stderr @@ -12,8 +12,8 @@ error[E0308]: mismatched types LL | true | ^^^^ expected (), found bool | - = note: expected type `()` - found type `bool` + = note: expected unit type `()` + found type `bool` error: aborting due to previous error diff --git a/src/test/ui/block-result/consider-removing-last-semi.stderr b/src/test/ui/block-result/consider-removing-last-semi.stderr index b028bfd520323..76643b49bc04e 100644 --- a/src/test/ui/block-result/consider-removing-last-semi.stderr +++ b/src/test/ui/block-result/consider-removing-last-semi.stderr @@ -10,7 +10,7 @@ LL | "bla".to_string(); | - help: consider removing this semicolon | = note: expected struct `std::string::String` - found type `()` + found unit type `()` error[E0308]: mismatched types --> $DIR/consider-removing-last-semi.rs:6:11 @@ -24,7 +24,7 @@ LL | "removeme".to_string(); | - help: consider removing this semicolon | = note: expected struct `std::string::String` - found type `()` + found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-11714.stderr b/src/test/ui/block-result/issue-11714.stderr index cfb42c601279a..54c1bb220a912 100644 --- a/src/test/ui/block-result/issue-11714.stderr +++ b/src/test/ui/block-result/issue-11714.stderr @@ -9,8 +9,8 @@ LL | fn blah() -> i32 { LL | ; | - help: consider removing this semicolon | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/block-result/issue-13428.stderr b/src/test/ui/block-result/issue-13428.stderr index f7b24ddbf55b9..b1f2ca634511b 100644 --- a/src/test/ui/block-result/issue-13428.stderr +++ b/src/test/ui/block-result/issue-13428.stderr @@ -10,7 +10,7 @@ LL | ; | - help: consider removing this semicolon | = note: expected struct `std::string::String` - found type `()` + found unit type `()` error[E0308]: mismatched types --> $DIR/issue-13428.rs:11:13 @@ -24,7 +24,7 @@ LL | ; | - help: consider removing this semicolon | = note: expected struct `std::string::String` - found type `()` + found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-13624.rs b/src/test/ui/block-result/issue-13624.rs index 0eeaa77163110..ca457aa907d9f 100644 --- a/src/test/ui/block-result/issue-13624.rs +++ b/src/test/ui/block-result/issue-13624.rs @@ -7,7 +7,7 @@ mod a { Enum::EnumStructVariant { x: 1, y: 2, z: 3 } //~^ ERROR mismatched types //~| expected (), found enum `a::Enum` - //~| expected type `()` + //~| expected unit type `()` //~| found enum `a::Enum` } } @@ -22,7 +22,7 @@ mod b { a::Enum::EnumStructVariant { x, y, z } => { //~^ ERROR mismatched types //~| expected (), found enum `a::Enum` - //~| expected type `()` + //~| expected unit type `()` //~| found enum `a::Enum` } } diff --git a/src/test/ui/block-result/issue-13624.stderr b/src/test/ui/block-result/issue-13624.stderr index 81daff5b5cccc..6e2b2812c7241 100644 --- a/src/test/ui/block-result/issue-13624.stderr +++ b/src/test/ui/block-result/issue-13624.stderr @@ -6,8 +6,8 @@ LL | pub fn get_enum_struct_variant() -> () { LL | Enum::EnumStructVariant { x: 1, y: 2, z: 3 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum` | - = note: expected type `()` - found enum `a::Enum` + = note: expected unit type `()` + found enum `a::Enum` error[E0308]: mismatched types --> $DIR/issue-13624.rs:22:9 @@ -17,8 +17,8 @@ LL | match enum_struct_variant { LL | a::Enum::EnumStructVariant { x, y, z } => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum` | - = note: expected type `()` - found enum `a::Enum` + = note: expected unit type `()` + found enum `a::Enum` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-20862.stderr b/src/test/ui/block-result/issue-20862.stderr index bcbc9b711adf6..717c7517defd6 100644 --- a/src/test/ui/block-result/issue-20862.stderr +++ b/src/test/ui/block-result/issue-20862.stderr @@ -6,8 +6,8 @@ LL | fn foo(x: i32) { LL | |y| x + y | ^^^^^^^^^ expected (), found closure | - = note: expected type `()` - found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]` + = note: expected unit type `()` + found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]` error[E0618]: expected function, found `()` --> $DIR/issue-20862.rs:7:13 diff --git a/src/test/ui/block-result/issue-22645.stderr b/src/test/ui/block-result/issue-22645.stderr index 379553b9e0d97..5df71e8374b1d 100644 --- a/src/test/ui/block-result/issue-22645.stderr +++ b/src/test/ui/block-result/issue-22645.stderr @@ -17,8 +17,8 @@ LL | let b = Bob + 3.5; LL | b + 3 | ^^^^^ expected (), found struct `Bob` | - = note: expected type `()` - found struct `Bob` + = note: expected unit type `()` + found struct `Bob` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-5500.rs b/src/test/ui/block-result/issue-5500.rs index 0df7533e38da6..55f1efce93dbc 100644 --- a/src/test/ui/block-result/issue-5500.rs +++ b/src/test/ui/block-result/issue-5500.rs @@ -1,7 +1,7 @@ fn main() { &panic!() //~^ ERROR mismatched types - //~| expected type `()` + //~| expected unit type `()` //~| found reference `&_` //~| expected (), found reference } diff --git a/src/test/ui/block-result/issue-5500.stderr b/src/test/ui/block-result/issue-5500.stderr index 27e492837248b..12ee677d09dd0 100644 --- a/src/test/ui/block-result/issue-5500.stderr +++ b/src/test/ui/block-result/issue-5500.stderr @@ -9,8 +9,8 @@ LL | &panic!() | expected (), found reference | help: consider removing the borrow: `panic!()` | - = note: expected type `()` - found reference `&_` + = note: expected unit type `()` + found reference `&_` error: aborting due to previous error diff --git a/src/test/ui/block-result/unexpected-return-on-unit.stderr b/src/test/ui/block-result/unexpected-return-on-unit.stderr index 3ceff81ec4d63..3eae3e7542241 100644 --- a/src/test/ui/block-result/unexpected-return-on-unit.stderr +++ b/src/test/ui/block-result/unexpected-return-on-unit.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | foo() | ^^^^^ expected (), found usize | - = note: expected type `()` - found type `usize` + = note: expected unit type `()` + found type `usize` help: try adding a semicolon | LL | foo(); diff --git a/src/test/ui/break-while-condition.stderr b/src/test/ui/break-while-condition.stderr index a08edee07ea0a..6f131514a4084 100644 --- a/src/test/ui/break-while-condition.stderr +++ b/src/test/ui/break-while-condition.stderr @@ -7,8 +7,8 @@ LL | | 'a: while break 'a {}; LL | | }; | |_________^ expected !, found () | - = note: expected type `!` - found type `()` + = note: expected type `!` + found unit type `()` error[E0308]: mismatched types --> $DIR/break-while-condition.rs:16:13 @@ -18,8 +18,8 @@ LL | | break LL | | } | |_____________^ expected !, found () | - = note: expected type `!` - found type `()` + = note: expected type `!` + found unit type `()` error[E0308]: mismatched types --> $DIR/break-while-condition.rs:24:13 @@ -29,8 +29,8 @@ LL | | return LL | | } | |_____________^ expected !, found () | - = note: expected type `!` - found type `()` + = note: expected type `!` + found unit type `()` error: aborting due to 3 previous errors diff --git a/src/test/ui/codemap_tests/tab.stderr b/src/test/ui/codemap_tests/tab.stderr index d2d52e282daa6..ea3ded67c0a0c 100644 --- a/src/test/ui/codemap_tests/tab.stderr +++ b/src/test/ui/codemap_tests/tab.stderr @@ -12,8 +12,8 @@ LL | fn foo() { LL | "bar boo" | ^^^^^^^^^^^^^^^^^^^^ expected (), found reference | - = note: expected type `()` - found reference `&'static str` + = note: expected unit type `()` + found reference `&'static str` error: aborting due to 2 previous errors diff --git a/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr b/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr index 3c44fdb195454..1122901a17eda 100644 --- a/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr +++ b/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr @@ -8,8 +8,8 @@ LL | fn plus_one(x: i32) -> i32 { LL | x + 1; | - help: consider removing this semicolon | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error[E0308]: mismatched types --> $DIR/coercion-missing-tail-expected-type.rs:7:13 @@ -21,8 +21,8 @@ LL | fn foo() -> Result { LL | Ok(1); | - help: consider removing this semicolon | - = note: expected enum `std::result::Result` - found type `()` + = note: expected enum `std::result::Result` + found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/destructure-trait-ref.rs b/src/test/ui/destructure-trait-ref.rs index 1c79282639969..c1b178b221cce 100644 --- a/src/test/ui/destructure-trait-ref.rs +++ b/src/test/ui/destructure-trait-ref.rs @@ -31,16 +31,16 @@ fn main() { // n > m let &&x = &1isize as &dyn T; //~^ ERROR mismatched types - //~| expected trait `dyn T` + //~| expected trait object `dyn T` //~| found reference `&_` //~| expected trait T, found reference let &&&x = &(&1isize as &dyn T); //~^ ERROR mismatched types - //~| expected trait `dyn T` + //~| expected trait object `dyn T` //~| found reference `&_` //~| expected trait T, found reference let box box x = box 1isize as Box; //~^ ERROR mismatched types - //~| expected trait `dyn T` + //~| expected trait object `dyn T` //~| found struct `std::boxed::Box<_>` } diff --git a/src/test/ui/destructure-trait-ref.stderr b/src/test/ui/destructure-trait-ref.stderr index 05545a7098c97..ef67c1c9637ed 100644 --- a/src/test/ui/destructure-trait-ref.stderr +++ b/src/test/ui/destructure-trait-ref.stderr @@ -25,8 +25,8 @@ LL | let &&x = &1isize as &dyn T; | expected trait T, found reference | help: you can probably remove the explicit borrow: `x` | - = note: expected trait `dyn T` - found reference `&_` + = note: expected trait object `dyn T` + found reference `&_` error[E0308]: mismatched types --> $DIR/destructure-trait-ref.rs:37:11 @@ -37,8 +37,8 @@ LL | let &&&x = &(&1isize as &dyn T); | expected trait T, found reference | help: you can probably remove the explicit borrow: `x` | - = note: expected trait `dyn T` - found reference `&_` + = note: expected trait object `dyn T` + found reference `&_` error[E0308]: mismatched types --> $DIR/destructure-trait-ref.rs:42:13 @@ -46,8 +46,8 @@ error[E0308]: mismatched types LL | let box box x = box 1isize as Box; | ^^^^^ expected trait T, found struct `std::boxed::Box` | - = note: expected trait `dyn T` - found struct `std::boxed::Box<_>` + = note: expected trait object `dyn T` + found struct `std::boxed::Box<_>` error: aborting due to 6 previous errors diff --git a/src/test/ui/diverging-tuple-parts-39485.stderr b/src/test/ui/diverging-tuple-parts-39485.stderr index 72cdfad6f7771..de5cf274c5349 100644 --- a/src/test/ui/diverging-tuple-parts-39485.stderr +++ b/src/test/ui/diverging-tuple-parts-39485.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | &panic!() | ^^^^^^^^^ expected (), found reference | - = note: expected type `()` - found reference `&_` + = note: expected unit type `()` + found reference `&_` help: try adding a return type | LL | fn g() -> &_ { diff --git a/src/test/ui/dst/dst-bad-assign-3.rs b/src/test/ui/dst/dst-bad-assign-3.rs index 8f0748f0a69bc..8218614134c38 100644 --- a/src/test/ui/dst/dst-bad-assign-3.rs +++ b/src/test/ui/dst/dst-bad-assign-3.rs @@ -33,7 +33,7 @@ pub fn main() { f5.2 = Bar1 {f: 36}; //~^ ERROR mismatched types //~| expected trait ToBar, found struct `Bar1` - //~| expected trait `dyn ToBar` + //~| expected trait object `dyn ToBar` //~| found struct `Bar1` //~| ERROR the size for values of type } diff --git a/src/test/ui/dst/dst-bad-assign-3.stderr b/src/test/ui/dst/dst-bad-assign-3.stderr index 773837e7994cb..54bb4bf9a3a43 100644 --- a/src/test/ui/dst/dst-bad-assign-3.stderr +++ b/src/test/ui/dst/dst-bad-assign-3.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | f5.2 = Bar1 {f: 36}; | ^^^^^^^^^^^^ expected trait ToBar, found struct `Bar1` | - = note: expected trait `dyn ToBar` - found struct `Bar1` + = note: expected trait object `dyn ToBar` + found struct `Bar1` error[E0277]: the size for values of type `dyn ToBar` cannot be known at compilation time --> $DIR/dst-bad-assign-3.rs:33:5 diff --git a/src/test/ui/dst/dst-bad-assign.rs b/src/test/ui/dst/dst-bad-assign.rs index c84c61ecb0ecd..ad3b3c71f5777 100644 --- a/src/test/ui/dst/dst-bad-assign.rs +++ b/src/test/ui/dst/dst-bad-assign.rs @@ -35,7 +35,7 @@ pub fn main() { f5.ptr = Bar1 {f: 36}; //~^ ERROR mismatched types //~| expected trait ToBar, found struct `Bar1` - //~| expected trait `dyn ToBar` + //~| expected trait object `dyn ToBar` //~| found struct `Bar1` //~| ERROR the size for values of type } diff --git a/src/test/ui/dst/dst-bad-assign.stderr b/src/test/ui/dst/dst-bad-assign.stderr index d01cbf7a3e982..5a2d73c3b1ac3 100644 --- a/src/test/ui/dst/dst-bad-assign.stderr +++ b/src/test/ui/dst/dst-bad-assign.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | f5.ptr = Bar1 {f: 36}; | ^^^^^^^^^^^^ expected trait ToBar, found struct `Bar1` | - = note: expected trait `dyn ToBar` - found struct `Bar1` + = note: expected trait object `dyn ToBar` + found struct `Bar1` error[E0277]: the size for values of type `dyn ToBar` cannot be known at compilation time --> $DIR/dst-bad-assign.rs:35:5 diff --git a/src/test/ui/error-codes/E0070.stderr b/src/test/ui/error-codes/E0070.stderr index 40186137b0aaf..c77a337012d55 100644 --- a/src/test/ui/error-codes/E0070.stderr +++ b/src/test/ui/error-codes/E0070.stderr @@ -16,8 +16,8 @@ error[E0308]: mismatched types LL | some_other_func() = 4; | ^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error[E0070]: invalid left-hand side expression --> $DIR/E0070.rs:8:5 diff --git a/src/test/ui/fn/fn-trait-formatting.rs b/src/test/ui/fn/fn-trait-formatting.rs index c74b79e3a6225..63ab8e88e4459 100644 --- a/src/test/ui/fn/fn-trait-formatting.rs +++ b/src/test/ui/fn/fn-trait-formatting.rs @@ -5,15 +5,15 @@ fn needs_fn(x: F) where F: Fn(isize) -> isize {} fn main() { let _: () = (box |_: isize| {}) as Box; //~^ ERROR mismatched types - //~| expected type `()` + //~| expected unit type `()` //~| found struct `std::boxed::Box` let _: () = (box |_: isize, isize| {}) as Box; //~^ ERROR mismatched types - //~| expected type `()` + //~| expected unit type `()` //~| found struct `std::boxed::Box` let _: () = (box || -> isize { unimplemented!() }) as Box isize>; //~^ ERROR mismatched types - //~| expected type `()` + //~| expected unit type `()` //~| found struct `std::boxed::Box isize>` needs_fn(1); diff --git a/src/test/ui/fn/fn-trait-formatting.stderr b/src/test/ui/fn/fn-trait-formatting.stderr index 962a310b875d7..44cc744809751 100644 --- a/src/test/ui/fn/fn-trait-formatting.stderr +++ b/src/test/ui/fn/fn-trait-formatting.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: () = (box |_: isize| {}) as Box; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` | - = note: expected type `()` - found struct `std::boxed::Box` + = note: expected unit type `()` + found struct `std::boxed::Box` error[E0308]: mismatched types --> $DIR/fn-trait-formatting.rs:10:17 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let _: () = (box |_: isize, isize| {}) as Box; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` | - = note: expected type `()` - found struct `std::boxed::Box` + = note: expected unit type `()` + found struct `std::boxed::Box` error[E0308]: mismatched types --> $DIR/fn-trait-formatting.rs:14:17 @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | let _: () = (box || -> isize { unimplemented!() }) as Box isize>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` | - = note: expected type `()` - found struct `std::boxed::Box isize>` + = note: expected unit type `()` + found struct `std::boxed::Box isize>` error[E0277]: expected a `std::ops::Fn<(isize,)>` closure, found `{integer}` --> $DIR/fn-trait-formatting.rs:19:14 diff --git a/src/test/ui/generic/generic-type-params-name-repr.rs b/src/test/ui/generic/generic-type-params-name-repr.rs index 65d409a983770..4b1af8e915c92 100644 --- a/src/test/ui/generic/generic-type-params-name-repr.rs +++ b/src/test/ui/generic/generic-type-params-name-repr.rs @@ -14,38 +14,38 @@ fn main() { //~^ ERROR mismatched types //~| expected struct `Foo`, found () //~| expected struct `Foo` - //~| found type `()` + //~| found unit type `()` // ...even when they're present, but the same types as the defaults. let _: Foo = (); //~^ ERROR mismatched types //~| expected struct `Foo`, found () //~| expected struct `Foo` - //~| found type `()` + //~| found unit type `()` // Including cases where the default is using previous type params. let _: HashMap = (); //~^ ERROR mismatched types //~| expected struct `HashMap`, found () //~| expected struct `HashMap` - //~| found type `()` + //~| found unit type `()` let _: HashMap> = (); //~^ ERROR mismatched types //~| expected struct `HashMap`, found () //~| expected struct `HashMap` - //~| found type `()` + //~| found unit type `()` // But not when there's a different type in between. let _: Foo = (); //~^ ERROR mismatched types //~| expected struct `Foo`, found () //~| expected struct `Foo` - //~| found type `()` + //~| found unit type `()` // And don't print <> at all when there's just defaults. let _: Foo = (); //~^ ERROR mismatched types //~| expected struct `Foo`, found () //~| expected struct `Foo` - //~| found type `()` + //~| found unit type `()` } diff --git a/src/test/ui/generic/generic-type-params-name-repr.stderr b/src/test/ui/generic/generic-type-params-name-repr.stderr index 86146f7e9bf7d..12cc11236f850 100644 --- a/src/test/ui/generic/generic-type-params-name-repr.stderr +++ b/src/test/ui/generic/generic-type-params-name-repr.stderr @@ -5,7 +5,7 @@ LL | let _: Foo = (); | ^^ expected struct `Foo`, found () | = note: expected struct `Foo` - found type `()` + found unit type `()` error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:20:31 @@ -14,7 +14,7 @@ LL | let _: Foo = (); | ^^ expected struct `Foo`, found () | = note: expected struct `Foo` - found type `()` + found unit type `()` error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:27:37 @@ -23,7 +23,7 @@ LL | let _: HashMap = (); | ^^ expected struct `HashMap`, found () | = note: expected struct `HashMap` - found type `()` + found unit type `()` error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:32:51 @@ -32,7 +32,7 @@ LL | let _: HashMap> = (); | ^^ expected struct `HashMap`, found () | = note: expected struct `HashMap` - found type `()` + found unit type `()` error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:39:31 @@ -41,7 +41,7 @@ LL | let _: Foo = (); | ^^ expected struct `Foo`, found () | = note: expected struct `Foo` - found type `()` + found unit type `()` error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:46:27 @@ -50,7 +50,7 @@ LL | let _: Foo = (); | ^^ expected struct `Foo`, found () | = note: expected struct `Foo` - found type `()` + found unit type `()` error: aborting due to 6 previous errors diff --git a/src/test/ui/if-else-type-mismatch.stderr b/src/test/ui/if-else-type-mismatch.stderr index b418c961189d6..d25eda0e98057 100644 --- a/src/test/ui/if-else-type-mismatch.stderr +++ b/src/test/ui/if-else-type-mismatch.stderr @@ -60,8 +60,8 @@ LL | | 6u32; LL | | }; | |_____- if and else have incompatible types | - = note: expected type `u32` - found type `()` + = note: expected type `u32` + found unit type `()` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:25:9 @@ -92,8 +92,8 @@ LL | | 10u32; LL | | }; | |_____- if and else have incompatible types | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:37:9 @@ -122,8 +122,8 @@ LL | | LL | | }; | |_____^ expected i32, found () | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error: aborting due to 8 previous errors diff --git a/src/test/ui/if/if-without-else-as-fn-expr.stderr b/src/test/ui/if/if-without-else-as-fn-expr.stderr index b49c2aa6319df..a62a2cc1522a7 100644 --- a/src/test/ui/if/if-without-else-as-fn-expr.stderr +++ b/src/test/ui/if/if-without-else-as-fn-expr.stderr @@ -8,8 +8,8 @@ LL | | return 3; LL | | } | |_____^ expected usize, found () | - = note: expected type `usize` - found type `()` + = note: expected type `usize` + found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -24,8 +24,8 @@ LL | | return 3; LL | | }; | |_____^ expected usize, found () | - = note: expected type `usize` - found type `()` + = note: expected type `usize` + found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -39,8 +39,8 @@ LL | | 3 LL | | } | |_____^ expected usize, found () | - = note: expected type `usize` - found type `()` + = note: expected type `usize` + found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -54,8 +54,8 @@ LL | | return 3; LL | | } | |_____^ expected usize, found () | - = note: expected type `usize` - found type `()` + = note: expected type `usize` + found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -70,8 +70,8 @@ LL | | return 3; LL | | }; | |_____^ expected usize, found () | - = note: expected type `usize` - found type `()` + = note: expected type `usize` + found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -85,8 +85,8 @@ LL | | 3 LL | | } | |_____^ expected usize, found () | - = note: expected type `usize` - found type `()` + = note: expected type `usize` + found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/if/if-without-else-result.rs b/src/test/ui/if/if-without-else-result.rs index cd7fde40fe8f3..4602beb4c77db 100644 --- a/src/test/ui/if/if-without-else-result.rs +++ b/src/test/ui/if/if-without-else-result.rs @@ -1,7 +1,7 @@ fn main() { let a = if true { true }; //~^ ERROR if may be missing an else clause [E0317] - //~| expected type `()` + //~| expected unit type `()` //~| found type `bool` //~| expected (), found bool println!("{}", a); diff --git a/src/test/ui/if/if-without-else-result.stderr b/src/test/ui/if/if-without-else-result.stderr index ddb013ab711fa..7870439fee15d 100644 --- a/src/test/ui/if/if-without-else-result.stderr +++ b/src/test/ui/if/if-without-else-result.stderr @@ -7,8 +7,8 @@ LL | let a = if true { true }; | | found here | expected (), found bool | - = note: expected type `()` - found type `bool` + = note: expected unit type `()` + found type `bool` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/issues/issue-11319.stderr b/src/test/ui/issues/issue-11319.stderr index 6179f9d3fe00f..9abae68ed5290 100644 --- a/src/test/ui/issues/issue-11319.stderr +++ b/src/test/ui/issues/issue-11319.stderr @@ -16,8 +16,8 @@ LL | | _ => true LL | | } | |_____- `match` arms have incompatible types | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-16401.rs b/src/test/ui/issues/issue-16401.rs index 9ed730ba2113f..aaa38b8f1709d 100644 --- a/src/test/ui/issues/issue-16401.rs +++ b/src/test/ui/issues/issue-16401.rs @@ -7,7 +7,7 @@ fn main() { match () { Slice { data: data, len: len } => (), //~^ ERROR mismatched types - //~| expected type `()` + //~| expected unit type `()` //~| found struct `Slice<_>` //~| expected (), found struct `Slice` _ => unreachable!() diff --git a/src/test/ui/issues/issue-16401.stderr b/src/test/ui/issues/issue-16401.stderr index e5bacc36de5e1..872066bd3f765 100644 --- a/src/test/ui/issues/issue-16401.stderr +++ b/src/test/ui/issues/issue-16401.stderr @@ -6,8 +6,8 @@ LL | match () { LL | Slice { data: data, len: len } => (), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `Slice` | - = note: expected type `()` - found struct `Slice<_>` + = note: expected unit type `()` + found struct `Slice<_>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-17033.rs b/src/test/ui/issues/issue-17033.rs index be80dce137151..c330745bc07d6 100644 --- a/src/test/ui/issues/issue-17033.rs +++ b/src/test/ui/issues/issue-17033.rs @@ -1,7 +1,7 @@ fn f<'r>(p: &'r mut fn(p: &mut ())) { (*p)(()) //~ ERROR mismatched types //~| expected mutable reference `&mut ()` - //~| found type `()` + //~| found unit type `()` //~| expected &mut (), found () } diff --git a/src/test/ui/issues/issue-17033.stderr b/src/test/ui/issues/issue-17033.stderr index c84b30d721f00..37f817c2e9b14 100644 --- a/src/test/ui/issues/issue-17033.stderr +++ b/src/test/ui/issues/issue-17033.stderr @@ -8,7 +8,7 @@ LL | (*p)(()) | help: consider mutably borrowing here: `&mut ()` | = note: expected mutable reference `&mut ()` - found type `()` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-17728.nll.stderr b/src/test/ui/issues/issue-17728.nll.stderr index 7436ebd920ee2..ef193ad85bf65 100644 --- a/src/test/ui/issues/issue-17728.nll.stderr +++ b/src/test/ui/issues/issue-17728.nll.stderr @@ -13,8 +13,8 @@ LL | | _ => None LL | | } | |_____- `match` arms have incompatible types | - = note: expected type `RoomDirection` - found type `std::option::Option<_>` + = note: expected enum `RoomDirection` + found enum `std::option::Option<_>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-19991.rs b/src/test/ui/issues/issue-19991.rs index e9094ecc01589..1d8128ffcb9e1 100644 --- a/src/test/ui/issues/issue-19991.rs +++ b/src/test/ui/issues/issue-19991.rs @@ -3,7 +3,7 @@ fn main() { if let Some(homura) = Some("madoka") { //~ ERROR missing an else clause - //~| expected type `()` + //~| expected unit type `()` //~| found type `{integer}` //~| expected (), found integer 765 diff --git a/src/test/ui/issues/issue-19991.stderr b/src/test/ui/issues/issue-19991.stderr index d9ea910adef50..c808680ce619b 100644 --- a/src/test/ui/issues/issue-19991.stderr +++ b/src/test/ui/issues/issue-19991.stderr @@ -10,8 +10,8 @@ LL | | 765 LL | | }; | |_____^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/issues/issue-22684.stderr b/src/test/ui/issues/issue-22684.stderr index 738123ec4d41b..20a0d6f410338 100644 --- a/src/test/ui/issues/issue-22684.stderr +++ b/src/test/ui/issues/issue-22684.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: () = foo::Foo.bar(); | ^^^^^^^^^^^^^^ expected (), found bool | - = note: expected type `()` - found type `bool` + = note: expected unit type `()` + found type `bool` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-27042.stderr b/src/test/ui/issues/issue-27042.stderr index 7678984a518ba..4244f36e48180 100644 --- a/src/test/ui/issues/issue-27042.stderr +++ b/src/test/ui/issues/issue-27042.stderr @@ -17,8 +17,8 @@ LL | loop { break }; | expected i32, found () | help: give it a value of the expected type: `break 42` | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error[E0308]: mismatched types --> $DIR/issue-27042.rs:8:9 @@ -28,8 +28,8 @@ LL | | LL | | while true { break }; // but here we cite the whole loop | |____________________________^ expected i32, found () | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error[E0308]: mismatched types --> $DIR/issue-27042.rs:12:9 @@ -38,8 +38,8 @@ LL | / 'c: LL | | for _ in None { break }; // but here we cite the whole loop | |_______________________________^ expected i32, found () | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error[E0308]: mismatched types --> $DIR/issue-27042.rs:15:9 @@ -48,8 +48,8 @@ LL | / 'd: LL | | while let Some(_) = None { break }; | |__________________________________________^ expected i32, found () | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/issues/issue-32323.stderr b/src/test/ui/issues/issue-32323.stderr index e7ad46a4aeff8..f0ca557e581d5 100644 --- a/src/test/ui/issues/issue-32323.stderr +++ b/src/test/ui/issues/issue-32323.stderr @@ -7,7 +7,7 @@ LL | pub fn f<'a, T: Tr<'a>>() -> >::Out {} | implicitly returns `()` as its body has no tail or `return` expression | = note: expected associated type `>::Out` - found type `()` + found unit type `()` = note: consider constraining the associated type `>::Out` to `()` or calling a method that returns `>::Out` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html diff --git a/src/test/ui/issues/issue-37026.stderr b/src/test/ui/issues/issue-37026.stderr index 239f0a181908e..00e44738742ec 100644 --- a/src/test/ui/issues/issue-37026.stderr +++ b/src/test/ui/issues/issue-37026.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let empty_struct::XEmpty2 = (); | ^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty2` | - = note: expected type `()` - found struct `empty_struct::XEmpty2` + = note: expected unit type `()` + found struct `empty_struct::XEmpty2` error[E0308]: mismatched types --> $DIR/issue-37026.rs:7:9 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let empty_struct::XEmpty6(..) = (); | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty6` | - = note: expected type `()` - found struct `empty_struct::XEmpty6` + = note: expected unit type `()` + found struct `empty_struct::XEmpty6` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-37665.stderr b/src/test/ui/issues/issue-37665.stderr index c27494699515b..e7eef47fd2910 100644 --- a/src/test/ui/issues/issue-37665.stderr +++ b/src/test/ui/issues/issue-37665.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let x: () = 0; | ^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-39970.stderr b/src/test/ui/issues/issue-39970.stderr index 8bc62dd1b84bf..7cef2e6cd4c88 100644 --- a/src/test/ui/issues/issue-39970.stderr +++ b/src/test/ui/issues/issue-39970.stderr @@ -8,7 +8,7 @@ LL | <() as Visit>::visit(); | ^^^^^^^^^^^^^^^^^^^^ expected &(), found () | = note: expected reference `&()` - found type `()` + found unit type `()` = note: required because of the requirements on the impl of `Visit` for `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-41549.stderr b/src/test/ui/issues/issue-41549.stderr index 5e102dcbf4115..c2ffc2f4ac30c 100644 --- a/src/test/ui/issues/issue-41549.stderr +++ b/src/test/ui/issues/issue-41549.stderr @@ -4,8 +4,8 @@ error[E0326]: implemented const `CONST` has an incompatible type for trait LL | const CONST: () = (); | ^^ expected u32, found () | - = note: expected type `u32` - found type `()` + = note: expected type `u32` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-4201.rs b/src/test/ui/issues/issue-4201.rs index 2f1d6d2177e40..d4ac39526dd68 100644 --- a/src/test/ui/issues/issue-4201.rs +++ b/src/test/ui/issues/issue-4201.rs @@ -3,7 +3,7 @@ fn main() { 0 } else if false { //~^ ERROR if may be missing an else clause -//~| expected type `()` +//~| expected unit type `()` //~| found type `{integer}` //~| expected (), found integer 1 diff --git a/src/test/ui/issues/issue-4201.stderr b/src/test/ui/issues/issue-4201.stderr index dd76faef5c7a6..8abb7c3c9f585 100644 --- a/src/test/ui/issues/issue-4201.stderr +++ b/src/test/ui/issues/issue-4201.stderr @@ -12,8 +12,8 @@ LL | | 1 LL | | }; | |_____^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/issues/issue-43162.stderr b/src/test/ui/issues/issue-43162.stderr index c729c05ff229e..259b47ebe7c21 100644 --- a/src/test/ui/issues/issue-43162.stderr +++ b/src/test/ui/issues/issue-43162.stderr @@ -21,8 +21,8 @@ LL | LL | break true; | - help: consider removing this semicolon | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error: aborting due to 3 previous errors diff --git a/src/test/ui/issues/issue-44023.stderr b/src/test/ui/issues/issue-44023.stderr index 258ffe558e9ba..c7b5f7b204048 100644 --- a/src/test/ui/issues/issue-44023.stderr +++ b/src/test/ui/issues/issue-44023.stderr @@ -6,8 +6,8 @@ LL | fn საჭმელად_გემრიელი_სადილი ( ) | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected type `isize` - found type `()` + = note: expected type `isize` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-46112.stderr b/src/test/ui/issues/issue-46112.stderr index 30ec6a966cebf..ea1eca7552d7b 100644 --- a/src/test/ui/issues/issue-46112.stderr +++ b/src/test/ui/issues/issue-46112.stderr @@ -7,8 +7,8 @@ LL | fn main() { test(Ok(())); } | expected enum `std::option::Option`, found () | help: try using a variant of the expected enum: `Some(())` | - = note: expected enum `std::option::Option<()>` - found type `()` + = note: expected enum `std::option::Option<()>` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-47486.stderr b/src/test/ui/issues/issue-47486.stderr index af6e3010f7958..2b49c27333068 100644 --- a/src/test/ui/issues/issue-47486.stderr +++ b/src/test/ui/issues/issue-47486.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | () < std::mem::size_of::<_>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found usize | - = note: expected type `()` - found type `usize` + = note: expected unit type `()` + found type `usize` error[E0282]: type annotations needed --> $DIR/issue-47486.rs:3:11 diff --git a/src/test/ui/issues/issue-50577.stderr b/src/test/ui/issues/issue-50577.stderr index 055a71f468dd2..bcc2fc500995f 100644 --- a/src/test/ui/issues/issue-50577.stderr +++ b/src/test/ui/issues/issue-50577.stderr @@ -31,8 +31,8 @@ LL | Drop = assert_eq!(1, 1) | expected (), found isize | found here | - = note: expected type `()` - found type `isize` + = note: expected unit type `()` + found type `isize` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) diff --git a/src/test/ui/issues/issue-50585.stderr b/src/test/ui/issues/issue-50585.stderr index 8e57c9806e3ee..d2a21c48a09fc 100644 --- a/src/test/ui/issues/issue-50585.stderr +++ b/src/test/ui/issues/issue-50585.stderr @@ -10,8 +10,8 @@ error[E0308]: mismatched types LL | |y: Vec<[(); for x in 0..2 {}]>| {}; | ^^^^^^^^^^^^^^^^ expected usize, found () | - = note: expected type `usize` - found type `()` + = note: expected type `usize` + found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-6458-4.stderr b/src/test/ui/issues/issue-6458-4.stderr index 246b53189c80b..d36297886df88 100644 --- a/src/test/ui/issues/issue-6458-4.stderr +++ b/src/test/ui/issues/issue-6458-4.stderr @@ -8,8 +8,8 @@ LL | fn foo(b: bool) -> Result { LL | Err("bar".to_string()); | - help: consider removing this semicolon | - = note: expected enum `std::result::Result` - found type `()` + = note: expected enum `std::result::Result` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/json-bom-plus-crlf-multifile.stderr b/src/test/ui/json-bom-plus-crlf-multifile.stderr index 53c9682acfeeb..5d631d576c7ac 100644 --- a/src/test/ui/json-bom-plus-crlf-multifile.stderr +++ b/src/test/ui/json-bom-plus-crlf-multifile.stderr @@ -76,7 +76,7 @@ let x: i32 = \"I am not a number!\"; // type `i32` assigned to variable `x` ``` "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` - found type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types +found unit type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types "} {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors "} diff --git a/src/test/ui/json-bom-plus-crlf.stderr b/src/test/ui/json-bom-plus-crlf.stderr index 6f2d1d0f234f7..a9c3ae4795d20 100644 --- a/src/test/ui/json-bom-plus-crlf.stderr +++ b/src/test/ui/json-bom-plus-crlf.stderr @@ -76,7 +76,7 @@ let x: i32 = \"I am not a number!\"; // type `i32` assigned to variable `x` ``` "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` - found type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:25:22: error[E0308]: mismatched types +found unit type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:25:22: error[E0308]: mismatched types "} {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors "} diff --git a/src/test/ui/liveness/liveness-closure-require-ret.stderr b/src/test/ui/liveness/liveness-closure-require-ret.stderr index e8f185a5cb27c..3885341e7b312 100644 --- a/src/test/ui/liveness/liveness-closure-require-ret.stderr +++ b/src/test/ui/liveness/liveness-closure-require-ret.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | fn main() { println!("{}", force(|| {})); } | ^^ expected isize, found () | - = note: expected type `isize` - found type `()` + = note: expected type `isize` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-forgot-ret.stderr b/src/test/ui/liveness/liveness-forgot-ret.stderr index 4baf351f7eb2d..201f90c6412e1 100644 --- a/src/test/ui/liveness/liveness-forgot-ret.stderr +++ b/src/test/ui/liveness/liveness-forgot-ret.stderr @@ -6,8 +6,8 @@ LL | fn f(a: isize) -> isize { if god_exists(a) { return 5; }; } | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected type `isize` - found type `()` + = note: expected type `isize` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-issue-2163.stderr b/src/test/ui/liveness/liveness-issue-2163.stderr index 780a2548f1f86..738811adedb29 100644 --- a/src/test/ui/liveness/liveness-issue-2163.stderr +++ b/src/test/ui/liveness/liveness-issue-2163.stderr @@ -7,8 +7,8 @@ LL | | LL | | }); | |_____^ expected bool, found () | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-missing-ret2.stderr b/src/test/ui/liveness/liveness-missing-ret2.stderr index 1f60560b45043..9825ecce403c5 100644 --- a/src/test/ui/liveness/liveness-missing-ret2.stderr +++ b/src/test/ui/liveness/liveness-missing-ret2.stderr @@ -6,8 +6,8 @@ LL | fn f() -> isize { | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected type `isize` - found type `()` + = note: expected type `isize` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr index 2497d93daa494..4255f55a4ec5f 100644 --- a/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr +++ b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr @@ -10,8 +10,8 @@ LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } } LL | test!(); | -------- in this macro invocation | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error[E0308]: mismatched types --> $DIR/liveness-return-last-stmt-semi.rs:7:19 @@ -21,8 +21,8 @@ LL | fn no_return() -> i32 {} | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error[E0308]: mismatched types --> $DIR/liveness-return-last-stmt-semi.rs:9:19 @@ -34,8 +34,8 @@ LL | fn bar(x: u32) -> u32 { LL | x * 2; | - help: consider removing this semicolon | - = note: expected type `u32` - found type `()` + = note: expected type `u32` + found unit type `()` error[E0308]: mismatched types --> $DIR/liveness-return-last-stmt-semi.rs:13:19 @@ -45,8 +45,8 @@ LL | fn baz(x: u64) -> u32 { | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected type `u32` - found type `()` + = note: expected type `u32` + found unit type `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/loops/loop-break-value.stderr b/src/test/ui/loops/loop-break-value.stderr index 6fbede9778d45..8a049ac002356 100644 --- a/src/test/ui/loops/loop-break-value.stderr +++ b/src/test/ui/loops/loop-break-value.stderr @@ -100,8 +100,8 @@ error[E0308]: mismatched types LL | let val: ! = loop { break break; }; | ^^^^^ expected !, found () | - = note: expected type `!` - found type `()` + = note: expected type `!` + found unit type `()` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:11:19 @@ -136,8 +136,8 @@ error[E0308]: mismatched types LL | break 'c 123; | ^^^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:80:15 @@ -145,8 +145,8 @@ error[E0308]: mismatched types LL | break (break, break); | ^^^^^^^^^^^^^^ expected (), found tuple | - = note: expected type `()` - found tuple `(!, !)` + = note: expected unit type `()` + found tuple `(!, !)` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:85:15 @@ -154,8 +154,8 @@ error[E0308]: mismatched types LL | break 2; | ^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:90:9 @@ -166,8 +166,8 @@ LL | break; | expected integer, found () | help: give it a value of the expected type: `break value` | - = note: expected type `{integer}` - found type `()` + = note: expected type `{integer}` + found unit type `()` error: aborting due to 16 previous errors diff --git a/src/test/ui/loops/loop-labeled-break-value.stderr b/src/test/ui/loops/loop-labeled-break-value.stderr index 8b9468cacc1f9..e34e7f4e956e2 100644 --- a/src/test/ui/loops/loop-labeled-break-value.stderr +++ b/src/test/ui/loops/loop-labeled-break-value.stderr @@ -7,8 +7,8 @@ LL | let _: i32 = loop { break }; | expected i32, found () | help: give it a value of the expected type: `break 42` | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error[E0308]: mismatched types --> $DIR/loop-labeled-break-value.rs:6:37 @@ -19,8 +19,8 @@ LL | let _: i32 = 'inner: loop { break 'inner }; | expected i32, found () | help: give it a value of the expected type: `break 'inner 42` | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error[E0308]: mismatched types --> $DIR/loop-labeled-break-value.rs:9:45 @@ -31,8 +31,8 @@ LL | let _: i32 = 'inner2: loop { loop { break 'inner2 } }; | expected i32, found () | help: give it a value of the expected type: `break 'inner2 42` | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error: aborting due to 3 previous errors diff --git a/src/test/ui/loops/loop-properly-diverging-2.stderr b/src/test/ui/loops/loop-properly-diverging-2.stderr index 3758bbf9f6f31..41027dc3ad6e4 100644 --- a/src/test/ui/loops/loop-properly-diverging-2.stderr +++ b/src/test/ui/loops/loop-properly-diverging-2.stderr @@ -7,8 +7,8 @@ LL | let x: i32 = loop { break }; | expected i32, found () | help: give it a value of the expected type: `break 42` | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/match/match-type-err-first-arm.stderr b/src/test/ui/match/match-type-err-first-arm.stderr index e0553fca683a5..8f8bb4bdcd2ca 100644 --- a/src/test/ui/match/match-type-err-first-arm.stderr +++ b/src/test/ui/match/match-type-err-first-arm.stderr @@ -62,8 +62,8 @@ LL | | LL | | }; | |_____- `match` arms have incompatible types | - = note: expected type `u32` - found type `()` + = note: expected type `u32` + found unit type `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr b/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr index 283ef8fcba7a4..99e0a466817fc 100644 --- a/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr +++ b/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _seetype: () = z; | ^ expected (), found u32 | - = note: expected type `()` - found type `u32` + = note: expected unit type `()` + found type `u32` error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:102:24 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | let _seetype: () = z; | ^ expected (), found u64 | - = note: expected type `()` - found type `u64` + = note: expected unit type `()` + found type `u64` error[E0034]: multiple applicable items in scope --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:120:15 @@ -47,8 +47,8 @@ error[E0308]: mismatched types LL | let _seetype: () = z; | ^ expected (), found u8 | - = note: expected type `()` - found type `u8` + = note: expected unit type `()` + found type `u8` error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:155:24 @@ -56,8 +56,8 @@ error[E0308]: mismatched types LL | let _seetype: () = z; | ^ expected (), found u32 | - = note: expected type `()` - found type `u32` + = note: expected unit type `()` + found type `u32` error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:172:24 @@ -65,8 +65,8 @@ error[E0308]: mismatched types LL | let _seetype: () = z; | ^ expected (), found u32 | - = note: expected type `()` - found type `u32` + = note: expected unit type `()` + found type `u32` error: aborting due to 6 previous errors diff --git a/src/test/ui/mir-unpretty.stderr b/src/test/ui/mir-unpretty.stderr index 6e5dac226692a..cb2715f554352 100644 --- a/src/test/ui/mir-unpretty.stderr +++ b/src/test/ui/mir-unpretty.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let x: () = 0; | ^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr b/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr index 3c8ba8057c55a..8bba0efc8142d 100644 --- a/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr +++ b/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | x | ^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/issue-19109.stderr b/src/test/ui/mismatched_types/issue-19109.stderr index 350dd69a1fd78..c790cc90a2cf5 100644 --- a/src/test/ui/mismatched_types/issue-19109.stderr +++ b/src/test/ui/mismatched_types/issue-19109.stderr @@ -6,8 +6,8 @@ LL | fn function(t: &mut dyn Trait) { LL | t as *mut dyn Trait | ^^^^^^^^^^^^^^^^^^^ expected (), found *-ptr | - = note: expected type `()` - found raw pointer `*mut dyn Trait` + = note: expected unit type `()` + found raw pointer `*mut dyn Trait` error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/main.stderr b/src/test/ui/mismatched_types/main.stderr index 1d53cfdd2527c..fc128fe6fc7f3 100644 --- a/src/test/ui/mismatched_types/main.stderr +++ b/src/test/ui/mismatched_types/main.stderr @@ -6,8 +6,8 @@ LL | let x: u32 = ( LL | | ); | |_____^ expected u32, found () | - = note: expected type `u32` - found type `()` + = note: expected type `u32` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/missing/missing-return.stderr b/src/test/ui/missing/missing-return.stderr index 3c8ecdcfbcbe4..8d8d6b78c197b 100644 --- a/src/test/ui/missing/missing-return.stderr +++ b/src/test/ui/missing/missing-return.stderr @@ -6,8 +6,8 @@ LL | fn f() -> isize { } | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected type `isize` - found type `()` + = note: expected type `isize` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/or-patterns/consistent-bindings.stderr b/src/test/ui/or-patterns/consistent-bindings.stderr index 7f5e670c257ce..b56aebb99d562 100644 --- a/src/test/ui/or-patterns/consistent-bindings.stderr +++ b/src/test/ui/or-patterns/consistent-bindings.stderr @@ -12,8 +12,8 @@ error[E0308]: mismatched types LL | let () = 0; | ^^ expected integer, found () | - = note: expected type `{integer}` - found type `()` + = note: expected type `{integer}` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/output-type-mismatch.stderr b/src/test/ui/output-type-mismatch.stderr index 449d312057162..051af60121bcf 100644 --- a/src/test/ui/output-type-mismatch.stderr +++ b/src/test/ui/output-type-mismatch.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | fn main() { let i: isize; i = f(); } | ^^^ expected isize, found () | - = note: expected type `isize` - found type `()` + = note: expected type `isize` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/parser/expr-as-stmt.stderr b/src/test/ui/parser/expr-as-stmt.stderr index 4dcc914f25d79..83e8880f183f2 100644 --- a/src/test/ui/parser/expr-as-stmt.stderr +++ b/src/test/ui/parser/expr-as-stmt.stderr @@ -49,8 +49,8 @@ error[E0308]: mismatched types LL | {2} + {2} | ^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:12:6 @@ -58,8 +58,8 @@ error[E0308]: mismatched types LL | {2} + 2 | ^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:18:7 @@ -67,8 +67,8 @@ error[E0308]: mismatched types LL | { 42 } + foo; | ^^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:24:7 @@ -76,8 +76,8 @@ error[E0308]: mismatched types LL | { 3 } * 3 | ^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error[E0614]: type `{integer}` cannot be dereferenced --> $DIR/expr-as-stmt.rs:24:11 diff --git a/src/test/ui/parser/issue-33413.stderr b/src/test/ui/parser/issue-33413.stderr index 7e5c348e36cea..d1e09ce16554a 100644 --- a/src/test/ui/parser/issue-33413.stderr +++ b/src/test/ui/parser/issue-33413.stderr @@ -12,8 +12,8 @@ LL | fn f(*, a: u8) -> u8 {} | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected type `u8` - found type `()` + = note: expected type `u8` + found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/issue-62881.stderr b/src/test/ui/parser/issue-62881.stderr index 3d58b6fba0baf..2905cc7370db2 100644 --- a/src/test/ui/parser/issue-62881.stderr +++ b/src/test/ui/parser/issue-62881.stderr @@ -21,8 +21,8 @@ LL | fn f() -> isize { fn f() -> isize {} pub f< | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected type `isize` - found type `()` + = note: expected type `isize` + found unit type `()` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/issue-62895.stderr b/src/test/ui/parser/issue-62895.stderr index 14869e9c8f5e6..61cb1faead124 100644 --- a/src/test/ui/parser/issue-62895.stderr +++ b/src/test/ui/parser/issue-62895.stderr @@ -41,8 +41,8 @@ LL | fn v() -> isize { | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected type `isize` - found type `()` + = note: expected type `isize` + found unit type `()` error: aborting due to 6 previous errors diff --git a/src/test/ui/parser/match-vec-invalid.stderr b/src/test/ui/parser/match-vec-invalid.stderr index 0956ac21b7f1e..2e4bf8320fb58 100644 --- a/src/test/ui/parser/match-vec-invalid.stderr +++ b/src/test/ui/parser/match-vec-invalid.stderr @@ -36,8 +36,8 @@ error[E0308]: mismatched types LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error: aborting due to 5 previous errors diff --git a/src/test/ui/parser/pat-lt-bracket-6.stderr b/src/test/ui/parser/pat-lt-bracket-6.stderr index 234e0c37723a7..d702dac81daf6 100644 --- a/src/test/ui/parser/pat-lt-bracket-6.stderr +++ b/src/test/ui/parser/pat-lt-bracket-6.stderr @@ -19,8 +19,8 @@ error[E0308]: mismatched types LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/pat-lt-bracket-7.stderr b/src/test/ui/parser/pat-lt-bracket-7.stderr index 86693ac27bd2b..77bb3b0417adb 100644 --- a/src/test/ui/parser/pat-lt-bracket-7.stderr +++ b/src/test/ui/parser/pat-lt-bracket-7.stderr @@ -10,8 +10,8 @@ error[E0308]: mismatched types LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/pat-tuple-4.stderr b/src/test/ui/parser/pat-tuple-4.stderr index af3ecce184649..7aa91ab2af476 100644 --- a/src/test/ui/parser/pat-tuple-4.stderr +++ b/src/test/ui/parser/pat-tuple-4.stderr @@ -19,8 +19,8 @@ error[E0308]: mismatched types LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/recover-for-loop-parens-around-head.stderr b/src/test/ui/parser/recover-for-loop-parens-around-head.stderr index ccabfbded8bad..f0373b0c89f19 100644 --- a/src/test/ui/parser/recover-for-loop-parens-around-head.stderr +++ b/src/test/ui/parser/recover-for-loop-parens-around-head.stderr @@ -19,8 +19,8 @@ error[E0308]: mismatched types LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/recover-from-homoglyph.stderr b/src/test/ui/parser/recover-from-homoglyph.stderr index ec7d041647a9f..d69cba7a10653 100644 --- a/src/test/ui/parser/recover-from-homoglyph.stderr +++ b/src/test/ui/parser/recover-from-homoglyph.stderr @@ -15,8 +15,8 @@ error[E0308]: mismatched types LL | let x: usize = (); | ^^ expected usize, found () | - = note: expected type `usize` - found type `()` + = note: expected type `usize` + found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/recover-missing-semi.stderr b/src/test/ui/parser/recover-missing-semi.stderr index c40918ee2bd5f..41640ac3f23a6 100644 --- a/src/test/ui/parser/recover-missing-semi.stderr +++ b/src/test/ui/parser/recover-missing-semi.stderr @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | let _: usize = () | ^^ expected usize, found () | - = note: expected type `usize` - found type `()` + = note: expected type `usize` + found unit type `()` error[E0308]: mismatched types --> $DIR/recover-missing-semi.rs:9:20 @@ -31,8 +31,8 @@ error[E0308]: mismatched types LL | let _: usize = () | ^^ expected usize, found () | - = note: expected type `usize` - found type `()` + = note: expected type `usize` + found unit type `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/pattern/pat-tuple-bad-type.stderr b/src/test/ui/pattern/pat-tuple-bad-type.stderr index 3da3bcb635f19..7a599b07f1e55 100644 --- a/src/test/ui/pattern/pat-tuple-bad-type.stderr +++ b/src/test/ui/pattern/pat-tuple-bad-type.stderr @@ -15,8 +15,8 @@ error[E0308]: mismatched types LL | (..) => {} | ^^^^ expected u8, found () | - = note: expected type `u8` - found type `()` + = note: expected type `u8` + found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/proc-macro/issue-37788.stderr b/src/test/ui/proc-macro/issue-37788.stderr index 6a75f229a0dfd..9c35115857f8c 100644 --- a/src/test/ui/proc-macro/issue-37788.stderr +++ b/src/test/ui/proc-macro/issue-37788.stderr @@ -9,8 +9,8 @@ LL | std::cell::Cell::new(0) | | | expected (), found struct `std::cell::Cell` | - = note: expected type `()` - found struct `std::cell::Cell<{integer}>` + = note: expected unit type `()` + found struct `std::cell::Cell<{integer}>` error: aborting due to previous error diff --git a/src/test/ui/proc-macro/span-preservation.stderr b/src/test/ui/proc-macro/span-preservation.stderr index f3b4f2bcd3d30..60fb975500327 100644 --- a/src/test/ui/proc-macro/span-preservation.stderr +++ b/src/test/ui/proc-macro/span-preservation.stderr @@ -49,8 +49,8 @@ LL | extern "C" fn baz() { LL | 0 | ^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error[E0308]: mismatched types --> $DIR/span-preservation.rs:49:5 diff --git a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr index 24c9a315badf6..b47e2ea3981ef 100644 --- a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr +++ b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: fn(&mut &isize, &mut &isize) = a; | ^ expected concrete lifetime, found bound lifetime parameter | - = note: expected type `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` - found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` + = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` + found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` error: aborting due to previous error diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr index 6d031e9ac3b98..85046f59da67d 100644 --- a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr +++ b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a; | ^ expected concrete lifetime, found bound lifetime parameter | - = note: expected type `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)` - found type `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}` + = note: expected fn pointer `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)` + found fn item `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr b/src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr index e1f14fc0cd919..78966048265d3 100644 --- a/src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr +++ b/src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let _: fn(&mut &isize, &mut &isize) = a; | ^ expected concrete lifetime, found bound lifetime parameter | - = note: expected type `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` - found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` + = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` + found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` error: aborting due to previous error diff --git a/src/test/ui/repeat_count.rs b/src/test/ui/repeat_count.rs index fd9c495101526..cd1b9336ac770 100644 --- a/src/test/ui/repeat_count.rs +++ b/src/test/ui/repeat_count.rs @@ -8,7 +8,7 @@ fn main() { //~^ ERROR mismatched types //~| expected usize, found () //~| expected type `usize` - //~| found type `()` + //~| found unit type `()` let c = [0; true]; //~^ ERROR mismatched types //~| expected usize, found bool diff --git a/src/test/ui/repeat_count.stderr b/src/test/ui/repeat_count.stderr index ff79a711ae1e8..056cad6127f1a 100644 --- a/src/test/ui/repeat_count.stderr +++ b/src/test/ui/repeat_count.stderr @@ -10,8 +10,8 @@ error[E0308]: mismatched types LL | let b = [0; ()]; | ^^ expected usize, found () | - = note: expected type `usize` - found type `()` + = note: expected type `usize` + found unit type `()` error[E0308]: mismatched types --> $DIR/repeat_count.rs:12:17 diff --git a/src/test/ui/return/return-type.stderr b/src/test/ui/return/return-type.stderr index feb8a95d3c8b6..40f1234710123 100644 --- a/src/test/ui/return/return-type.stderr +++ b/src/test/ui/return/return-type.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | foo(4 as usize) | ^^^^^^^^^^^^^^^ expected (), found struct `S` | - = note: expected type `()` - found struct `S` + = note: expected unit type `()` + found struct `S` help: try adding a semicolon | LL | foo(4 as usize); diff --git a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr index 41f0ca2ed5a61..b7f16a8d5bbd9 100644 --- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr +++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr @@ -584,8 +584,8 @@ LL | if x = let 0 = 0 {} | expected bool, found () | help: try comparing for equality: `x == let 0 = 0` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:59:8 @@ -772,8 +772,8 @@ LL | while x = let 0 = 0 {} | expected bool, found () | help: try comparing for equality: `x == let 0 = 0` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:123:11 @@ -959,8 +959,8 @@ LL | fn outside_if_and_while_expr() { LL | &let 0 = 0 | ^^^^^^^^^^ expected (), found &bool | - = note: expected type `()` - found reference `&bool` + = note: expected unit type `()` + found reference `&bool` error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try` --> $DIR/disallowed-positions.rs:179:17 diff --git a/src/test/ui/span/move-closure.stderr b/src/test/ui/span/move-closure.stderr index e628428436d51..f6ee7d4d44e7f 100644 --- a/src/test/ui/span/move-closure.stderr +++ b/src/test/ui/span/move-closure.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let x: () = move || (); | ^^^^^^^^^^ expected (), found closure | - = note: expected type `()` - found closure `[closure@$DIR/move-closure.rs:5:17: 5:27]` + = note: expected unit type `()` + found closure `[closure@$DIR/move-closure.rs:5:17: 5:27]` error: aborting due to previous error diff --git a/src/test/ui/specialization/specialization-default-projection.stderr b/src/test/ui/specialization/specialization-default-projection.stderr index 6ee634d4d1cba..bad7fc35edf3d 100644 --- a/src/test/ui/specialization/specialization-default-projection.stderr +++ b/src/test/ui/specialization/specialization-default-projection.stderr @@ -8,7 +8,7 @@ LL | () | ^^ expected associated type, found () | = note: expected associated type `::Assoc` - found type `()` + found unit type `()` = note: consider constraining the associated type `::Assoc` to `()` or calling a method that returns `::Assoc` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html @@ -23,7 +23,7 @@ LL | generic::<()>() | | | expected (), found associated type | - = note: expected type `()` + = note: expected unit type `()` found associated type `<() as Foo>::Assoc` = note: consider constraining the associated type `<() as Foo>::Assoc` to `()` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html diff --git a/src/test/ui/struct-literal-variant-in-if.stderr b/src/test/ui/struct-literal-variant-in-if.stderr index bfc8b24e8ac49..8c7475e622a21 100644 --- a/src/test/ui/struct-literal-variant-in-if.stderr +++ b/src/test/ui/struct-literal-variant-in-if.stderr @@ -59,8 +59,8 @@ LL | if x == E::V { field } {} | | expected (), found bool | expected this to be `()` | - = note: expected type `()` - found type `bool` + = note: expected unit type `()` + found type `bool` error[E0308]: mismatched types --> $DIR/struct-literal-variant-in-if.rs:21:20 @@ -68,8 +68,8 @@ error[E0308]: mismatched types LL | let y: usize = (); | ^^ expected usize, found () | - = note: expected type `usize` - found type `()` + = note: expected type `usize` + found unit type `()` error: aborting due to 7 previous errors diff --git a/src/test/ui/substs-ppaux.normal.stderr b/src/test/ui/substs-ppaux.normal.stderr index 6c732ddceefe6..2e23e7220b760 100644 --- a/src/test/ui/substs-ppaux.normal.stderr +++ b/src/test/ui/substs-ppaux.normal.stderr @@ -10,8 +10,8 @@ LL | let x: () = >::bar::<'static, char>; | expected (), found fn item | help: use parentheses to call this function: `>::bar::<'static, char>()` | - = note: expected type `()` - found fn item `fn() {>::bar::<'static, char>}` + = note: expected unit type `()` + found fn item `fn() {>::bar::<'static, char>}` error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:25:17 @@ -25,8 +25,8 @@ LL | let x: () = >::bar::<'static, char>; | expected (), found fn item | help: use parentheses to call this function: `>::bar::<'static, char>()` | - = note: expected type `()` - found fn item `fn() {>::bar::<'static, char>}` + = note: expected unit type `()` + found fn item `fn() {>::bar::<'static, char>}` error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:33:17 @@ -40,8 +40,8 @@ LL | let x: () = >::baz; | expected (), found fn item | help: use parentheses to call this function: `>::baz()` | - = note: expected type `()` - found fn item `fn() {>::baz}` + = note: expected unit type `()` + found fn item `fn() {>::baz}` error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:41:17 @@ -55,8 +55,8 @@ LL | let x: () = foo::<'static>; | expected (), found fn item | help: use parentheses to call this function: `foo::<'static>()` | - = note: expected type `()` - found fn item `fn() {foo::<'static>}` + = note: expected unit type `()` + found fn item `fn() {foo::<'static>}` error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/substs-ppaux.rs:49:5 diff --git a/src/test/ui/substs-ppaux.rs b/src/test/ui/substs-ppaux.rs index b5b4740603a47..66cd94d7a1b37 100644 --- a/src/test/ui/substs-ppaux.rs +++ b/src/test/ui/substs-ppaux.rs @@ -15,35 +15,35 @@ fn main() {} fn foo<'z>() where &'z (): Sized { let x: () = >::bar::<'static, char>; //[verbose]~^ ERROR mismatched types - //[verbose]~| expected type `()` + //[verbose]~| expected unit type `()` //[verbose]~| found fn item `fn() {>::bar::}` //[normal]~^^^^ ERROR mismatched types - //[normal]~| expected type `()` + //[normal]~| expected unit type `()` //[normal]~| found fn item `fn() {>::bar::<'static, char>}` let x: () = >::bar::<'static, char>; //[verbose]~^ ERROR mismatched types - //[verbose]~| expected type `()` + //[verbose]~| expected unit type `()` //[verbose]~| found fn item `fn() {>::bar::}` //[normal]~^^^^ ERROR mismatched types - //[normal]~| expected type `()` + //[normal]~| expected unit type `()` //[normal]~| found fn item `fn() {>::bar::<'static, char>}` let x: () = >::baz; //[verbose]~^ ERROR mismatched types - //[verbose]~| expected type `()` + //[verbose]~| expected unit type `()` //[verbose]~| found fn item `fn() {>::baz}` //[normal]~^^^^ ERROR mismatched types - //[normal]~| expected type `()` + //[normal]~| expected unit type `()` //[normal]~| found fn item `fn() {>::baz}` let x: () = foo::<'static>; //[verbose]~^ ERROR mismatched types - //[verbose]~| expected type `()` + //[verbose]~| expected unit type `()` //[verbose]~| found fn item `fn() {foo::}` //[normal]~^^^^ ERROR mismatched types - //[normal]~| expected type `()` + //[normal]~| expected unit type `()` //[normal]~| found fn item `fn() {foo::<'static>}` >::bar; diff --git a/src/test/ui/substs-ppaux.verbose.stderr b/src/test/ui/substs-ppaux.verbose.stderr index b2f647cac24b3..0d26dcc4c1767 100644 --- a/src/test/ui/substs-ppaux.verbose.stderr +++ b/src/test/ui/substs-ppaux.verbose.stderr @@ -10,8 +10,8 @@ LL | let x: () = >::bar::<'static, char>; | expected (), found fn item | help: use parentheses to call this function: `>::bar::<'static, char>()` | - = note: expected type `()` - found fn item `fn() {>::bar::}` + = note: expected unit type `()` + found fn item `fn() {>::bar::}` error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:25:17 @@ -25,8 +25,8 @@ LL | let x: () = >::bar::<'static, char>; | expected (), found fn item | help: use parentheses to call this function: `>::bar::<'static, char>()` | - = note: expected type `()` - found fn item `fn() {>::bar::}` + = note: expected unit type `()` + found fn item `fn() {>::bar::}` error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:33:17 @@ -40,8 +40,8 @@ LL | let x: () = >::baz; | expected (), found fn item | help: use parentheses to call this function: `>::baz()` | - = note: expected type `()` - found fn item `fn() {>::baz}` + = note: expected unit type `()` + found fn item `fn() {>::baz}` error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:41:17 @@ -55,8 +55,8 @@ LL | let x: () = foo::<'static>; | expected (), found fn item | help: use parentheses to call this function: `foo::<'static>()` | - = note: expected type `()` - found fn item `fn() {foo::}` + = note: expected unit type `()` + found fn item `fn() {foo::}` error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/substs-ppaux.rs:49:5 diff --git a/src/test/ui/suggestions/match-needing-semi.stderr b/src/test/ui/suggestions/match-needing-semi.stderr index 988945817c2ee..eccd9d01fec5e 100644 --- a/src/test/ui/suggestions/match-needing-semi.stderr +++ b/src/test/ui/suggestions/match-needing-semi.stderr @@ -13,8 +13,8 @@ LL | | } | |_____| | expected this to be `()` | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error[E0308]: mismatched types --> $DIR/match-needing-semi.rs:12:5 @@ -28,8 +28,8 @@ LL | | } | |_____| | expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error: aborting due to 2 previous errors diff --git a/src/test/ui/suppressed-error.rs b/src/test/ui/suppressed-error.rs index 7bb704367f30b..65da1ccd9758f 100644 --- a/src/test/ui/suppressed-error.rs +++ b/src/test/ui/suppressed-error.rs @@ -1,7 +1,7 @@ fn main() { let (x, y) = (); //~^ ERROR mismatched types -//~| expected type `()` +//~| expected unit type `()` //~| found tuple `(_, _)` //~| expected (), found tuple return x; diff --git a/src/test/ui/suppressed-error.stderr b/src/test/ui/suppressed-error.stderr index 0d0ca4d5f73a4..994011f3f0ea1 100644 --- a/src/test/ui/suppressed-error.stderr +++ b/src/test/ui/suppressed-error.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | let (x, y) = (); | ^^^^^^ expected (), found tuple | - = note: expected type `()` - found tuple `(_, _)` + = note: expected unit type `()` + found tuple `(_, _)` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr b/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr index bf1699f5cabbb..fca72817d651f 100644 --- a/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr +++ b/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | ...; let _: usize = 14; let _: usize = 15; let _: () = 42; let _: usize = 0; let _: usize = 1; let _: usize = 2; let _: usize = 3; let _:... | ^^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr b/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr index b56b1948d9e07..e1b73104521a8 100644 --- a/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr +++ b/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | ...♯♰♱♲♳♴♵♶♷♸♹♺♻♼♽♾♿⚀⚁⚂⚃⚄⚅⚆⚈⚉4"; let _: () = 42; let _: &str = "🦀☀☁☂☃☄★☆☇☈☉☊☋☌☍☎☏☐☑☒☓ ☖☗☘☙☚☛☜☝☞☟☠☡☢☣☤☥☦☧☨☩☪☫☬☭☮☯☰☱☲☳☴☵☶☷☸☹☺☻☼☽☾☿♀♁♂♃♄♅♆... | ^^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/non-whitespace-trimming.stderr b/src/test/ui/terminal-width/non-whitespace-trimming.stderr index 622713eb5f6fc..72b1502fbf23e 100644 --- a/src/test/ui/terminal-width/non-whitespace-trimming.stderr +++ b/src/test/ui/terminal-width/non-whitespace-trimming.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | ...) = (); let _: () = (); let _: () = (); let _: () = 42; let _: () = (); let _: () = (); let _: () = (); let _: () = (); let _: () = ()... | ^^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/whitespace-trimming-2.stderr b/src/test/ui/terminal-width/whitespace-trimming-2.stderr index 38df5a9e9a01f..dae00b902dcf8 100644 --- a/src/test/ui/terminal-width/whitespace-trimming-2.stderr +++ b/src/test/ui/terminal-width/whitespace-trimming-2.stderr @@ -6,8 +6,8 @@ LL | ...-> usize { LL | ... () | ^^ expected usize, found () | - = note: expected type `usize` - found type `()` + = note: expected type `usize` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/whitespace-trimming.stderr b/src/test/ui/terminal-width/whitespace-trimming.stderr index 45a804b9f6a46..4a1f8f6f84669 100644 --- a/src/test/ui/terminal-width/whitespace-trimming.stderr +++ b/src/test/ui/terminal-width/whitespace-trimming.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | ... let _: () = 42; | ^^ expected (), found integer | - = note: expected type `()` - found type `{integer}` + = note: expected unit type `()` + found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/try-block/try-block-bad-type.stderr b/src/test/ui/try-block/try-block-bad-type.stderr index ecef3b5353f4e..722b7a3b60a63 100644 --- a/src/test/ui/try-block/try-block-bad-type.stderr +++ b/src/test/ui/try-block/try-block-bad-type.stderr @@ -28,8 +28,8 @@ error[E0271]: type mismatch resolving ` as std::op LL | let res: Result = try { }; | ^ expected i32, found () | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error[E0277]: the trait bound `(): std::ops::Try` is not satisfied --> $DIR/try-block-bad-type.rs:17:23 diff --git a/src/test/ui/try-block/try-block-type-error.stderr b/src/test/ui/try-block/try-block-type-error.stderr index 0cbd737debde5..0dd81d8e152fe 100644 --- a/src/test/ui/try-block/try-block-type-error.stderr +++ b/src/test/ui/try-block/try-block-type-error.stderr @@ -16,8 +16,8 @@ error[E0271]: type mismatch resolving ` as std::ops::Tr LL | }; | ^ expected i32, found () | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr index e158224d89a0e..bbe152d69d755 100644 --- a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr +++ b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr @@ -8,7 +8,7 @@ LL | Self::TSVariant(()); | ^^ expected type parameter `T`, found () | = note: expected type parameter `T` - found type `()` + found unit type `()` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters @@ -34,7 +34,7 @@ LL | Self::<()>::TSVariant(()); | ^^ expected type parameter `T`, found () | = note: expected type parameter `T` - found type `()` + found unit type `()` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters @@ -60,7 +60,7 @@ LL | Self::SVariant { v: () }; | ^^ expected type parameter `T`, found () | = note: expected type parameter `T` - found type `()` + found unit type `()` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters @@ -80,7 +80,7 @@ LL | Self::SVariant::<()> { v: () }; | ^^ expected type parameter `T`, found () | = note: expected type parameter `T` - found type `()` + found unit type `()` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters @@ -100,7 +100,7 @@ LL | Self::<()>::SVariant { v: () }; | ^^ expected type parameter `T`, found () | = note: expected type parameter `T` - found type `()` + found unit type `()` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters @@ -126,7 +126,7 @@ LL | Self::<()>::SVariant::<()> { v: () }; | ^^ expected type parameter `T`, found () | = note: expected type parameter `T` - found type `()` + found unit type `()` = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr index b4ecf81ad8827..7e744925a7ce2 100644 --- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr @@ -10,8 +10,8 @@ error[E0308]: mismatched types LL | let z: i32 = x; | ^ expected i32, found opaque type | - = note: expected type `i32` - found type `WrongGeneric::<&{integer}>` + = note: expected type `i32` + found opaque type `WrongGeneric::<&{integer}>` error: aborting due to 2 previous errors diff --git a/src/test/ui/type-alias-impl-trait/issue-63279.stderr b/src/test/ui/type-alias-impl-trait/issue-63279.stderr index 7232bae93d248..bb5f1d3bbc97b 100644 --- a/src/test/ui/type-alias-impl-trait/issue-63279.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-63279.stderr @@ -5,7 +5,7 @@ LL | type Closure = impl FnOnce(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found () | = note: expected opaque type `Closure` - found type `()` + found unit type `()` = note: the return type of a function must have a statically known size error: aborting due to previous error diff --git a/src/test/ui/type/type-check/assignment-expected-bool.stderr b/src/test/ui/type/type-check/assignment-expected-bool.stderr index b636a71f3afe2..c6b42afa513b4 100644 --- a/src/test/ui/type/type-check/assignment-expected-bool.stderr +++ b/src/test/ui/type/type-check/assignment-expected-bool.stderr @@ -7,8 +7,8 @@ LL | let _: bool = 0 = 0; | expected bool, found () | help: try comparing for equality: `0 == 0` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:9:14 @@ -19,8 +19,8 @@ LL | 0 => 0 = 0, | expected bool, found () | help: try comparing for equality: `0 == 0` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:10:14 @@ -31,8 +31,8 @@ LL | _ => 0 = 0, | expected bool, found () | help: try comparing for equality: `0 == 0` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:14:17 @@ -43,8 +43,8 @@ LL | true => 0 = 0, | expected bool, found () | help: try comparing for equality: `0 == 0` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:18:8 @@ -55,8 +55,8 @@ LL | if 0 = 0 {} | expected bool, found () | help: try comparing for equality: `0 == 0` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:20:24 @@ -67,8 +67,8 @@ LL | let _: bool = if { 0 = 0 } { | expected bool, found () | help: try comparing for equality: `0 == 0` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:21:9 @@ -79,8 +79,8 @@ LL | 0 = 0 | expected bool, found () | help: try comparing for equality: `0 == 0` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:23:9 @@ -91,8 +91,8 @@ LL | 0 = 0 | expected bool, found () | help: try comparing for equality: `0 == 0` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:26:13 @@ -103,8 +103,8 @@ LL | let _ = (0 = 0) | expected bool, found () | help: try comparing for equality: `0 == 0` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:27:14 @@ -115,8 +115,8 @@ LL | && { 0 = 0 } | expected bool, found () | help: try comparing for equality: `0 == 0` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:28:12 @@ -127,8 +127,8 @@ LL | || (0 = 0); | expected bool, found () | help: try comparing for equality: `0 == 0` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0070]: invalid left-hand side expression --> $DIR/assignment-expected-bool.rs:31:20 @@ -142,8 +142,8 @@ error[E0308]: mismatched types LL | let _: usize = 0 = 0; | ^^^^^ expected usize, found () | - = note: expected type `usize` - found type `()` + = note: expected type `usize` + found unit type `()` error: aborting due to 13 previous errors diff --git a/src/test/ui/type/type-check/assignment-in-if.stderr b/src/test/ui/type/type-check/assignment-in-if.stderr index 87b8d17c21bcc..05280aab2ddfb 100644 --- a/src/test/ui/type/type-check/assignment-in-if.stderr +++ b/src/test/ui/type/type-check/assignment-in-if.stderr @@ -7,8 +7,8 @@ LL | if x = x { | expected bool, found () | help: try comparing for equality: `x == x` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:20:8 @@ -19,8 +19,8 @@ LL | if (x = x) { | expected bool, found () | help: try comparing for equality: `x == x` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:25:8 @@ -31,8 +31,8 @@ LL | if y = (Foo { foo: x }) { | expected bool, found () | help: try comparing for equality: `y == (Foo { foo: x })` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:30:8 @@ -43,8 +43,8 @@ LL | if 3 = x { | expected bool, found () | help: try comparing for equality: `3 == x` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:36:13 @@ -55,8 +55,8 @@ LL | x = 4 | expected bool, found () | help: try comparing for equality: `x == 4` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:38:13 @@ -67,8 +67,8 @@ LL | x = 5 | expected bool, found () | help: try comparing for equality: `x == 5` | - = note: expected type `bool` - found type `()` + = note: expected type `bool` + found unit type `()` error: aborting due to 6 previous errors diff --git a/src/test/ui/type/type-error-break-tail.stderr b/src/test/ui/type/type-error-break-tail.stderr index e5297d9a596d8..47416c4f911f5 100644 --- a/src/test/ui/type/type-error-break-tail.stderr +++ b/src/test/ui/type/type-error-break-tail.stderr @@ -10,8 +10,8 @@ LL | if false { break; } | expected i32, found () | help: give it a value of the expected type: `break 42` | - = note: expected type `i32` - found type `()` + = note: expected type `i32` + found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr b/src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr index d155744836eaf..aca9c3f558a7b 100644 --- a/src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr +++ b/src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr @@ -6,8 +6,8 @@ LL | fn ice(x: Box>) { LL | *x | ^^ expected (), found trait std::iter::Iterator | - = note: expected type `()` - found trait `(dyn std::iter::Iterator + 'static)` + = note: expected unit type `()` + found trait object `(dyn std::iter::Iterator + 'static)` error: aborting due to previous error diff --git a/src/test/ui/variance/variance-contravariant-arg-object.stderr b/src/test/ui/variance/variance-contravariant-arg-object.stderr index 67ce9bc134672..a512a60aa42d9 100644 --- a/src/test/ui/variance/variance-contravariant-arg-object.stderr +++ b/src/test/ui/variance/variance-contravariant-arg-object.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected trait `dyn Get<&'min i32>` - found trait `dyn Get<&'max i32>` + = note: expected trait object `dyn Get<&'min i32>` + found trait object `dyn Get<&'max i32>` note: the lifetime `'min` as defined on the function body at 10:21... --> $DIR/variance-contravariant-arg-object.rs:10:21 | @@ -23,8 +23,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected trait `dyn Get<&'max i32>` - found trait `dyn Get<&'min i32>` + = note: expected trait object `dyn Get<&'max i32>` + found trait object `dyn Get<&'min i32>` note: the lifetime `'min` as defined on the function body at 17:21... --> $DIR/variance-contravariant-arg-object.rs:17:21 | diff --git a/src/test/ui/variance/variance-covariant-arg-object.stderr b/src/test/ui/variance/variance-covariant-arg-object.stderr index f66c0f20ba154..75b6d588c1593 100644 --- a/src/test/ui/variance/variance-covariant-arg-object.stderr +++ b/src/test/ui/variance/variance-covariant-arg-object.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected trait `dyn Get<&'min i32>` - found trait `dyn Get<&'max i32>` + = note: expected trait object `dyn Get<&'min i32>` + found trait object `dyn Get<&'max i32>` note: the lifetime `'min` as defined on the function body at 10:21... --> $DIR/variance-covariant-arg-object.rs:10:21 | @@ -23,8 +23,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected trait `dyn Get<&'max i32>` - found trait `dyn Get<&'min i32>` + = note: expected trait object `dyn Get<&'max i32>` + found trait object `dyn Get<&'min i32>` note: the lifetime `'min` as defined on the function body at 18:21... --> $DIR/variance-covariant-arg-object.rs:18:21 | diff --git a/src/test/ui/variance/variance-invariant-arg-object.stderr b/src/test/ui/variance/variance-invariant-arg-object.stderr index 8ae7240b2827e..13ee9b9da3c98 100644 --- a/src/test/ui/variance/variance-invariant-arg-object.stderr +++ b/src/test/ui/variance/variance-invariant-arg-object.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected trait `dyn Get<&'min i32>` - found trait `dyn Get<&'max i32>` + = note: expected trait object `dyn Get<&'min i32>` + found trait object `dyn Get<&'max i32>` note: the lifetime `'min` as defined on the function body at 7:21... --> $DIR/variance-invariant-arg-object.rs:7:21 | @@ -23,8 +23,8 @@ error[E0308]: mismatched types LL | v | ^ lifetime mismatch | - = note: expected trait `dyn Get<&'max i32>` - found trait `dyn Get<&'min i32>` + = note: expected trait object `dyn Get<&'max i32>` + found trait object `dyn Get<&'min i32>` note: the lifetime `'min` as defined on the function body at 14:21... --> $DIR/variance-invariant-arg-object.rs:14:21 | From 94c642546497dd4c04609bd6dbe7631fb56df1fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Thu, 14 Nov 2019 23:45:30 -0800 Subject: [PATCH 3/6] Remove E0308 note when primary label has all info --- src/librustc/infer/error_reporting/mod.rs | 49 ++++++++----- src/librustc/ty/error.rs | 71 ++++++++++++++----- src/librustc/ty/mod.rs | 33 ++++++--- .../failed-doctest-missing-codes.stdout | 3 - src/test/ui/arg-type-mismatch.stderr | 3 - src/test/ui/array-not-vector.rs | 4 +- src/test/ui/array-not-vector.stderr | 9 +-- ...ssociated-const-generic-obligations.stderr | 2 +- ...ted-type-projection-from-supertrait.stderr | 12 ---- ...nding-to-type-defined-in-supertrait.stderr | 6 -- .../associated-types-eq-3.stderr | 5 -- ...sociated-types-overridden-binding-2.stderr | 2 - .../ui/associated-types/issue-44153.stderr | 2 - ...point-at-type-on-obligation-failure.stderr | 3 - ...block-control-flow-static-semantics.stderr | 10 --- src/test/ui/bad/bad-const-type.rs | 2 - src/test/ui/bad/bad-const-type.stderr | 3 - src/test/ui/binop/binop-logic-int.stderr | 6 -- .../ui/blind/blind-item-block-middle.stderr | 3 - .../block-expression-remove-semicolon.stderr | 3 - .../block-must-not-have-result-do.stderr | 3 - .../block-must-not-have-result-res.stderr | 3 - .../block-must-not-have-result-while.rs | 2 - .../block-must-not-have-result-while.stderr | 3 - .../consider-removing-last-semi.stderr | 6 -- src/test/ui/block-result/issue-11714.stderr | 3 - src/test/ui/block-result/issue-13428.stderr | 6 -- src/test/ui/block-result/issue-13624.rs | 4 -- src/test/ui/block-result/issue-13624.stderr | 8 +-- src/test/ui/block-result/issue-22645.stderr | 3 - .../unexpected-return-on-unit.stderr | 2 - src/test/ui/chalkify/type_inference.stderr | 3 - src/test/ui/codemap_tests/tab.stderr | 5 +- .../coerce-expect-unsized-ascribed.stderr | 14 ++-- ...coercion-missing-tail-expected-type.stderr | 3 - src/test/ui/coercion/coercion-slice.rs | 3 +- src/test/ui/coercion/coercion-slice.stderr | 5 +- ...const-argument-cross-crate-mismatch.stderr | 6 -- .../ui/consts/const-array-oob-arith.stderr | 6 -- .../ui/consts/const-eval/const-eval-span.rs | 1 - .../consts/const-eval/const-eval-span.stderr | 3 - .../ui/consts/const-integer-bool-ops.stderr | 24 ------- src/test/ui/conversion-methods.stderr | 15 +--- src/test/ui/deref-suggestion.stderr | 35 +-------- src/test/ui/did_you_mean/issue-42764.stderr | 3 - ...xpected-float-found-integer-literal.stderr | 15 ---- src/test/ui/diverging-fn-tail-35849.stderr | 2 +- src/test/ui/dst/dst-bad-coerce1.stderr | 4 +- src/test/ui/dst/dst-bad-coerce4.rs | 4 +- src/test/ui/dst/dst-bad-coerce4.stderr | 4 +- src/test/ui/error-codes/E0070.stderr | 3 - src/test/ui/error-codes/E0271.stderr | 5 +- src/test/ui/estr-subtyping.stderr | 3 - ...loat-literal-inference-restrictions.stderr | 3 - .../fully-qualified-type-name2.rs | 2 - .../fully-qualified-type-name2.stderr | 3 - src/test/ui/hrtb/issue-62203-hrtb-ice.stderr | 2 - src/test/ui/if-else-type-mismatch.stderr | 24 ------- src/test/ui/if/if-branch-types.stderr | 3 - src/test/ui/if/if-let-arm-types.rs | 1 - src/test/ui/if/if-let-arm-types.stderr | 3 - src/test/ui/if/if-no-match-bindings.stderr | 24 ------- .../ui/if/if-without-else-as-fn-expr.stderr | 12 ---- src/test/ui/if/if-without-else-result.rs | 2 - src/test/ui/if/if-without-else-result.stderr | 2 - src/test/ui/impl-trait/equality.stderr | 3 - .../ui/include-macros/mismatched-types.stderr | 4 +- .../ui/integral-variable-unification-error.rs | 2 - ...integral-variable-unification-error.stderr | 3 - src/test/ui/issues/issue-11319.rs | 1 - src/test/ui/issues/issue-11319.stderr | 3 - src/test/ui/issues/issue-12997-2.stderr | 5 +- src/test/ui/issues/issue-13407.stderr | 3 - src/test/ui/issues/issue-13446.stderr | 2 +- src/test/ui/issues/issue-14091.stderr | 3 - src/test/ui/issues/issue-14541.rs | 2 - src/test/ui/issues/issue-14541.stderr | 3 - src/test/ui/issues/issue-15783.rs | 2 +- src/test/ui/issues/issue-15783.stderr | 2 +- src/test/ui/issues/issue-15896.rs | 2 - src/test/ui/issues/issue-15896.stderr | 3 - src/test/ui/issues/issue-17033.rs | 2 - src/test/ui/issues/issue-17033.stderr | 3 - src/test/ui/issues/issue-19991.rs | 2 - src/test/ui/issues/issue-19991.stderr | 4 -- src/test/ui/issues/issue-20225.rs | 3 - src/test/ui/issues/issue-20225.stderr | 10 +-- src/test/ui/issues/issue-22684.stderr | 3 - src/test/ui/issues/issue-23589.stderr | 3 - src/test/ui/issues/issue-27008.rs | 2 - src/test/ui/issues/issue-27008.stderr | 3 - src/test/ui/issues/issue-27042.stderr | 12 ---- src/test/ui/issues/issue-29084.rs | 2 - src/test/ui/issues/issue-29084.stderr | 3 - src/test/ui/issues/issue-30225.stderr | 3 - src/test/ui/issues/issue-33504.stderr | 3 - src/test/ui/issues/issue-37026.stderr | 6 -- src/test/ui/issues/issue-37665.stderr | 3 - src/test/ui/issues/issue-39970.stderr | 2 - src/test/ui/issues/issue-41549.stderr | 3 - src/test/ui/issues/issue-41742.stderr | 5 +- src/test/ui/issues/issue-4201.rs | 2 - src/test/ui/issues/issue-4201.stderr | 4 -- src/test/ui/issues/issue-43162.stderr | 3 - .../issues/issue-43420-no-over-suggest.stderr | 2 +- src/test/ui/issues/issue-44023.stderr | 3 - src/test/ui/issues/issue-4517.rs | 4 +- src/test/ui/issues/issue-4517.stderr | 5 +- src/test/ui/issues/issue-46302.stderr | 3 - ...-consider-borrowing-cast-or-binexpr.stderr | 6 -- src/test/ui/issues/issue-47486.stderr | 3 - src/test/ui/issues/issue-48364.stderr | 2 +- src/test/ui/issues/issue-50577.stderr | 2 - src/test/ui/issues/issue-50585.stderr | 3 - src/test/ui/issues/issue-53348.rs | 1 - src/test/ui/issues/issue-53348.stderr | 3 - src/test/ui/issues/issue-53692.stderr | 3 - src/test/ui/issues/issue-56943.stderr | 3 - src/test/ui/issues/issue-61106.stderr | 3 - src/test/ui/issues/issue-61882.stderr | 3 - src/test/ui/issues/issue-7061.stderr | 2 +- .../ui/json-bom-plus-crlf-multifile.stderr | 12 ++-- src/test/ui/json-bom-plus-crlf.stderr | 12 ++-- .../keyword-false-as-identifier.stderr | 3 - .../keyword/keyword-true-as-identifier.stderr | 3 - .../liveness-closure-require-ret.stderr | 3 - .../ui/liveness/liveness-forgot-ret.stderr | 3 - .../ui/liveness/liveness-issue-2163.stderr | 3 - .../ui/liveness/liveness-missing-ret2.stderr | 3 - .../liveness-return-last-stmt-semi.stderr | 12 ---- src/test/ui/loops/loop-break-value.stderr | 22 +----- .../ui/loops/loop-labeled-break-value.stderr | 9 --- .../ui/loops/loop-properly-diverging-2.stderr | 3 - .../match/match-arm-resolving-to-never.stderr | 4 +- src/test/ui/match/match-range-fail.rs | 2 - src/test/ui/match/match-range-fail.stderr | 3 - src/test/ui/match/match-struct.rs | 2 - src/test/ui/match/match-struct.stderr | 3 - src/test/ui/match/match-tag-nullary.stderr | 3 - src/test/ui/match/match-tag-unary.stderr | 3 - src/test/ui/match/match-type-err-first-arm.rs | 3 - .../ui/match/match-type-err-first-arm.stderr | 18 ++--- ...e-trait-object-with-separate-params.stderr | 15 ---- src/test/ui/methods/method-self-arg-1.rs | 2 - src/test/ui/methods/method-self-arg-1.stderr | 5 +- src/test/ui/mir-unpretty.stderr | 3 - src/test/ui/mismatched_types/E0409.stderr | 3 - src/test/ui/mismatched_types/abridged.stderr | 6 -- .../for-loop-has-unit-body.stderr | 3 - src/test/ui/mismatched_types/main.stderr | 3 - .../overloaded-calls-bad.stderr | 5 +- src/test/ui/missing/missing-return.stderr | 3 - .../call-fn-never-arg-wrong-type.stderr | 2 +- .../never_type/never-assign-wrong-type.stderr | 2 +- .../ui/or-patterns/consistent-bindings.stderr | 3 - .../issue-64879-trailing-before-guard.stderr | 3 - .../ui/or-patterns/or-pattern-mismatch.stderr | 3 - .../or-patterns-syntactic-fail.stderr | 3 - src/test/ui/output-type-mismatch.stderr | 3 - src/test/ui/parser/expr-as-stmt.stderr | 12 ---- src/test/ui/parser/fn-arg-doc-comment.rs | 9 +-- src/test/ui/parser/fn-arg-doc-comment.stderr | 17 ++--- src/test/ui/parser/issue-33413.stderr | 3 - src/test/ui/parser/issue-62881.stderr | 3 - src/test/ui/parser/issue-62895.stderr | 3 - .../ui/parser/lex-bad-char-literals-6.stderr | 5 +- src/test/ui/parser/match-vec-invalid.stderr | 3 - src/test/ui/parser/numeric-lifetime.stderr | 5 +- src/test/ui/parser/pat-lt-bracket-6.stderr | 3 - src/test/ui/parser/pat-lt-bracket-7.stderr | 3 - src/test/ui/parser/pat-tuple-4.stderr | 3 - ...recover-for-loop-parens-around-head.stderr | 3 - .../ui/parser/recover-from-homoglyph.stderr | 3 - .../ui/parser/recover-missing-semi.stderr | 6 -- src/test/ui/parser/recover-range-pats.stderr | 36 ---------- src/test/ui/parser/recover-tuple.stderr | 5 +- ...quire-parens-for-chained-comparison.stderr | 6 -- src/test/ui/pattern/pat-tuple-bad-type.stderr | 3 - src/test/ui/pattern/pattern-error-continue.rs | 2 - .../ui/pattern/pattern-error-continue.stderr | 7 +- ...type-err-cause-on-impl-trait-return.stderr | 21 ------ .../attribute-spans-preserved.stderr | 10 +-- .../ui/proc-macro/attribute-with-error.stderr | 20 ++---- .../ui/proc-macro/nested-item-spans.stderr | 10 +-- .../ui/proc-macro/span-preservation.stderr | 8 +-- src/test/ui/repeat_count.rs | 10 +-- src/test/ui/repeat_count.stderr | 26 ++----- .../resolve-inconsistent-binding-mode.stderr | 6 -- .../resolve/resolve-inconsistent-names.stderr | 3 - .../ui/return/return-from-diverging.stderr | 2 +- .../const.stderr | 3 - .../rfc-2005-default-binding-mode/lit.stderr | 2 +- .../uninhabited/coercions.stderr | 12 ---- .../uninhabited/coercions_same_crate.stderr | 12 ---- .../disallowed-positions.stderr | 21 ------ src/test/ui/span/coerce-suggestions.stderr | 10 +-- src/test/ui/span/issue-33884.stderr | 2 - src/test/ui/span/issue-34264.stderr | 5 +- src/test/ui/span/issue-39018.stderr | 3 - src/test/ui/str/str-array-assignment.stderr | 9 --- src/test/ui/str/str-lit-type-mismatch.stderr | 6 +- .../ui/struct-literal-variant-in-if.stderr | 6 -- .../ui/structs/struct-base-wrong-type.stderr | 12 ---- ...structure-constructor-type-mismatch.stderr | 24 ------- src/test/ui/suggestions/as-ref.stderr | 12 ---- ...gest-deref-inside-macro-issue-58298.stderr | 2 - src/test/ui/suggestions/format-borrow.stderr | 10 +-- src/test/ui/suggestions/issue-52820.stderr | 6 -- src/test/ui/suggestions/issue-59819.stderr | 9 --- .../ui/suggestions/match-needing-semi.stderr | 6 -- ...ecover-from-semicolon-trailing-item.stderr | 11 +-- src/test/ui/switched-expectations.stderr | 3 - .../non-whitespace-trimming-2.stderr | 3 - .../non-whitespace-trimming-unicode.stderr | 3 - .../non-whitespace-trimming.stderr | 3 - .../whitespace-trimming-2.stderr | 3 - .../terminal-width/whitespace-trimming.stderr | 3 - src/test/ui/terr-in-field.rs | 2 - src/test/ui/terr-in-field.stderr | 3 - ...traits-assoc-type-in-supertrait-bad.stderr | 3 - .../ui/try-block/try-block-bad-type.stderr | 6 -- .../ui/try-block/try-block-type-error.stderr | 6 -- ...priority-higher-than-other-inherent.stderr | 3 - .../never_reveal_concrete_type.stderr | 2 +- ...o_revealing_outside_defining_module.stderr | 2 +- .../ui/type/type-ascription-precedence.stderr | 15 ---- .../ui/type/type-ascription-soundness.stderr | 8 +-- .../assignment-expected-bool.stderr | 36 ---------- .../type/type-check/assignment-in-if.stderr | 18 ----- src/test/ui/type/type-error-break-tail.stderr | 3 - src/test/ui/type/type-mismatch-multiple.rs | 2 - .../ui/type/type-mismatch-multiple.stderr | 3 - .../ui/type/type-mismatch-same-crate-name.rs | 2 - .../type/type-mismatch-same-crate-name.stderr | 6 +- src/test/ui/type/type-mismatch.stderr | 18 +---- src/test/ui/type/type-shadow.stderr | 5 +- src/test/ui/wrong-mul-method-signature.stderr | 6 -- 237 files changed, 225 insertions(+), 1278 deletions(-) diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs index caf9f7288b99f..cccdcc68a5793 100644 --- a/src/librustc/infer/error_reporting/mod.rs +++ b/src/librustc/infer/error_reporting/mod.rs @@ -1163,8 +1163,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { Some(values) => { let (is_simple_error, exp_found) = match values { ValuePairs::Types(exp_found) => { - let is_simple_err = - exp_found.expected.is_primitive() && exp_found.found.is_primitive(); + let is_simple_err = exp_found.expected.is_simple_text() + && exp_found.found.is_simple_text(); (is_simple_err, Some(exp_found)) } @@ -1201,8 +1201,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { .unwrap_or("type".into()); let found_label = exp_found.map(|ef| ef.found.prefix_string()) .unwrap_or("type".into()); - match (terr, is_simple_error, expected == found) { - (&TypeError::Sorts(ref values), false, extra) => { + match (&terr, expected == found) { + (TypeError::Sorts(values), extra) => { let sort_string = |ty: Ty<'tcx>| match (extra, &ty.kind) { (true, ty::Opaque(def_id, _)) => format!( " (opaque type at {})", @@ -1212,26 +1212,43 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { (true, _) => format!(" ({})", ty.sort_string(self.tcx)), (false, _) => "".to_string(), }; - diag.note_expected_found_extra( - &expected_label, - expected, - &found_label, - found, - &sort_string(values.expected), - &sort_string(values.found), - ); + if !(values.expected.is_simple_text() && values.found.is_simple_text()) || ( + exp_found.map_or(false, |ef| { + // This happens when the type error is a subset of the expectation, + // like when you have two references but one is `usize` and the other + // is `f32`. In those cases we still want to show the `note`. If the + // value from `ef` is `Infer(_)`, then we ignore it. + if !ef.expected.is_ty_infer() { + ef.expected != values.expected + } else if !ef.found.is_ty_infer() { + ef.found != values.found + } else { + false + } + }) + ) { + diag.note_expected_found_extra( + &expected_label, + expected, + &found_label, + found, + &sort_string(values.expected), + &sort_string(values.found), + ); + } } - (TypeError::ObjectUnsafeCoercion(_), ..) => { + (TypeError::ObjectUnsafeCoercion(_), _) => { diag.note_unsuccessfull_coercion(found, expected); } - (_, false, _) => { + (_, _) => { debug!( "note_type_err: exp_found={:?}, expected={:?} found={:?}", exp_found, expected, found ); - diag.note_expected_found(&expected_label, expected, &found_label, found); + if !is_simple_error || terr.must_include_note() { + diag.note_expected_found(&expected_label, expected, &found_label, found); + } } - _ => (), } } if let Some(exp_found) = exp_found { diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs index 09a833baca93f..feb53539a2eda 100644 --- a/src/librustc/ty/error.rs +++ b/src/librustc/ty/error.rs @@ -64,8 +64,11 @@ pub enum UnconstrainedNumeric { impl<'tcx> fmt::Display for TypeError<'tcx> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { use self::TypeError::*; - fn report_maybe_different(f: &mut fmt::Formatter<'_>, - expected: &str, found: &str) -> fmt::Result { + fn report_maybe_different( + f: &mut fmt::Formatter<'_>, + expected: &str, + found: &str, + ) -> fmt::Result { // A naive approach to making sure that we're not reporting silly errors such as: // (expected closure, found closure). if expected == found { @@ -183,39 +186,70 @@ impl<'tcx> fmt::Display for TypeError<'tcx> { } } +impl<'tcx> TypeError<'tcx> { + pub fn must_include_note(&self) -> bool { + use self::TypeError::*; + match self { + CyclicTy(_) | + UnsafetyMismatch(_) | + Mismatch | + AbiMismatch(_) | + FixedArraySize(_) | + Sorts(_) | + IntMismatch(_) | + FloatMismatch(_) | + VariadicMismatch(_) => false, + + Mutability | + TupleSize(_) | + ArgCount | + RegionsDoesNotOutlive(..) | + RegionsInsufficientlyPolymorphic(..) | + RegionsOverlyPolymorphic(..) | + RegionsPlaceholderMismatch | + Traits(_) | + ProjectionMismatched(_) | + ProjectionBoundsLength(_) | + ExistentialMismatch(_) | + ConstMismatch(_) | + IntrinsicCast | + ObjectUnsafeCoercion(_) => true, + } + } +} + impl<'tcx> ty::TyS<'tcx> { pub fn sort_string(&self, tcx: TyCtxt<'_>) -> Cow<'static, str> { match self.kind { ty::Bool | ty::Char | ty::Int(_) | - ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => self.to_string().into(), - ty::Tuple(ref tys) if tys.is_empty() => self.to_string().into(), + ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => format!("{}", self).into(), + ty::Tuple(ref tys) if tys.is_empty() => format!("{}", self).into(), ty::Adt(def, _) => format!("{} `{}`", def.descr(), tcx.def_path_str(def.did)).into(), ty::Foreign(def_id) => format!("extern type `{}`", tcx.def_path_str(def_id)).into(), - ty::Array(_, n) => { + ty::Array(t, n) => { let n = tcx.lift(&n).unwrap(); match n.try_eval_usize(tcx, ty::ParamEnv::empty()) { - Some(n) => { - format!("array of {} element{}", n, pluralize!(n)).into() - } + _ if t.is_simple_ty() => format!("array `{}`", self).into(), + Some(n) => format!("array of {} element{} ", n, pluralize!(n)).into(), None => "array".into(), } } + ty::Slice(ty) if ty.is_simple_ty() => format!("slice `{}`", self).into(), ty::Slice(_) => "slice".into(), ty::RawPtr(_) => "*-ptr".into(), - ty::Ref(region, ty, mutbl) => { + ty::Ref(_, ty, mutbl) => { let tymut = ty::TypeAndMut { ty, mutbl }; let tymut_string = tymut.to_string(); - if tymut_string == "_" || //unknown type name, - tymut_string.len() > 10 || //name longer than saying "reference", - region.to_string() != "'_" //... or a complex type - { - format!("{}reference", match mutbl { - hir::Mutability::Mutable => "mutable ", - _ => "" - }).into() - } else { + if tymut_string != "_" && ( + ty.is_simple_text() || tymut_string.len() < "mutable reference".len() + ) { format!("&{}", tymut_string).into() + } else { // Unknown type name, it's long or has type arguments + match mutbl { + hir::Mutability::Mutable => "mutable reference", + _ => "reference", + }.into() } } ty::FnDef(..) => "fn item".into(), @@ -248,7 +282,6 @@ impl<'tcx> ty::TyS<'tcx> { } pub fn prefix_string(&self) -> Cow<'static, str> { - debug!("prefix_string {:?} {} {:?}", self, self, self.kind); match self.kind { ty::Infer(_) | ty::Error | ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => "type".into(), diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 031d6f09b4485..5fc2812fd97db 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -555,16 +555,29 @@ impl<'tcx> Hash for TyS<'tcx> { impl<'tcx> TyS<'tcx> { pub fn is_primitive_ty(&self) -> bool { match self.kind { - Bool | - Char | - Int(_) | - Uint(_) | - Float(_) | - Infer(InferTy::IntVar(_)) | - Infer(InferTy::FloatVar(_)) | - Infer(InferTy::FreshIntTy(_)) | - Infer(InferTy::FreshFloatTy(_)) => true, - Ref(_, x, _) => x.is_primitive_ty(), + Bool | Char | Str | Int(_) | Uint(_) | Float(_) | + Infer(InferTy::IntVar(_)) | Infer(InferTy::FloatVar(_)) | + Infer(InferTy::FreshIntTy(_)) | Infer(InferTy::FreshFloatTy(_)) => true, + _ => false, + } + } + + pub fn is_simple_ty(&self) -> bool { + match self.kind { + Bool | Char | Str | Int(_) | Uint(_) | Float(_) | + Infer(InferTy::IntVar(_)) | Infer(InferTy::FloatVar(_)) | + Infer(InferTy::FreshIntTy(_)) | Infer(InferTy::FreshFloatTy(_)) => true, + Ref(_, x, _) | Array(x, _) | Slice(x) => x.peel_refs().is_simple_ty(), + Tuple(tys) if tys.is_empty() => true, + _ => false, + } + } + + pub fn is_simple_text(&self) -> bool { + match self.kind { + Adt(_, substs) => substs.types().next().is_none(), + Ref(_, ty, _) => ty.is_simple_text(), + _ if self.is_simple_ty() => true, _ => false, } } diff --git a/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout b/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout index a8753d14de22f..42dc56c44ce95 100644 --- a/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout +++ b/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout @@ -10,9 +10,6 @@ error[E0308]: mismatched types | LL | let x: () = 5i32; | ^^^^ expected (), found i32 - | - = note: expected type `()` - found type `i32` error: aborting due to previous error diff --git a/src/test/ui/arg-type-mismatch.stderr b/src/test/ui/arg-type-mismatch.stderr index 95aa36ebb89f9..321a07c4a66b2 100644 --- a/src/test/ui/arg-type-mismatch.stderr +++ b/src/test/ui/arg-type-mismatch.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | fn main() { let i: (); i = f(()); } | ^^ expected isize, found () - | - = note: expected type `isize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/array-not-vector.rs b/src/test/ui/array-not-vector.rs index 838951c7c1d48..504874f2ce364 100644 --- a/src/test/ui/array-not-vector.rs +++ b/src/test/ui/array-not-vector.rs @@ -1,9 +1,7 @@ fn main() { let _x: i32 = [1, 2, 3]; //~^ ERROR mismatched types - //~| expected type `i32` - //~| found array `[{integer}; 3]` - //~| expected i32, found array of 3 elements + //~| expected i32, found array let x: &[i32] = &[1, 2, 3]; let _y: &i32 = x; diff --git a/src/test/ui/array-not-vector.stderr b/src/test/ui/array-not-vector.stderr index 2a2fbe6660a35..fd02307ffd30e 100644 --- a/src/test/ui/array-not-vector.stderr +++ b/src/test/ui/array-not-vector.stderr @@ -2,16 +2,13 @@ error[E0308]: mismatched types --> $DIR/array-not-vector.rs:2:19 | LL | let _x: i32 = [1, 2, 3]; - | ^^^^^^^^^ expected i32, found array of 3 elements - | - = note: expected type `i32` - found array `[{integer}; 3]` + | ^^^^^^^^^ expected i32, found array `[{integer}; 3]` error[E0308]: mismatched types - --> $DIR/array-not-vector.rs:9:20 + --> $DIR/array-not-vector.rs:7:20 | LL | let _y: &i32 = x; - | ^ expected i32, found slice + | ^ expected i32, found slice `[i32]` | = note: expected reference `&i32` found reference `&[i32]` diff --git a/src/test/ui/associated-const/associated-const-generic-obligations.stderr b/src/test/ui/associated-const/associated-const-generic-obligations.stderr index 6a48bbabe1078..f2312cbaa0622 100644 --- a/src/test/ui/associated-const/associated-const-generic-obligations.stderr +++ b/src/test/ui/associated-const/associated-const-generic-obligations.stderr @@ -5,7 +5,7 @@ LL | const FROM: Self::Out; | --------- type in trait ... LL | const FROM: &'static str = "foo"; - | ^^^^^^^^^^^^ expected associated type, found reference + | ^^^^^^^^^^^^ expected associated type, found &str | = note: expected associated type `::Out` found reference `&'static str` diff --git a/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr b/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr index 483c7e7707e4f..07f207627f4df 100644 --- a/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr +++ b/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr @@ -3,36 +3,24 @@ error[E0308]: mismatched types | LL | fn b() { dent(ModelT, Blue); } | ^^^^ expected struct `Black`, found struct `Blue` - | - = note: expected struct `Black` - found struct `Blue` error[E0308]: mismatched types --> $DIR/associated-type-projection-from-supertrait.rs:28:23 | LL | fn c() { dent(ModelU, Black); } | ^^^^^ expected struct `Blue`, found struct `Black` - | - = note: expected struct `Blue` - found struct `Black` error[E0308]: mismatched types --> $DIR/associated-type-projection-from-supertrait.rs:32:28 | LL | fn f() { ModelT.chip_paint(Blue); } | ^^^^ expected struct `Black`, found struct `Blue` - | - = note: expected struct `Black` - found struct `Blue` error[E0308]: mismatched types --> $DIR/associated-type-projection-from-supertrait.rs:33:28 | LL | fn g() { ModelU.chip_paint(Black); } | ^^^^^ expected struct `Blue`, found struct `Black` - | - = note: expected struct `Blue` - found struct `Black` error: aborting due to 4 previous errors diff --git a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr index 6443de5878181..86e651b53f0b9 100644 --- a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr +++ b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr @@ -6,9 +6,6 @@ LL | fn blue_car>(c: C) { ... LL | fn b() { blue_car(ModelT); } | ^^^^^^^^ expected struct `Blue`, found struct `Black` - | - = note: expected struct `Blue` - found struct `Black` error[E0271]: type mismatch resolving `::Color == Black` --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:32:10 @@ -18,9 +15,6 @@ LL | fn black_car>(c: C) { ... LL | fn c() { black_car(ModelU); } | ^^^^^^^^^ expected struct `Black`, found struct `Blue` - | - = note: expected struct `Black` - found struct `Blue` error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/associated-types-eq-3.stderr b/src/test/ui/associated-types/associated-types-eq-3.stderr index 88910f6de2a3a..060e2c8a2ccc1 100644 --- a/src/test/ui/associated-types/associated-types-eq-3.stderr +++ b/src/test/ui/associated-types/associated-types-eq-3.stderr @@ -17,9 +17,6 @@ LL | fn foo1>(x: I) { ... LL | foo1(a); | ^^^^ expected struct `Bar`, found usize - | - = note: expected struct `Bar` - found type `usize` error[E0271]: type mismatch resolving `::A == Bar` --> $DIR/associated-types-eq-3.rs:41:9 @@ -27,8 +24,6 @@ error[E0271]: type mismatch resolving `::A == Bar` LL | baz(&a); | ^^ expected struct `Bar`, found usize | - = note: expected struct `Bar` - found type `usize` = note: required for the cast to the object type `dyn Foo` error: aborting due to 3 previous errors diff --git a/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr b/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr index 02a6ac12dd927..4ec1fd810aa76 100644 --- a/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr +++ b/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr @@ -4,8 +4,6 @@ error[E0271]: type mismatch resolving ` as std::iter::It LL | let _: &dyn I32Iterator = &vec![42].into_iter(); | ^^^^^^^^^^^^^^^^^^^^^ expected i32, found u32 | - = note: expected type `i32` - found type `u32` = note: required for the cast to the object type `dyn std::iter::Iterator` error: aborting due to previous error diff --git a/src/test/ui/associated-types/issue-44153.stderr b/src/test/ui/associated-types/issue-44153.stderr index 7751d20f3527a..f9b1373820f3a 100644 --- a/src/test/ui/associated-types/issue-44153.stderr +++ b/src/test/ui/associated-types/issue-44153.stderr @@ -7,8 +7,6 @@ LL | fn visit() {} LL | <() as Visit>::visit(); | ^^^^^^^^^^^^^^^^^^^^ expected (), found &() | - = note: expected unit type `()` - found reference `&()` = note: required because of the requirements on the impl of `Visit` for `()` error: aborting due to previous error diff --git a/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr b/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr index ceb811f7e0143..9b4defaa0bd86 100644 --- a/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr +++ b/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr @@ -8,9 +8,6 @@ LL | impl Bar for Foo { | ---------------- in this `impl` item LL | type Ok = (); | ^^^^^^^^^^^^^ expected u32, found () - | - = note: expected type `u32` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr b/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr index 832f00642e3a5..212558cf9328e 100644 --- a/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr +++ b/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr @@ -25,9 +25,6 @@ LL | fn return_targets_async_block_not_fn() -> u8 { | --------------------------------- ^^ expected u8, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `u8` - found unit type `()` error[E0271]: type mismatch resolving `::Output == ()` --> $DIR/async-block-control-flow-static-semantics.rs:18:39 @@ -35,8 +32,6 @@ error[E0271]: type mismatch resolving ` = █ | ^^^^^^ expected (), found u8 | - = note: expected unit type `()` - found type `u8` = note: required for the cast to the object type `dyn std::future::Future` error[E0308]: mismatched types @@ -51,9 +46,6 @@ LL | | return 0u8; LL | | LL | | } | |_^ expected u8, found () - | - = note: expected type `u8` - found unit type `()` error[E0271]: type mismatch resolving `::Output == ()` --> $DIR/async-block-control-flow-static-semantics.rs:27:39 @@ -61,8 +53,6 @@ error[E0271]: type mismatch resolving ` = █ | ^^^^^^ expected (), found u8 | - = note: expected unit type `()` - found type `u8` = note: required for the cast to the object type `dyn std::future::Future` error[E0308]: mismatched types diff --git a/src/test/ui/bad/bad-const-type.rs b/src/test/ui/bad/bad-const-type.rs index aacc796e2a84a..ce9ea7bc9edfc 100644 --- a/src/test/ui/bad/bad-const-type.rs +++ b/src/test/ui/bad/bad-const-type.rs @@ -1,6 +1,4 @@ static i: String = 10; //~^ ERROR mismatched types //~| expected struct `std::string::String`, found integer -//~| expected struct `std::string::String` -//~| found type `{integer}` fn main() { println!("{}", i); } diff --git a/src/test/ui/bad/bad-const-type.stderr b/src/test/ui/bad/bad-const-type.stderr index d3da6bd771897..f667779fab58f 100644 --- a/src/test/ui/bad/bad-const-type.stderr +++ b/src/test/ui/bad/bad-const-type.stderr @@ -6,9 +6,6 @@ LL | static i: String = 10; | | | expected struct `std::string::String`, found integer | help: try using a conversion method: `10.to_string()` - | - = note: expected struct `std::string::String` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/binop/binop-logic-int.stderr b/src/test/ui/binop/binop-logic-int.stderr index b699b390b8bb1..06b7fcbe9b6b9 100644 --- a/src/test/ui/binop/binop-logic-int.stderr +++ b/src/test/ui/binop/binop-logic-int.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | fn main() { let x = 1 && 2; } | ^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/binop-logic-int.rs:1:26 | LL | fn main() { let x = 1 && 2; } | ^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error: aborting due to 2 previous errors diff --git a/src/test/ui/blind/blind-item-block-middle.stderr b/src/test/ui/blind/blind-item-block-middle.stderr index 8e6e754df5b21..264e7fc8e73a2 100644 --- a/src/test/ui/blind/blind-item-block-middle.stderr +++ b/src/test/ui/blind/blind-item-block-middle.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let bar = 5; | ^^^ expected integer, found struct `foo::bar` - | - = note: expected type `{integer}` - found struct `foo::bar` error: aborting due to previous error diff --git a/src/test/ui/block-expression-remove-semicolon.stderr b/src/test/ui/block-expression-remove-semicolon.stderr index 29a53bed7d744..cc515f4bf456d 100644 --- a/src/test/ui/block-expression-remove-semicolon.stderr +++ b/src/test/ui/block-expression-remove-semicolon.stderr @@ -8,9 +8,6 @@ LL | | foo(); | | - help: consider removing this semicolon LL | | }; | |_____^ expected i32, found () - | - = note: expected type `i32` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/block-result/block-must-not-have-result-do.stderr b/src/test/ui/block-result/block-must-not-have-result-do.stderr index 11f9db6937e12..a303f5d29d045 100644 --- a/src/test/ui/block-result/block-must-not-have-result-do.stderr +++ b/src/test/ui/block-result/block-must-not-have-result-do.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | true | ^^^^ expected (), found bool - | - = note: expected unit type `()` - found type `bool` error: aborting due to previous error diff --git a/src/test/ui/block-result/block-must-not-have-result-res.stderr b/src/test/ui/block-result/block-must-not-have-result-res.stderr index ba80ce2d6b14a..aabc7604f90c0 100644 --- a/src/test/ui/block-result/block-must-not-have-result-res.stderr +++ b/src/test/ui/block-result/block-must-not-have-result-res.stderr @@ -5,9 +5,6 @@ LL | fn drop(&mut self) { | - expected `()` because of default return type LL | true | ^^^^ expected (), found bool - | - = note: expected unit type `()` - found type `bool` error: aborting due to previous error diff --git a/src/test/ui/block-result/block-must-not-have-result-while.rs b/src/test/ui/block-result/block-must-not-have-result-while.rs index 42b439cd3208e..f93725937299a 100644 --- a/src/test/ui/block-result/block-must-not-have-result-while.rs +++ b/src/test/ui/block-result/block-must-not-have-result-while.rs @@ -1,8 +1,6 @@ fn main() { while true { //~ WARN denote infinite loops with true //~ ERROR mismatched types - //~| expected unit type `()` - //~| found type `bool` //~| expected (), found bool } } diff --git a/src/test/ui/block-result/block-must-not-have-result-while.stderr b/src/test/ui/block-result/block-must-not-have-result-while.stderr index d19ae3af657c0..72063ad1731df 100644 --- a/src/test/ui/block-result/block-must-not-have-result-while.stderr +++ b/src/test/ui/block-result/block-must-not-have-result-while.stderr @@ -11,9 +11,6 @@ error[E0308]: mismatched types | LL | true | ^^^^ expected (), found bool - | - = note: expected unit type `()` - found type `bool` error: aborting due to previous error diff --git a/src/test/ui/block-result/consider-removing-last-semi.stderr b/src/test/ui/block-result/consider-removing-last-semi.stderr index 76643b49bc04e..fed98f912462b 100644 --- a/src/test/ui/block-result/consider-removing-last-semi.stderr +++ b/src/test/ui/block-result/consider-removing-last-semi.stderr @@ -8,9 +8,6 @@ LL | fn f() -> String { LL | 0u8; LL | "bla".to_string(); | - help: consider removing this semicolon - | - = note: expected struct `std::string::String` - found unit type `()` error[E0308]: mismatched types --> $DIR/consider-removing-last-semi.rs:6:11 @@ -22,9 +19,6 @@ LL | fn g() -> String { LL | "this won't work".to_string(); LL | "removeme".to_string(); | - help: consider removing this semicolon - | - = note: expected struct `std::string::String` - found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-11714.stderr b/src/test/ui/block-result/issue-11714.stderr index 54c1bb220a912..5cd2726b8ddbc 100644 --- a/src/test/ui/block-result/issue-11714.stderr +++ b/src/test/ui/block-result/issue-11714.stderr @@ -8,9 +8,6 @@ LL | fn blah() -> i32 { ... LL | ; | - help: consider removing this semicolon - | - = note: expected type `i32` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/block-result/issue-13428.stderr b/src/test/ui/block-result/issue-13428.stderr index b1f2ca634511b..24e942619f0d1 100644 --- a/src/test/ui/block-result/issue-13428.stderr +++ b/src/test/ui/block-result/issue-13428.stderr @@ -8,9 +8,6 @@ LL | fn foo() -> String { ... LL | ; | - help: consider removing this semicolon - | - = note: expected struct `std::string::String` - found unit type `()` error[E0308]: mismatched types --> $DIR/issue-13428.rs:11:13 @@ -22,9 +19,6 @@ LL | fn bar() -> String { LL | "foobar".to_string() LL | ; | - help: consider removing this semicolon - | - = note: expected struct `std::string::String` - found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-13624.rs b/src/test/ui/block-result/issue-13624.rs index ca457aa907d9f..ed0b302174604 100644 --- a/src/test/ui/block-result/issue-13624.rs +++ b/src/test/ui/block-result/issue-13624.rs @@ -7,8 +7,6 @@ mod a { Enum::EnumStructVariant { x: 1, y: 2, z: 3 } //~^ ERROR mismatched types //~| expected (), found enum `a::Enum` - //~| expected unit type `()` - //~| found enum `a::Enum` } } @@ -22,8 +20,6 @@ mod b { a::Enum::EnumStructVariant { x, y, z } => { //~^ ERROR mismatched types //~| expected (), found enum `a::Enum` - //~| expected unit type `()` - //~| found enum `a::Enum` } } } diff --git a/src/test/ui/block-result/issue-13624.stderr b/src/test/ui/block-result/issue-13624.stderr index 6e2b2812c7241..2404d06ae8665 100644 --- a/src/test/ui/block-result/issue-13624.stderr +++ b/src/test/ui/block-result/issue-13624.stderr @@ -5,20 +5,14 @@ LL | pub fn get_enum_struct_variant() -> () { | -- expected `()` because of return type LL | Enum::EnumStructVariant { x: 1, y: 2, z: 3 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum` - | - = note: expected unit type `()` - found enum `a::Enum` error[E0308]: mismatched types - --> $DIR/issue-13624.rs:22:9 + --> $DIR/issue-13624.rs:20:9 | LL | match enum_struct_variant { | ------------------- this match expression has type `()` LL | a::Enum::EnumStructVariant { x, y, z } => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum` - | - = note: expected unit type `()` - found enum `a::Enum` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-22645.stderr b/src/test/ui/block-result/issue-22645.stderr index 5df71e8374b1d..cc1b4a217ce47 100644 --- a/src/test/ui/block-result/issue-22645.stderr +++ b/src/test/ui/block-result/issue-22645.stderr @@ -16,9 +16,6 @@ LL | fn main() { LL | let b = Bob + 3.5; LL | b + 3 | ^^^^^ expected (), found struct `Bob` - | - = note: expected unit type `()` - found struct `Bob` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/unexpected-return-on-unit.stderr b/src/test/ui/block-result/unexpected-return-on-unit.stderr index 3eae3e7542241..170d11373ddd0 100644 --- a/src/test/ui/block-result/unexpected-return-on-unit.stderr +++ b/src/test/ui/block-result/unexpected-return-on-unit.stderr @@ -4,8 +4,6 @@ error[E0308]: mismatched types LL | foo() | ^^^^^ expected (), found usize | - = note: expected unit type `()` - found type `usize` help: try adding a semicolon | LL | foo(); diff --git a/src/test/ui/chalkify/type_inference.stderr b/src/test/ui/chalkify/type_inference.stderr index c6bc306e45a1c..fdc79ec29f378 100644 --- a/src/test/ui/chalkify/type_inference.stderr +++ b/src/test/ui/chalkify/type_inference.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | only_foo(x); | ^ expected i32, found floating-point number - | - = note: expected type `i32` - found type `{float}` error[E0277]: the trait bound `{float}: Bar` is not satisfied --> $DIR/type_inference.rs:25:5 diff --git a/src/test/ui/codemap_tests/tab.stderr b/src/test/ui/codemap_tests/tab.stderr index ea3ded67c0a0c..3ee10cd4cb828 100644 --- a/src/test/ui/codemap_tests/tab.stderr +++ b/src/test/ui/codemap_tests/tab.stderr @@ -10,10 +10,7 @@ error[E0308]: mismatched types LL | fn foo() { | - help: try adding a return type: `-> &'static str` LL | "bar boo" - | ^^^^^^^^^^^^^^^^^^^^ expected (), found reference - | - = note: expected unit type `()` - found reference `&'static str` + | ^^^^^^^^^^^^^^^^^^^^ expected (), found &str error: aborting due to 2 previous errors diff --git a/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr b/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr index acbc8339b1911..db8ecb818c9bd 100644 --- a/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr +++ b/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:9:13 | LL | let _ = box { [1, 2, 3] }: Box<[i32]>; - | ^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | ^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` | = note: expected struct `std::boxed::Box<[i32]>` found struct `std::boxed::Box<[i32; 3]>` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:10:13 | LL | let _ = box if true { [1, 2, 3] } else { [1, 3, 4] }: Box<[i32]>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` | = note: expected struct `std::boxed::Box<[i32]>` found struct `std::boxed::Box<[i32; 3]>` @@ -20,7 +20,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:11:13 | LL | let _ = box match true { true => [1, 2, 3], false => [1, 3, 4] }: Box<[i32]>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` | = note: expected struct `std::boxed::Box<[i32]>` found struct `std::boxed::Box<[i32; 3]>` @@ -56,7 +56,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:17:13 | LL | let _ = &{ [1, 2, 3] }: &[i32]; - | ^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | ^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` | = note: expected reference `&[i32]` found reference `&[i32; 3]` @@ -65,7 +65,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:18:13 | LL | let _ = &if true { [1, 2, 3] } else { [1, 3, 4] }: &[i32]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` | = note: expected reference `&[i32]` found reference `&[i32; 3]` @@ -74,7 +74,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:19:13 | LL | let _ = &match true { true => [1, 2, 3], false => [1, 3, 4] }: &[i32]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` | = note: expected reference `&[i32]` found reference `&[i32; 3]` @@ -110,7 +110,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:25:13 | LL | let _ = Box::new([1, 2, 3]): Box<[i32]>; - | ^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | ^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` | = note: expected struct `std::boxed::Box<[i32]>` found struct `std::boxed::Box<[i32; 3]>` diff --git a/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr b/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr index 1122901a17eda..7811df4525983 100644 --- a/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr +++ b/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr @@ -7,9 +7,6 @@ LL | fn plus_one(x: i32) -> i32 { | implicitly returns `()` as its body has no tail or `return` expression LL | x + 1; | - help: consider removing this semicolon - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/coercion-missing-tail-expected-type.rs:7:13 diff --git a/src/test/ui/coercion/coercion-slice.rs b/src/test/ui/coercion/coercion-slice.rs index fbfe1984b9f4a..1d54d35f649a3 100644 --- a/src/test/ui/coercion/coercion-slice.rs +++ b/src/test/ui/coercion/coercion-slice.rs @@ -3,6 +3,5 @@ fn main() { let _: &[i32] = [0]; //~^ ERROR mismatched types - //~| expected reference `&[i32]` - //~| expected &[i32], found array of 1 element + //~| expected &[i32], found array `[{integer}; 1]` } diff --git a/src/test/ui/coercion/coercion-slice.stderr b/src/test/ui/coercion/coercion-slice.stderr index 55523933f5472..34caaed9de4f5 100644 --- a/src/test/ui/coercion/coercion-slice.stderr +++ b/src/test/ui/coercion/coercion-slice.stderr @@ -4,11 +4,8 @@ error[E0308]: mismatched types LL | let _: &[i32] = [0]; | ^^^ | | - | expected &[i32], found array of 1 element + | expected &[i32], found array `[{integer}; 1]` | help: consider borrowing here: `&[0]` - | - = note: expected reference `&[i32]` - found array `[{integer}; 1]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr index 8461755dbfe57..aefd514f7a68e 100644 --- a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr +++ b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8])); | ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements - | - = note: expected array `[u8; 3]` - found array `[u8; 2]` error[E0308]: mismatched types --> $DIR/const-argument-cross-crate-mismatch.rs:8:65 | LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]); | ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements - | - = note: expected array `[u8; 2]` - found array `[u8; 3]` error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/const-array-oob-arith.stderr b/src/test/ui/consts/const-array-oob-arith.stderr index f4a4c091e78a0..eae93b72ddc86 100644 --- a/src/test/ui/consts/const-array-oob-arith.stderr +++ b/src/test/ui/consts/const-array-oob-arith.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | const BLUB: [i32; (ARR[0] - 40) as usize] = [5]; | ^^^ expected an array with a fixed size of 2 elements, found one with 1 element - | - = note: expected array `[i32; 2]` - found array `[i32; 1]` error[E0308]: mismatched types --> $DIR/const-array-oob-arith.rs:10:44 | LL | const BOO: [i32; (ARR[0] - 41) as usize] = [5, 99]; | ^^^^^^^ expected an array with a fixed size of 1 element, found one with 2 elements - | - = note: expected array `[i32; 1]` - found array `[i32; 2]` error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/const-eval/const-eval-span.rs b/src/test/ui/consts/const-eval/const-eval-span.rs index 279fe7fb7fed5..682c7a1d65fc9 100644 --- a/src/test/ui/consts/const-eval/const-eval-span.rs +++ b/src/test/ui/consts/const-eval/const-eval-span.rs @@ -9,7 +9,6 @@ enum E { V = CONSTANT, //~^ ERROR mismatched types //~| expected isize, found struct `S` - //~| found struct `S` } fn main() {} diff --git a/src/test/ui/consts/const-eval/const-eval-span.stderr b/src/test/ui/consts/const-eval/const-eval-span.stderr index 5b046e266a2df..3436802f8a95b 100644 --- a/src/test/ui/consts/const-eval/const-eval-span.stderr +++ b/src/test/ui/consts/const-eval/const-eval-span.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | V = CONSTANT, | ^^^^^^^^ expected isize, found struct `S` - | - = note: expected type `isize` - found struct `S` error: aborting due to previous error diff --git a/src/test/ui/consts/const-integer-bool-ops.stderr b/src/test/ui/consts/const-integer-bool-ops.stderr index 7fd973786d1b7..8b5f3440964d5 100644 --- a/src/test/ui/consts/const-integer-bool-ops.stderr +++ b/src/test/ui/consts/const-integer-bool-ops.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | const X: usize = 42 && 39; | ^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:1:24 | LL | const X: usize = 42 && 39; | ^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:1:18 @@ -33,18 +27,12 @@ error[E0308]: mismatched types | LL | const X1: usize = 42 || 39; | ^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:11:25 | LL | const X1: usize = 42 || 39; | ^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:11:19 @@ -63,18 +51,12 @@ error[E0308]: mismatched types | LL | const X2: usize = -42 || -39; | ^^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:21:26 | LL | const X2: usize = -42 || -39; | ^^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:21:19 @@ -93,18 +75,12 @@ error[E0308]: mismatched types | LL | const X3: usize = -42 && -39; | ^^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:31:26 | LL | const X3: usize = -42 && -39; | ^^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:31:19 diff --git a/src/test/ui/conversion-methods.stderr b/src/test/ui/conversion-methods.stderr index 11384d92cb8a6..ff5529a840852 100644 --- a/src/test/ui/conversion-methods.stderr +++ b/src/test/ui/conversion-methods.stderr @@ -4,11 +4,8 @@ error[E0308]: mismatched types LL | let _tis_an_instants_play: String = "'Tis a fond Ambush—"; | ^^^^^^^^^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found reference + | expected struct `std::string::String`, found &str | help: try using a conversion method: `"'Tis a fond Ambush—".to_string()` - | - = note: expected struct `std::string::String` - found reference `&'static str` error[E0308]: mismatched types --> $DIR/conversion-methods.rs:6:40 @@ -16,11 +13,8 @@ error[E0308]: mismatched types LL | let _just_to_make_bliss: PathBuf = Path::new("/ern/her/own/surprise"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | - | expected struct `std::path::PathBuf`, found reference + | expected struct `std::path::PathBuf`, found &std::path::Path | help: try using a conversion method: `Path::new("/ern/her/own/surprise").to_path_buf()` - | - = note: expected struct `std::path::PathBuf` - found reference `&std::path::Path` error[E0308]: mismatched types --> $DIR/conversion-methods.rs:9:40 @@ -30,9 +24,6 @@ LL | let _but_should_the_play: String = 2; // Perhaps surprisingly, we sugge | | | expected struct `std::string::String`, found integer | help: try using a conversion method: `2.to_string()` - | - = note: expected struct `std::string::String` - found type `{integer}` error[E0308]: mismatched types --> $DIR/conversion-methods.rs:12:47 @@ -40,7 +31,7 @@ error[E0308]: mismatched types LL | let _prove_piercing_earnest: Vec = &[1, 2, 3]; | ^^^^^^^^^^ | | - | expected struct `std::vec::Vec`, found reference + | expected struct `std::vec::Vec`, found &[{integer}; 3] | help: try using a conversion method: `(&[1, 2, 3]).to_vec()` | = note: expected struct `std::vec::Vec` diff --git a/src/test/ui/deref-suggestion.stderr b/src/test/ui/deref-suggestion.stderr index 53bc3212a7fb0..433bab7718917 100644 --- a/src/test/ui/deref-suggestion.stderr +++ b/src/test/ui/deref-suggestion.stderr @@ -4,11 +4,8 @@ error[E0308]: mismatched types LL | foo(s); | ^ | | - | expected struct `std::string::String`, found reference + | expected struct `std::string::String`, found &std::string::String | help: try using a conversion method: `s.to_string()` - | - = note: expected struct `std::string::String` - found reference `&std::string::String` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:14:10 @@ -18,9 +15,6 @@ LL | foo3(u); | | | expected u32, found &u32 | help: consider dereferencing the borrow: `*u` - | - = note: expected type `u32` - found reference `&u32` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:30:9 @@ -28,11 +22,8 @@ error[E0308]: mismatched types LL | foo(&"aaa".to_owned()); | ^^^^^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found reference + | expected struct `std::string::String`, found &std::string::String | help: consider removing the borrow: `"aaa".to_owned()` - | - = note: expected struct `std::string::String` - found reference `&std::string::String` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:32:9 @@ -40,11 +31,8 @@ error[E0308]: mismatched types LL | foo(&mut "aaa".to_owned()); | ^^^^^^^^^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found mutable reference + | expected struct `std::string::String`, found &mut std::string::String | help: consider removing the borrow: `"aaa".to_owned()` - | - = note: expected struct `std::string::String` - found mutable reference `&mut std::string::String` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:2:20 @@ -54,9 +42,6 @@ LL | ($x:expr) => { &$x } ... LL | foo3(borrow!(0)); | ---------- in this macro invocation - | - = note: expected type `u32` - found reference `&{integer}` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:36:5 @@ -64,8 +49,6 @@ error[E0308]: mismatched types LL | assert_eq!(3i32, &3i32); | ^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found &i32 | - = note: expected type `i32` - found reference `&i32` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error[E0308]: mismatched types @@ -76,9 +59,6 @@ LL | let s = S { u }; | | | expected &u32, found integer | help: consider borrowing here: `u: &u` - | - = note: expected reference `&u32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:41:20 @@ -88,9 +68,6 @@ LL | let s = S { u: u }; | | | expected &u32, found integer | help: consider borrowing here: `&u` - | - = note: expected reference `&u32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:44:17 @@ -100,9 +77,6 @@ LL | let r = R { i }; | | | expected u32, found &{integer} | help: consider dereferencing the borrow: `i: *i` - | - = note: expected type `u32` - found reference `&{integer}` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:46:20 @@ -112,9 +86,6 @@ LL | let r = R { i: i }; | | | expected u32, found &{integer} | help: consider dereferencing the borrow: `*i` - | - = note: expected type `u32` - found reference `&{integer}` error: aborting due to 10 previous errors diff --git a/src/test/ui/did_you_mean/issue-42764.stderr b/src/test/ui/did_you_mean/issue-42764.stderr index bd913649dd070..5fd3676d3613f 100644 --- a/src/test/ui/did_you_mean/issue-42764.stderr +++ b/src/test/ui/did_you_mean/issue-42764.stderr @@ -18,9 +18,6 @@ error[E0308]: mismatched types | LL | let _c = Context { wrapper: Payload{} }; | ^^^^^^^^^ expected struct `Wrapper`, found struct `Payload` - | - = note: expected struct `Wrapper` - found struct `Payload` error: aborting due to 2 previous errors diff --git a/src/test/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr b/src/test/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr index 301704ec0c7ef..76641b1120a27 100644 --- a/src/test/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr +++ b/src/test/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr @@ -6,9 +6,6 @@ LL | let sixteen: f32 = 16; | | | expected f32, found integer | help: use a float literal: `16.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/issue-53280-expected-float-found-integer-literal.rs:5:38 @@ -18,9 +15,6 @@ LL | let a_million_and_seventy: f64 = 1_000_070; | | | expected f64, found integer | help: use a float literal: `1_000_070.0` - | - = note: expected type `f64` - found type `{integer}` error[E0308]: mismatched types --> $DIR/issue-53280-expected-float-found-integer-literal.rs:8:30 @@ -30,27 +24,18 @@ LL | let negative_nine: f32 = -9; | | | expected f32, found integer | help: use a float literal: `-9.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/issue-53280-expected-float-found-integer-literal.rs:15:30 | LL | let sixteen_again: f64 = 0x10; | ^^^^ expected f64, found integer - | - = note: expected type `f64` - found type `{integer}` error[E0308]: mismatched types --> $DIR/issue-53280-expected-float-found-integer-literal.rs:17:30 | LL | let and_once_more: f32 = 0o20; | ^^^^ expected f32, found integer - | - = note: expected type `f32` - found type `{integer}` error: aborting due to 5 previous errors diff --git a/src/test/ui/diverging-fn-tail-35849.stderr b/src/test/ui/diverging-fn-tail-35849.stderr index ebca760e23549..3f3ef666f6639 100644 --- a/src/test/ui/diverging-fn-tail-35849.stderr +++ b/src/test/ui/diverging-fn-tail-35849.stderr @@ -5,7 +5,7 @@ LL | fn assert_sizeof() -> ! { | - expected `!` because of return type LL | unsafe { LL | ::std::mem::transmute::(panic!()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected !, found array of 8 elements + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected !, found array `[u8; 8]` | = note: expected type `!` found array `[u8; 8]` diff --git a/src/test/ui/dst/dst-bad-coerce1.stderr b/src/test/ui/dst/dst-bad-coerce1.stderr index 7e9d127a9af6e..3eb16663e13e1 100644 --- a/src/test/ui/dst/dst-bad-coerce1.stderr +++ b/src/test/ui/dst/dst-bad-coerce1.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coerce1.rs:16:29 | LL | let f3: &Fat<[usize]> = f2; - | ^^ expected slice, found array of 3 elements + | ^^ expected slice `[usize]`, found array `[isize; 3]` | = note: expected reference `&Fat<[usize]>` found reference `&Fat<[isize; 3]>` @@ -19,7 +19,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coerce1.rs:28:27 | LL | let f3: &([usize],) = f2; - | ^^ expected slice, found array of 3 elements + | ^^ expected slice `[usize]`, found array `[isize; 3]` | = note: expected reference `&([usize],)` found reference `&([isize; 3],)` diff --git a/src/test/ui/dst/dst-bad-coerce4.rs b/src/test/ui/dst/dst-bad-coerce4.rs index d1c590347eda0..f63da60d281d7 100644 --- a/src/test/ui/dst/dst-bad-coerce4.rs +++ b/src/test/ui/dst/dst-bad-coerce4.rs @@ -11,15 +11,15 @@ pub fn main() { let f1: &Fat<[isize]> = &Fat { ptr: [1, 2, 3] }; let f2: &Fat<[isize; 3]> = f1; //~^ ERROR mismatched types + //~| expected array `[isize; 3]`, found slice `[isize]` //~| expected reference `&Fat<[isize; 3]>` //~| found reference `&Fat<[isize]>` - //~| expected array of 3 elements, found slice // Tuple with a vec of isizes. let f1: &([isize],) = &([1, 2, 3],); let f2: &([isize; 3],) = f1; //~^ ERROR mismatched types + //~| expected array `[isize; 3]`, found slice `[isize]` //~| expected reference `&([isize; 3],)` //~| found reference `&([isize],)` - //~| expected array of 3 elements, found slice } diff --git a/src/test/ui/dst/dst-bad-coerce4.stderr b/src/test/ui/dst/dst-bad-coerce4.stderr index fad34633da5cb..e85d354e4680d 100644 --- a/src/test/ui/dst/dst-bad-coerce4.stderr +++ b/src/test/ui/dst/dst-bad-coerce4.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coerce4.rs:12:32 | LL | let f2: &Fat<[isize; 3]> = f1; - | ^^ expected array of 3 elements, found slice + | ^^ expected array `[isize; 3]`, found slice `[isize]` | = note: expected reference `&Fat<[isize; 3]>` found reference `&Fat<[isize]>` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coerce4.rs:20:30 | LL | let f2: &([isize; 3],) = f1; - | ^^ expected array of 3 elements, found slice + | ^^ expected array `[isize; 3]`, found slice `[isize]` | = note: expected reference `&([isize; 3],)` found reference `&([isize],)` diff --git a/src/test/ui/error-codes/E0070.stderr b/src/test/ui/error-codes/E0070.stderr index c77a337012d55..779b6ea924c72 100644 --- a/src/test/ui/error-codes/E0070.stderr +++ b/src/test/ui/error-codes/E0070.stderr @@ -15,9 +15,6 @@ error[E0308]: mismatched types | LL | some_other_func() = 4; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0070]: invalid left-hand side expression --> $DIR/E0070.rs:8:5 diff --git a/src/test/ui/error-codes/E0271.stderr b/src/test/ui/error-codes/E0271.stderr index 2f9191b43269b..3ed2f6f0d235b 100644 --- a/src/test/ui/error-codes/E0271.stderr +++ b/src/test/ui/error-codes/E0271.stderr @@ -5,10 +5,7 @@ LL | fn foo(t: T) where T: Trait { | --- ------------------ required by this bound in `foo` ... LL | foo(3_i8); - | ^^^ expected u32, found reference - | - = note: expected type `u32` - found reference `&'static str` + | ^^^ expected u32, found &str error: aborting due to previous error diff --git a/src/test/ui/estr-subtyping.stderr b/src/test/ui/estr-subtyping.stderr index 810c52a57066b..108df4ae1c9d2 100644 --- a/src/test/ui/estr-subtyping.stderr +++ b/src/test/ui/estr-subtyping.stderr @@ -6,9 +6,6 @@ LL | wants_uniq(x); | | | expected struct `std::string::String`, found &str | help: try using a conversion method: `x.to_string()` - | - = note: expected struct `std::string::String` - found reference `&str` error: aborting due to previous error diff --git a/src/test/ui/float-literal-inference-restrictions.stderr b/src/test/ui/float-literal-inference-restrictions.stderr index 08513507ecf96..ea4db56482948 100644 --- a/src/test/ui/float-literal-inference-restrictions.stderr +++ b/src/test/ui/float-literal-inference-restrictions.stderr @@ -6,9 +6,6 @@ LL | let x: f32 = 1; | | | expected f32, found integer | help: use a float literal: `1.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/float-literal-inference-restrictions.rs:3:18 diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.rs b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.rs index af4a633090b0e..94a9f4e5692a3 100644 --- a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.rs +++ b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.rs @@ -12,8 +12,6 @@ fn bar(x: x::Foo) -> y::Foo { return x; //~^ ERROR mismatched types //~| expected enum `y::Foo`, found enum `x::Foo` - //~| expected enum `y::Foo` - //~| found enum `x::Foo` } fn main() { diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr index fe4579f49b910..aed7f72c660df 100644 --- a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr +++ b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr @@ -5,9 +5,6 @@ LL | fn bar(x: x::Foo) -> y::Foo { | ------ expected `y::Foo` because of return type LL | return x; | ^ expected enum `y::Foo`, found enum `x::Foo` - | - = note: expected enum `y::Foo` - found enum `x::Foo` error: aborting due to previous error diff --git a/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr b/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr index 16847727aef30..759c7302d13c6 100644 --- a/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr +++ b/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr @@ -15,8 +15,6 @@ error[E0271]: type mismatch resolving `<[closure@$DIR/issue-62203-hrtb-ice.rs:42 LL | let v = Unit2.m( | ^ expected struct `Unit4`, found struct `Unit3` | - = note: expected struct `Unit4` - found struct `Unit3` = note: required because of the requirements on the impl of `for<'r> T0<'r, (>::V,)>` for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]>` error: aborting due to 2 previous errors diff --git a/src/test/ui/if-else-type-mismatch.stderr b/src/test/ui/if-else-type-mismatch.stderr index d25eda0e98057..6d36854545cab 100644 --- a/src/test/ui/if-else-type-mismatch.stderr +++ b/src/test/ui/if-else-type-mismatch.stderr @@ -10,9 +10,6 @@ LL | | 2u32 | | ^^^^ expected i32, found u32 LL | | }; | |_____- if and else have incompatible types - | - = note: expected type `i32` - found type `u32` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:8:38 @@ -21,9 +18,6 @@ LL | let _ = if true { 42i32 } else { 42u32 }; | ----- ^^^^^ expected i32, found u32 | | | expected because of this - | - = note: expected type `i32` - found type `u32` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:13:9 @@ -40,9 +34,6 @@ LL | | 4u32 | | ^^^^ expected (), found u32 LL | | }; | |_____- if and else have incompatible types - | - = note: expected type `()` - found type `u32` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:19:9 @@ -59,9 +50,6 @@ LL | | 6u32; | | expected u32, found () LL | | }; | |_____- if and else have incompatible types - | - = note: expected type `u32` - found unit type `()` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:25:9 @@ -75,9 +63,6 @@ LL | | 8u32 | | ^^^^ expected (), found u32 LL | | }; | |_____- if and else have incompatible types - | - = note: expected type `()` - found type `u32` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:31:9 @@ -91,9 +76,6 @@ LL | | 10u32; | | ^^^^^^ expected i32, found () LL | | }; | |_____- if and else have incompatible types - | - = note: expected type `i32` - found unit type `()` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:37:9 @@ -105,9 +87,6 @@ LL | | } else { | |_____- expected because of this LL | 11u32 | ^^^^^ expected (), found u32 - | - = note: expected type `()` - found type `u32` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:42:12 @@ -121,9 +100,6 @@ LL | } else { LL | | LL | | }; | |_____^ expected i32, found () - | - = note: expected type `i32` - found unit type `()` error: aborting due to 8 previous errors diff --git a/src/test/ui/if/if-branch-types.stderr b/src/test/ui/if/if-branch-types.stderr index 74b925f72fff0..bfaae2d31a01b 100644 --- a/src/test/ui/if/if-branch-types.stderr +++ b/src/test/ui/if/if-branch-types.stderr @@ -5,9 +5,6 @@ LL | let x = if true { 10i32 } else { 10u32 }; | ----- ^^^^^ expected i32, found u32 | | | expected because of this - | - = note: expected type `i32` - found type `u32` error: aborting due to previous error diff --git a/src/test/ui/if/if-let-arm-types.rs b/src/test/ui/if/if-let-arm-types.rs index 0f8815f0479f5..f120b60c611f0 100644 --- a/src/test/ui/if/if-let-arm-types.rs +++ b/src/test/ui/if/if-let-arm-types.rs @@ -8,5 +8,4 @@ fn main() { }; //~^^ ERROR: if and else have incompatible types //~| NOTE expected (), found integer - //~| NOTE expected type `()` } diff --git a/src/test/ui/if/if-let-arm-types.stderr b/src/test/ui/if/if-let-arm-types.stderr index ff88de20f76cc..088aa0e8554bb 100644 --- a/src/test/ui/if/if-let-arm-types.stderr +++ b/src/test/ui/if/if-let-arm-types.stderr @@ -11,9 +11,6 @@ LL | | 1 | | ^ expected (), found integer LL | | }; | |_____- if and else have incompatible types - | - = note: expected type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/if/if-no-match-bindings.stderr b/src/test/ui/if/if-no-match-bindings.stderr index 215e236f6b01e..add9ee86ac226 100644 --- a/src/test/ui/if/if-no-match-bindings.stderr +++ b/src/test/ui/if/if-no-match-bindings.stderr @@ -6,9 +6,6 @@ LL | if b_ref() {} | | | expected bool, found &bool | help: consider dereferencing the borrow: `*b_ref()` - | - = note: expected type `bool` - found reference `&bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:19:8 @@ -18,9 +15,6 @@ LL | if b_mut_ref() {} | | | expected bool, found &mut bool | help: consider dereferencing the borrow: `*b_mut_ref()` - | - = note: expected type `bool` - found mutable reference `&mut bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:20:8 @@ -30,9 +24,6 @@ LL | if &true {} | | | expected bool, found &bool | help: consider removing the borrow: `true` - | - = note: expected type `bool` - found reference `&bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:21:8 @@ -42,9 +33,6 @@ LL | if &mut true {} | | | expected bool, found &mut bool | help: consider removing the borrow: `true` - | - = note: expected type `bool` - found mutable reference `&mut bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:24:11 @@ -54,9 +42,6 @@ LL | while b_ref() {} | | | expected bool, found &bool | help: consider dereferencing the borrow: `*b_ref()` - | - = note: expected type `bool` - found reference `&bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:25:11 @@ -66,9 +51,6 @@ LL | while b_mut_ref() {} | | | expected bool, found &mut bool | help: consider dereferencing the borrow: `*b_mut_ref()` - | - = note: expected type `bool` - found mutable reference `&mut bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:26:11 @@ -78,9 +60,6 @@ LL | while &true {} | | | expected bool, found &bool | help: consider removing the borrow: `true` - | - = note: expected type `bool` - found reference `&bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:27:11 @@ -90,9 +69,6 @@ LL | while &mut true {} | | | expected bool, found &mut bool | help: consider removing the borrow: `true` - | - = note: expected type `bool` - found mutable reference `&mut bool` error: aborting due to 8 previous errors diff --git a/src/test/ui/if/if-without-else-as-fn-expr.stderr b/src/test/ui/if/if-without-else-as-fn-expr.stderr index a62a2cc1522a7..472c85d96fbd7 100644 --- a/src/test/ui/if/if-without-else-as-fn-expr.stderr +++ b/src/test/ui/if/if-without-else-as-fn-expr.stderr @@ -8,8 +8,6 @@ LL | | return 3; LL | | } | |_____^ expected usize, found () | - = note: expected type `usize` - found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -24,8 +22,6 @@ LL | | return 3; LL | | }; | |_____^ expected usize, found () | - = note: expected type `usize` - found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -39,8 +35,6 @@ LL | | 3 LL | | } | |_____^ expected usize, found () | - = note: expected type `usize` - found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -54,8 +48,6 @@ LL | | return 3; LL | | } | |_____^ expected usize, found () | - = note: expected type `usize` - found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -70,8 +62,6 @@ LL | | return 3; LL | | }; | |_____^ expected usize, found () | - = note: expected type `usize` - found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -85,8 +75,6 @@ LL | | 3 LL | | } | |_____^ expected usize, found () | - = note: expected type `usize` - found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/if/if-without-else-result.rs b/src/test/ui/if/if-without-else-result.rs index 4602beb4c77db..bd55973346665 100644 --- a/src/test/ui/if/if-without-else-result.rs +++ b/src/test/ui/if/if-without-else-result.rs @@ -1,8 +1,6 @@ fn main() { let a = if true { true }; //~^ ERROR if may be missing an else clause [E0317] - //~| expected unit type `()` - //~| found type `bool` //~| expected (), found bool println!("{}", a); } diff --git a/src/test/ui/if/if-without-else-result.stderr b/src/test/ui/if/if-without-else-result.stderr index 7870439fee15d..b2c700d3c8feb 100644 --- a/src/test/ui/if/if-without-else-result.stderr +++ b/src/test/ui/if/if-without-else-result.stderr @@ -7,8 +7,6 @@ LL | let a = if true { true }; | | found here | expected (), found bool | - = note: expected unit type `()` - found type `bool` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/impl-trait/equality.stderr b/src/test/ui/impl-trait/equality.stderr index 7bb2d7d47a51d..7349ab12cda04 100644 --- a/src/test/ui/impl-trait/equality.stderr +++ b/src/test/ui/impl-trait/equality.stderr @@ -9,9 +9,6 @@ LL | return 1_i32; LL | } LL | 0_u32 | ^^^^^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error[E0277]: cannot add `impl Foo` to `u32` --> $DIR/equality.rs:24:11 diff --git a/src/test/ui/include-macros/mismatched-types.stderr b/src/test/ui/include-macros/mismatched-types.stderr index 79f12356a6de4..43d8ba1d7a361 100644 --- a/src/test/ui/include-macros/mismatched-types.stderr +++ b/src/test/ui/include-macros/mismatched-types.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/mismatched-types.rs:2:20 | LL | let b: &[u8] = include_str!("file.txt"); - | ^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found str + | ^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[u8]`, found str | = note: expected reference `&[u8]` found reference `&'static str` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/mismatched-types.rs:3:19 | LL | let s: &str = include_bytes!("file.txt"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected str, found array of 0 elements + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected str, found array `[u8; 0]` | = note: expected reference `&str` found reference `&'static [u8; 0]` diff --git a/src/test/ui/integral-variable-unification-error.rs b/src/test/ui/integral-variable-unification-error.rs index 3eefcdea3d902..5200b4a829db2 100644 --- a/src/test/ui/integral-variable-unification-error.rs +++ b/src/test/ui/integral-variable-unification-error.rs @@ -2,7 +2,5 @@ fn main() { let mut x = 2; x = 5.0; //~^ ERROR mismatched types - //~| expected type `{integer}` - //~| found type `{float}` //~| expected integer, found floating-point number } diff --git a/src/test/ui/integral-variable-unification-error.stderr b/src/test/ui/integral-variable-unification-error.stderr index 262203b7b8e4d..b49bff1b0d84d 100644 --- a/src/test/ui/integral-variable-unification-error.stderr +++ b/src/test/ui/integral-variable-unification-error.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | x = 5.0; | ^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-11319.rs b/src/test/ui/issues/issue-11319.rs index 726c437355e53..f40d000516156 100644 --- a/src/test/ui/issues/issue-11319.rs +++ b/src/test/ui/issues/issue-11319.rs @@ -8,7 +8,6 @@ fn main() { None => (), //~^ ERROR match arms have incompatible types //~| NOTE expected bool, found () - //~| NOTE expected type `bool` _ => true } } diff --git a/src/test/ui/issues/issue-11319.stderr b/src/test/ui/issues/issue-11319.stderr index 9abae68ed5290..2ca49922d0612 100644 --- a/src/test/ui/issues/issue-11319.stderr +++ b/src/test/ui/issues/issue-11319.stderr @@ -15,9 +15,6 @@ LL | | None => (), LL | | _ => true LL | | } | |_____- `match` arms have incompatible types - | - = note: expected type `bool` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-12997-2.stderr b/src/test/ui/issues/issue-12997-2.stderr index bac69075c83bb..102405cd0f674 100644 --- a/src/test/ui/issues/issue-12997-2.stderr +++ b/src/test/ui/issues/issue-12997-2.stderr @@ -2,10 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-12997-2.rs:8:1 | LL | fn bar(x: isize) { } - | ^^^^^^^^^^^^^^^^^^^^ expected isize, found mutable reference - | - = note: expected type `isize` - found mutable reference `&mut test::Bencher` + | ^^^^^^^^^^^^^^^^^^^^ expected isize, found &mut test::Bencher error: aborting due to previous error diff --git a/src/test/ui/issues/issue-13407.stderr b/src/test/ui/issues/issue-13407.stderr index 4c3e481564f23..5a465cc533bb7 100644 --- a/src/test/ui/issues/issue-13407.stderr +++ b/src/test/ui/issues/issue-13407.stderr @@ -9,9 +9,6 @@ error[E0308]: mismatched types | LL | A::C = 1; | ^ expected struct `A::C`, found integer - | - = note: expected struct `A::C` - found type `{integer}` error[E0070]: invalid left-hand side expression --> $DIR/issue-13407.rs:6:5 diff --git a/src/test/ui/issues/issue-13446.stderr b/src/test/ui/issues/issue-13446.stderr index 80a32cd276a98..13c35dd84f7c5 100644 --- a/src/test/ui/issues/issue-13446.stderr +++ b/src/test/ui/issues/issue-13446.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-13446.rs:3:26 | LL | static VEC: [u32; 256] = vec![]; - | ^^^^^^ expected array of 256 elements, found struct `std::vec::Vec` + | ^^^^^^ expected array `[u32; 256]`, found struct `std::vec::Vec` | = note: expected array `[u32; 256]` found struct `std::vec::Vec<_>` diff --git a/src/test/ui/issues/issue-14091.stderr b/src/test/ui/issues/issue-14091.stderr index 24a076624edee..bb9f843dadfe3 100644 --- a/src/test/ui/issues/issue-14091.stderr +++ b/src/test/ui/issues/issue-14091.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | assert!(1,1); | ^^^^^^^^^^^^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-14541.rs b/src/test/ui/issues/issue-14541.rs index e8d44a4a9f88d..555ec9f9868c5 100644 --- a/src/test/ui/issues/issue-14541.rs +++ b/src/test/ui/issues/issue-14541.rs @@ -5,8 +5,6 @@ fn make(v: Vec2) { let Vec3 { y: _, z: _ } = v; //~^ ERROR mismatched types //~| expected struct `Vec2`, found struct `Vec3` - //~| expected struct `Vec2` - //~| found struct `Vec3` } fn main() { } diff --git a/src/test/ui/issues/issue-14541.stderr b/src/test/ui/issues/issue-14541.stderr index e7cae883d6bf2..c5512e03007df 100644 --- a/src/test/ui/issues/issue-14541.stderr +++ b/src/test/ui/issues/issue-14541.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let Vec3 { y: _, z: _ } = v; | ^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found struct `Vec3` - | - = note: expected struct `Vec2` - found struct `Vec3` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-15783.rs b/src/test/ui/issues/issue-15783.rs index 61cb0093b1c44..0c1db02a8e637 100644 --- a/src/test/ui/issues/issue-15783.rs +++ b/src/test/ui/issues/issue-15783.rs @@ -9,6 +9,6 @@ fn main() { //~^ ERROR mismatched types //~| expected enum `std::option::Option<&[&str]>` //~| found enum `std::option::Option<&[&str; 1]>` - //~| expected slice, found array of 1 element + //~| expected slice `[&str]`, found array `[&str; 1]` assert_eq!(msg, 3); } diff --git a/src/test/ui/issues/issue-15783.stderr b/src/test/ui/issues/issue-15783.stderr index f60655b7a34d3..74a96df5b1b0f 100644 --- a/src/test/ui/issues/issue-15783.stderr +++ b/src/test/ui/issues/issue-15783.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-15783.rs:8:19 | LL | let msg = foo(x); - | ^ expected slice, found array of 1 element + | ^ expected slice `[&str]`, found array `[&str; 1]` | = note: expected enum `std::option::Option<&[&str]>` found enum `std::option::Option<&[&str; 1]>` diff --git a/src/test/ui/issues/issue-15896.rs b/src/test/ui/issues/issue-15896.rs index 1a0a7b4b8e6d9..a11c9d07f6fe5 100644 --- a/src/test/ui/issues/issue-15896.rs +++ b/src/test/ui/issues/issue-15896.rs @@ -11,8 +11,6 @@ fn main() { Tau{t: x}, //~^ ERROR mismatched types //~| expected enum `main::R`, found struct `main::Tau` - //~| expected enum `main::R` - //~| found struct `main::Tau` _) => x, }; } diff --git a/src/test/ui/issues/issue-15896.stderr b/src/test/ui/issues/issue-15896.stderr index a8227bb19c23f..f553be9df55eb 100644 --- a/src/test/ui/issues/issue-15896.stderr +++ b/src/test/ui/issues/issue-15896.stderr @@ -6,9 +6,6 @@ LL | let u = match e { LL | E::B( LL | Tau{t: x}, | ^^^^^^^^^ expected enum `main::R`, found struct `main::Tau` - | - = note: expected enum `main::R` - found struct `main::Tau` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-17033.rs b/src/test/ui/issues/issue-17033.rs index c330745bc07d6..715892397a479 100644 --- a/src/test/ui/issues/issue-17033.rs +++ b/src/test/ui/issues/issue-17033.rs @@ -1,7 +1,5 @@ fn f<'r>(p: &'r mut fn(p: &mut ())) { (*p)(()) //~ ERROR mismatched types - //~| expected mutable reference `&mut ()` - //~| found unit type `()` //~| expected &mut (), found () } diff --git a/src/test/ui/issues/issue-17033.stderr b/src/test/ui/issues/issue-17033.stderr index 37f817c2e9b14..4bdc806f71763 100644 --- a/src/test/ui/issues/issue-17033.stderr +++ b/src/test/ui/issues/issue-17033.stderr @@ -6,9 +6,6 @@ LL | (*p)(()) | | | expected &mut (), found () | help: consider mutably borrowing here: `&mut ()` - | - = note: expected mutable reference `&mut ()` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-19991.rs b/src/test/ui/issues/issue-19991.rs index 1d8128ffcb9e1..e79a006afd9f7 100644 --- a/src/test/ui/issues/issue-19991.rs +++ b/src/test/ui/issues/issue-19991.rs @@ -3,8 +3,6 @@ fn main() { if let Some(homura) = Some("madoka") { //~ ERROR missing an else clause - //~| expected unit type `()` - //~| found type `{integer}` //~| expected (), found integer 765 }; diff --git a/src/test/ui/issues/issue-19991.stderr b/src/test/ui/issues/issue-19991.stderr index c808680ce619b..d06c3acfd12c6 100644 --- a/src/test/ui/issues/issue-19991.stderr +++ b/src/test/ui/issues/issue-19991.stderr @@ -3,15 +3,11 @@ error[E0317]: if may be missing an else clause | LL | / if let Some(homura) = Some("madoka") { LL | | -LL | | -LL | | LL | | 765 | | --- found here LL | | }; | |_____^ expected (), found integer | - = note: expected unit type `()` - found type `{integer}` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/issues/issue-20225.rs b/src/test/ui/issues/issue-20225.rs index b15f2a631fd86..0c8e6e402e2ce 100644 --- a/src/test/ui/issues/issue-20225.rs +++ b/src/test/ui/issues/issue-20225.rs @@ -5,13 +5,11 @@ struct Foo; impl<'a, T> Fn<(&'a T,)> for Foo { extern "rust-call" fn call(&self, (_,): (T,)) {} //~^ ERROR: has an incompatible type for trait - //~| expected reference } impl<'a, T> FnMut<(&'a T,)> for Foo { extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} //~^ ERROR: has an incompatible type for trait - //~| expected reference } impl<'a, T> FnOnce<(&'a T,)> for Foo { @@ -19,7 +17,6 @@ impl<'a, T> FnOnce<(&'a T,)> for Foo { extern "rust-call" fn call_once(self, (_,): (T,)) {} //~^ ERROR: has an incompatible type for trait - //~| expected reference } fn main() {} diff --git a/src/test/ui/issues/issue-20225.stderr b/src/test/ui/issues/issue-20225.stderr index 63b0451e01a18..baee8b967992f 100644 --- a/src/test/ui/issues/issue-20225.stderr +++ b/src/test/ui/issues/issue-20225.stderr @@ -4,7 +4,7 @@ error[E0053]: method `call` has an incompatible type for trait LL | impl<'a, T> Fn<(&'a T,)> for Foo { | - this type parameter LL | extern "rust-call" fn call(&self, (_,): (T,)) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter `T` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &T, found type parameter `T` | = note: expected fn pointer `extern "rust-call" fn(&Foo, (&'a T,))` found fn pointer `extern "rust-call" fn(&Foo, (T,))` @@ -12,12 +12,12 @@ LL | extern "rust-call" fn call(&self, (_,): (T,)) {} = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters error[E0053]: method `call_mut` has an incompatible type for trait - --> $DIR/issue-20225.rs:12:3 + --> $DIR/issue-20225.rs:11:3 | LL | impl<'a, T> FnMut<(&'a T,)> for Foo { | - this type parameter LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter `T` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &T, found type parameter `T` | = note: expected fn pointer `extern "rust-call" fn(&mut Foo, (&'a T,))` found fn pointer `extern "rust-call" fn(&mut Foo, (T,))` @@ -25,13 +25,13 @@ LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters error[E0053]: method `call_once` has an incompatible type for trait - --> $DIR/issue-20225.rs:20:3 + --> $DIR/issue-20225.rs:18:3 | LL | impl<'a, T> FnOnce<(&'a T,)> for Foo { | - this type parameter ... LL | extern "rust-call" fn call_once(self, (_,): (T,)) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter `T` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &T, found type parameter `T` | = note: expected fn pointer `extern "rust-call" fn(Foo, (&'a T,))` found fn pointer `extern "rust-call" fn(Foo, (T,))` diff --git a/src/test/ui/issues/issue-22684.stderr b/src/test/ui/issues/issue-22684.stderr index 20a0d6f410338..3c6d3df7faee4 100644 --- a/src/test/ui/issues/issue-22684.stderr +++ b/src/test/ui/issues/issue-22684.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let _: () = foo::Foo.bar(); | ^^^^^^^^^^^^^^ expected (), found bool - | - = note: expected unit type `()` - found type `bool` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-23589.stderr b/src/test/ui/issues/issue-23589.stderr index 8d58095ceff30..a36b380b9c1f0 100644 --- a/src/test/ui/issues/issue-23589.stderr +++ b/src/test/ui/issues/issue-23589.stderr @@ -12,9 +12,6 @@ error[E0308]: mismatched types | LL | let v: Vec(&str) = vec!['1', '2']; | ^^^ expected &str, found char - | - = note: expected reference `&str` - found type `char` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-27008.rs b/src/test/ui/issues/issue-27008.rs index 3b271a2a35bdb..1a08647358ccc 100644 --- a/src/test/ui/issues/issue-27008.rs +++ b/src/test/ui/issues/issue-27008.rs @@ -4,6 +4,4 @@ fn main() { let b = [0; S]; //~^ ERROR mismatched types //~| expected usize, found struct `S` - //~| expected type `usize` - //~| found struct `S` } diff --git a/src/test/ui/issues/issue-27008.stderr b/src/test/ui/issues/issue-27008.stderr index 598ee741a5c8b..2c9eed0b3a54b 100644 --- a/src/test/ui/issues/issue-27008.stderr +++ b/src/test/ui/issues/issue-27008.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let b = [0; S]; | ^ expected usize, found struct `S` - | - = note: expected type `usize` - found struct `S` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-27042.stderr b/src/test/ui/issues/issue-27042.stderr index 4244f36e48180..e379b23a5950a 100644 --- a/src/test/ui/issues/issue-27042.stderr +++ b/src/test/ui/issues/issue-27042.stderr @@ -16,9 +16,6 @@ LL | loop { break }; | | | expected i32, found () | help: give it a value of the expected type: `break 42` - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/issue-27042.rs:8:9 @@ -27,9 +24,6 @@ LL | / 'b: LL | | LL | | while true { break }; // but here we cite the whole loop | |____________________________^ expected i32, found () - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/issue-27042.rs:12:9 @@ -37,9 +31,6 @@ error[E0308]: mismatched types LL | / 'c: LL | | for _ in None { break }; // but here we cite the whole loop | |_______________________________^ expected i32, found () - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/issue-27042.rs:15:9 @@ -47,9 +38,6 @@ error[E0308]: mismatched types LL | / 'd: LL | | while let Some(_) = None { break }; | |__________________________________________^ expected i32, found () - | - = note: expected type `i32` - found unit type `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/issues/issue-29084.rs b/src/test/ui/issues/issue-29084.rs index 4710a594b3102..c4c6b6f8183b9 100644 --- a/src/test/ui/issues/issue-29084.rs +++ b/src/test/ui/issues/issue-29084.rs @@ -4,8 +4,6 @@ macro_rules! foo { bar(&mut $d); //~^ ERROR mismatched types //~| expected u8, found &mut u8 - //~| expected type `u8` - //~| found mutable reference `&mut u8` }} } diff --git a/src/test/ui/issues/issue-29084.stderr b/src/test/ui/issues/issue-29084.stderr index 0a238761fc604..a91033e336020 100644 --- a/src/test/ui/issues/issue-29084.stderr +++ b/src/test/ui/issues/issue-29084.stderr @@ -6,9 +6,6 @@ LL | bar(&mut $d); ... LL | foo!(0u8); | ---------- in this macro invocation - | - = note: expected type `u8` - found mutable reference `&mut u8` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-30225.stderr b/src/test/ui/issues/issue-30225.stderr index 27a567548ba29..ccd05fa6bfb09 100644 --- a/src/test/ui/issues/issue-30225.stderr +++ b/src/test/ui/issues/issue-30225.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | u = v; // mark $0 and $1 in a subtype relationship | ^ expected struct `A`, found struct `B` - | - = note: expected struct `A` - found struct `B` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-33504.stderr b/src/test/ui/issues/issue-33504.stderr index 758f86d3db850..522df6a07c2c6 100644 --- a/src/test/ui/issues/issue-33504.stderr +++ b/src/test/ui/issues/issue-33504.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let Test = 1; | ^^^^ expected integer, found struct `Test` - | - = note: expected type `{integer}` - found struct `Test` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-37026.stderr b/src/test/ui/issues/issue-37026.stderr index 00e44738742ec..5613d3f1766b2 100644 --- a/src/test/ui/issues/issue-37026.stderr +++ b/src/test/ui/issues/issue-37026.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | let empty_struct::XEmpty2 = (); | ^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty2` - | - = note: expected unit type `()` - found struct `empty_struct::XEmpty2` error[E0308]: mismatched types --> $DIR/issue-37026.rs:7:9 | LL | let empty_struct::XEmpty6(..) = (); | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty6` - | - = note: expected unit type `()` - found struct `empty_struct::XEmpty6` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-37665.stderr b/src/test/ui/issues/issue-37665.stderr index e7eef47fd2910..f872557966bfe 100644 --- a/src/test/ui/issues/issue-37665.stderr +++ b/src/test/ui/issues/issue-37665.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let x: () = 0; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-39970.stderr b/src/test/ui/issues/issue-39970.stderr index 7cef2e6cd4c88..b758cccd8f7bf 100644 --- a/src/test/ui/issues/issue-39970.stderr +++ b/src/test/ui/issues/issue-39970.stderr @@ -7,8 +7,6 @@ LL | fn visit() {} LL | <() as Visit>::visit(); | ^^^^^^^^^^^^^^^^^^^^ expected &(), found () | - = note: expected reference `&()` - found unit type `()` = note: required because of the requirements on the impl of `Visit` for `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-41549.stderr b/src/test/ui/issues/issue-41549.stderr index c2ffc2f4ac30c..6d2ef769a162a 100644 --- a/src/test/ui/issues/issue-41549.stderr +++ b/src/test/ui/issues/issue-41549.stderr @@ -3,9 +3,6 @@ error[E0326]: implemented const `CONST` has an incompatible type for trait | LL | const CONST: () = (); | ^^ expected u32, found () - | - = note: expected type `u32` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-41742.stderr b/src/test/ui/issues/issue-41742.stderr index a1dae867ae6fb..d6e2146208e3d 100644 --- a/src/test/ui/issues/issue-41742.stderr +++ b/src/test/ui/issues/issue-41742.stderr @@ -2,10 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-41742.rs:24:7 | LL | H["?"].f(); - | ^^^ expected u32, found reference - | - = note: expected type `u32` - found reference `&'static str` + | ^^^ expected u32, found &str error: aborting due to previous error diff --git a/src/test/ui/issues/issue-4201.rs b/src/test/ui/issues/issue-4201.rs index d4ac39526dd68..ba4e9f6fa9892 100644 --- a/src/test/ui/issues/issue-4201.rs +++ b/src/test/ui/issues/issue-4201.rs @@ -3,8 +3,6 @@ fn main() { 0 } else if false { //~^ ERROR if may be missing an else clause -//~| expected unit type `()` -//~| found type `{integer}` //~| expected (), found integer 1 }; diff --git a/src/test/ui/issues/issue-4201.stderr b/src/test/ui/issues/issue-4201.stderr index 8abb7c3c9f585..5ea4fdbf7ecc8 100644 --- a/src/test/ui/issues/issue-4201.stderr +++ b/src/test/ui/issues/issue-4201.stderr @@ -5,15 +5,11 @@ LL | } else if false { | ____________^ LL | | LL | | -LL | | -LL | | LL | | 1 | | - found here LL | | }; | |_____^ expected (), found integer | - = note: expected unit type `()` - found type `{integer}` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/issues/issue-43162.stderr b/src/test/ui/issues/issue-43162.stderr index 259b47ebe7c21..76696873f4eef 100644 --- a/src/test/ui/issues/issue-43162.stderr +++ b/src/test/ui/issues/issue-43162.stderr @@ -20,9 +20,6 @@ LL | fn foo() -> bool { LL | LL | break true; | - help: consider removing this semicolon - | - = note: expected type `bool` - found unit type `()` error: aborting due to 3 previous errors diff --git a/src/test/ui/issues/issue-43420-no-over-suggest.stderr b/src/test/ui/issues/issue-43420-no-over-suggest.stderr index 4d61788c347d5..27aebc548e198 100644 --- a/src/test/ui/issues/issue-43420-no-over-suggest.stderr +++ b/src/test/ui/issues/issue-43420-no-over-suggest.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-43420-no-over-suggest.rs:8:9 | LL | foo(&a); - | ^^ expected slice, found struct `std::vec::Vec` + | ^^ expected slice `[u16]`, found struct `std::vec::Vec` | = note: expected reference `&[u16]` found reference `&std::vec::Vec` diff --git a/src/test/ui/issues/issue-44023.stderr b/src/test/ui/issues/issue-44023.stderr index c7b5f7b204048..a55bb22986963 100644 --- a/src/test/ui/issues/issue-44023.stderr +++ b/src/test/ui/issues/issue-44023.stderr @@ -5,9 +5,6 @@ LL | fn საჭმელად_გემრიელი_სადილი ( ) | ------------------------ ^^^^^ expected isize, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `isize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-4517.rs b/src/test/ui/issues/issue-4517.rs index 569fdc1662a7b..df3da04f2e835 100644 --- a/src/test/ui/issues/issue-4517.rs +++ b/src/test/ui/issues/issue-4517.rs @@ -4,7 +4,5 @@ fn main() { let foo: [u8; 4] = [1; 4]; bar(foo); //~^ ERROR mismatched types - //~| expected type `usize` - //~| found array `[u8; 4]` - //~| expected usize, found array of 4 elements + //~| expected usize, found array `[u8; 4]` } diff --git a/src/test/ui/issues/issue-4517.stderr b/src/test/ui/issues/issue-4517.stderr index 0f45e91d6f562..6c5495484b33c 100644 --- a/src/test/ui/issues/issue-4517.stderr +++ b/src/test/ui/issues/issue-4517.stderr @@ -2,10 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-4517.rs:5:9 | LL | bar(foo); - | ^^^ expected usize, found array of 4 elements - | - = note: expected type `usize` - found array `[u8; 4]` + | ^^^ expected usize, found array `[u8; 4]` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-46302.stderr b/src/test/ui/issues/issue-46302.stderr index 221d4b6d67f71..073abdfefdc81 100644 --- a/src/test/ui/issues/issue-46302.stderr +++ b/src/test/ui/issues/issue-46302.stderr @@ -6,9 +6,6 @@ LL | let u: &str = if true { s[..2] } else { s }; | | | expected &str, found str | help: consider borrowing here: `&s[..2]` - | - = note: expected reference `&str` - found type `str` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr b/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr index dd6bef5c102c6..7e356ba1c1164 100644 --- a/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr +++ b/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr @@ -6,9 +6,6 @@ LL | light_flows_our_war_of_mocking_words(behold as usize); | | | expected &usize, found usize | help: consider borrowing here: `&(behold as usize)` - | - = note: expected reference `&usize` - found type `usize` error[E0308]: mismatched types --> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:14:42 @@ -18,9 +15,6 @@ LL | light_flows_our_war_of_mocking_words(with_tears + 4); | | | expected &usize, found usize | help: consider borrowing here: `&(with_tears + 4)` - | - = note: expected reference `&usize` - found type `usize` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-47486.stderr b/src/test/ui/issues/issue-47486.stderr index 2b49c27333068..9237b93924a85 100644 --- a/src/test/ui/issues/issue-47486.stderr +++ b/src/test/ui/issues/issue-47486.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | () < std::mem::size_of::<_>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found usize - | - = note: expected unit type `()` - found type `usize` error[E0282]: type annotations needed --> $DIR/issue-47486.rs:3:11 diff --git a/src/test/ui/issues/issue-48364.stderr b/src/test/ui/issues/issue-48364.stderr index 4e4e0e7ed94a0..4fc534d59c899 100644 --- a/src/test/ui/issues/issue-48364.stderr +++ b/src/test/ui/issues/issue-48364.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-48364.rs:2:21 | LL | b"".starts_with(stringify!(foo)) - | ^^^^^^^^^^^^^^^ expected slice, found str + | ^^^^^^^^^^^^^^^ expected slice `[u8]`, found str | = note: expected reference `&[u8]` found reference `&'static str` diff --git a/src/test/ui/issues/issue-50577.stderr b/src/test/ui/issues/issue-50577.stderr index bcc2fc500995f..2494bf7471bb9 100644 --- a/src/test/ui/issues/issue-50577.stderr +++ b/src/test/ui/issues/issue-50577.stderr @@ -31,8 +31,6 @@ LL | Drop = assert_eq!(1, 1) | expected (), found isize | found here | - = note: expected unit type `()` - found type `isize` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) diff --git a/src/test/ui/issues/issue-50585.stderr b/src/test/ui/issues/issue-50585.stderr index d2a21c48a09fc..9f60db917316e 100644 --- a/src/test/ui/issues/issue-50585.stderr +++ b/src/test/ui/issues/issue-50585.stderr @@ -9,9 +9,6 @@ error[E0308]: mismatched types | LL | |y: Vec<[(); for x in 0..2 {}]>| {}; | ^^^^^^^^^^^^^^^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-53348.rs b/src/test/ui/issues/issue-53348.rs index 83e5ddc48261a..e453b0cfaa83b 100644 --- a/src/test/ui/issues/issue-53348.rs +++ b/src/test/ui/issues/issue-53348.rs @@ -10,7 +10,6 @@ fn main() { a = *i.to_string(); //~^ ERROR mismatched types //~| NOTE expected struct `std::string::String`, found str - //~| NOTE expected struct v2.push(a); } } diff --git a/src/test/ui/issues/issue-53348.stderr b/src/test/ui/issues/issue-53348.stderr index 949d9a2f47d3d..2c117f52a26bf 100644 --- a/src/test/ui/issues/issue-53348.stderr +++ b/src/test/ui/issues/issue-53348.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | a = *i.to_string(); | ^^^^^^^^^^^^^^ expected struct `std::string::String`, found str - | - = note: expected struct `std::string::String` - found type `str` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-53692.stderr b/src/test/ui/issues/issue-53692.stderr index e3f2cb8c4101d..8dc5c95b9b1e3 100644 --- a/src/test/ui/issues/issue-53692.stderr +++ b/src/test/ui/issues/issue-53692.stderr @@ -18,9 +18,6 @@ LL | let string: String = s.clone(); | | | expected struct `std::string::String`, found &str | help: try using a conversion method: `s.to_string()` - | - = note: expected struct `std::string::String` - found reference `&str` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-56943.stderr b/src/test/ui/issues/issue-56943.stderr index fc6370b2d31cb..7fd124046dc61 100644 --- a/src/test/ui/issues/issue-56943.stderr +++ b/src/test/ui/issues/issue-56943.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let _: issue_56943::S = issue_56943::S2; | ^^^^^^^^^^^^^^^ expected struct `issue_56943::S`, found struct `issue_56943::S2` - | - = note: expected struct `issue_56943::S` - found struct `issue_56943::S2` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-61106.stderr b/src/test/ui/issues/issue-61106.stderr index 8690ff4731fed..c8439ee18f4f3 100644 --- a/src/test/ui/issues/issue-61106.stderr +++ b/src/test/ui/issues/issue-61106.stderr @@ -6,9 +6,6 @@ LL | foo(x.clone()); | | | expected &str, found struct `std::string::String` | help: consider borrowing here: `&x` - | - = note: expected reference `&str` - found struct `std::string::String` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-61882.stderr b/src/test/ui/issues/issue-61882.stderr index dbdb14d7160ec..86cc48aff06e9 100644 --- a/src/test/ui/issues/issue-61882.stderr +++ b/src/test/ui/issues/issue-61882.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | const B: A = Self(0); | ^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/issue-61882.rs:4:22 diff --git a/src/test/ui/issues/issue-7061.stderr b/src/test/ui/issues/issue-7061.stderr index 223cc48c7dd61..b498ff0b534b4 100644 --- a/src/test/ui/issues/issue-7061.stderr +++ b/src/test/ui/issues/issue-7061.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-7061.rs:4:46 | LL | fn foo(&'a mut self) -> Box { self } - | -------------- ^^^^ expected struct `std::boxed::Box`, found mutable reference + | -------------- ^^^^ expected struct `std::boxed::Box`, found &mut BarStruct | | | expected `std::boxed::Box` because of return type | diff --git a/src/test/ui/json-bom-plus-crlf-multifile.stderr b/src/test/ui/json-bom-plus-crlf-multifile.stderr index 5d631d576c7ac..c1cc57ab5119e 100644 --- a/src/test/ui/json-bom-plus-crlf-multifile.stderr +++ b/src/test/ui/json-bom-plus-crlf-multifile.stderr @@ -15,8 +15,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -35,8 +34,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -55,8 +53,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -75,8 +72,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` -found unit type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types "} {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors "} diff --git a/src/test/ui/json-bom-plus-crlf.stderr b/src/test/ui/json-bom-plus-crlf.stderr index a9c3ae4795d20..581605ca5bbfb 100644 --- a/src/test/ui/json-bom-plus-crlf.stderr +++ b/src/test/ui/json-bom-plus-crlf.stderr @@ -15,8 +15,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:17:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:17:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -35,8 +34,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:19:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:19:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -55,8 +53,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:23:1: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:23:1: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -75,8 +72,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` -found unit type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:25:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:25:22: error[E0308]: mismatched types "} {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors "} diff --git a/src/test/ui/keyword/keyword-false-as-identifier.stderr b/src/test/ui/keyword/keyword-false-as-identifier.stderr index 9544604599835..7774349b75ae6 100644 --- a/src/test/ui/keyword/keyword-false-as-identifier.stderr +++ b/src/test/ui/keyword/keyword-false-as-identifier.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let false = 22; | ^^^^^ expected integer, found bool - | - = note: expected type `{integer}` - found type `bool` error: aborting due to previous error diff --git a/src/test/ui/keyword/keyword-true-as-identifier.stderr b/src/test/ui/keyword/keyword-true-as-identifier.stderr index 36b1d882a347f..b2c2fc744c3bb 100644 --- a/src/test/ui/keyword/keyword-true-as-identifier.stderr +++ b/src/test/ui/keyword/keyword-true-as-identifier.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let true = 22; | ^^^^ expected integer, found bool - | - = note: expected type `{integer}` - found type `bool` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-closure-require-ret.stderr b/src/test/ui/liveness/liveness-closure-require-ret.stderr index 3885341e7b312..db330c2f35408 100644 --- a/src/test/ui/liveness/liveness-closure-require-ret.stderr +++ b/src/test/ui/liveness/liveness-closure-require-ret.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | fn main() { println!("{}", force(|| {})); } | ^^ expected isize, found () - | - = note: expected type `isize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-forgot-ret.stderr b/src/test/ui/liveness/liveness-forgot-ret.stderr index 201f90c6412e1..6b7bd1acdc7a7 100644 --- a/src/test/ui/liveness/liveness-forgot-ret.stderr +++ b/src/test/ui/liveness/liveness-forgot-ret.stderr @@ -5,9 +5,6 @@ LL | fn f(a: isize) -> isize { if god_exists(a) { return 5; }; } | - ^^^^^ expected isize, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `isize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-issue-2163.stderr b/src/test/ui/liveness/liveness-issue-2163.stderr index 738811adedb29..7606413f15ef8 100644 --- a/src/test/ui/liveness/liveness-issue-2163.stderr +++ b/src/test/ui/liveness/liveness-issue-2163.stderr @@ -6,9 +6,6 @@ LL | a.iter().all(|_| -> bool { LL | | LL | | }); | |_____^ expected bool, found () - | - = note: expected type `bool` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-missing-ret2.stderr b/src/test/ui/liveness/liveness-missing-ret2.stderr index 9825ecce403c5..499dbf10ede28 100644 --- a/src/test/ui/liveness/liveness-missing-ret2.stderr +++ b/src/test/ui/liveness/liveness-missing-ret2.stderr @@ -5,9 +5,6 @@ LL | fn f() -> isize { | - ^^^^^ expected isize, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `isize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr index 4255f55a4ec5f..93249fd5aff57 100644 --- a/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr +++ b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr @@ -9,9 +9,6 @@ LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } } ... LL | test!(); | -------- in this macro invocation - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/liveness-return-last-stmt-semi.rs:7:19 @@ -20,9 +17,6 @@ LL | fn no_return() -> i32 {} | --------- ^^^ expected i32, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/liveness-return-last-stmt-semi.rs:9:19 @@ -33,9 +27,6 @@ LL | fn bar(x: u32) -> u32 { | implicitly returns `()` as its body has no tail or `return` expression LL | x * 2; | - help: consider removing this semicolon - | - = note: expected type `u32` - found unit type `()` error[E0308]: mismatched types --> $DIR/liveness-return-last-stmt-semi.rs:13:19 @@ -44,9 +35,6 @@ LL | fn baz(x: u64) -> u32 { | --- ^^^ expected u32, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `u32` - found unit type `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/loops/loop-break-value.stderr b/src/test/ui/loops/loop-break-value.stderr index 8a049ac002356..4588b7b02bbe0 100644 --- a/src/test/ui/loops/loop-break-value.stderr +++ b/src/test/ui/loops/loop-break-value.stderr @@ -108,36 +108,24 @@ error[E0308]: mismatched types | LL | break 123; | ^^^ expected &str, found integer - | - = note: expected type `&str` - found type `{integer}` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:16:15 | LL | break "asdf"; - | ^^^^^^ expected i32, found reference - | - = note: expected type `i32` - found reference `&'static str` + | ^^^^^^ expected i32, found &str error[E0308]: mismatched types --> $DIR/loop-break-value.rs:21:31 | LL | break 'outer_loop "nope"; - | ^^^^^^ expected i32, found reference - | - = note: expected type `i32` - found reference `&'static str` + | ^^^^^^ expected i32, found &str error[E0308]: mismatched types --> $DIR/loop-break-value.rs:73:26 | LL | break 'c 123; | ^^^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:80:15 @@ -153,9 +141,6 @@ error[E0308]: mismatched types | LL | break 2; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:90:9 @@ -165,9 +150,6 @@ LL | break; | | | expected integer, found () | help: give it a value of the expected type: `break value` - | - = note: expected type `{integer}` - found unit type `()` error: aborting due to 16 previous errors diff --git a/src/test/ui/loops/loop-labeled-break-value.stderr b/src/test/ui/loops/loop-labeled-break-value.stderr index e34e7f4e956e2..c3d0ae28f74d7 100644 --- a/src/test/ui/loops/loop-labeled-break-value.stderr +++ b/src/test/ui/loops/loop-labeled-break-value.stderr @@ -6,9 +6,6 @@ LL | let _: i32 = loop { break }; | | | expected i32, found () | help: give it a value of the expected type: `break 42` - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/loop-labeled-break-value.rs:6:37 @@ -18,9 +15,6 @@ LL | let _: i32 = 'inner: loop { break 'inner }; | | | expected i32, found () | help: give it a value of the expected type: `break 'inner 42` - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/loop-labeled-break-value.rs:9:45 @@ -30,9 +24,6 @@ LL | let _: i32 = 'inner2: loop { loop { break 'inner2 } }; | | | expected i32, found () | help: give it a value of the expected type: `break 'inner2 42` - | - = note: expected type `i32` - found unit type `()` error: aborting due to 3 previous errors diff --git a/src/test/ui/loops/loop-properly-diverging-2.stderr b/src/test/ui/loops/loop-properly-diverging-2.stderr index 41027dc3ad6e4..9b4329ded18bd 100644 --- a/src/test/ui/loops/loop-properly-diverging-2.stderr +++ b/src/test/ui/loops/loop-properly-diverging-2.stderr @@ -6,9 +6,6 @@ LL | let x: i32 = loop { break }; | | | expected i32, found () | help: give it a value of the expected type: `break 42` - | - = note: expected type `i32` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/match/match-arm-resolving-to-never.stderr b/src/test/ui/match/match-arm-resolving-to-never.stderr index f717cf4ea75c4..4598b512f1d1f 100644 --- a/src/test/ui/match/match-arm-resolving-to-never.stderr +++ b/src/test/ui/match/match-arm-resolving-to-never.stderr @@ -9,12 +9,10 @@ LL | | E::D => 4, LL | | E::E => unimplemented!(""), | | ------------------ this and all prior arms are found to be of type `{integer}` LL | | E::F => "", - | | ^^ expected integer, found reference + | | ^^ expected integer, found &str LL | | }; | |_____- `match` arms have incompatible types | - = note: expected type `{integer}` - found reference `&'static str` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/match/match-range-fail.rs b/src/test/ui/match/match-range-fail.rs index 252d4cbf16241..c0cdbe342a07d 100644 --- a/src/test/ui/match/match-range-fail.rs +++ b/src/test/ui/match/match-range-fail.rs @@ -19,6 +19,4 @@ fn main() { _ => { } }; //~^^^ ERROR mismatched types - //~| expected type `{integer}` - //~| found type `char` } diff --git a/src/test/ui/match/match-range-fail.stderr b/src/test/ui/match/match-range-fail.stderr index 25fa9c2f6182e..8ce2d8853de31 100644 --- a/src/test/ui/match/match-range-fail.stderr +++ b/src/test/ui/match/match-range-fail.stderr @@ -29,9 +29,6 @@ error[E0308]: mismatched types | LL | 'c' ..= 100 => { } | ^^^^^^^^^^^ expected integer, found char - | - = note: expected type `{integer}` - found type `char` error: aborting due to 4 previous errors diff --git a/src/test/ui/match/match-struct.rs b/src/test/ui/match/match-struct.rs index e82d9581b2d1e..7a54c54b98cb8 100644 --- a/src/test/ui/match/match-struct.rs +++ b/src/test/ui/match/match-struct.rs @@ -6,8 +6,6 @@ fn main() { E::C(_) => (), //~^ ERROR mismatched types //~| expected struct `S`, found enum `E` - //~| expected struct `S` - //~| found enum `E` _ => () } } diff --git a/src/test/ui/match/match-struct.stderr b/src/test/ui/match/match-struct.stderr index 3d4a19a93170d..c23451d51ec5a 100644 --- a/src/test/ui/match/match-struct.stderr +++ b/src/test/ui/match/match-struct.stderr @@ -5,9 +5,6 @@ LL | match (S { a: 1 }) { | ------------ this match expression has type `S` LL | E::C(_) => (), | ^^^^^^^ expected struct `S`, found enum `E` - | - = note: expected struct `S` - found enum `E` error: aborting due to previous error diff --git a/src/test/ui/match/match-tag-nullary.stderr b/src/test/ui/match/match-tag-nullary.stderr index 5dd7b564d9dc2..4b6260b2199e1 100644 --- a/src/test/ui/match/match-tag-nullary.stderr +++ b/src/test/ui/match/match-tag-nullary.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | fn main() { let x: A = A::A; match x { B::B => { } } } | ^^^^ expected enum `A`, found enum `B` - | - = note: expected enum `A` - found enum `B` error: aborting due to previous error diff --git a/src/test/ui/match/match-tag-unary.stderr b/src/test/ui/match/match-tag-unary.stderr index 833d8838e57a8..db5dcd2be3b51 100644 --- a/src/test/ui/match/match-tag-unary.stderr +++ b/src/test/ui/match/match-tag-unary.stderr @@ -5,9 +5,6 @@ LL | fn main() { let x: A = A::A(0); match x { B::B(y) => { } } } | - ^^^^^^^ expected enum `A`, found enum `B` | | | this match expression has type `A` - | - = note: expected enum `A` - found enum `B` error: aborting due to previous error diff --git a/src/test/ui/match/match-type-err-first-arm.rs b/src/test/ui/match/match-type-err-first-arm.rs index 8dfbf1019e9a4..2a0f01a0b093f 100644 --- a/src/test/ui/match/match-type-err-first-arm.rs +++ b/src/test/ui/match/match-type-err-first-arm.rs @@ -18,7 +18,6 @@ fn test_func2(n: i32) -> i32 { _ => 42, //~^ ERROR match arms have incompatible types //~| NOTE expected char, found integer - //~| NOTE expected type `char` }; x } @@ -35,7 +34,6 @@ fn test_func3(n: i32) -> i32 { _ => 42, //~^ ERROR match arms have incompatible types //~| NOTE expected char, found integer - //~| NOTE expected type `char` }; x } @@ -48,6 +46,5 @@ fn test_func4() { None => {} //~^ ERROR match arms have incompatible types //~| NOTE expected u32, found () - //~| NOTE expected type `u32` }; } diff --git a/src/test/ui/match/match-type-err-first-arm.stderr b/src/test/ui/match/match-type-err-first-arm.stderr index 8f8bb4bdcd2ca..39048e03296a9 100644 --- a/src/test/ui/match/match-type-err-first-arm.stderr +++ b/src/test/ui/match/match-type-err-first-arm.stderr @@ -18,15 +18,11 @@ LL | | _ => 42, | | ^^ expected char, found integer LL | | LL | | -LL | | LL | | }; | |_____- `match` arms have incompatible types - | - = note: expected type `char` - found type `{integer}` error[E0308]: match arms have incompatible types - --> $DIR/match-type-err-first-arm.rs:35:14 + --> $DIR/match-type-err-first-arm.rs:34:14 | LL | let x = match n { | _____________- @@ -39,16 +35,13 @@ LL | | 6 => 'b', LL | | LL | | _ => 42, | | ^^ expected char, found integer -... | +LL | | LL | | LL | | }; | |_____- `match` arms have incompatible types - | - = note: expected type `char` - found type `{integer}` error[E0308]: match arms have incompatible types - --> $DIR/match-type-err-first-arm.rs:48:17 + --> $DIR/match-type-err-first-arm.rs:46:17 | LL | / match Some(0u32) { LL | | Some(x) => { @@ -57,13 +50,10 @@ LL | | x LL | | }, LL | | None => {} | | ^^ expected u32, found () -... | +LL | | LL | | LL | | }; | |_____- `match` arms have incompatible types - | - = note: expected type `u32` - found unit type `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr b/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr index 99e0a466817fc..12f75d009e2e5 100644 --- a/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr +++ b/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | let _seetype: () = z; | ^ expected (), found u32 - | - = note: expected unit type `()` - found type `u32` error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:102:24 | LL | let _seetype: () = z; | ^ expected (), found u64 - | - = note: expected unit type `()` - found type `u64` error[E0034]: multiple applicable items in scope --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:120:15 @@ -46,27 +40,18 @@ error[E0308]: mismatched types | LL | let _seetype: () = z; | ^ expected (), found u8 - | - = note: expected unit type `()` - found type `u8` error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:155:24 | LL | let _seetype: () = z; | ^ expected (), found u32 - | - = note: expected unit type `()` - found type `u32` error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:172:24 | LL | let _seetype: () = z; | ^ expected (), found u32 - | - = note: expected unit type `()` - found type `u32` error: aborting due to 6 previous errors diff --git a/src/test/ui/methods/method-self-arg-1.rs b/src/test/ui/methods/method-self-arg-1.rs index 169c14c0f5354..c58040cdf5fb7 100644 --- a/src/test/ui/methods/method-self-arg-1.rs +++ b/src/test/ui/methods/method-self-arg-1.rs @@ -10,8 +10,6 @@ fn main() { let x = Foo; Foo::bar(x); //~ ERROR mismatched types //~| expected &Foo, found struct `Foo` - //~| expected reference `&Foo` - //~| found struct `Foo` Foo::bar(&42); //~ ERROR mismatched types //~| expected struct `Foo`, found integer //~| expected reference `&Foo` diff --git a/src/test/ui/methods/method-self-arg-1.stderr b/src/test/ui/methods/method-self-arg-1.stderr index e0cb0915fe109..a56164db1b6c2 100644 --- a/src/test/ui/methods/method-self-arg-1.stderr +++ b/src/test/ui/methods/method-self-arg-1.stderr @@ -6,12 +6,9 @@ LL | Foo::bar(x); | | | expected &Foo, found struct `Foo` | help: consider borrowing here: `&x` - | - = note: expected reference `&Foo` - found struct `Foo` error[E0308]: mismatched types - --> $DIR/method-self-arg-1.rs:15:14 + --> $DIR/method-self-arg-1.rs:13:14 | LL | Foo::bar(&42); | ^^^ expected struct `Foo`, found integer diff --git a/src/test/ui/mir-unpretty.stderr b/src/test/ui/mir-unpretty.stderr index cb2715f554352..d3e41dabba61d 100644 --- a/src/test/ui/mir-unpretty.stderr +++ b/src/test/ui/mir-unpretty.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let x: () = 0; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/E0409.stderr b/src/test/ui/mismatched_types/E0409.stderr index e3919bf260264..5a961f8948b92 100644 --- a/src/test/ui/mismatched_types/E0409.stderr +++ b/src/test/ui/mismatched_types/E0409.stderr @@ -11,9 +11,6 @@ error[E0308]: mismatched types | LL | (0, ref y) | (y, 0) => {} | ^ expected &{integer}, found integer - | - = note: expected type `&{integer}` - found type `{integer}` error: aborting due to 2 previous errors diff --git a/src/test/ui/mismatched_types/abridged.stderr b/src/test/ui/mismatched_types/abridged.stderr index 81cc8e29e49c5..c2081878629a6 100644 --- a/src/test/ui/mismatched_types/abridged.stderr +++ b/src/test/ui/mismatched_types/abridged.stderr @@ -76,9 +76,6 @@ LL | 1+2 | | | expected struct `std::string::String`, found integer | help: try using a conversion method: `(1+2).to_string()` - | - = note: expected struct `std::string::String` - found type `{integer}` error[E0308]: mismatched types --> $DIR/abridged.rs:59:5 @@ -90,9 +87,6 @@ LL | -2 | | | expected struct `std::string::String`, found integer | help: try using a conversion method: `(-2).to_string()` - | - = note: expected struct `std::string::String` - found type `{integer}` error: aborting due to 8 previous errors diff --git a/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr b/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr index 8bba0efc8142d..97b1139abd599 100644 --- a/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr +++ b/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | x | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/main.stderr b/src/test/ui/mismatched_types/main.stderr index fc128fe6fc7f3..de66c504f8cce 100644 --- a/src/test/ui/mismatched_types/main.stderr +++ b/src/test/ui/mismatched_types/main.stderr @@ -5,9 +5,6 @@ LL | let x: u32 = ( | __________________^ LL | | ); | |_____^ expected u32, found () - | - = note: expected type `u32` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr index b5daf195ef78a..b57ceb08b1725 100644 --- a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr +++ b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr @@ -2,10 +2,7 @@ error[E0308]: mismatched types --> $DIR/overloaded-calls-bad.rs:28:17 | LL | let ans = s("what"); - | ^^^^^^ expected isize, found reference - | - = note: expected type `isize` - found reference `&'static str` + | ^^^^^^ expected isize, found &str error[E0057]: this function takes 1 parameter but 0 parameters were supplied --> $DIR/overloaded-calls-bad.rs:29:15 diff --git a/src/test/ui/missing/missing-return.stderr b/src/test/ui/missing/missing-return.stderr index 8d8d6b78c197b..441551486a40c 100644 --- a/src/test/ui/missing/missing-return.stderr +++ b/src/test/ui/missing/missing-return.stderr @@ -5,9 +5,6 @@ LL | fn f() -> isize { } | - ^^^^^ expected isize, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `isize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr b/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr index cf3952bca11dc..d7013bf3c0fb0 100644 --- a/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr +++ b/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/call-fn-never-arg-wrong-type.rs:10:9 | LL | foo("wow"); - | ^^^^^ expected !, found reference + | ^^^^^ expected !, found &str | = note: expected type `!` found reference `&'static str` diff --git a/src/test/ui/never_type/never-assign-wrong-type.stderr b/src/test/ui/never_type/never-assign-wrong-type.stderr index fcdb9ef6c9211..3f72b6914ca38 100644 --- a/src/test/ui/never_type/never-assign-wrong-type.stderr +++ b/src/test/ui/never_type/never-assign-wrong-type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/never-assign-wrong-type.rs:7:16 | LL | let x: ! = "hello"; - | ^^^^^^^ expected !, found reference + | ^^^^^^^ expected !, found &str | = note: expected type `!` found reference `&'static str` diff --git a/src/test/ui/or-patterns/consistent-bindings.stderr b/src/test/ui/or-patterns/consistent-bindings.stderr index b56aebb99d562..d787cae434362 100644 --- a/src/test/ui/or-patterns/consistent-bindings.stderr +++ b/src/test/ui/or-patterns/consistent-bindings.stderr @@ -11,9 +11,6 @@ error[E0308]: mismatched types | LL | let () = 0; | ^^ expected integer, found () - | - = note: expected type `{integer}` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/or-patterns/issue-64879-trailing-before-guard.stderr b/src/test/ui/or-patterns/issue-64879-trailing-before-guard.stderr index db6670fc5b1e0..4502ae0c0cc3e 100644 --- a/src/test/ui/or-patterns/issue-64879-trailing-before-guard.stderr +++ b/src/test/ui/or-patterns/issue-64879-trailing-before-guard.stderr @@ -11,9 +11,6 @@ error[E0308]: mismatched types | LL | let recovery_witness: bool = 0; | ^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error: aborting due to 2 previous errors diff --git a/src/test/ui/or-patterns/or-pattern-mismatch.stderr b/src/test/ui/or-patterns/or-pattern-mismatch.stderr index 731b2090a7ba0..be06f3666cb3e 100644 --- a/src/test/ui/or-patterns/or-pattern-mismatch.stderr +++ b/src/test/ui/or-patterns/or-pattern-mismatch.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | fn main() { match Blah::A(1, 1, 2) { Blah::A(_, x, y) | Blah::B(x, y) => { } } } | ^ expected usize, found isize - | - = note: expected type `usize` - found type `isize` error: aborting due to previous error diff --git a/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr b/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr index 5985b2aecfc20..7e4cf0d14e1f8 100644 --- a/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr +++ b/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr @@ -122,9 +122,6 @@ LL | let recovery_witness: String = 0; | | | expected struct `std::string::String`, found integer | help: try using a conversion method: `0.to_string()` - | - = note: expected struct `std::string::String` - found type `{integer}` error: aborting due to 16 previous errors diff --git a/src/test/ui/output-type-mismatch.stderr b/src/test/ui/output-type-mismatch.stderr index 051af60121bcf..91ee46c55a786 100644 --- a/src/test/ui/output-type-mismatch.stderr +++ b/src/test/ui/output-type-mismatch.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | fn main() { let i: isize; i = f(); } | ^^^ expected isize, found () - | - = note: expected type `isize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/parser/expr-as-stmt.stderr b/src/test/ui/parser/expr-as-stmt.stderr index 83e8880f183f2..2a751e9d43a37 100644 --- a/src/test/ui/parser/expr-as-stmt.stderr +++ b/src/test/ui/parser/expr-as-stmt.stderr @@ -48,36 +48,24 @@ error[E0308]: mismatched types | LL | {2} + {2} | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:12:6 | LL | {2} + 2 | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:18:7 | LL | { 42 } + foo; | ^^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:24:7 | LL | { 3 } * 3 | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0614]: type `{integer}` cannot be dereferenced --> $DIR/expr-as-stmt.rs:24:11 diff --git a/src/test/ui/parser/fn-arg-doc-comment.rs b/src/test/ui/parser/fn-arg-doc-comment.rs index 995eb62d0bb59..ad28c9d3dce34 100644 --- a/src/test/ui/parser/fn-arg-doc-comment.rs +++ b/src/test/ui/parser/fn-arg-doc-comment.rs @@ -17,13 +17,10 @@ fn main() { // verify that the parser recovered and properly typechecked the args f("", ""); //~^ ERROR mismatched types - //~| NOTE expected u8, found reference - //~| NOTE expected + //~| NOTE expected u8, found &str //~| ERROR mismatched types - //~| NOTE expected u8, found reference - //~| NOTE expected + //~| NOTE expected u8, found &str bar(""); //~^ ERROR mismatched types - //~| NOTE expected i32, found reference - //~| NOTE expected + //~| NOTE expected i32, found &str } diff --git a/src/test/ui/parser/fn-arg-doc-comment.stderr b/src/test/ui/parser/fn-arg-doc-comment.stderr index 9554cf42ee383..5ea1eef0e4f0d 100644 --- a/src/test/ui/parser/fn-arg-doc-comment.stderr +++ b/src/test/ui/parser/fn-arg-doc-comment.stderr @@ -20,28 +20,19 @@ error[E0308]: mismatched types --> $DIR/fn-arg-doc-comment.rs:18:7 | LL | f("", ""); - | ^^ expected u8, found reference - | - = note: expected type `u8` - found reference `&'static str` + | ^^ expected u8, found &str error[E0308]: mismatched types --> $DIR/fn-arg-doc-comment.rs:18:11 | LL | f("", ""); - | ^^ expected u8, found reference - | - = note: expected type `u8` - found reference `&'static str` + | ^^ expected u8, found &str error[E0308]: mismatched types - --> $DIR/fn-arg-doc-comment.rs:25:9 + --> $DIR/fn-arg-doc-comment.rs:23:9 | LL | bar(""); - | ^^ expected i32, found reference - | - = note: expected type `i32` - found reference `&'static str` + | ^^ expected i32, found &str error: aborting due to 6 previous errors diff --git a/src/test/ui/parser/issue-33413.stderr b/src/test/ui/parser/issue-33413.stderr index d1e09ce16554a..b0d41a27dc909 100644 --- a/src/test/ui/parser/issue-33413.stderr +++ b/src/test/ui/parser/issue-33413.stderr @@ -11,9 +11,6 @@ LL | fn f(*, a: u8) -> u8 {} | - ^^ expected u8, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `u8` - found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/issue-62881.stderr b/src/test/ui/parser/issue-62881.stderr index 2905cc7370db2..ddb97b40e9590 100644 --- a/src/test/ui/parser/issue-62881.stderr +++ b/src/test/ui/parser/issue-62881.stderr @@ -20,9 +20,6 @@ LL | fn f() -> isize { fn f() -> isize {} pub f< | - ^^^^^ expected isize, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `isize` - found unit type `()` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/issue-62895.stderr b/src/test/ui/parser/issue-62895.stderr index 61cb1faead124..e46152fad0e5e 100644 --- a/src/test/ui/parser/issue-62895.stderr +++ b/src/test/ui/parser/issue-62895.stderr @@ -40,9 +40,6 @@ LL | fn v() -> isize { | - ^^^^^ expected isize, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `isize` - found unit type `()` error: aborting due to 6 previous errors diff --git a/src/test/ui/parser/lex-bad-char-literals-6.stderr b/src/test/ui/parser/lex-bad-char-literals-6.stderr index fbd1fc28dd6e7..db2b9c70a03a7 100644 --- a/src/test/ui/parser/lex-bad-char-literals-6.stderr +++ b/src/test/ui/parser/lex-bad-char-literals-6.stderr @@ -43,10 +43,7 @@ error[E0308]: mismatched types --> $DIR/lex-bad-char-literals-6.rs:15:20 | LL | let a: usize = ""; - | ^^ expected usize, found reference - | - = note: expected type `usize` - found reference `&'static str` + | ^^ expected usize, found &str error[E0277]: can't compare `&str` with `char` --> $DIR/lex-bad-char-literals-6.rs:12:10 diff --git a/src/test/ui/parser/match-vec-invalid.stderr b/src/test/ui/parser/match-vec-invalid.stderr index 2e4bf8320fb58..b9d0f13c0651f 100644 --- a/src/test/ui/parser/match-vec-invalid.stderr +++ b/src/test/ui/parser/match-vec-invalid.stderr @@ -35,9 +35,6 @@ error[E0308]: mismatched types | LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to 5 previous errors diff --git a/src/test/ui/parser/numeric-lifetime.stderr b/src/test/ui/parser/numeric-lifetime.stderr index 4a7a28825ffc2..2ef6aa6f113c5 100644 --- a/src/test/ui/parser/numeric-lifetime.stderr +++ b/src/test/ui/parser/numeric-lifetime.stderr @@ -14,10 +14,7 @@ error[E0308]: mismatched types --> $DIR/numeric-lifetime.rs:6:20 | LL | let x: usize = ""; - | ^^ expected usize, found reference - | - = note: expected type `usize` - found reference `&'static str` + | ^^ expected usize, found &str error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/pat-lt-bracket-6.stderr b/src/test/ui/parser/pat-lt-bracket-6.stderr index d702dac81daf6..bfb8866437bcd 100644 --- a/src/test/ui/parser/pat-lt-bracket-6.stderr +++ b/src/test/ui/parser/pat-lt-bracket-6.stderr @@ -18,9 +18,6 @@ error[E0308]: mismatched types | LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/pat-lt-bracket-7.stderr b/src/test/ui/parser/pat-lt-bracket-7.stderr index 77bb3b0417adb..d30a3bc0b1499 100644 --- a/src/test/ui/parser/pat-lt-bracket-7.stderr +++ b/src/test/ui/parser/pat-lt-bracket-7.stderr @@ -9,9 +9,6 @@ error[E0308]: mismatched types | LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/pat-tuple-4.stderr b/src/test/ui/parser/pat-tuple-4.stderr index 7aa91ab2af476..9472237a22ef4 100644 --- a/src/test/ui/parser/pat-tuple-4.stderr +++ b/src/test/ui/parser/pat-tuple-4.stderr @@ -18,9 +18,6 @@ error[E0308]: mismatched types | LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/recover-for-loop-parens-around-head.stderr b/src/test/ui/parser/recover-for-loop-parens-around-head.stderr index f0373b0c89f19..74ac926cb0283 100644 --- a/src/test/ui/parser/recover-for-loop-parens-around-head.stderr +++ b/src/test/ui/parser/recover-for-loop-parens-around-head.stderr @@ -18,9 +18,6 @@ error[E0308]: mismatched types | LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/recover-from-homoglyph.stderr b/src/test/ui/parser/recover-from-homoglyph.stderr index d69cba7a10653..3f5a986f08684 100644 --- a/src/test/ui/parser/recover-from-homoglyph.stderr +++ b/src/test/ui/parser/recover-from-homoglyph.stderr @@ -14,9 +14,6 @@ error[E0308]: mismatched types | LL | let x: usize = (); | ^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/recover-missing-semi.stderr b/src/test/ui/parser/recover-missing-semi.stderr index 41640ac3f23a6..1ccf8b22c5364 100644 --- a/src/test/ui/parser/recover-missing-semi.stderr +++ b/src/test/ui/parser/recover-missing-semi.stderr @@ -21,18 +21,12 @@ error[E0308]: mismatched types | LL | let _: usize = () | ^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error[E0308]: mismatched types --> $DIR/recover-missing-semi.rs:9:20 | LL | let _: usize = () | ^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/parser/recover-range-pats.stderr b/src/test/ui/parser/recover-range-pats.stderr index 160ab18e34a54..af03b577548f7 100644 --- a/src/test/ui/parser/recover-range-pats.stderr +++ b/src/test/ui/parser/recover-range-pats.stderr @@ -418,18 +418,12 @@ error[E0308]: mismatched types | LL | if let .0..Y = 0 {} | ^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0308]: mismatched types --> $DIR/recover-range-pats.rs:23:12 | LL | if let X.. .0 = 0 {} | ^^^^^^ expected integer, found floating-point number - | - = note: expected type `u8` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:32:12 @@ -452,18 +446,12 @@ error[E0308]: mismatched types | LL | if let .0..=Y = 0 {} | ^^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0308]: mismatched types --> $DIR/recover-range-pats.rs:36:12 | LL | if let X..=.0 = 0 {} | ^^^^^^ expected integer, found floating-point number - | - = note: expected type `u8` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:45:12 @@ -486,18 +474,12 @@ error[E0308]: mismatched types | LL | if let .0...Y = 0 {} | ^^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0308]: mismatched types --> $DIR/recover-range-pats.rs:52:12 | LL | if let X... .0 = 0 {} | ^^^^^^^ expected integer, found floating-point number - | - = note: expected type `u8` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:60:12 @@ -510,9 +492,6 @@ error[E0308]: mismatched types | LL | if let .0.. = 0 {} | ^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:70:12 @@ -525,9 +504,6 @@ error[E0308]: mismatched types | LL | if let .0..= = 0 {} | ^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:82:12 @@ -540,9 +516,6 @@ error[E0308]: mismatched types | LL | if let .0... = 0 {} | ^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:94:14 @@ -555,9 +528,6 @@ error[E0308]: mismatched types | LL | if let .. .0 = 0 {} | ^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:104:15 @@ -570,9 +540,6 @@ error[E0308]: mismatched types | LL | if let ..=.0 = 0 {} | ^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:116:15 @@ -585,9 +552,6 @@ error[E0308]: mismatched types | LL | if let ....3 = 0 {} | ^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error: aborting due to 85 previous errors diff --git a/src/test/ui/parser/recover-tuple.stderr b/src/test/ui/parser/recover-tuple.stderr index 70eefd8a1701e..1bd2e9867533e 100644 --- a/src/test/ui/parser/recover-tuple.stderr +++ b/src/test/ui/parser/recover-tuple.stderr @@ -8,10 +8,7 @@ error[E0308]: mismatched types --> $DIR/recover-tuple.rs:6:20 | LL | let y: usize = ""; - | ^^ expected usize, found reference - | - = note: expected type `usize` - found reference `&'static str` + | ^^ expected usize, found &str error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/require-parens-for-chained-comparison.stderr b/src/test/ui/parser/require-parens-for-chained-comparison.stderr index 85478dcd1dce5..f57668812490c 100644 --- a/src/test/ui/parser/require-parens-for-chained-comparison.stderr +++ b/src/test/ui/parser/require-parens-for-chained-comparison.stderr @@ -46,18 +46,12 @@ error[E0308]: mismatched types | LL | false == 0 < 2; | ^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/require-parens-for-chained-comparison.rs:8:18 | LL | false == 0 < 2; | ^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error: aborting due to 7 previous errors diff --git a/src/test/ui/pattern/pat-tuple-bad-type.stderr b/src/test/ui/pattern/pat-tuple-bad-type.stderr index 7a599b07f1e55..a6224d8989437 100644 --- a/src/test/ui/pattern/pat-tuple-bad-type.stderr +++ b/src/test/ui/pattern/pat-tuple-bad-type.stderr @@ -14,9 +14,6 @@ error[E0308]: mismatched types | LL | (..) => {} | ^^^^ expected u8, found () - | - = note: expected type `u8` - found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/pattern/pattern-error-continue.rs b/src/test/ui/pattern/pattern-error-continue.rs index f21da3b55dc35..eb57210f45474 100644 --- a/src/test/ui/pattern/pattern-error-continue.rs +++ b/src/test/ui/pattern/pattern-error-continue.rs @@ -22,8 +22,6 @@ fn main() { S { .. } => (), //~^ ERROR mismatched types //~| expected char, found struct `S` - //~| expected type `char` - //~| found struct `S` _ => () } diff --git a/src/test/ui/pattern/pattern-error-continue.stderr b/src/test/ui/pattern/pattern-error-continue.stderr index c8d80043fdbef..22da0d5e0db3a 100644 --- a/src/test/ui/pattern/pattern-error-continue.stderr +++ b/src/test/ui/pattern/pattern-error-continue.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: use of undeclared type or module `E` - --> $DIR/pattern-error-continue.rs:35:9 + --> $DIR/pattern-error-continue.rs:33:9 | LL | E::V => {} | ^ use of undeclared type or module `E` @@ -31,12 +31,9 @@ LL | match 'c' { | --- this match expression has type `char` LL | S { .. } => (), | ^^^^^^^^ expected char, found struct `S` - | - = note: expected type `char` - found struct `S` error[E0308]: mismatched types - --> $DIR/pattern-error-continue.rs:30:7 + --> $DIR/pattern-error-continue.rs:28:7 | LL | f(true); | ^^^^ expected char, found bool diff --git a/src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr b/src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr index 314ff84ae3c46..b73ab6e5d9f18 100644 --- a/src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr +++ b/src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr @@ -9,9 +9,6 @@ LL | return 0i32; LL | } LL | 1u32 | ^^^^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:13:16 @@ -24,9 +21,6 @@ LL | return 0i32; LL | } else { LL | return 1u32; | ^^^^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:22:9 @@ -39,9 +33,6 @@ LL | return 0i32; LL | } else { LL | 1u32 | ^^^^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error[E0308]: if and else have incompatible types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:31:9 @@ -55,9 +46,6 @@ LL | | 1u32 LL | | LL | | } | |_____- if and else have incompatible types - | - = note: expected type `i32` - found type `u32` error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:39:14 @@ -69,9 +57,6 @@ LL | 0 => return 0i32, | ---- ...is found to be `i32` here LL | _ => 1u32, | ^^^^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:45:5 @@ -86,9 +71,6 @@ LL | | 1 => 1u32, LL | | _ => 2u32, LL | | } | |_____^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:59:13 @@ -101,9 +83,6 @@ LL | return 0i32; ... LL | 1u32 | ^^^^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error: aborting due to 7 previous errors diff --git a/src/test/ui/proc-macro/attribute-spans-preserved.stderr b/src/test/ui/proc-macro/attribute-spans-preserved.stderr index e8e3b488209e8..34a203300949b 100644 --- a/src/test/ui/proc-macro/attribute-spans-preserved.stderr +++ b/src/test/ui/proc-macro/attribute-spans-preserved.stderr @@ -2,19 +2,13 @@ error[E0308]: mismatched types --> $DIR/attribute-spans-preserved.rs:7:23 | LL | #[ foo ( let y: u32 = "z"; ) ] - | ^^^ expected u32, found reference - | - = note: expected type `u32` - found reference `&'static str` + | ^^^ expected u32, found &str error[E0308]: mismatched types --> $DIR/attribute-spans-preserved.rs:8:23 | LL | #[ bar { let x: u32 = "y"; } ] - | ^^^ expected u32, found reference - | - = note: expected type `u32` - found reference `&'static str` + | ^^^ expected u32, found &str error: aborting due to 2 previous errors diff --git a/src/test/ui/proc-macro/attribute-with-error.stderr b/src/test/ui/proc-macro/attribute-with-error.stderr index 73d0e2ef66e77..e810e9ad65882 100644 --- a/src/test/ui/proc-macro/attribute-with-error.stderr +++ b/src/test/ui/proc-macro/attribute-with-error.stderr @@ -2,37 +2,25 @@ error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:10:18 | LL | let a: i32 = "foo"; - | ^^^^^ expected i32, found reference - | - = note: expected type `i32` - found reference `&'static str` + | ^^^^^ expected i32, found &str error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:12:18 | LL | let b: i32 = "f'oo"; - | ^^^^^^ expected i32, found reference - | - = note: expected type `i32` - found reference `&'static str` + | ^^^^^^ expected i32, found &str error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:25:22 | LL | let a: i32 = "foo"; - | ^^^^^ expected i32, found reference - | - = note: expected type `i32` - found reference `&'static str` + | ^^^^^ expected i32, found &str error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:35:22 | LL | let a: i32 = "foo"; - | ^^^^^ expected i32, found reference - | - = note: expected type `i32` - found reference `&'static str` + | ^^^^^ expected i32, found &str error: aborting due to 4 previous errors diff --git a/src/test/ui/proc-macro/nested-item-spans.stderr b/src/test/ui/proc-macro/nested-item-spans.stderr index b8776c29057c1..e6d1c9356ea76 100644 --- a/src/test/ui/proc-macro/nested-item-spans.stderr +++ b/src/test/ui/proc-macro/nested-item-spans.stderr @@ -2,19 +2,13 @@ error[E0308]: mismatched types --> $DIR/nested-item-spans.rs:9:22 | LL | let x: u32 = "x"; - | ^^^ expected u32, found reference - | - = note: expected type `u32` - found reference `&'static str` + | ^^^ expected u32, found &str error[E0308]: mismatched types --> $DIR/nested-item-spans.rs:18:22 | LL | let x: u32 = "x"; - | ^^^ expected u32, found reference - | - = note: expected type `u32` - found reference `&'static str` + | ^^^ expected u32, found &str error: aborting due to 2 previous errors diff --git a/src/test/ui/proc-macro/span-preservation.stderr b/src/test/ui/proc-macro/span-preservation.stderr index 60fb975500327..86d2bee20683b 100644 --- a/src/test/ui/proc-macro/span-preservation.stderr +++ b/src/test/ui/proc-macro/span-preservation.stderr @@ -2,10 +2,7 @@ error[E0308]: mismatched types --> $DIR/span-preservation.rs:11:20 | LL | let x: usize = "hello"; - | ^^^^^^^ expected usize, found reference - | - = note: expected type `usize` - found reference `&'static str` + | ^^^^^^^ expected usize, found &str error[E0308]: mismatched types --> $DIR/span-preservation.rs:17:29 @@ -48,9 +45,6 @@ LL | extern "C" fn baz() { | - possibly return type missing here? LL | 0 | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0308]: mismatched types --> $DIR/span-preservation.rs:49:5 diff --git a/src/test/ui/repeat_count.rs b/src/test/ui/repeat_count.rs index cd1b9336ac770..7e899ec37d244 100644 --- a/src/test/ui/repeat_count.rs +++ b/src/test/ui/repeat_count.rs @@ -7,21 +7,15 @@ fn main() { let b = [0; ()]; //~^ ERROR mismatched types //~| expected usize, found () - //~| expected type `usize` - //~| found unit type `()` let c = [0; true]; //~^ ERROR mismatched types //~| expected usize, found bool let d = [0; 0.5]; //~^ ERROR mismatched types //~| expected usize, found floating-point number - //~| expected type `usize` - //~| found type `{float}` let e = [0; "foo"]; //~^ ERROR mismatched types - //~| expected usize, found reference - //~| expected type `usize` - //~| found reference `&'static str` + //~| expected usize, found &str let f = [0; -4_isize]; //~^ ERROR mismatched types //~| expected usize, found isize @@ -34,6 +28,4 @@ fn main() { let g = [0; G { g: () }]; //~^ ERROR mismatched types //~| expected usize, found struct `main::G` - //~| expected type `usize` - //~| found struct `main::G` } diff --git a/src/test/ui/repeat_count.stderr b/src/test/ui/repeat_count.stderr index 056cad6127f1a..76e90af7557a8 100644 --- a/src/test/ui/repeat_count.stderr +++ b/src/test/ui/repeat_count.stderr @@ -9,36 +9,27 @@ error[E0308]: mismatched types | LL | let b = [0; ()]; | ^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error[E0308]: mismatched types - --> $DIR/repeat_count.rs:12:17 + --> $DIR/repeat_count.rs:10:17 | LL | let c = [0; true]; | ^^^^ expected usize, found bool error[E0308]: mismatched types - --> $DIR/repeat_count.rs:15:17 + --> $DIR/repeat_count.rs:13:17 | LL | let d = [0; 0.5]; | ^^^ expected usize, found floating-point number - | - = note: expected type `usize` - found type `{float}` error[E0308]: mismatched types - --> $DIR/repeat_count.rs:20:17 + --> $DIR/repeat_count.rs:16:17 | LL | let e = [0; "foo"]; - | ^^^^^ expected usize, found reference - | - = note: expected type `usize` - found reference `&'static str` + | ^^^^^ expected usize, found &str error[E0308]: mismatched types - --> $DIR/repeat_count.rs:25:17 + --> $DIR/repeat_count.rs:19:17 | LL | let f = [0; -4_isize]; | ^^^^^^^^ expected usize, found isize @@ -49,7 +40,7 @@ LL | let f = [0; (-4_isize).try_into().unwrap()]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types - --> $DIR/repeat_count.rs:28:23 + --> $DIR/repeat_count.rs:22:23 | LL | let f = [0_usize; -1_isize]; | ^^^^^^^^ expected usize, found isize @@ -60,13 +51,10 @@ LL | let f = [0_usize; (-1_isize).try_into().unwrap()]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types - --> $DIR/repeat_count.rs:34:17 + --> $DIR/repeat_count.rs:28:17 | LL | let g = [0; G { g: () }]; | ^^^^^^^^^^^ expected usize, found struct `main::G` - | - = note: expected type `usize` - found struct `main::G` error: aborting due to 8 previous errors diff --git a/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr b/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr index 6f660872f5e58..361c79dabd14f 100644 --- a/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr +++ b/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr @@ -25,18 +25,12 @@ error[E0308]: mismatched types | LL | Opts::A(ref i) | Opts::B(i) => {} | ^ expected &isize, found isize - | - = note: expected type `&isize` - found type `isize` error[E0308]: mismatched types --> $DIR/resolve-inconsistent-binding-mode.rs:16:32 | LL | Opts::A(ref i) | Opts::B(i) => {} | ^ expected &isize, found isize - | - = note: expected type `&isize` - found type `isize` error[E0308]: mismatched types --> $DIR/resolve-inconsistent-binding-mode.rs:25:36 diff --git a/src/test/ui/resolve/resolve-inconsistent-names.stderr b/src/test/ui/resolve/resolve-inconsistent-names.stderr index f02867a0024b5..04edc2da25651 100644 --- a/src/test/ui/resolve/resolve-inconsistent-names.stderr +++ b/src/test/ui/resolve/resolve-inconsistent-names.stderr @@ -88,9 +88,6 @@ error[E0308]: mismatched types | LL | (A, B) | (ref B, c) | (c, A) => () | ^^^^^ expected enum `E`, found &E - | - = note: expected type `E` - found type `&E` error: aborting due to 9 previous errors diff --git a/src/test/ui/return/return-from-diverging.stderr b/src/test/ui/return/return-from-diverging.stderr index 31f86bdf15de6..c1dcc1d5d8fb5 100644 --- a/src/test/ui/return/return-from-diverging.stderr +++ b/src/test/ui/return/return-from-diverging.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn fail() -> ! { | - expected `!` because of return type LL | return "wow"; - | ^^^^^ expected !, found reference + | ^^^^^ expected !, found &str | = note: expected type `!` found reference `&'static str` diff --git a/src/test/ui/rfc-2005-default-binding-mode/const.stderr b/src/test/ui/rfc-2005-default-binding-mode/const.stderr index e536ed50de153..8e1873c06593d 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/const.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/const.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | FOO => {}, | ^^^ expected &Foo, found struct `Foo` - | - = note: expected type `&Foo` - found struct `Foo` error: aborting due to previous error diff --git a/src/test/ui/rfc-2005-default-binding-mode/lit.stderr b/src/test/ui/rfc-2005-default-binding-mode/lit.stderr index f8df0b4ada082..fd48c56c07b79 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/lit.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/lit.stderr @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/lit.rs:16:9 | LL | b"abc" => true, - | ^^^^^^ expected &[u8], found array of 3 elements + | ^^^^^^ expected &[u8], found array `[u8; 3]` | = note: expected type `&&[u8]` found reference `&'static [u8; 3]` diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr index 0a597eaa1ffcd..d2d319f50c78d 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr @@ -5,9 +5,6 @@ LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A { | - expected `A` because of return type LL | x | ^ expected struct `A`, found enum `uninhabited::UninhabitedEnum` - | - = note: expected struct `A` - found enum `uninhabited::UninhabitedEnum` error[E0308]: mismatched types --> $DIR/coercions.rs:27:5 @@ -16,9 +13,6 @@ LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) | - expected `A` because of return type LL | x | ^ expected struct `A`, found struct `uninhabited::UninhabitedTupleStruct` - | - = note: expected struct `A` - found struct `uninhabited::UninhabitedTupleStruct` error[E0308]: mismatched types --> $DIR/coercions.rs:31:5 @@ -27,9 +21,6 @@ LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A { | - expected `A` because of return type LL | x | ^ expected struct `A`, found struct `uninhabited::UninhabitedStruct` - | - = note: expected struct `A` - found struct `uninhabited::UninhabitedStruct` error[E0308]: mismatched types --> $DIR/coercions.rs:35:5 @@ -38,9 +29,6 @@ LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariant | - expected `A` because of return type LL | x | ^ expected struct `A`, found enum `uninhabited::UninhabitedVariants` - | - = note: expected struct `A` - found enum `uninhabited::UninhabitedVariants` error: aborting due to 4 previous errors diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr index 6d7383b38960b..fd2c56974bd4a 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr @@ -5,9 +5,6 @@ LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A { | - expected `A` because of return type LL | x | ^ expected struct `A`, found enum `UninhabitedEnum` - | - = note: expected struct `A` - found enum `UninhabitedEnum` error[E0308]: mismatched types --> $DIR/coercions_same_crate.rs:34:5 @@ -16,9 +13,6 @@ LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) | - expected `A` because of return type LL | x | ^ expected struct `A`, found struct `UninhabitedTupleStruct` - | - = note: expected struct `A` - found struct `UninhabitedTupleStruct` error[E0308]: mismatched types --> $DIR/coercions_same_crate.rs:38:5 @@ -27,9 +21,6 @@ LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A { | - expected `A` because of return type LL | x | ^ expected struct `A`, found struct `UninhabitedStruct` - | - = note: expected struct `A` - found struct `UninhabitedStruct` error[E0308]: mismatched types --> $DIR/coercions_same_crate.rs:42:5 @@ -38,9 +29,6 @@ LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariant | - expected `A` because of return type LL | x | ^ expected struct `A`, found enum `UninhabitedVariants` - | - = note: expected struct `A` - found enum `UninhabitedVariants` error: aborting due to 4 previous errors diff --git a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr index b7f16a8d5bbd9..a04b109ba6d3c 100644 --- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr +++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr @@ -539,9 +539,6 @@ LL | if &let 0 = 0 {} | | | expected bool, found &bool | help: consider removing the borrow: `let 0 = 0` - | - = note: expected type `bool` - found reference `&bool` error[E0614]: type `bool` cannot be dereferenced --> $DIR/disallowed-positions.rs:36:8 @@ -583,9 +580,6 @@ LL | if x = let 0 = 0 {} | | | expected bool, found () | help: try comparing for equality: `x == let 0 = 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:59:8 @@ -697,9 +691,6 @@ error[E0308]: mismatched types | LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^ expected bool, found &&bool - | - = note: expected type `bool` - found reference `&&bool` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:86:8 @@ -727,9 +718,6 @@ LL | while &let 0 = 0 {} | | | expected bool, found &bool | help: consider removing the borrow: `let 0 = 0` - | - = note: expected type `bool` - found reference `&bool` error[E0614]: type `bool` cannot be dereferenced --> $DIR/disallowed-positions.rs:100:11 @@ -771,9 +759,6 @@ LL | while x = let 0 = 0 {} | | | expected bool, found () | help: try comparing for equality: `x == let 0 = 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:123:11 @@ -885,9 +870,6 @@ error[E0308]: mismatched types | LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^ expected bool, found &&bool - | - = note: expected type `bool` - found reference `&&bool` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:150:11 @@ -958,9 +940,6 @@ LL | fn outside_if_and_while_expr() { ... LL | &let 0 = 0 | ^^^^^^^^^^ expected (), found &bool - | - = note: expected unit type `()` - found reference `&bool` error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try` --> $DIR/disallowed-positions.rs:179:17 diff --git a/src/test/ui/span/coerce-suggestions.stderr b/src/test/ui/span/coerce-suggestions.stderr index 84b92a7c04add..da9ac04e34883 100644 --- a/src/test/ui/span/coerce-suggestions.stderr +++ b/src/test/ui/span/coerce-suggestions.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let x: usize = String::new(); | ^^^^^^^^^^^^^ expected usize, found struct `std::string::String` - | - = note: expected type `usize` - found struct `std::string::String` error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:9:19 @@ -15,9 +12,6 @@ LL | let x: &str = String::new(); | | | expected &str, found struct `std::string::String` | help: consider borrowing here: `&String::new()` - | - = note: expected reference `&str` - found struct `std::string::String` error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:12:10 @@ -50,10 +44,8 @@ error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:21:9 | LL | s = format!("foo"); - | ^^^^^^^^^^^^^^ expected mutable reference, found struct `std::string::String` + | ^^^^^^^^^^^^^^ expected &mut std::string::String, found struct `std::string::String` | - = note: expected mutable reference `&mut std::string::String` - found struct `std::string::String` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to 6 previous errors diff --git a/src/test/ui/span/issue-33884.stderr b/src/test/ui/span/issue-33884.stderr index 4cb2fc24a0549..4f46c4c739436 100644 --- a/src/test/ui/span/issue-33884.stderr +++ b/src/test/ui/span/issue-33884.stderr @@ -4,8 +4,6 @@ error[E0308]: mismatched types LL | stream.write_fmt(format!("message received")) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::fmt::Arguments`, found struct `std::string::String` | - = note: expected struct `std::fmt::Arguments<'_>` - found struct `std::string::String` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/span/issue-34264.stderr b/src/test/ui/span/issue-34264.stderr index a9cf323c99057..c0e9d6cfab8cf 100644 --- a/src/test/ui/span/issue-34264.stderr +++ b/src/test/ui/span/issue-34264.stderr @@ -55,10 +55,7 @@ error[E0308]: mismatched types --> $DIR/issue-34264.rs:8:13 | LL | bar("", ""); - | ^^ expected usize, found reference - | - = note: expected type `usize` - found reference `&'static str` + | ^^ expected usize, found &str error[E0061]: this function takes 2 parameters but 3 parameters were supplied --> $DIR/issue-34264.rs:10:5 diff --git a/src/test/ui/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr index 8ce1dfb11bca2..e2ba768d7a3e8 100644 --- a/src/test/ui/span/issue-39018.stderr +++ b/src/test/ui/span/issue-39018.stderr @@ -72,9 +72,6 @@ LL | let _ = a + b; | | | expected &str, found struct `std::string::String` | help: consider borrowing here: `&b` - | - = note: expected reference `&str` - found struct `std::string::String` error[E0369]: binary operation `+` cannot be applied to type `&std::string::String` --> $DIR/issue-39018.rs:30:15 diff --git a/src/test/ui/str/str-array-assignment.stderr b/src/test/ui/str/str-array-assignment.stderr index 9f790d3365939..e8678b439d4a0 100644 --- a/src/test/ui/str/str-array-assignment.stderr +++ b/src/test/ui/str/str-array-assignment.stderr @@ -5,9 +5,6 @@ LL | let t = if true { s[..2] } else { s }; | ------ ^ expected str, found &str | | | expected because of this - | - = note: expected type `str` - found reference `&str` error[E0308]: mismatched types --> $DIR/str-array-assignment.rs:5:27 @@ -17,9 +14,6 @@ LL | let u: &str = if true { s[..2] } else { s }; | | | expected &str, found str | help: consider borrowing here: `&s[..2]` - | - = note: expected reference `&str` - found type `str` error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/str-array-assignment.rs:7:7 @@ -42,9 +36,6 @@ LL | let w: &str = s[..2]; | | | expected &str, found str | help: consider borrowing here: `&s[..2]` - | - = note: expected reference `&str` - found type `str` error: aborting due to 4 previous errors diff --git a/src/test/ui/str/str-lit-type-mismatch.stderr b/src/test/ui/str/str-lit-type-mismatch.stderr index e328bb33c837b..af66fe8b88049 100644 --- a/src/test/ui/str/str-lit-type-mismatch.stderr +++ b/src/test/ui/str/str-lit-type-mismatch.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let x: &[u8] = "foo"; | ^^^^^ | | - | expected slice, found str + | expected slice `[u8]`, found str | help: consider adding a leading `b`: `b"foo"` | = note: expected reference `&[u8]` @@ -16,7 +16,7 @@ error[E0308]: mismatched types LL | let y: &[u8; 4] = "baaa"; | ^^^^^^ | | - | expected array of 4 elements, found str + | expected array `[u8; 4]`, found str | help: consider adding a leading `b`: `b"baaa"` | = note: expected reference `&[u8; 4]` @@ -28,7 +28,7 @@ error[E0308]: mismatched types LL | let z: &str = b"foo"; | ^^^^^^ | | - | expected str, found array of 3 elements + | expected str, found array `[u8; 3]` | help: consider removing the leading `b`: `"foo"` | = note: expected reference `&str` diff --git a/src/test/ui/struct-literal-variant-in-if.stderr b/src/test/ui/struct-literal-variant-in-if.stderr index 8c7475e622a21..e89111ca2c8a8 100644 --- a/src/test/ui/struct-literal-variant-in-if.stderr +++ b/src/test/ui/struct-literal-variant-in-if.stderr @@ -58,18 +58,12 @@ LL | if x == E::V { field } {} | | | | | expected (), found bool | expected this to be `()` - | - = note: expected unit type `()` - found type `bool` error[E0308]: mismatched types --> $DIR/struct-literal-variant-in-if.rs:21:20 | LL | let y: usize = (); | ^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error: aborting due to 7 previous errors diff --git a/src/test/ui/structs/struct-base-wrong-type.stderr b/src/test/ui/structs/struct-base-wrong-type.stderr index c0bd9bda45185..b039ce2cc9209 100644 --- a/src/test/ui/structs/struct-base-wrong-type.stderr +++ b/src/test/ui/structs/struct-base-wrong-type.stderr @@ -3,36 +3,24 @@ error[E0308]: mismatched types | LL | static foo: Foo = Foo { a: 2, ..bar }; | ^^^ expected struct `Foo`, found struct `Bar` - | - = note: expected struct `Foo` - found struct `Bar` error[E0308]: mismatched types --> $DIR/struct-base-wrong-type.rs:8:35 | LL | static foo_i: Foo = Foo { a: 2, ..4 }; | ^ expected struct `Foo`, found integer - | - = note: expected struct `Foo` - found type `{integer}` error[E0308]: mismatched types --> $DIR/struct-base-wrong-type.rs:12:27 | LL | let f = Foo { a: 2, ..b }; | ^ expected struct `Foo`, found struct `Bar` - | - = note: expected struct `Foo` - found struct `Bar` error[E0308]: mismatched types --> $DIR/struct-base-wrong-type.rs:13:34 | LL | let f__isize = Foo { a: 2, ..4 }; | ^ expected struct `Foo`, found integer - | - = note: expected struct `Foo` - found type `{integer}` error: aborting due to 4 previous errors diff --git a/src/test/ui/structs/structure-constructor-type-mismatch.stderr b/src/test/ui/structs/structure-constructor-type-mismatch.stderr index 4a78fa3896ffa..f184f81647d13 100644 --- a/src/test/ui/structs/structure-constructor-type-mismatch.stderr +++ b/src/test/ui/structs/structure-constructor-type-mismatch.stderr @@ -6,9 +6,6 @@ LL | x: 1, | | | expected f32, found integer | help: use a float literal: `1.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:20:12 @@ -18,9 +15,6 @@ LL | y: 2, | | | expected f32, found integer | help: use a float literal: `2.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:26:12 @@ -30,9 +24,6 @@ LL | x: 3, | | | expected f32, found integer | help: use a float literal: `3.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:29:12 @@ -42,9 +33,6 @@ LL | y: 4, | | | expected f32, found integer | help: use a float literal: `4.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:35:12 @@ -54,9 +42,6 @@ LL | x: 5, | | | expected f32, found integer | help: use a float literal: `5.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:42:12 @@ -66,9 +51,6 @@ LL | x: 7, | | | expected f32, found integer | help: use a float literal: `7.0` - | - = note: expected type `f32` - found type `{integer}` error[E0107]: wrong number of type arguments: expected 0, found 1 --> $DIR/structure-constructor-type-mismatch.rs:48:24 @@ -84,9 +66,6 @@ LL | x: 9, | | | expected f32, found integer | help: use a float literal: `9.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:50:12 @@ -96,9 +75,6 @@ LL | y: 10, | | | expected f32, found integer | help: use a float literal: `10.0` - | - = note: expected type `f32` - found type `{integer}` error[E0107]: wrong number of type arguments: expected 0, found 1 --> $DIR/structure-constructor-type-mismatch.rs:54:18 diff --git a/src/test/ui/suggestions/as-ref.stderr b/src/test/ui/suggestions/as-ref.stderr index d01c37351951f..5379f77ae5c31 100644 --- a/src/test/ui/suggestions/as-ref.stderr +++ b/src/test/ui/suggestions/as-ref.stderr @@ -5,9 +5,6 @@ LL | opt.map(|arg| takes_ref(arg)); | --- ^^^ expected &Foo, found struct `Foo` | | | help: consider using `as_ref` instead: `as_ref().map` - | - = note: expected reference `&Foo` - found struct `Foo` error[E0308]: mismatched types --> $DIR/as-ref.rs:8:37 @@ -16,9 +13,6 @@ LL | opt.and_then(|arg| Some(takes_ref(arg))); | -------- ^^^ expected &Foo, found struct `Foo` | | | help: consider using `as_ref` instead: `as_ref().and_then` - | - = note: expected reference `&Foo` - found struct `Foo` error[E0308]: mismatched types --> $DIR/as-ref.rs:11:27 @@ -27,9 +21,6 @@ LL | opt.map(|arg| takes_ref(arg)); | --- ^^^ expected &Foo, found struct `Foo` | | | help: consider using `as_ref` instead: `as_ref().map` - | - = note: expected reference `&Foo` - found struct `Foo` error[E0308]: mismatched types --> $DIR/as-ref.rs:13:35 @@ -38,9 +29,6 @@ LL | opt.and_then(|arg| Ok(takes_ref(arg))); | -------- ^^^ expected &Foo, found struct `Foo` | | | help: consider using `as_ref` instead: `as_ref().and_then` - | - = note: expected reference `&Foo` - found struct `Foo` error[E0308]: mismatched types --> $DIR/as-ref.rs:16:27 diff --git a/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr b/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr index 66f6bf91cc289..7ec1daacb6142 100644 --- a/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr +++ b/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr @@ -9,8 +9,6 @@ LL | | }; | |______expected &str, found struct `std::string::String` | in this macro invocation | - = note: expected reference `&str` - found struct `std::string::String` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/suggestions/format-borrow.stderr b/src/test/ui/suggestions/format-borrow.stderr index 7f1cec2d21881..d43a249d9cc96 100644 --- a/src/test/ui/suggestions/format-borrow.stderr +++ b/src/test/ui/suggestions/format-borrow.stderr @@ -4,11 +4,8 @@ error[E0308]: mismatched types LL | let a: String = &String::from("a"); | ^^^^^^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found reference + | expected struct `std::string::String`, found &std::string::String | help: consider removing the borrow: `String::from("a")` - | - = note: expected struct `std::string::String` - found reference `&std::string::String` error[E0308]: mismatched types --> $DIR/format-borrow.rs:4:21 @@ -16,11 +13,8 @@ error[E0308]: mismatched types LL | let b: String = &format!("b"); | ^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found reference + | expected struct `std::string::String`, found &std::string::String | help: consider removing the borrow: `format!("b")` - | - = note: expected struct `std::string::String` - found reference `&std::string::String` error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/issue-52820.stderr b/src/test/ui/suggestions/issue-52820.stderr index 0b064d196750e..ba7457df0693e 100644 --- a/src/test/ui/suggestions/issue-52820.stderr +++ b/src/test/ui/suggestions/issue-52820.stderr @@ -6,9 +6,6 @@ LL | guts, | | | expected struct `std::string::String`, found &str | help: try using a conversion method: `guts: guts.to_string()` - | - = note: expected struct `std::string::String` - found reference `&str` error[E0308]: mismatched types --> $DIR/issue-52820.rs:10:17 @@ -18,9 +15,6 @@ LL | brains: guts.clone(), | | | expected struct `std::string::String`, found &str | help: try using a conversion method: `guts.to_string()` - | - = note: expected struct `std::string::String` - found reference `&str` error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/issue-59819.stderr b/src/test/ui/suggestions/issue-59819.stderr index b04ab374f0f0f..331a6a53b1239 100644 --- a/src/test/ui/suggestions/issue-59819.stderr +++ b/src/test/ui/suggestions/issue-59819.stderr @@ -6,9 +6,6 @@ LL | let y: i32 = x; | | | expected i32, found struct `Foo` | help: consider dereferencing the type: `*x` - | - = note: expected type `i32` - found struct `Foo` error[E0308]: mismatched types --> $DIR/issue-59819.rs:30:18 @@ -18,9 +15,6 @@ LL | let b: i32 = a; | | | expected i32, found &{integer} | help: consider dereferencing the borrow: `*a` - | - = note: expected type `i32` - found reference `&{integer}` error[E0308]: mismatched types --> $DIR/issue-59819.rs:34:21 @@ -30,9 +24,6 @@ LL | let g: String = f; | | | expected struct `std::string::String`, found struct `Bar` | help: try using a conversion method: `f.to_string()` - | - = note: expected struct `std::string::String` - found struct `Bar` error: aborting due to 3 previous errors diff --git a/src/test/ui/suggestions/match-needing-semi.stderr b/src/test/ui/suggestions/match-needing-semi.stderr index eccd9d01fec5e..c9e263d0db842 100644 --- a/src/test/ui/suggestions/match-needing-semi.stderr +++ b/src/test/ui/suggestions/match-needing-semi.stderr @@ -12,9 +12,6 @@ LL | | } | | -- help: consider using a semicolon here | |_____| | expected this to be `()` - | - = note: expected unit type `()` - found type `{integer}` error[E0308]: mismatched types --> $DIR/match-needing-semi.rs:12:5 @@ -27,9 +24,6 @@ LL | | } | | ^- help: consider using a semicolon here | |_____| | expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr b/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr index 36548a3dfcbfa..44c07a7c83a8b 100644 --- a/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr +++ b/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr @@ -23,27 +23,18 @@ error[E0308]: mismatched types | LL | let _: usize = S {}; | ^^^^ expected usize, found struct `S` - | - = note: expected type `usize` - found struct `S` error[E0308]: mismatched types --> $DIR/recover-from-semicolon-trailing-item.rs:12:20 | LL | let _: usize = X {}; | ^^^^ expected usize, found struct `main::X` - | - = note: expected type `usize` - found struct `main::X` error[E0308]: mismatched types --> $DIR/recover-from-semicolon-trailing-item.rs:14:9 | LL | foo(""); - | ^^ expected usize, found reference - | - = note: expected type `usize` - found reference `&'static str` + | ^^ expected usize, found &str error: aborting due to 6 previous errors diff --git a/src/test/ui/switched-expectations.stderr b/src/test/ui/switched-expectations.stderr index b38c0d9309980..d65adea1ed426 100644 --- a/src/test/ui/switched-expectations.stderr +++ b/src/test/ui/switched-expectations.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let ref string: String = var; | ^^^ expected struct `std::string::String`, found i32 - | - = note: expected struct `std::string::String` - found type `i32` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr b/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr index fca72817d651f..5e49fcdf95a87 100644 --- a/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr +++ b/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | ...; let _: usize = 14; let _: usize = 15; let _: () = 42; let _: usize = 0; let _: usize = 1; let _: usize = 2; let _: usize = 3; let _:... | ^^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr b/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr index e1b73104521a8..cea937ca8b155 100644 --- a/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr +++ b/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | ...♯♰♱♲♳♴♵♶♷♸♹♺♻♼♽♾♿⚀⚁⚂⚃⚄⚅⚆⚈⚉4"; let _: () = 42; let _: &str = "🦀☀☁☂☃☄★☆☇☈☉☊☋☌☍☎☏☐☑☒☓ ☖☗☘☙☚☛☜☝☞☟☠☡☢☣☤☥☦☧☨☩☪☫☬☭☮☯☰☱☲☳☴☵☶☷☸☹☺☻☼☽☾☿♀♁♂♃♄♅♆... | ^^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/non-whitespace-trimming.stderr b/src/test/ui/terminal-width/non-whitespace-trimming.stderr index 72b1502fbf23e..b024d2ace37af 100644 --- a/src/test/ui/terminal-width/non-whitespace-trimming.stderr +++ b/src/test/ui/terminal-width/non-whitespace-trimming.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | ...) = (); let _: () = (); let _: () = (); let _: () = 42; let _: () = (); let _: () = (); let _: () = (); let _: () = (); let _: () = ()... | ^^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/whitespace-trimming-2.stderr b/src/test/ui/terminal-width/whitespace-trimming-2.stderr index dae00b902dcf8..3013019df269f 100644 --- a/src/test/ui/terminal-width/whitespace-trimming-2.stderr +++ b/src/test/ui/terminal-width/whitespace-trimming-2.stderr @@ -5,9 +5,6 @@ LL | ...-> usize { | ----- expected `usize` because of return type LL | ... () | ^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/whitespace-trimming.stderr b/src/test/ui/terminal-width/whitespace-trimming.stderr index 4a1f8f6f84669..d3064d8bfb976 100644 --- a/src/test/ui/terminal-width/whitespace-trimming.stderr +++ b/src/test/ui/terminal-width/whitespace-trimming.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | ... let _: () = 42; | ^^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/terr-in-field.rs b/src/test/ui/terr-in-field.rs index 80834985471d5..aa801fd0a6c64 100644 --- a/src/test/ui/terr-in-field.rs +++ b/src/test/ui/terr-in-field.rs @@ -12,8 +12,6 @@ fn want_foo(f: Foo) {} fn have_bar(b: Bar) { want_foo(b); //~ ERROR mismatched types //~| expected struct `Foo`, found struct `Bar` - //~| expected struct `Foo` - //~| found struct `Bar` } fn main() {} diff --git a/src/test/ui/terr-in-field.stderr b/src/test/ui/terr-in-field.stderr index ef6412a633bab..5c6859a0efe98 100644 --- a/src/test/ui/terr-in-field.stderr +++ b/src/test/ui/terr-in-field.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | want_foo(b); | ^ expected struct `Foo`, found struct `Bar` - | - = note: expected struct `Foo` - found struct `Bar` error: aborting due to previous error diff --git a/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr b/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr index 44643e8c8de43..19374ba49c5c7 100644 --- a/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr +++ b/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr @@ -3,9 +3,6 @@ error[E0271]: type mismatch resolving ` as std::iter::It | LL | impl Foo for IntoIter { | ^^^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error: aborting due to previous error diff --git a/src/test/ui/try-block/try-block-bad-type.stderr b/src/test/ui/try-block/try-block-bad-type.stderr index 722b7a3b60a63..75ff998d3bf07 100644 --- a/src/test/ui/try-block/try-block-bad-type.stderr +++ b/src/test/ui/try-block/try-block-bad-type.stderr @@ -18,18 +18,12 @@ error[E0271]: type mismatch resolving ` as std::op | LL | "" | ^^ expected i32, found &str - | - = note: expected type `i32` - found reference `&str` error[E0271]: type mismatch resolving ` as std::ops::Try>::Ok == ()` --> $DIR/try-block-bad-type.rs:15:39 | LL | let res: Result = try { }; | ^ expected i32, found () - | - = note: expected type `i32` - found unit type `()` error[E0277]: the trait bound `(): std::ops::Try` is not satisfied --> $DIR/try-block-bad-type.rs:17:23 diff --git a/src/test/ui/try-block/try-block-type-error.stderr b/src/test/ui/try-block/try-block-type-error.stderr index 0dd81d8e152fe..63f2c02bc7102 100644 --- a/src/test/ui/try-block/try-block-type-error.stderr +++ b/src/test/ui/try-block/try-block-type-error.stderr @@ -6,18 +6,12 @@ LL | 42 | | | expected f32, found integer | help: use a float literal: `42.0` - | - = note: expected type `f32` - found type `{integer}` error[E0271]: type mismatch resolving ` as std::ops::Try>::Ok == ()` --> $DIR/try-block-type-error.rs:16:5 | LL | }; | ^ expected i32, found () - | - = note: expected type `i32` - found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr index e6e82f4969230..a1afd5e9a0e25 100644 --- a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr +++ b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr @@ -12,9 +12,6 @@ error[E0308]: mismatched types | LL | let _: u8 = ::V; | ^^^^^^^ expected u8, found enum `E2` - | - = note: expected type `u8` - found enum `E2` error: aborting due to 2 previous errors diff --git a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr index 0a6d454a67f43..5411456b34b98 100644 --- a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr +++ b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/never_reveal_concrete_type.rs:13:27 | LL | let _: &'static str = x; - | ^ expected reference, found opaque type + | ^ expected &str, found opaque type | = note: expected reference `&'static str` found opaque type `NoReveal` diff --git a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr index 366d6bad37a5f..aaf5e286643f9 100644 --- a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr +++ b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | fn bomp() -> boo::Boo { | -------- expected `Boo` because of return type LL | "" - | ^^ expected opaque type, found reference + | ^^ expected opaque type, found &str | = note: expected opaque type `Boo` found reference `&'static str` diff --git a/src/test/ui/type/type-ascription-precedence.stderr b/src/test/ui/type/type-ascription-precedence.stderr index ebb9c4199dc70..5f42ed228dd0e 100644 --- a/src/test/ui/type/type-ascription-precedence.stderr +++ b/src/test/ui/type/type-ascription-precedence.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | &(S: &S); | ^ expected &S, found struct `S` - | - = note: expected reference `&S` - found struct `S` error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:35:7 | LL | *(S: Z); | ^ expected struct `Z`, found struct `S` - | - = note: expected struct `Z` - found struct `S` error[E0614]: type `Z` cannot be dereferenced --> $DIR/type-ascription-precedence.rs:35:5 @@ -27,9 +21,6 @@ error[E0308]: mismatched types | LL | -(S: Z); | ^ expected struct `Z`, found struct `S` - | - = note: expected struct `Z` - found struct `S` error[E0600]: cannot apply unary operator `-` to type `Z` --> $DIR/type-ascription-precedence.rs:40:5 @@ -44,18 +35,12 @@ error[E0308]: mismatched types | LL | (S + Z): Z; | ^^^^^^^ expected struct `Z`, found struct `S` - | - = note: expected struct `Z` - found struct `S` error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:49:5 | LL | (S * Z): Z; | ^^^^^^^ expected struct `Z`, found struct `S` - | - = note: expected struct `Z` - found struct `S` error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:53:5 diff --git a/src/test/ui/type/type-ascription-soundness.stderr b/src/test/ui/type/type-ascription-soundness.stderr index d8803cad0113b..6ed940823af1a 100644 --- a/src/test/ui/type/type-ascription-soundness.stderr +++ b/src/test/ui/type/type-ascription-soundness.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:7:17 | LL | let ref x = arr: &[u8]; - | ^^^ expected slice, found array of 3 elements + | ^^^ expected slice `[u8]`, found array `[u8; 3]` | = note: expected reference `&[u8]` found reference `&[u8; 3]` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:8:21 | LL | let ref mut x = arr: &[u8]; - | ^^^ expected slice, found array of 3 elements + | ^^^ expected slice `[u8]`, found array `[u8; 3]` | = note: expected reference `&[u8]` found reference `&[u8; 3]` @@ -20,7 +20,7 @@ error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:9:11 | LL | match arr: &[u8] { - | ^^^ expected slice, found array of 3 elements + | ^^^ expected slice `[u8]`, found array `[u8; 3]` | = note: expected reference `&[u8]` found reference `&[u8; 3]` @@ -29,7 +29,7 @@ error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:12:17 | LL | let _len = (arr: &[u8]).len(); - | ^^^ expected slice, found array of 3 elements + | ^^^ expected slice `[u8]`, found array `[u8; 3]` | = note: expected reference `&[u8]` found reference `&[u8; 3]` diff --git a/src/test/ui/type/type-check/assignment-expected-bool.stderr b/src/test/ui/type/type-check/assignment-expected-bool.stderr index c6b42afa513b4..f210fd62d7dc7 100644 --- a/src/test/ui/type/type-check/assignment-expected-bool.stderr +++ b/src/test/ui/type/type-check/assignment-expected-bool.stderr @@ -6,9 +6,6 @@ LL | let _: bool = 0 = 0; | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:9:14 @@ -18,9 +15,6 @@ LL | 0 => 0 = 0, | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:10:14 @@ -30,9 +24,6 @@ LL | _ => 0 = 0, | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:14:17 @@ -42,9 +33,6 @@ LL | true => 0 = 0, | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:18:8 @@ -54,9 +42,6 @@ LL | if 0 = 0 {} | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:20:24 @@ -66,9 +51,6 @@ LL | let _: bool = if { 0 = 0 } { | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:21:9 @@ -78,9 +60,6 @@ LL | 0 = 0 | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:23:9 @@ -90,9 +69,6 @@ LL | 0 = 0 | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:26:13 @@ -102,9 +78,6 @@ LL | let _ = (0 = 0) | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:27:14 @@ -114,9 +87,6 @@ LL | && { 0 = 0 } | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:28:12 @@ -126,9 +96,6 @@ LL | || (0 = 0); | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0070]: invalid left-hand side expression --> $DIR/assignment-expected-bool.rs:31:20 @@ -141,9 +108,6 @@ error[E0308]: mismatched types | LL | let _: usize = 0 = 0; | ^^^^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error: aborting due to 13 previous errors diff --git a/src/test/ui/type/type-check/assignment-in-if.stderr b/src/test/ui/type/type-check/assignment-in-if.stderr index 05280aab2ddfb..789902bbb9455 100644 --- a/src/test/ui/type/type-check/assignment-in-if.stderr +++ b/src/test/ui/type/type-check/assignment-in-if.stderr @@ -6,9 +6,6 @@ LL | if x = x { | | | expected bool, found () | help: try comparing for equality: `x == x` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:20:8 @@ -18,9 +15,6 @@ LL | if (x = x) { | | | expected bool, found () | help: try comparing for equality: `x == x` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:25:8 @@ -30,9 +24,6 @@ LL | if y = (Foo { foo: x }) { | | | expected bool, found () | help: try comparing for equality: `y == (Foo { foo: x })` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:30:8 @@ -42,9 +33,6 @@ LL | if 3 = x { | | | expected bool, found () | help: try comparing for equality: `3 == x` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:36:13 @@ -54,9 +42,6 @@ LL | x = 4 | | | expected bool, found () | help: try comparing for equality: `x == 4` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:38:13 @@ -66,9 +51,6 @@ LL | x = 5 | | | expected bool, found () | help: try comparing for equality: `x == 5` - | - = note: expected type `bool` - found unit type `()` error: aborting due to 6 previous errors diff --git a/src/test/ui/type/type-error-break-tail.stderr b/src/test/ui/type/type-error-break-tail.stderr index 47416c4f911f5..720bde9371132 100644 --- a/src/test/ui/type/type-error-break-tail.stderr +++ b/src/test/ui/type/type-error-break-tail.stderr @@ -9,9 +9,6 @@ LL | if false { break; } | | | expected i32, found () | help: give it a value of the expected type: `break 42` - | - = note: expected type `i32` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/type/type-mismatch-multiple.rs b/src/test/ui/type/type-mismatch-multiple.rs index b8f04ca8d4a33..6270ee6471301 100644 --- a/src/test/ui/type/type-mismatch-multiple.rs +++ b/src/test/ui/type/type-mismatch-multiple.rs @@ -2,8 +2,6 @@ fn main() { let a: bool = 1; let b: i32 = true; } //~^ ERROR mismatched types -//~| expected type `bool` -//~| found type `{integer}` //~| expected bool, found integer //~| ERROR mismatched types //~| expected i32, found bool diff --git a/src/test/ui/type/type-mismatch-multiple.stderr b/src/test/ui/type/type-mismatch-multiple.stderr index 8f6b23ea091a2..6de8a056978cb 100644 --- a/src/test/ui/type/type-mismatch-multiple.stderr +++ b/src/test/ui/type/type-mismatch-multiple.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | fn main() { let a: bool = 1; let b: i32 = true; } | ^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/type-mismatch-multiple.rs:3:43 diff --git a/src/test/ui/type/type-mismatch-same-crate-name.rs b/src/test/ui/type/type-mismatch-same-crate-name.rs index 88daffde504a5..b1f9a28e16d56 100644 --- a/src/test/ui/type/type-mismatch-same-crate-name.rs +++ b/src/test/ui/type/type-mismatch-same-crate-name.rs @@ -17,8 +17,6 @@ fn main() { //~^ ERROR mismatched types //~| Perhaps two different versions of crate `crate_a1` //~| expected struct `main::a::Foo` - //~| expected struct `main::a::Foo` - //~| found struct `main::a::Foo` a::try_bar(bar2); //~^ ERROR mismatched types //~| Perhaps two different versions of crate `crate_a1` diff --git a/src/test/ui/type/type-mismatch-same-crate-name.stderr b/src/test/ui/type/type-mismatch-same-crate-name.stderr index db53344a07e7c..91bbe9c1fbe2a 100644 --- a/src/test/ui/type/type-mismatch-same-crate-name.stderr +++ b/src/test/ui/type/type-mismatch-same-crate-name.stderr @@ -4,8 +4,6 @@ error[E0308]: mismatched types LL | a::try_foo(foo2); | ^^^^ expected struct `main::a::Foo`, found a different struct `main::a::Foo` | - = note: expected struct `main::a::Foo` (struct `main::a::Foo`) - found struct `main::a::Foo` (struct `main::a::Foo`) note: Perhaps two different versions of crate `crate_a1` are being used? --> $DIR/type-mismatch-same-crate-name.rs:16:20 | @@ -13,7 +11,7 @@ LL | a::try_foo(foo2); | ^^^^ error[E0308]: mismatched types - --> $DIR/type-mismatch-same-crate-name.rs:22:20 + --> $DIR/type-mismatch-same-crate-name.rs:20:20 | LL | a::try_bar(bar2); | ^^^^ expected trait `main::a::Bar`, found a different trait `main::a::Bar` @@ -21,7 +19,7 @@ LL | a::try_bar(bar2); = note: expected struct `std::boxed::Box<(dyn main::a::Bar + 'static)>` found struct `std::boxed::Box` note: Perhaps two different versions of crate `crate_a1` are being used? - --> $DIR/type-mismatch-same-crate-name.rs:22:20 + --> $DIR/type-mismatch-same-crate-name.rs:20:20 | LL | a::try_bar(bar2); | ^^^^ diff --git a/src/test/ui/type/type-mismatch.stderr b/src/test/ui/type/type-mismatch.stderr index 2d9481e5a4102..e6016bdef18ed 100644 --- a/src/test/ui/type/type-mismatch.stderr +++ b/src/test/ui/type/type-mismatch.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | want::(f); | ^ expected struct `foo`, found usize - | - = note: expected struct `foo` - found type `usize` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:18:17 | LL | want::(f); | ^ expected struct `bar`, found usize - | - = note: expected struct `bar` - found type `usize` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:19:24 @@ -75,18 +69,12 @@ error[E0308]: mismatched types | LL | want::(f); | ^ expected usize, found struct `foo` - | - = note: expected type `usize` - found struct `foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:29:17 | LL | want::(f); | ^ expected struct `bar`, found struct `foo` - | - = note: expected struct `bar` - found struct `foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:30:24 @@ -230,7 +218,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:48:26 | LL | want::<&Foo>(f); - | ^ expected reference, found struct `Foo` + | ^ expected &Foo, found struct `Foo` | = note: expected reference `&Foo` found struct `Foo` @@ -322,7 +310,7 @@ error[E0308]: mismatched types LL | want::<&Foo>(f); | ^ | | - | expected reference, found struct `Foo` + | expected &Foo, found struct `Foo` | help: consider borrowing here: `&f` | = note: expected reference `&Foo` @@ -422,7 +410,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:75:26 | LL | want::<&Foo>(f); - | ^ expected reference, found struct `Foo` + | ^ expected &Foo, found struct `Foo` | = note: expected reference `&Foo` found struct `Foo` diff --git a/src/test/ui/type/type-shadow.stderr b/src/test/ui/type/type-shadow.stderr index 56185e048a320..70be30ed53e83 100644 --- a/src/test/ui/type/type-shadow.stderr +++ b/src/test/ui/type/type-shadow.stderr @@ -2,10 +2,7 @@ error[E0308]: mismatched types --> $DIR/type-shadow.rs:6:20 | LL | let y: Y = "hello"; - | ^^^^^^^ expected isize, found reference - | - = note: expected type `isize` - found reference `&'static str` + | ^^^^^^^ expected isize, found &str error: aborting due to previous error diff --git a/src/test/ui/wrong-mul-method-signature.stderr b/src/test/ui/wrong-mul-method-signature.stderr index 61c976b773af4..fb21980805fa8 100644 --- a/src/test/ui/wrong-mul-method-signature.stderr +++ b/src/test/ui/wrong-mul-method-signature.stderr @@ -30,18 +30,12 @@ error[E0308]: mismatched types | LL | let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order | ^^^ expected struct `Vec2`, found floating-point number - | - = note: expected struct `Vec2` - found type `{float}` error[E0308]: mismatched types --> $DIR/wrong-mul-method-signature.rs:63:19 | LL | let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found f64 - | - = note: expected struct `Vec2` - found type `f64` error: aborting due to 5 previous errors From 6f8f70624b99460481af25764b9e02d2c67b42c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Fri, 15 Nov 2019 09:37:01 -0800 Subject: [PATCH 4/6] Surround types with backticks in type errors --- src/librustc/ty/error.rs | 8 +- src/librustc/ty/wf.rs | 4 +- src/librustc_typeck/check/_match.rs | 8 +- src/librustc_typeck/check/pat.rs | 2 +- .../failed-doctest-missing-codes.stdout | 2 +- src/test/ui/arg-type-mismatch.stderr | 2 +- src/test/ui/array-break-length.stderr | 4 +- src/test/ui/array-not-vector.rs | 4 +- src/test/ui/array-not-vector.stderr | 4 +- ...ssociated-const-generic-obligations.stderr | 2 +- .../associated-const-impl-wrong-type.stderr | 2 +- .../associated-types/associated-types-eq-3.rs | 4 +- .../associated-types-eq-3.stderr | 4 +- .../associated-types-eq-hr.stderr | 4 +- ...ated-types-multiple-types-one-trait.stderr | 4 +- ...sociated-types-overridden-binding-2.stderr | 2 +- .../associated-types-path-2.rs | 4 +- .../associated-types-path-2.stderr | 4 +- .../ui/associated-types/issue-44153.stderr | 2 +- ...point-at-type-on-obligation-failure.stderr | 2 +- ...block-control-flow-static-semantics.stderr | 12 +- .../dont-suggest-missing-await.stderr | 2 +- .../suggest-missing-await-closure.stderr | 2 +- .../async-await/suggest-missing-await.stderr | 2 +- src/test/ui/binop/binop-logic-float.stderr | 4 +- src/test/ui/binop/binop-logic-int.stderr | 4 +- .../block-expression-remove-semicolon.stderr | 2 +- .../block-must-not-have-result-do.stderr | 2 +- .../block-must-not-have-result-res.stderr | 2 +- .../block-must-not-have-result-while.rs | 2 +- .../block-must-not-have-result-while.stderr | 2 +- .../consider-removing-last-semi.stderr | 4 +- src/test/ui/block-result/issue-11714.stderr | 2 +- src/test/ui/block-result/issue-13428.stderr | 4 +- src/test/ui/block-result/issue-13624.rs | 4 +- src/test/ui/block-result/issue-13624.stderr | 4 +- src/test/ui/block-result/issue-20862.stderr | 2 +- src/test/ui/block-result/issue-22645.stderr | 2 +- src/test/ui/block-result/issue-5500.rs | 2 +- src/test/ui/block-result/issue-5500.stderr | 2 +- .../unexpected-return-on-unit.stderr | 2 +- src/test/ui/break-while-condition.stderr | 6 +- src/test/ui/chalkify/type_inference.stderr | 2 +- .../closure-array-break-length.stderr | 4 +- src/test/ui/codemap_tests/tab.stderr | 2 +- .../coerce-expect-unsized-ascribed.stderr | 14 +- src/test/ui/coercion/coerce-to-bang.stderr | 20 +- ...coercion-missing-tail-expected-type.stderr | 4 +- src/test/ui/coercion/coercion-slice.rs | 2 +- src/test/ui/coercion/coercion-slice.stderr | 2 +- .../fn-const-param-infer.stderr | 2 +- .../types-mismatch-const-args.stderr | 2 +- .../ui/consts/const-cast-wrong-type.stderr | 2 +- .../const-eval/const-eval-overflow-3b.stderr | 2 +- .../const-eval/const-eval-overflow-4b.rs | 2 +- .../const-eval/const-eval-overflow-4b.stderr | 2 +- .../ui/consts/const-eval/const-eval-span.rs | 2 +- .../consts/const-eval/const-eval-span.stderr | 2 +- src/test/ui/consts/const-integer-bool-ops.rs | 36 +-- .../ui/consts/const-integer-bool-ops.stderr | 36 +-- src/test/ui/consts/const-tup-index-span.rs | 2 +- .../ui/consts/const-tup-index-span.stderr | 2 +- src/test/ui/consts/const-type-mismatch.stderr | 4 +- src/test/ui/consts/enum-discr-type-err.stderr | 2 +- src/test/ui/conversion-methods.stderr | 6 +- src/test/ui/cross/cross-borrow-trait.stderr | 2 +- src/test/ui/deref-suggestion.stderr | 20 +- src/test/ui/destructure-trait-ref.rs | 4 +- src/test/ui/destructure-trait-ref.stderr | 6 +- src/test/ui/did_you_mean/issue-42764.stderr | 2 +- ...xpected-float-found-integer-literal.stderr | 10 +- src/test/ui/discrim/discrim-ill-typed.rs | 16 +- src/test/ui/discrim/discrim-ill-typed.stderr | 16 +- src/test/ui/diverging-fn-tail-35849.stderr | 2 +- .../ui/diverging-tuple-parts-39485.stderr | 4 +- src/test/ui/dst/dst-bad-assign-3.rs | 2 +- src/test/ui/dst/dst-bad-assign-3.stderr | 2 +- src/test/ui/dst/dst-bad-assign.rs | 2 +- src/test/ui/dst/dst-bad-assign.stderr | 2 +- src/test/ui/dst/dst-bad-coercions.stderr | 8 +- src/test/ui/error-codes/E0070.stderr | 2 +- src/test/ui/error-codes/E0271.stderr | 2 +- src/test/ui/error-codes/E0308-4.stderr | 2 +- src/test/ui/error-codes/E0308.stderr | 2 +- src/test/ui/estr-subtyping.stderr | 2 +- ...loat-literal-inference-restrictions.stderr | 4 +- src/test/ui/fn/fn-bad-block-type.stderr | 2 +- src/test/ui/fn/fn-item-type.rs | 4 +- src/test/ui/fn/fn-item-type.stderr | 4 +- src/test/ui/fn/fn-trait-formatting.stderr | 6 +- .../fully-qualified-type-name4.rs | 2 +- .../fully-qualified-type-name4.stderr | 2 +- .../type-mismatch-signature-deduction.stderr | 2 +- .../generic-arg-mismatch-recover.stderr | 2 +- .../generic/generic-type-params-name-repr.rs | 12 +- .../generic-type-params-name-repr.stderr | 12 +- src/test/ui/if-else-type-mismatch.stderr | 16 +- src/test/ui/if/if-branch-types.rs | 2 +- src/test/ui/if/if-branch-types.stderr | 2 +- src/test/ui/if/if-let-arm-types.rs | 2 +- src/test/ui/if/if-let-arm-types.stderr | 2 +- src/test/ui/if/if-no-match-bindings.stderr | 16 +- src/test/ui/if/if-typeck.stderr | 2 +- .../ui/if/if-without-else-as-fn-expr.stderr | 12 +- src/test/ui/if/if-without-else-result.rs | 2 +- src/test/ui/if/if-without-else-result.stderr | 2 +- src/test/ui/if/ifmt-bad-arg.stderr | 4 +- .../bound-normalization-fail.stderr | 4 +- src/test/ui/impl-trait/equality.rs | 2 +- src/test/ui/impl-trait/equality.stderr | 2 +- src/test/ui/impl-trait/equality2.rs | 8 +- src/test/ui/impl-trait/equality2.stderr | 16 +- .../ui/include-macros/mismatched-types.stderr | 4 +- src/test/ui/indexing-requires-a-uint.stderr | 2 +- .../ui/integer-literal-suffix-inference.rs | 72 ++--- .../integer-literal-suffix-inference.stderr | 72 ++--- src/test/ui/issues/issue-10176.rs | 2 +- src/test/ui/issues/issue-10176.stderr | 2 +- src/test/ui/issues/issue-11319.rs | 2 +- src/test/ui/issues/issue-11319.stderr | 2 +- src/test/ui/issues/issue-11374.stderr | 2 +- src/test/ui/issues/issue-12997-2.stderr | 2 +- src/test/ui/issues/issue-13359.rs | 4 +- src/test/ui/issues/issue-13359.stderr | 4 +- src/test/ui/issues/issue-1362.stderr | 2 +- src/test/ui/issues/issue-14091.stderr | 2 +- src/test/ui/issues/issue-1448-2.stderr | 2 +- src/test/ui/issues/issue-16338.stderr | 2 +- src/test/ui/issues/issue-16401.rs | 2 +- src/test/ui/issues/issue-16401.stderr | 2 +- src/test/ui/issues/issue-17033.rs | 2 +- src/test/ui/issues/issue-17033.stderr | 2 +- src/test/ui/issues/issue-19991.rs | 2 +- src/test/ui/issues/issue-19991.stderr | 2 +- src/test/ui/issues/issue-20225.stderr | 6 +- src/test/ui/issues/issue-22684.stderr | 2 +- src/test/ui/issues/issue-23589.stderr | 2 +- src/test/ui/issues/issue-27008.rs | 2 +- src/test/ui/issues/issue-27008.stderr | 2 +- src/test/ui/issues/issue-27042.stderr | 8 +- src/test/ui/issues/issue-29084.rs | 2 +- src/test/ui/issues/issue-29084.stderr | 2 +- src/test/ui/issues/issue-31173.stderr | 2 +- src/test/ui/issues/issue-31910.rs | 2 +- src/test/ui/issues/issue-31910.stderr | 2 +- src/test/ui/issues/issue-32323.stderr | 2 +- src/test/ui/issues/issue-34334.stderr | 2 +- src/test/ui/issues/issue-3477.rs | 2 +- src/test/ui/issues/issue-3477.stderr | 2 +- src/test/ui/issues/issue-35869.stderr | 8 +- src/test/ui/issues/issue-37026.stderr | 4 +- src/test/ui/issues/issue-37665.stderr | 2 +- src/test/ui/issues/issue-39970.stderr | 2 +- src/test/ui/issues/issue-39974.rs | 2 +- src/test/ui/issues/issue-39974.stderr | 2 +- src/test/ui/issues/issue-40749.stderr | 2 +- src/test/ui/issues/issue-41549.stderr | 2 +- src/test/ui/issues/issue-41742.stderr | 2 +- src/test/ui/issues/issue-4201.rs | 2 +- src/test/ui/issues/issue-4201.stderr | 2 +- src/test/ui/issues/issue-43162.stderr | 2 +- src/test/ui/issues/issue-44023.stderr | 2 +- src/test/ui/issues/issue-4517.rs | 2 +- src/test/ui/issues/issue-4517.stderr | 2 +- src/test/ui/issues/issue-46112.stderr | 2 +- src/test/ui/issues/issue-46302.stderr | 2 +- ...-consider-borrowing-cast-or-binexpr.stderr | 4 +- src/test/ui/issues/issue-47486.stderr | 2 +- src/test/ui/issues/issue-48364.stderr | 2 +- src/test/ui/issues/issue-48838.stderr | 2 +- src/test/ui/issues/issue-50577.stderr | 2 +- src/test/ui/issues/issue-50585.stderr | 2 +- src/test/ui/issues/issue-50600.stderr | 2 +- src/test/ui/issues/issue-50688.stderr | 2 +- src/test/ui/issues/issue-5100.rs | 2 +- src/test/ui/issues/issue-5100.stderr | 2 +- ...1632-try-desugar-incompatible-types.stderr | 2 +- src/test/ui/issues/issue-53348.rs | 2 +- src/test/ui/issues/issue-53348.stderr | 2 +- src/test/ui/issues/issue-53692.stderr | 4 +- src/test/ui/issues/issue-61106.stderr | 2 +- src/test/ui/issues/issue-61882.stderr | 4 +- src/test/ui/issues/issue-6458-4.stderr | 2 +- src/test/ui/issues/issue-7061.stderr | 2 +- src/test/ui/issues/issue-8761.rs | 4 +- src/test/ui/issues/issue-8761.stderr | 4 +- .../ui/json-bom-plus-crlf-multifile.stderr | 2 +- src/test/ui/json-bom-plus-crlf.stderr | 2 +- .../keyword-false-as-identifier.stderr | 2 +- .../keyword/keyword-true-as-identifier.stderr | 2 +- .../liveness-closure-require-ret.stderr | 2 +- .../ui/liveness/liveness-forgot-ret.stderr | 2 +- .../ui/liveness/liveness-issue-2163.stderr | 2 +- .../ui/liveness/liveness-missing-ret2.stderr | 2 +- .../liveness-return-last-stmt-semi.stderr | 8 +- src/test/ui/loops/loop-break-value.stderr | 16 +- .../ui/loops/loop-labeled-break-value.stderr | 6 +- .../ui/loops/loop-properly-diverging-2.stderr | 2 +- .../match/match-arm-resolving-to-never.stderr | 2 +- src/test/ui/match/match-ill-type2.stderr | 2 +- src/test/ui/match/match-range-fail.stderr | 2 +- src/test/ui/match/match-type-err-first-arm.rs | 8 +- .../ui/match/match-type-err-first-arm.stderr | 8 +- .../meta-expected-error-correct-rev.a.stderr | 2 +- ...od-ambig-one-trait-unknown-int-type.stderr | 2 +- ...-same-trait-object-with-separate-params.rs | 10 +- ...e-trait-object-with-separate-params.stderr | 10 +- src/test/ui/methods/method-self-arg-1.rs | 2 +- src/test/ui/methods/method-self-arg-1.stderr | 2 +- src/test/ui/mir-unpretty.stderr | 2 +- src/test/ui/mismatched_types/E0053.stderr | 2 +- src/test/ui/mismatched_types/E0409.stderr | 2 +- .../for-loop-has-unit-body.stderr | 2 +- .../ui/mismatched_types/issue-19109.stderr | 2 +- .../ui/mismatched_types/issue-26480.stderr | 2 +- .../ui/mismatched_types/issue-35030.stderr | 4 +- .../ui/mismatched_types/issue-38371.stderr | 4 +- src/test/ui/mismatched_types/main.stderr | 2 +- .../numeric-literal-cast.stderr | 6 +- .../overloaded-calls-bad.stderr | 2 +- .../trait-impl-fn-incompatibility.stderr | 2 +- src/test/ui/missing/missing-return.stderr | 2 +- src/test/ui/mut/mut-cross-borrowing.stderr | 2 +- .../call-fn-never-arg-wrong-type.stderr | 2 +- .../never_type/never-assign-wrong-type.stderr | 2 +- src/test/ui/noexporttypeexe.rs | 2 +- src/test/ui/noexporttypeexe.stderr | 2 +- src/test/ui/numeric/const-scope.stderr | 12 +- src/test/ui/numeric/len.stderr | 2 +- src/test/ui/numeric/numeric-cast-2.stderr | 6 +- .../numeric-cast-without-suggestion.stderr | 42 +-- src/test/ui/numeric/numeric-cast.stderr | 226 +++++++-------- src/test/ui/numeric/numeric-suffix.stderr | 268 +++++++++--------- .../ui/or-patterns/consistent-bindings.stderr | 2 +- .../issue-64879-trailing-before-guard.stderr | 2 +- .../ui/or-patterns/or-pattern-mismatch.stderr | 2 +- src/test/ui/output-type-mismatch.stderr | 2 +- src/test/ui/parser/expr-as-stmt.stderr | 8 +- src/test/ui/parser/fn-arg-doc-comment.rs | 6 +- src/test/ui/parser/fn-arg-doc-comment.stderr | 6 +- src/test/ui/parser/issue-33413.stderr | 2 +- src/test/ui/parser/issue-62881.stderr | 2 +- src/test/ui/parser/issue-62895.stderr | 2 +- .../ui/parser/lex-bad-char-literals-6.stderr | 2 +- src/test/ui/parser/match-vec-invalid.stderr | 2 +- src/test/ui/parser/numeric-lifetime.stderr | 2 +- src/test/ui/parser/pat-lt-bracket-6.stderr | 2 +- src/test/ui/parser/pat-lt-bracket-7.stderr | 2 +- src/test/ui/parser/pat-tuple-4.stderr | 2 +- src/test/ui/parser/pat-tuple-5.stderr | 2 +- ...recover-for-loop-parens-around-head.stderr | 2 +- .../ui/parser/recover-from-homoglyph.stderr | 2 +- .../ui/parser/recover-missing-semi.stderr | 4 +- src/test/ui/parser/recover-tuple.stderr | 2 +- ...quire-parens-for-chained-comparison.stderr | 4 +- ...truct-literal-restrictions-in-lamda.stderr | 2 +- .../parser/unclosed-delimiter-in-dep.stderr | 2 +- src/test/ui/pattern/pat-tuple-bad-type.stderr | 2 +- src/test/ui/pattern/pattern-error-continue.rs | 4 +- .../ui/pattern/pattern-error-continue.stderr | 4 +- .../pattern-ident-path-generics.stderr | 2 +- src/test/ui/pattern/pattern-tyvar.stderr | 2 +- ...pe-err-cause-on-impl-trait-return-2.stderr | 2 +- ...type-err-cause-on-impl-trait-return.stderr | 14 +- src/test/ui/pptypedef.rs | 4 +- src/test/ui/pptypedef.stderr | 4 +- .../attribute-spans-preserved.stderr | 4 +- .../ui/proc-macro/attribute-with-error.stderr | 8 +- src/test/ui/proc-macro/issue-37788.stderr | 2 +- src/test/ui/proc-macro/macro-brackets.stderr | 2 +- .../ui/proc-macro/nested-item-spans.stderr | 4 +- .../ui/proc-macro/span-preservation.stderr | 8 +- src/test/ui/range/range-1.stderr | 2 +- src/test/ui/repeat_count.rs | 14 +- src/test/ui/repeat_count.stderr | 14 +- src/test/ui/resolve/name-clash-nullary.stderr | 2 +- .../resolve-inconsistent-binding-mode.stderr | 4 +- .../resolve/resolve-inconsistent-names.stderr | 2 +- .../ui/return/return-from-diverging.stderr | 2 +- src/test/ui/return/return-type.stderr | 2 +- .../const.stderr | 2 +- .../rfc-2005-default-binding-mode/lit.stderr | 4 +- .../disallowed-positions.stderr | 60 ++-- src/test/ui/shift-various-bad-types.rs | 2 +- src/test/ui/shift-various-bad-types.stderr | 2 +- src/test/ui/span/coerce-suggestions.stderr | 6 +- src/test/ui/span/issue-34264.stderr | 2 +- src/test/ui/span/issue-39018.stderr | 2 +- src/test/ui/span/move-closure.stderr | 2 +- .../specialization-default-projection.stderr | 4 +- .../ui/static/static-mut-bad-types.stderr | 2 +- src/test/ui/str/str-array-assignment.stderr | 6 +- src/test/ui/str/str-lit-type-mismatch.stderr | 6 +- .../ui/struct-literal-variant-in-if.stderr | 4 +- .../struct-path-self-type-mismatch.stderr | 2 +- .../structure-constructor-type-mismatch.rs | 12 +- ...structure-constructor-type-mismatch.stderr | 22 +- src/test/ui/substs-ppaux.normal.stderr | 8 +- src/test/ui/substs-ppaux.verbose.stderr | 8 +- src/test/ui/suggestions/as-ref.stderr | 8 +- ...gest-deref-inside-macro-issue-58298.stderr | 2 +- .../dont-suggest-try_into-in-macros.stderr | 2 +- .../fn-or-tuple-struct-without-args.stderr | 22 +- src/test/ui/suggestions/format-borrow.stderr | 4 +- src/test/ui/suggestions/issue-52820.stderr | 4 +- src/test/ui/suggestions/issue-59819.stderr | 4 +- .../ui/suggestions/match-ergonomics.stderr | 6 +- .../ui/suggestions/match-needing-semi.stderr | 4 +- .../mismatched-types-numeric-from.stderr | 2 +- ...ecover-from-semicolon-trailing-item.stderr | 6 +- ...e-mismatch-struct-field-shorthand-2.stderr | 4 +- ...ype-mismatch-struct-field-shorthand.stderr | 6 +- src/test/ui/suppressed-error.rs | 2 +- src/test/ui/suppressed-error.stderr | 2 +- src/test/ui/switched-expectations.stderr | 2 +- .../ui/tag-that-dare-not-speak-its-name.rs | 2 +- .../tag-that-dare-not-speak-its-name.stderr | 2 +- src/test/ui/tail-typeck.stderr | 2 +- .../non-whitespace-trimming-2.stderr | 4 +- .../non-whitespace-trimming-unicode.stderr | 4 +- .../non-whitespace-trimming.stderr | 4 +- .../whitespace-trimming-2.stderr | 2 +- .../terminal-width/whitespace-trimming.stderr | 2 +- ...traits-assoc-type-in-supertrait-bad.stderr | 2 +- .../ui/traits/traits-multidispatch-bad.stderr | 2 +- ...ounds-inconsistent-projection-error.stderr | 2 +- .../ui/try-block/try-block-bad-type.stderr | 4 +- .../ui/try-block/try-block-type-error.stderr | 4 +- src/test/ui/tutorial-suffix-inference-test.rs | 6 +- .../ui/tutorial-suffix-inference-test.stderr | 6 +- .../enum-variant-generic-args.stderr | 12 +- ...priority-higher-than-other-inherent.stderr | 2 +- ..._type_does_not_live_long_enough.nll.stderr | 2 +- ...eric_type_does_not_live_long_enough.stderr | 2 +- .../type-alias-impl-trait/issue-63279.stderr | 2 +- .../never_reveal_concrete_type.stderr | 2 +- ...o_revealing_outside_defining_module.stderr | 4 +- .../ui/type/type-ascription-precedence.stderr | 2 +- .../assignment-expected-bool.stderr | 24 +- .../type/type-check/assignment-in-if.stderr | 12 +- src/test/ui/type/type-error-break-tail.stderr | 2 +- src/test/ui/type/type-mismatch-multiple.rs | 4 +- .../ui/type/type-mismatch-multiple.stderr | 4 +- src/test/ui/type/type-mismatch.stderr | 48 ++-- src/test/ui/type/type-shadow.stderr | 2 +- ...e-57673-ice-on-deref-of-boxed-trait.stderr | 2 +- .../ui/ufcs/ufcs-qpath-self-mismatch.stderr | 4 +- .../unboxed-closures-type-mismatch.stderr | 2 +- src/test/ui/while-type-error.stderr | 2 +- src/test/ui/wrong-mul-method-signature.stderr | 8 +- src/test/ui/wrong-ret-type.stderr | 2 +- 351 files changed, 1086 insertions(+), 1086 deletions(-) diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs index feb53539a2eda..8e3ae0864aa0e 100644 --- a/src/librustc/ty/error.rs +++ b/src/librustc/ty/error.rs @@ -222,8 +222,8 @@ impl<'tcx> ty::TyS<'tcx> { pub fn sort_string(&self, tcx: TyCtxt<'_>) -> Cow<'static, str> { match self.kind { ty::Bool | ty::Char | ty::Int(_) | - ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => format!("{}", self).into(), - ty::Tuple(ref tys) if tys.is_empty() => format!("{}", self).into(), + ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => format!("`{}`", self).into(), + ty::Tuple(ref tys) if tys.is_empty() => format!("`{}`", self).into(), ty::Adt(def, _) => format!("{} `{}`", def.descr(), tcx.def_path_str(def.did)).into(), ty::Foreign(def_id) => format!("extern type `{}`", tcx.def_path_str(def_id)).into(), @@ -244,7 +244,7 @@ impl<'tcx> ty::TyS<'tcx> { if tymut_string != "_" && ( ty.is_simple_text() || tymut_string.len() < "mutable reference".len() ) { - format!("&{}", tymut_string).into() + format!("`&{}`", tymut_string).into() } else { // Unknown type name, it's long or has type arguments match mutbl { hir::Mutability::Mutable => "mutable reference", @@ -256,7 +256,7 @@ impl<'tcx> ty::TyS<'tcx> { ty::FnPtr(_) => "fn pointer".into(), ty::Dynamic(ref inner, ..) => { if let Some(principal) = inner.principal() { - format!("trait {}", tcx.def_path_str(principal.def_id())).into() + format!("trait `{}`", tcx.def_path_str(principal.def_id())).into() } else { "trait".into() } diff --git a/src/librustc/ty/wf.rs b/src/librustc/ty/wf.rs index aa0456b78af3e..276fc8c1dec0f 100644 --- a/src/librustc/ty/wf.rs +++ b/src/librustc/ty/wf.rs @@ -209,7 +209,7 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> { // LL | impl Bar for Foo { // | ---------------- in this `impl` item // LL | type Ok = (); - // | ^^^^^^^^^^^^^ expected u32, found () + // | ^^^^^^^^^^^^^ expected `u32`, found `()` // | // = note: expected type `u32` // found type `()` @@ -228,7 +228,7 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> { // LL | impl Bar for Foo { // | ---------------- in this `impl` item // LL | type Ok = (); - // | ^^^^^^^^^^^^^ expected u32, found () + // | ^^^^^^^^^^^^^ expected `u32`, found `()` // ... // LL | impl Bar2 for Foo2 { // | ---------------- in this `impl` item diff --git a/src/librustc_typeck/check/_match.rs b/src/librustc_typeck/check/_match.rs index 6a35f9b845258..6b34159066a30 100644 --- a/src/librustc_typeck/check/_match.rs +++ b/src/librustc_typeck/check/_match.rs @@ -285,7 +285,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // || ----- expected because of this // LL || } else { // LL || 10u32 - // || ^^^^^ expected i32, found u32 + // || ^^^^^ expected `i32`, found `u32` // LL || }; // ||_____- if and else have incompatible types // ``` @@ -294,7 +294,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // The entire expression is in one line, only point at the arms // ``` // LL | let x = if true { 10i32 } else { 10u32 }; - // | ----- ^^^^^ expected i32, found u32 + // | ----- ^^^^^ expected `i32`, found `u32` // | | // | expected because of this // ``` @@ -323,7 +323,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // | || ^ // | ||_____| // | |______if and else have incompatible types - // | expected integer, found () + // | expected integer, found `()` // ``` // by not pointing at the entire expression: // ``` @@ -335,7 +335,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // | ____________^ // 5 | | // 6 | | }; - // | |_____^ expected integer, found () + // | |_____^ expected integer, found `()` // ``` if outer_sp.is_some() { outer_sp = Some(self.tcx.sess.source_map().def_span(span)); diff --git a/src/librustc_typeck/check/pat.rs b/src/librustc_typeck/check/pat.rs index b2250559506eb..bba30ebbbe7bb 100644 --- a/src/librustc_typeck/check/pat.rs +++ b/src/librustc_typeck/check/pat.rs @@ -47,7 +47,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { /// 4 | let temp: usize = match a + b { /// | ----- this expression has type `usize` /// 5 | Ok(num) => num, - /// | ^^^^^^^ expected usize, found enum `std::result::Result` + /// | ^^^^^^^ expected `usize`, found enum `std::result::Result` /// | /// = note: expected type `usize` /// found type `std::result::Result<_, _>` diff --git a/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout b/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout index 42dc56c44ce95..9d486d0a661e9 100644 --- a/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout +++ b/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout @@ -9,7 +9,7 @@ error[E0308]: mismatched types --> $DIR/failed-doctest-missing-codes.rs:9:13 | LL | let x: () = 5i32; - | ^^^^ expected (), found i32 + | ^^^^ expected `()`, found `i32` error: aborting due to previous error diff --git a/src/test/ui/arg-type-mismatch.stderr b/src/test/ui/arg-type-mismatch.stderr index 321a07c4a66b2..05b21efeecec4 100644 --- a/src/test/ui/arg-type-mismatch.stderr +++ b/src/test/ui/arg-type-mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/arg-type-mismatch.rs:5:30 | LL | fn main() { let i: (); i = f(()); } - | ^^ expected isize, found () + | ^^ expected `isize`, found `()` error: aborting due to previous error diff --git a/src/test/ui/array-break-length.stderr b/src/test/ui/array-break-length.stderr index 971b3685b90a1..69c7599cce199 100644 --- a/src/test/ui/array-break-length.stderr +++ b/src/test/ui/array-break-length.stderr @@ -14,7 +14,7 @@ error[E0308]: mismatched types --> $DIR/array-break-length.rs:3:9 | LL | |_: [_; break]| {} - | ^^^^^^^^^^^^^^^^^^ expected (), found closure + | ^^^^^^^^^^^^^^^^^^ expected `()`, found closure | = note: expected unit type `()` found closure `[closure@$DIR/array-break-length.rs:3:9: 3:27]` @@ -23,7 +23,7 @@ error[E0308]: mismatched types --> $DIR/array-break-length.rs:8:9 | LL | |_: [_; continue]| {} - | ^^^^^^^^^^^^^^^^^^^^^ expected (), found closure + | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found closure | = note: expected unit type `()` found closure `[closure@$DIR/array-break-length.rs:8:9: 8:30]` diff --git a/src/test/ui/array-not-vector.rs b/src/test/ui/array-not-vector.rs index 504874f2ce364..5e46f015baf62 100644 --- a/src/test/ui/array-not-vector.rs +++ b/src/test/ui/array-not-vector.rs @@ -1,12 +1,12 @@ fn main() { let _x: i32 = [1, 2, 3]; //~^ ERROR mismatched types - //~| expected i32, found array + //~| expected `i32`, found array 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 slice } diff --git a/src/test/ui/array-not-vector.stderr b/src/test/ui/array-not-vector.stderr index fd02307ffd30e..412a8ae846124 100644 --- a/src/test/ui/array-not-vector.stderr +++ b/src/test/ui/array-not-vector.stderr @@ -2,13 +2,13 @@ error[E0308]: mismatched types --> $DIR/array-not-vector.rs:2:19 | LL | let _x: i32 = [1, 2, 3]; - | ^^^^^^^^^ expected i32, found array `[{integer}; 3]` + | ^^^^^^^^^ expected `i32`, found array `[{integer}; 3]` error[E0308]: mismatched types --> $DIR/array-not-vector.rs:7:20 | LL | let _y: &i32 = x; - | ^ expected i32, found slice `[i32]` + | ^ expected `i32`, found slice `[i32]` | = note: expected reference `&i32` found reference `&[i32]` diff --git a/src/test/ui/associated-const/associated-const-generic-obligations.stderr b/src/test/ui/associated-const/associated-const-generic-obligations.stderr index f2312cbaa0622..d6cdcd4747ff2 100644 --- a/src/test/ui/associated-const/associated-const-generic-obligations.stderr +++ b/src/test/ui/associated-const/associated-const-generic-obligations.stderr @@ -5,7 +5,7 @@ LL | const FROM: Self::Out; | --------- type in trait ... LL | const FROM: &'static str = "foo"; - | ^^^^^^^^^^^^ expected associated type, found &str + | ^^^^^^^^^^^^ expected associated type, found `&str` | = note: expected associated type `::Out` found reference `&'static str` diff --git a/src/test/ui/associated-const/associated-const-impl-wrong-type.stderr b/src/test/ui/associated-const/associated-const-impl-wrong-type.stderr index 0693d99282dcc..acdf33b2b835b 100644 --- a/src/test/ui/associated-const/associated-const-impl-wrong-type.stderr +++ b/src/test/ui/associated-const/associated-const-impl-wrong-type.stderr @@ -5,7 +5,7 @@ LL | const BAR: u32; | --- type in trait ... LL | const BAR: i32 = -1; - | ^^^ expected u32, found i32 + | ^^^ expected `u32`, found `i32` error: aborting due to previous error diff --git a/src/test/ui/associated-types/associated-types-eq-3.rs b/src/test/ui/associated-types/associated-types-eq-3.rs index 2bc302914a5bb..3bb03c39e0f60 100644 --- a/src/test/ui/associated-types/associated-types-eq-3.rs +++ b/src/test/ui/associated-types/associated-types-eq-3.rs @@ -37,8 +37,8 @@ pub fn main() { let a = 42; foo1(a); //~^ ERROR type mismatch resolving - //~| expected struct `Bar`, found usize + //~| expected struct `Bar`, found `usize` baz(&a); //~^ ERROR type mismatch resolving - //~| expected struct `Bar`, found usize + //~| expected struct `Bar`, found `usize` } diff --git a/src/test/ui/associated-types/associated-types-eq-3.stderr b/src/test/ui/associated-types/associated-types-eq-3.stderr index 060e2c8a2ccc1..24c830d8b5bbb 100644 --- a/src/test/ui/associated-types/associated-types-eq-3.stderr +++ b/src/test/ui/associated-types/associated-types-eq-3.stderr @@ -16,13 +16,13 @@ LL | fn foo1>(x: I) { | ---- ----- required by this bound in `foo1` ... LL | foo1(a); - | ^^^^ expected struct `Bar`, found usize + | ^^^^ expected struct `Bar`, found `usize` error[E0271]: type mismatch resolving `::A == Bar` --> $DIR/associated-types-eq-3.rs:41:9 | LL | baz(&a); - | ^^ expected struct `Bar`, found usize + | ^^ expected struct `Bar`, found `usize` | = note: required for the cast to the object type `dyn Foo` diff --git a/src/test/ui/associated-types/associated-types-eq-hr.stderr b/src/test/ui/associated-types/associated-types-eq-hr.stderr index 6ed91b9ff473f..fd7d89d193381 100644 --- a/src/test/ui/associated-types/associated-types-eq-hr.stderr +++ b/src/test/ui/associated-types/associated-types-eq-hr.stderr @@ -7,7 +7,7 @@ LL | where T : for<'x> TheTrait<&'x isize, A = &'x isize> | ------------- required by this bound in `foo` ... LL | foo::(); - | ^^^^^^^^^^^^^^^^^ expected isize, found usize + | ^^^^^^^^^^^^^^^^^ expected `isize`, found `usize` | = note: expected reference `&isize` found reference `&usize` @@ -21,7 +21,7 @@ LL | where T : for<'x> TheTrait<&'x isize, A = &'x usize> | ------------- required by this bound in `bar` ... LL | bar::(); - | ^^^^^^^^^^^^^^^^ expected usize, found isize + | ^^^^^^^^^^^^^^^^ expected `usize`, found `isize` | = note: expected reference `&usize` found reference `&isize` diff --git a/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr b/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr index 69596fa4b9038..d56b45dc2512e 100644 --- a/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr +++ b/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr @@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `::Y == i32` --> $DIR/associated-types-multiple-types-one-trait.rs:13:5 | LL | want_y(t); - | ^^^^^^ expected i32, found associated type + | ^^^^^^ expected `i32`, found associated type ... LL | fn want_y>(t: &T) { } | ------ ----- required by this bound in `want_y` @@ -16,7 +16,7 @@ error[E0271]: type mismatch resolving `::X == u32` --> $DIR/associated-types-multiple-types-one-trait.rs:18:5 | LL | want_x(t); - | ^^^^^^ expected u32, found associated type + | ^^^^^^ expected `u32`, found associated type ... LL | fn want_x>(t: &T) { } | ------ ----- required by this bound in `want_x` diff --git a/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr b/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr index 4ec1fd810aa76..82c0eba87ef3d 100644 --- a/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr +++ b/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr @@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving ` as std::iter::It --> $DIR/associated-types-overridden-binding-2.rs:6:43 | LL | let _: &dyn I32Iterator = &vec![42].into_iter(); - | ^^^^^^^^^^^^^^^^^^^^^ expected i32, found u32 + | ^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32` | = note: required for the cast to the object type `dyn std::iter::Iterator` diff --git a/src/test/ui/associated-types/associated-types-path-2.rs b/src/test/ui/associated-types/associated-types-path-2.rs index b28b60e70081b..c993e1d27202d 100644 --- a/src/test/ui/associated-types/associated-types-path-2.rs +++ b/src/test/ui/associated-types/associated-types-path-2.rs @@ -18,7 +18,7 @@ pub fn f2(a: T) -> T::A { pub fn f1_int_int() { f1(2i32, 4i32); //~^ ERROR mismatched types - //~| expected u32, found i32 + //~| expected `u32`, found `i32` } pub fn f1_int_uint() { @@ -40,7 +40,7 @@ pub fn f1_uint_int() { pub fn f2_int() { let _: i32 = f2(2i32); //~^ ERROR mismatched types - //~| expected i32, found u32 + //~| expected `i32`, found `u32` } pub fn main() { } diff --git a/src/test/ui/associated-types/associated-types-path-2.stderr b/src/test/ui/associated-types/associated-types-path-2.stderr index 246c745cd3385..f1b7798262403 100644 --- a/src/test/ui/associated-types/associated-types-path-2.stderr +++ b/src/test/ui/associated-types/associated-types-path-2.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/associated-types-path-2.rs:19:14 | LL | f1(2i32, 4i32); - | ^^^^ expected u32, found i32 + | ^^^^ expected `u32`, found `i32` | help: change the type of the numeric literal from `i32` to `u32` | @@ -43,7 +43,7 @@ error[E0308]: mismatched types --> $DIR/associated-types-path-2.rs:41:18 | LL | let _: i32 = f2(2i32); - | ^^^^^^^^ expected i32, found u32 + | ^^^^^^^^ expected `i32`, found `u32` | help: you can convert an `u32` to `i32` and panic if the converted value wouldn't fit | diff --git a/src/test/ui/associated-types/issue-44153.stderr b/src/test/ui/associated-types/issue-44153.stderr index f9b1373820f3a..8ef71087958ca 100644 --- a/src/test/ui/associated-types/issue-44153.stderr +++ b/src/test/ui/associated-types/issue-44153.stderr @@ -5,7 +5,7 @@ LL | fn visit() {} | ---------- required by `Visit::visit` ... LL | <() as Visit>::visit(); - | ^^^^^^^^^^^^^^^^^^^^ expected (), found &() + | ^^^^^^^^^^^^^^^^^^^^ expected `()`, found `&()` | = note: required because of the requirements on the impl of `Visit` for `()` diff --git a/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr b/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr index 9b4defaa0bd86..e86b460f818b8 100644 --- a/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr +++ b/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr @@ -7,7 +7,7 @@ LL | type Ok; LL | impl Bar for Foo { | ---------------- in this `impl` item LL | type Ok = (); - | ^^^^^^^^^^^^^ expected u32, found () + | ^^^^^^^^^^^^^ expected `u32`, found `()` error: aborting due to previous error diff --git a/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr b/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr index 212558cf9328e..afb8f146192cc 100644 --- a/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr +++ b/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr @@ -22,7 +22,7 @@ error[E0308]: mismatched types --> $DIR/async-block-control-flow-static-semantics.rs:13:43 | LL | fn return_targets_async_block_not_fn() -> u8 { - | --------------------------------- ^^ expected u8, found () + | --------------------------------- ^^ expected `u8`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression @@ -30,7 +30,7 @@ error[E0271]: type mismatch resolving ` $DIR/async-block-control-flow-static-semantics.rs:18:39 | LL | let _: &dyn Future = █ - | ^^^^^^ expected (), found u8 + | ^^^^^^ expected `()`, found `u8` | = note: required for the cast to the object type `dyn std::future::Future` @@ -45,13 +45,13 @@ LL | | return 0u8; ... | LL | | LL | | } - | |_^ expected u8, found () + | |_^ expected `u8`, found `()` error[E0271]: type mismatch resolving `::Output == ()` --> $DIR/async-block-control-flow-static-semantics.rs:27:39 | LL | let _: &dyn Future = █ - | ^^^^^^ expected (), found u8 + | ^^^^^^ expected `()`, found `u8` | = note: required for the cast to the object type `dyn std::future::Future` @@ -59,7 +59,7 @@ error[E0308]: mismatched types --> $DIR/async-block-control-flow-static-semantics.rs:48:44 | LL | fn rethrow_targets_async_block_not_fn() -> Result { - | ---------------------------------- ^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found () + | ---------------------------------- ^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression | @@ -70,7 +70,7 @@ error[E0308]: mismatched types --> $DIR/async-block-control-flow-static-semantics.rs:57:50 | LL | fn rethrow_targets_async_block_not_async_fn() -> Result { - | ---------------------------------------- ^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found () + | ---------------------------------------- ^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression | diff --git a/src/test/ui/async-await/dont-suggest-missing-await.stderr b/src/test/ui/async-await/dont-suggest-missing-await.stderr index 6f3d10d08686a..239f801c39d4e 100644 --- a/src/test/ui/async-await/dont-suggest-missing-await.stderr +++ b/src/test/ui/async-await/dont-suggest-missing-await.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dont-suggest-missing-await.rs:14:18 | LL | take_u32(x) - | ^ expected u32, found opaque type + | ^ expected `u32`, found opaque type | = note: expected type `u32` found opaque type `impl std::future::Future` diff --git a/src/test/ui/async-await/suggest-missing-await-closure.stderr b/src/test/ui/async-await/suggest-missing-await-closure.stderr index 56d2682636637..1efc20082a08a 100644 --- a/src/test/ui/async-await/suggest-missing-await-closure.stderr +++ b/src/test/ui/async-await/suggest-missing-await-closure.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | take_u32(x) | ^ | | - | expected u32, found opaque type + | expected `u32`, found opaque type | help: consider using `.await` here: `x.await` | = note: expected type `u32` diff --git a/src/test/ui/async-await/suggest-missing-await.stderr b/src/test/ui/async-await/suggest-missing-await.stderr index e44438bfa58d8..7a635a37107d2 100644 --- a/src/test/ui/async-await/suggest-missing-await.stderr +++ b/src/test/ui/async-await/suggest-missing-await.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | take_u32(x) | ^ | | - | expected u32, found opaque type + | expected `u32`, found opaque type | help: consider using `.await` here: `x.await` | = note: expected type `u32` diff --git a/src/test/ui/binop/binop-logic-float.stderr b/src/test/ui/binop/binop-logic-float.stderr index 5a94307ff85ee..3615622ae369f 100644 --- a/src/test/ui/binop/binop-logic-float.stderr +++ b/src/test/ui/binop/binop-logic-float.stderr @@ -2,13 +2,13 @@ error[E0308]: mismatched types --> $DIR/binop-logic-float.rs:1:21 | LL | fn main() { let x = 1.0_f32 || 2.0_f32; } - | ^^^^^^^ expected bool, found f32 + | ^^^^^^^ expected `bool`, found `f32` error[E0308]: mismatched types --> $DIR/binop-logic-float.rs:1:32 | LL | fn main() { let x = 1.0_f32 || 2.0_f32; } - | ^^^^^^^ expected bool, found f32 + | ^^^^^^^ expected `bool`, found `f32` error: aborting due to 2 previous errors diff --git a/src/test/ui/binop/binop-logic-int.stderr b/src/test/ui/binop/binop-logic-int.stderr index 06b7fcbe9b6b9..50d857cd9d7ab 100644 --- a/src/test/ui/binop/binop-logic-int.stderr +++ b/src/test/ui/binop/binop-logic-int.stderr @@ -2,13 +2,13 @@ error[E0308]: mismatched types --> $DIR/binop-logic-int.rs:1:21 | LL | fn main() { let x = 1 && 2; } - | ^ expected bool, found integer + | ^ expected `bool`, found integer error[E0308]: mismatched types --> $DIR/binop-logic-int.rs:1:26 | LL | fn main() { let x = 1 && 2; } - | ^ expected bool, found integer + | ^ expected `bool`, found integer error: aborting due to 2 previous errors diff --git a/src/test/ui/block-expression-remove-semicolon.stderr b/src/test/ui/block-expression-remove-semicolon.stderr index cc515f4bf456d..e39cd04f81b3c 100644 --- a/src/test/ui/block-expression-remove-semicolon.stderr +++ b/src/test/ui/block-expression-remove-semicolon.stderr @@ -7,7 +7,7 @@ LL | | LL | | foo(); | | - help: consider removing this semicolon LL | | }; - | |_____^ expected i32, found () + | |_____^ expected `i32`, found `()` error: aborting due to previous error diff --git a/src/test/ui/block-result/block-must-not-have-result-do.stderr b/src/test/ui/block-result/block-must-not-have-result-do.stderr index a303f5d29d045..914886f81b4ae 100644 --- a/src/test/ui/block-result/block-must-not-have-result-do.stderr +++ b/src/test/ui/block-result/block-must-not-have-result-do.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/block-must-not-have-result-do.rs:3:9 | LL | true - | ^^^^ expected (), found bool + | ^^^^ expected `()`, found `bool` error: aborting due to previous error diff --git a/src/test/ui/block-result/block-must-not-have-result-res.stderr b/src/test/ui/block-result/block-must-not-have-result-res.stderr index aabc7604f90c0..0080d06dd207a 100644 --- a/src/test/ui/block-result/block-must-not-have-result-res.stderr +++ b/src/test/ui/block-result/block-must-not-have-result-res.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn drop(&mut self) { | - expected `()` because of default return type LL | true - | ^^^^ expected (), found bool + | ^^^^ expected `()`, found `bool` error: aborting due to previous error diff --git a/src/test/ui/block-result/block-must-not-have-result-while.rs b/src/test/ui/block-result/block-must-not-have-result-while.rs index f93725937299a..418059bf280ea 100644 --- a/src/test/ui/block-result/block-must-not-have-result-while.rs +++ b/src/test/ui/block-result/block-must-not-have-result-while.rs @@ -1,6 +1,6 @@ fn main() { while true { //~ WARN denote infinite loops with true //~ ERROR mismatched types - //~| expected (), found bool + //~| expected `()`, found `bool` } } diff --git a/src/test/ui/block-result/block-must-not-have-result-while.stderr b/src/test/ui/block-result/block-must-not-have-result-while.stderr index 72063ad1731df..638ce03cb3663 100644 --- a/src/test/ui/block-result/block-must-not-have-result-while.stderr +++ b/src/test/ui/block-result/block-must-not-have-result-while.stderr @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/block-must-not-have-result-while.rs:3:9 | LL | true - | ^^^^ expected (), found bool + | ^^^^ expected `()`, found `bool` error: aborting due to previous error diff --git a/src/test/ui/block-result/consider-removing-last-semi.stderr b/src/test/ui/block-result/consider-removing-last-semi.stderr index fed98f912462b..b45f2a6282136 100644 --- a/src/test/ui/block-result/consider-removing-last-semi.stderr +++ b/src/test/ui/block-result/consider-removing-last-semi.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/consider-removing-last-semi.rs:1:11 | LL | fn f() -> String { - | - ^^^^^^ expected struct `std::string::String`, found () + | - ^^^^^^ expected struct `std::string::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:6:11 | LL | fn g() -> String { - | - ^^^^^^ expected struct `std::string::String`, found () + | - ^^^^^^ expected struct `std::string::String`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression LL | "this won't work".to_string(); diff --git a/src/test/ui/block-result/issue-11714.stderr b/src/test/ui/block-result/issue-11714.stderr index 5cd2726b8ddbc..61991643a4a56 100644 --- a/src/test/ui/block-result/issue-11714.stderr +++ b/src/test/ui/block-result/issue-11714.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-11714.rs:1:14 | LL | fn blah() -> i32 { - | ---- ^^^ expected i32, found () + | ---- ^^^ expected `i32`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression ... diff --git a/src/test/ui/block-result/issue-13428.stderr b/src/test/ui/block-result/issue-13428.stderr index 24e942619f0d1..707d24cd6ab23 100644 --- a/src/test/ui/block-result/issue-13428.stderr +++ b/src/test/ui/block-result/issue-13428.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-13428.rs:3:13 | LL | fn foo() -> String { - | --- ^^^^^^ expected struct `std::string::String`, found () + | --- ^^^^^^ expected struct `std::string::String`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression ... @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/issue-13428.rs:11:13 | LL | fn bar() -> String { - | --- ^^^^^^ expected struct `std::string::String`, found () + | --- ^^^^^^ expected struct `std::string::String`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression LL | "foobar".to_string() diff --git a/src/test/ui/block-result/issue-13624.rs b/src/test/ui/block-result/issue-13624.rs index ed0b302174604..bd1d0de320e26 100644 --- a/src/test/ui/block-result/issue-13624.rs +++ b/src/test/ui/block-result/issue-13624.rs @@ -6,7 +6,7 @@ mod a { pub fn get_enum_struct_variant() -> () { Enum::EnumStructVariant { x: 1, y: 2, z: 3 } //~^ ERROR mismatched types - //~| expected (), found enum `a::Enum` + //~| expected `()`, found enum `a::Enum` } } @@ -19,7 +19,7 @@ mod b { match enum_struct_variant { a::Enum::EnumStructVariant { x, y, z } => { //~^ ERROR mismatched types - //~| expected (), found enum `a::Enum` + //~| expected `()`, found enum `a::Enum` } } } diff --git a/src/test/ui/block-result/issue-13624.stderr b/src/test/ui/block-result/issue-13624.stderr index 2404d06ae8665..90ffb4b2e52bc 100644 --- a/src/test/ui/block-result/issue-13624.stderr +++ b/src/test/ui/block-result/issue-13624.stderr @@ -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 `a::Enum` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found enum `a::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 match expression has type `()` LL | a::Enum::EnumStructVariant { x, y, z } => { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found enum `a::Enum` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-20862.stderr b/src/test/ui/block-result/issue-20862.stderr index 717c7517defd6..f9c890b0ed82a 100644 --- a/src/test/ui/block-result/issue-20862.stderr +++ b/src/test/ui/block-result/issue-20862.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn foo(x: i32) { | - possibly return type missing here? LL | |y| x + y - | ^^^^^^^^^ expected (), found closure + | ^^^^^^^^^ expected `()`, found closure | = note: expected unit type `()` found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]` diff --git a/src/test/ui/block-result/issue-22645.stderr b/src/test/ui/block-result/issue-22645.stderr index cc1b4a217ce47..79eb1d4b890f0 100644 --- a/src/test/ui/block-result/issue-22645.stderr +++ b/src/test/ui/block-result/issue-22645.stderr @@ -15,7 +15,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 struct `Bob` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-5500.rs b/src/test/ui/block-result/issue-5500.rs index 55f1efce93dbc..577987a4596cb 100644 --- a/src/test/ui/block-result/issue-5500.rs +++ b/src/test/ui/block-result/issue-5500.rs @@ -3,5 +3,5 @@ fn main() { //~^ ERROR mismatched types //~| expected unit type `()` //~| found reference `&_` - //~| expected (), found reference + //~| expected `()`, found reference } diff --git a/src/test/ui/block-result/issue-5500.stderr b/src/test/ui/block-result/issue-5500.stderr index 12ee677d09dd0..9d9f7ac2e4a0b 100644 --- a/src/test/ui/block-result/issue-5500.stderr +++ b/src/test/ui/block-result/issue-5500.stderr @@ -6,7 +6,7 @@ LL | fn main() { LL | &panic!() | ^^^^^^^^^ | | - | expected (), found reference + | expected `()`, found reference | help: consider removing the borrow: `panic!()` | = note: expected unit type `()` diff --git a/src/test/ui/block-result/unexpected-return-on-unit.stderr b/src/test/ui/block-result/unexpected-return-on-unit.stderr index 170d11373ddd0..3dce459ddbdae 100644 --- a/src/test/ui/block-result/unexpected-return-on-unit.stderr +++ b/src/test/ui/block-result/unexpected-return-on-unit.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/unexpected-return-on-unit.rs:9:5 | LL | foo() - | ^^^^^ expected (), found usize + | ^^^^^ expected `()`, found `usize` | help: try adding a semicolon | diff --git a/src/test/ui/break-while-condition.stderr b/src/test/ui/break-while-condition.stderr index 6f131514a4084..6960c4fd86735 100644 --- a/src/test/ui/break-while-condition.stderr +++ b/src/test/ui/break-while-condition.stderr @@ -5,7 +5,7 @@ LL | let _: ! = { | ____________________^ LL | | 'a: while break 'a {}; LL | | }; - | |_________^ expected !, found () + | |_________^ expected `!`, found `()` | = note: expected type `!` found unit type `()` @@ -16,7 +16,7 @@ error[E0308]: mismatched types LL | / while false { LL | | break LL | | } - | |_____________^ expected !, found () + | |_____________^ expected `!`, found `()` | = note: expected type `!` found unit type `()` @@ -27,7 +27,7 @@ error[E0308]: mismatched types LL | / while false { LL | | return LL | | } - | |_____________^ expected !, found () + | |_____________^ expected `!`, found `()` | = note: expected type `!` found unit type `()` diff --git a/src/test/ui/chalkify/type_inference.stderr b/src/test/ui/chalkify/type_inference.stderr index fdc79ec29f378..b8152caf3d29f 100644 --- a/src/test/ui/chalkify/type_inference.stderr +++ b/src/test/ui/chalkify/type_inference.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/type_inference.rs:21:14 | LL | only_foo(x); - | ^ expected i32, found floating-point number + | ^ expected `i32`, found floating-point number error[E0277]: the trait bound `{float}: Bar` is not satisfied --> $DIR/type_inference.rs:25:5 diff --git a/src/test/ui/closures/closure-array-break-length.stderr b/src/test/ui/closures/closure-array-break-length.stderr index 44c9ee3357560..f6991a23f4d4d 100644 --- a/src/test/ui/closures/closure-array-break-length.stderr +++ b/src/test/ui/closures/closure-array-break-length.stderr @@ -20,7 +20,7 @@ error[E0308]: mismatched types --> $DIR/closure-array-break-length.rs:4:11 | LL | while |_: [_; continue]| {} {} - | ^^^^^^^^^^^^^^^^^^^^^ expected bool, found closure + | ^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found closure | = note: expected type `bool` found closure `[closure@$DIR/closure-array-break-length.rs:4:11: 4:32]` @@ -29,7 +29,7 @@ error[E0308]: mismatched types --> $DIR/closure-array-break-length.rs:7:11 | LL | while |_: [_; break]| {} {} - | ^^^^^^^^^^^^^^^^^^ expected bool, found closure + | ^^^^^^^^^^^^^^^^^^ expected `bool`, found closure | = note: expected type `bool` found closure `[closure@$DIR/closure-array-break-length.rs:7:11: 7:29]` diff --git a/src/test/ui/codemap_tests/tab.stderr b/src/test/ui/codemap_tests/tab.stderr index 3ee10cd4cb828..c3f19d20d3952 100644 --- a/src/test/ui/codemap_tests/tab.stderr +++ b/src/test/ui/codemap_tests/tab.stderr @@ -10,7 +10,7 @@ error[E0308]: mismatched types LL | fn foo() { | - help: try adding a return type: `-> &'static str` LL | "bar boo" - | ^^^^^^^^^^^^^^^^^^^^ expected (), found &str + | ^^^^^^^^^^^^^^^^^^^^ expected `()`, found `&str` error: aborting due to 2 previous errors diff --git a/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr b/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr index db8ecb818c9bd..303d83d342625 100644 --- a/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr +++ b/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr @@ -29,7 +29,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:13:13 | LL | let _ = box { |x| (x as u8) }: Box _>; - | ^^^^^^^^^^^^^^^^^^^^^ expected trait std::ops::Fn, found closure + | ^^^^^^^^^^^^^^^^^^^^^ expected trait `std::ops::Fn`, found closure | = note: expected struct `std::boxed::Box u8>` found struct `std::boxed::Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:13:19: 13:32]>` @@ -38,7 +38,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:14:13 | LL | let _ = box if true { false } else { true }: Box; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::fmt::Debug, found bool + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait `std::fmt::Debug`, found `bool` | = note: expected struct `std::boxed::Box` found struct `std::boxed::Box` @@ -47,7 +47,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:15:13 | LL | let _ = box match true { true => 'a', false => 'b' }: Box; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::fmt::Debug, found char + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait `std::fmt::Debug`, found `char` | = note: expected struct `std::boxed::Box` found struct `std::boxed::Box` @@ -83,7 +83,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:21:13 | LL | let _ = &{ |x| (x as u8) }: &dyn Fn(i32) -> _; - | ^^^^^^^^^^^^^^^^^^ expected trait std::ops::Fn, found closure + | ^^^^^^^^^^^^^^^^^^ expected trait `std::ops::Fn`, found closure | = note: expected reference `&dyn std::ops::Fn(i32) -> u8` found reference `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:21:16: 21:29]` @@ -92,7 +92,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:22:13 | LL | let _ = &if true { false } else { true }: &dyn Debug; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::fmt::Debug, found bool + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait `std::fmt::Debug`, found `bool` | = note: expected reference `&dyn std::fmt::Debug` found reference `&bool` @@ -101,7 +101,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:23:13 | LL | let _ = &match true { true => 'a', false => 'b' }: &dyn Debug; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::fmt::Debug, found char + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait `std::fmt::Debug`, found `char` | = note: expected reference `&dyn std::fmt::Debug` found reference `&char` @@ -119,7 +119,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:26:13 | LL | let _ = Box::new(|x| (x as u8)): Box _>; - | ^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::ops::Fn, found closure + | ^^^^^^^^^^^^^^^^^^^^^^^ expected trait `std::ops::Fn`, found closure | = note: expected struct `std::boxed::Box _>` found struct `std::boxed::Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:26:22: 26:35]>` diff --git a/src/test/ui/coercion/coerce-to-bang.stderr b/src/test/ui/coercion/coerce-to-bang.stderr index 284c20b6e2884..0b0c2e9f5a3ba 100644 --- a/src/test/ui/coercion/coerce-to-bang.stderr +++ b/src/test/ui/coercion/coerce-to-bang.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/coerce-to-bang.rs:6:17 | LL | foo(return, 22, 44); - | ^^ expected !, found integer + | ^^ expected `!`, found integer | = note: expected type `!` found type `{integer}` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/coerce-to-bang.rs:18:13 | LL | foo(22, 44, return); - | ^^ expected !, found integer + | ^^ expected `!`, found integer | = note: expected type `!` found type `{integer}` @@ -20,7 +20,7 @@ error[E0308]: mismatched types --> $DIR/coerce-to-bang.rs:26:12 | LL | foo(a, b, c); // ... and hence a reference to `a` is expected to diverge. - | ^ expected !, found integer + | ^ expected `!`, found integer | = note: expected type `!` found type `{integer}` @@ -29,7 +29,7 @@ error[E0308]: mismatched types --> $DIR/coerce-to-bang.rs:36:12 | LL | foo(a, b, c); - | ^ expected !, found integer + | ^ expected `!`, found integer | = note: expected type `!` found type `{integer}` @@ -38,7 +38,7 @@ error[E0308]: mismatched types --> $DIR/coerce-to-bang.rs:45:12 | LL | foo(a, b, c); - | ^ expected !, found integer + | ^ expected `!`, found integer | = note: expected type `!` found type `{integer}` @@ -47,7 +47,7 @@ error[E0308]: mismatched types --> $DIR/coerce-to-bang.rs:50:21 | LL | let x: [!; 2] = [return, 22]; - | ^^^^^^^^^^^^ expected !, found integer + | ^^^^^^^^^^^^ expected `!`, found integer | = note: expected array `[!; 2]` found array `[{integer}; 2]` @@ -56,7 +56,7 @@ error[E0308]: mismatched types --> $DIR/coerce-to-bang.rs:55:22 | LL | let x: [!; 2] = [22, return]; - | ^^ expected !, found integer + | ^^ expected `!`, found integer | = note: expected type `!` found type `{integer}` @@ -65,7 +65,7 @@ error[E0308]: mismatched types --> $DIR/coerce-to-bang.rs:60:37 | LL | let x: (usize, !, usize) = (22, 44, 66); - | ^^ expected !, found integer + | ^^ expected `!`, found integer | = note: expected type `!` found type `{integer}` @@ -74,7 +74,7 @@ error[E0308]: mismatched types --> $DIR/coerce-to-bang.rs:65:41 | LL | let x: (usize, !, usize) = (return, 44, 66); - | ^^ expected !, found integer + | ^^ expected `!`, found integer | = note: expected type `!` found type `{integer}` @@ -83,7 +83,7 @@ error[E0308]: mismatched types --> $DIR/coerce-to-bang.rs:76:37 | LL | let x: (usize, !, usize) = (22, 44, return); - | ^^ expected !, found integer + | ^^ expected `!`, found integer | = note: expected type `!` found type `{integer}` diff --git a/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr b/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr index 7811df4525983..f1911dde981f5 100644 --- a/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr +++ b/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/coercion-missing-tail-expected-type.rs:3:24 | LL | fn plus_one(x: i32) -> i32 { - | -------- ^^^ expected i32, found () + | -------- ^^^ expected `i32`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression LL | x + 1; @@ -12,7 +12,7 @@ error[E0308]: mismatched types --> $DIR/coercion-missing-tail-expected-type.rs:7:13 | LL | fn foo() -> Result { - | --- ^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found () + | --- ^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression LL | Ok(1); diff --git a/src/test/ui/coercion/coercion-slice.rs b/src/test/ui/coercion/coercion-slice.rs index 1d54d35f649a3..b756c8f8203a0 100644 --- a/src/test/ui/coercion/coercion-slice.rs +++ b/src/test/ui/coercion/coercion-slice.rs @@ -3,5 +3,5 @@ fn main() { let _: &[i32] = [0]; //~^ ERROR mismatched types - //~| expected &[i32], found array `[{integer}; 1]` + //~| expected `&[i32]`, found array `[{integer}; 1]` } diff --git a/src/test/ui/coercion/coercion-slice.stderr b/src/test/ui/coercion/coercion-slice.stderr index 34caaed9de4f5..0e7fc06a9b720 100644 --- a/src/test/ui/coercion/coercion-slice.stderr +++ b/src/test/ui/coercion/coercion-slice.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let _: &[i32] = [0]; | ^^^ | | - | expected &[i32], found array `[{integer}; 1]` + | expected `&[i32]`, found array `[{integer}; 1]` | help: consider borrowing here: `&[0]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/fn-const-param-infer.stderr b/src/test/ui/const-generics/fn-const-param-infer.stderr index d62383e1224c6..7eb3c19a58910 100644 --- a/src/test/ui/const-generics/fn-const-param-infer.stderr +++ b/src/test/ui/const-generics/fn-const-param-infer.stderr @@ -19,7 +19,7 @@ error[E0308]: mismatched types --> $DIR/fn-const-param-infer.rs:20:24 | LL | let _ = Checked::<{generic_arg::}>; - | ^^^^^^^^^^^^^^^^^^ expected usize, found u32 + | ^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32` | = note: expected fn pointer `fn(usize) -> bool` found fn item `fn(u32) -> bool {generic_arg::}` diff --git a/src/test/ui/const-generics/types-mismatch-const-args.stderr b/src/test/ui/const-generics/types-mismatch-const-args.stderr index c912d9d0abf09..0ce98f1455c99 100644 --- a/src/test/ui/const-generics/types-mismatch-const-args.stderr +++ b/src/test/ui/const-generics/types-mismatch-const-args.stderr @@ -19,7 +19,7 @@ error[E0308]: mismatched types --> $DIR/types-mismatch-const-args.rs:15:41 | LL | let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u16, found u32 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32` | = note: expected struct `A<'a, u16, _, _>` found struct `A<'b, u32, _, _>` diff --git a/src/test/ui/consts/const-cast-wrong-type.stderr b/src/test/ui/consts/const-cast-wrong-type.stderr index ad816d9297bd0..282f5ccde772f 100644 --- a/src/test/ui/consts/const-cast-wrong-type.stderr +++ b/src/test/ui/consts/const-cast-wrong-type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/const-cast-wrong-type.rs:2:23 | LL | static b: *const i8 = &a as *const i8; - | ^^^^^^^^^^^^^^^ expected u8, found i8 + | ^^^^^^^^^^^^^^^ expected `u8`, found `i8` error: aborting due to previous error diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr index f6b6b5882ba3c..3da34fe9af7ec 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/const-eval-overflow-3b.rs:18:22 | LL | = [0; (i8::MAX + 1u8) as usize]; - | ^^^ expected i8, found u8 + | ^^^ expected `i8`, found `u8` error[E0277]: cannot add `u8` to `i8` --> $DIR/const-eval-overflow-3b.rs:18:20 diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-4b.rs b/src/test/ui/consts/const-eval/const-eval-overflow-4b.rs index 75c396f235130..2a4585faf1493 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow-4b.rs +++ b/src/test/ui/consts/const-eval/const-eval-overflow-4b.rs @@ -11,7 +11,7 @@ use std::{u8, u16, u32, u64, usize}; const A_I8_T : [u32; (i8::MAX as i8 + 1u8) as usize] //~^ ERROR mismatched types - //~| expected i8, found u8 + //~| expected `i8`, found `u8` //~| ERROR cannot add `u8` to `i8` = [0; (i8::MAX as usize) + 1]; diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr index 3735b2fd5ff1a..5b2c4116c4b1d 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/const-eval-overflow-4b.rs:12:30 | LL | : [u32; (i8::MAX as i8 + 1u8) as usize] - | ^^^ expected i8, found u8 + | ^^^ expected `i8`, found `u8` error[E0277]: cannot add `u8` to `i8` --> $DIR/const-eval-overflow-4b.rs:12:28 diff --git a/src/test/ui/consts/const-eval/const-eval-span.rs b/src/test/ui/consts/const-eval/const-eval-span.rs index 682c7a1d65fc9..82f101b47cfeb 100644 --- a/src/test/ui/consts/const-eval/const-eval-span.rs +++ b/src/test/ui/consts/const-eval/const-eval-span.rs @@ -8,7 +8,7 @@ const CONSTANT: S = S(0); enum E { V = CONSTANT, //~^ ERROR mismatched types - //~| expected isize, found struct `S` + //~| expected `isize`, found struct `S` } fn main() {} diff --git a/src/test/ui/consts/const-eval/const-eval-span.stderr b/src/test/ui/consts/const-eval/const-eval-span.stderr index 3436802f8a95b..c5b001899ff92 100644 --- a/src/test/ui/consts/const-eval/const-eval-span.stderr +++ b/src/test/ui/consts/const-eval/const-eval-span.stderr @@ -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 struct `S` error: aborting due to previous error diff --git a/src/test/ui/consts/const-integer-bool-ops.rs b/src/test/ui/consts/const-integer-bool-ops.rs index f0d5a558e3529..6924956bdf706 100644 --- a/src/test/ui/consts/const-integer-bool-ops.rs +++ b/src/test/ui/consts/const-integer-bool-ops.rs @@ -1,76 +1,76 @@ const X: usize = 42 && 39; //~^ ERROR mismatched types -//~| expected bool, found integer +//~| expected `bool`, found integer //~| ERROR mismatched types -//~| expected bool, found integer +//~| expected `bool`, found integer //~| ERROR mismatched types -//~| expected usize, found bool +//~| expected `usize`, found `bool` const ARR: [i32; X] = [99; 34]; //~^ ERROR evaluation of constant value failed const X1: usize = 42 || 39; //~^ ERROR mismatched types -//~| expected bool, found integer +//~| expected `bool`, found integer //~| ERROR mismatched types -//~| expected bool, found integer +//~| expected `bool`, found integer //~| ERROR mismatched types -//~| expected usize, found bool +//~| expected `usize`, found `bool` const ARR1: [i32; X1] = [99; 47]; //~^ ERROR evaluation of constant value failed const X2: usize = -42 || -39; //~^ ERROR mismatched types -//~| expected bool, found integer +//~| expected `bool`, found integer //~| ERROR mismatched types -//~| expected bool, found integer +//~| expected `bool`, found integer //~| ERROR mismatched types -//~| expected usize, found bool +//~| expected `usize`, found `bool` const ARR2: [i32; X2] = [99; 18446744073709551607]; //~^ ERROR evaluation of constant value failed const X3: usize = -42 && -39; //~^ ERROR mismatched types -//~| expected bool, found integer +//~| expected `bool`, found integer //~| ERROR mismatched types -//~| expected bool, found integer +//~| expected `bool`, found integer //~| ERROR mismatched types -//~| expected usize, found bool +//~| expected `usize`, found `bool` const ARR3: [i32; X3] = [99; 6]; //~^ ERROR evaluation of constant value failed const Y: usize = 42.0 == 42.0; //~^ ERROR mismatched types -//~| expected usize, found bool +//~| expected `usize`, found `bool` const ARRR: [i32; Y] = [99; 1]; //~^ ERROR evaluation of constant value failed const Y1: usize = 42.0 >= 42.0; //~^ ERROR mismatched types -//~| expected usize, found bool +//~| expected `usize`, found `bool` const ARRR1: [i32; Y1] = [99; 1]; //~^ ERROR evaluation of constant value failed const Y2: usize = 42.0 <= 42.0; //~^ ERROR mismatched types -//~| expected usize, found bool +//~| expected `usize`, found `bool` const ARRR2: [i32; Y2] = [99; 1]; //~^ ERROR evaluation of constant value failed const Y3: usize = 42.0 > 42.0; //~^ ERROR mismatched types -//~| expected usize, found bool +//~| expected `usize`, found `bool` const ARRR3: [i32; Y3] = [99; 0]; //~^ ERROR evaluation of constant value failed const Y4: usize = 42.0 < 42.0; //~^ ERROR mismatched types -//~| expected usize, found bool +//~| expected `usize`, found `bool` const ARRR4: [i32; Y4] = [99; 0]; //~^ ERROR evaluation of constant value failed const Y5: usize = 42.0 != 42.0; //~^ ERROR mismatched types -//~| expected usize, found bool +//~| expected `usize`, found `bool` const ARRR5: [i32; Y5] = [99; 0]; //~^ ERROR evaluation of constant value failed diff --git a/src/test/ui/consts/const-integer-bool-ops.stderr b/src/test/ui/consts/const-integer-bool-ops.stderr index 8b5f3440964d5..9001fefd1029f 100644 --- a/src/test/ui/consts/const-integer-bool-ops.stderr +++ b/src/test/ui/consts/const-integer-bool-ops.stderr @@ -2,19 +2,19 @@ error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:1:18 | LL | const X: usize = 42 && 39; - | ^^ expected bool, found integer + | ^^ expected `bool`, found integer error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:1:24 | LL | const X: usize = 42 && 39; - | ^^ expected bool, found integer + | ^^ expected `bool`, found integer error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:1:18 | LL | const X: usize = 42 && 39; - | ^^^^^^^^ expected usize, found bool + | ^^^^^^^^ expected `usize`, found `bool` error[E0080]: evaluation of constant value failed --> $DIR/const-integer-bool-ops.rs:8:18 @@ -26,19 +26,19 @@ error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:11:19 | LL | const X1: usize = 42 || 39; - | ^^ expected bool, found integer + | ^^ expected `bool`, found integer error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:11:25 | LL | const X1: usize = 42 || 39; - | ^^ expected bool, found integer + | ^^ expected `bool`, found integer error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:11:19 | LL | const X1: usize = 42 || 39; - | ^^^^^^^^ expected usize, found bool + | ^^^^^^^^ expected `usize`, found `bool` error[E0080]: evaluation of constant value failed --> $DIR/const-integer-bool-ops.rs:18:19 @@ -50,19 +50,19 @@ error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:21:19 | LL | const X2: usize = -42 || -39; - | ^^^ expected bool, found integer + | ^^^ expected `bool`, found integer error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:21:26 | LL | const X2: usize = -42 || -39; - | ^^^ expected bool, found integer + | ^^^ expected `bool`, found integer error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:21:19 | LL | const X2: usize = -42 || -39; - | ^^^^^^^^^^ expected usize, found bool + | ^^^^^^^^^^ expected `usize`, found `bool` error[E0080]: evaluation of constant value failed --> $DIR/const-integer-bool-ops.rs:28:19 @@ -74,19 +74,19 @@ error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:31:19 | LL | const X3: usize = -42 && -39; - | ^^^ expected bool, found integer + | ^^^ expected `bool`, found integer error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:31:26 | LL | const X3: usize = -42 && -39; - | ^^^ expected bool, found integer + | ^^^ expected `bool`, found integer error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:31:19 | LL | const X3: usize = -42 && -39; - | ^^^^^^^^^^ expected usize, found bool + | ^^^^^^^^^^ expected `usize`, found `bool` error[E0080]: evaluation of constant value failed --> $DIR/const-integer-bool-ops.rs:38:19 @@ -98,7 +98,7 @@ error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:41:18 | LL | const Y: usize = 42.0 == 42.0; - | ^^^^^^^^^^^^ expected usize, found bool + | ^^^^^^^^^^^^ expected `usize`, found `bool` error[E0080]: evaluation of constant value failed --> $DIR/const-integer-bool-ops.rs:44:19 @@ -110,7 +110,7 @@ error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:47:19 | LL | const Y1: usize = 42.0 >= 42.0; - | ^^^^^^^^^^^^ expected usize, found bool + | ^^^^^^^^^^^^ expected `usize`, found `bool` error[E0080]: evaluation of constant value failed --> $DIR/const-integer-bool-ops.rs:50:20 @@ -122,7 +122,7 @@ error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:53:19 | LL | const Y2: usize = 42.0 <= 42.0; - | ^^^^^^^^^^^^ expected usize, found bool + | ^^^^^^^^^^^^ expected `usize`, found `bool` error[E0080]: evaluation of constant value failed --> $DIR/const-integer-bool-ops.rs:56:20 @@ -134,7 +134,7 @@ error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:59:19 | LL | const Y3: usize = 42.0 > 42.0; - | ^^^^^^^^^^^ expected usize, found bool + | ^^^^^^^^^^^ expected `usize`, found `bool` error[E0080]: evaluation of constant value failed --> $DIR/const-integer-bool-ops.rs:62:20 @@ -146,7 +146,7 @@ error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:65:19 | LL | const Y4: usize = 42.0 < 42.0; - | ^^^^^^^^^^^ expected usize, found bool + | ^^^^^^^^^^^ expected `usize`, found `bool` error[E0080]: evaluation of constant value failed --> $DIR/const-integer-bool-ops.rs:68:20 @@ -158,7 +158,7 @@ error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:71:19 | LL | const Y5: usize = 42.0 != 42.0; - | ^^^^^^^^^^^^ expected usize, found bool + | ^^^^^^^^^^^^ expected `usize`, found `bool` error[E0080]: evaluation of constant value failed --> $DIR/const-integer-bool-ops.rs:74:20 diff --git a/src/test/ui/consts/const-tup-index-span.rs b/src/test/ui/consts/const-tup-index-span.rs index 047ed0204b156..763263c6aeb4f 100644 --- a/src/test/ui/consts/const-tup-index-span.rs +++ b/src/test/ui/consts/const-tup-index-span.rs @@ -2,7 +2,7 @@ const TUP: (usize,) = 5usize << 64; //~^ ERROR mismatched types -//~| expected tuple, found usize +//~| expected tuple, found `usize` const ARR: [i32; TUP.0] = []; //~^ ERROR evaluation of constant value failed diff --git a/src/test/ui/consts/const-tup-index-span.stderr b/src/test/ui/consts/const-tup-index-span.stderr index 1d280026a0190..8e4a092e40f5e 100644 --- a/src/test/ui/consts/const-tup-index-span.stderr +++ b/src/test/ui/consts/const-tup-index-span.stderr @@ -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 tuple, found `usize` | = note: expected tuple `(usize,)` found type `usize` diff --git a/src/test/ui/consts/const-type-mismatch.stderr b/src/test/ui/consts/const-type-mismatch.stderr index dbc533c6c60ad..17bb27d4b72fa 100644 --- a/src/test/ui/consts/const-type-mismatch.stderr +++ b/src/test/ui/consts/const-type-mismatch.stderr @@ -2,13 +2,13 @@ error[E0308]: mismatched types --> $DIR/const-type-mismatch.rs:4:21 | LL | const TWELVE: u16 = TEN + 2; - | ^^^^^^^ expected u16, found u8 + | ^^^^^^^ expected `u16`, found `u8` error[E0308]: mismatched types --> $DIR/const-type-mismatch.rs:9:27 | LL | const ALSO_TEN: u16 = TEN; - | ^^^ expected u16, found u8 + | ^^^ expected `u16`, found `u8` error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/enum-discr-type-err.stderr b/src/test/ui/consts/enum-discr-type-err.stderr index a2545c8b6f2ac..848ccf94da2b6 100644 --- a/src/test/ui/consts/enum-discr-type-err.stderr +++ b/src/test/ui/consts/enum-discr-type-err.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/enum-discr-type-err.rs:18:21 | LL | $( $v = $s::V, )* - | ^^^^^ expected isize, found i32 + | ^^^^^ expected `isize`, found `i32` ... LL | / mac! { LL | | A = F, diff --git a/src/test/ui/conversion-methods.stderr b/src/test/ui/conversion-methods.stderr index ff5529a840852..1aca37a6fb82e 100644 --- a/src/test/ui/conversion-methods.stderr +++ b/src/test/ui/conversion-methods.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let _tis_an_instants_play: String = "'Tis a fond Ambush—"; | ^^^^^^^^^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found &str + | expected struct `std::string::String`, found `&str` | help: try using a conversion method: `"'Tis a fond Ambush—".to_string()` 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"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | - | expected struct `std::path::PathBuf`, found &std::path::Path + | expected struct `std::path::PathBuf`, found `&std::path::Path` | help: try using a conversion method: `Path::new("/ern/her/own/surprise").to_path_buf()` error[E0308]: mismatched types @@ -31,7 +31,7 @@ error[E0308]: mismatched types LL | let _prove_piercing_earnest: Vec = &[1, 2, 3]; | ^^^^^^^^^^ | | - | expected struct `std::vec::Vec`, found &[{integer}; 3] + | expected struct `std::vec::Vec`, found `&[{integer}; 3]` | help: try using a conversion method: `(&[1, 2, 3]).to_vec()` | = note: expected struct `std::vec::Vec` diff --git a/src/test/ui/cross/cross-borrow-trait.stderr b/src/test/ui/cross/cross-borrow-trait.stderr index 282912e076eb9..9bffa6bd111a6 100644 --- a/src/test/ui/cross/cross-borrow-trait.stderr +++ b/src/test/ui/cross/cross-borrow-trait.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let _y: &dyn Trait = x; | ^ | | - | expected &dyn Trait, found struct `std::boxed::Box` + | expected `&dyn Trait`, found struct `std::boxed::Box` | help: consider borrowing here: `&x` | = note: expected reference `&dyn Trait` diff --git a/src/test/ui/deref-suggestion.stderr b/src/test/ui/deref-suggestion.stderr index 433bab7718917..226f6fb620fc2 100644 --- a/src/test/ui/deref-suggestion.stderr +++ b/src/test/ui/deref-suggestion.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | foo(s); | ^ | | - | expected struct `std::string::String`, found &std::string::String + | expected struct `std::string::String`, found `&std::string::String` | help: try using a conversion method: `s.to_string()` error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | foo3(u); | ^ | | - | expected u32, found &u32 + | expected `u32`, found `&u32` | help: consider dereferencing the borrow: `*u` error[E0308]: mismatched types @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | foo(&"aaa".to_owned()); | ^^^^^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found &std::string::String + | expected struct `std::string::String`, found `&std::string::String` | help: consider removing the borrow: `"aaa".to_owned()` error[E0308]: mismatched types @@ -31,14 +31,14 @@ error[E0308]: mismatched types LL | foo(&mut "aaa".to_owned()); | ^^^^^^^^^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found &mut std::string::String + | expected struct `std::string::String`, found `&mut std::string::String` | help: consider removing the borrow: `"aaa".to_owned()` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:2:20 | LL | ($x:expr) => { &$x } - | ^^^ expected u32, found &{integer} + | ^^^ expected `u32`, found `&{integer}` ... LL | foo3(borrow!(0)); | ---------- in this macro invocation @@ -47,7 +47,7 @@ error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:36:5 | LL | assert_eq!(3i32, &3i32); - | ^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found &i32 + | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32` | = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) @@ -57,7 +57,7 @@ error[E0308]: mismatched types LL | let s = S { u }; | ^ | | - | expected &u32, found integer + | expected `&u32`, found integer | help: consider borrowing here: `u: &u` error[E0308]: mismatched types @@ -66,7 +66,7 @@ error[E0308]: mismatched types LL | let s = S { u: u }; | ^ | | - | expected &u32, found integer + | expected `&u32`, found integer | help: consider borrowing here: `&u` error[E0308]: mismatched types @@ -75,7 +75,7 @@ error[E0308]: mismatched types LL | let r = R { i }; | ^ | | - | expected u32, found &{integer} + | expected `u32`, found `&{integer}` | help: consider dereferencing the borrow: `i: *i` error[E0308]: mismatched types @@ -84,7 +84,7 @@ error[E0308]: mismatched types LL | let r = R { i: i }; | ^ | | - | expected u32, found &{integer} + | expected `u32`, found `&{integer}` | help: consider dereferencing the borrow: `*i` error: aborting due to 10 previous errors diff --git a/src/test/ui/destructure-trait-ref.rs b/src/test/ui/destructure-trait-ref.rs index c1b178b221cce..fb92196b2bd56 100644 --- a/src/test/ui/destructure-trait-ref.rs +++ b/src/test/ui/destructure-trait-ref.rs @@ -33,12 +33,12 @@ fn main() { //~^ ERROR mismatched types //~| expected trait object `dyn T` //~| found reference `&_` - //~| expected trait T, found reference + //~| expected trait `T`, found reference let &&&x = &(&1isize as &dyn T); //~^ ERROR mismatched types //~| expected trait object `dyn T` //~| found reference `&_` - //~| expected trait T, found reference + //~| expected trait `T`, found reference let box box x = box 1isize as Box; //~^ ERROR mismatched types //~| expected trait object `dyn T` diff --git a/src/test/ui/destructure-trait-ref.stderr b/src/test/ui/destructure-trait-ref.stderr index ef67c1c9637ed..f77291969d2db 100644 --- a/src/test/ui/destructure-trait-ref.stderr +++ b/src/test/ui/destructure-trait-ref.stderr @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | let &&x = &1isize as &dyn T; | ^^ | | - | expected trait T, found reference + | expected trait `T`, found reference | help: you can probably remove the explicit borrow: `x` | = note: expected trait object `dyn T` @@ -34,7 +34,7 @@ error[E0308]: mismatched types LL | let &&&x = &(&1isize as &dyn T); | ^^ | | - | expected trait T, found reference + | expected trait `T`, found reference | help: you can probably remove the explicit borrow: `x` | = note: expected trait object `dyn T` @@ -44,7 +44,7 @@ error[E0308]: mismatched types --> $DIR/destructure-trait-ref.rs:42:13 | LL | let box box x = box 1isize as Box; - | ^^^^^ expected trait T, found struct `std::boxed::Box` + | ^^^^^ expected trait `T`, found struct `std::boxed::Box` | = note: expected trait object `dyn T` found struct `std::boxed::Box<_>` diff --git a/src/test/ui/did_you_mean/issue-42764.stderr b/src/test/ui/did_you_mean/issue-42764.stderr index 5fd3676d3613f..16b80a6f41236 100644 --- a/src/test/ui/did_you_mean/issue-42764.stderr +++ b/src/test/ui/did_you_mean/issue-42764.stderr @@ -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 enum `DoubleOption`, found `usize` | = note: expected enum `DoubleOption<_>` found type `usize` diff --git a/src/test/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr b/src/test/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr index 76641b1120a27..e2c3c08a8d914 100644 --- a/src/test/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr +++ b/src/test/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let sixteen: f32 = 16; | ^^ | | - | expected f32, found integer + | expected `f32`, found integer | help: use a float literal: `16.0` error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | let a_million_and_seventy: f64 = 1_000_070; | ^^^^^^^^^ | | - | expected f64, found integer + | expected `f64`, found integer | help: use a float literal: `1_000_070.0` error[E0308]: mismatched types @@ -22,20 +22,20 @@ error[E0308]: mismatched types LL | let negative_nine: f32 = -9; | ^^ | | - | expected f32, found integer + | expected `f32`, found integer | help: use a float literal: `-9.0` error[E0308]: mismatched types --> $DIR/issue-53280-expected-float-found-integer-literal.rs:15:30 | LL | let sixteen_again: f64 = 0x10; - | ^^^^ expected f64, found integer + | ^^^^ expected `f64`, found integer error[E0308]: mismatched types --> $DIR/issue-53280-expected-float-found-integer-literal.rs:17:30 | LL | let and_once_more: f32 = 0o20; - | ^^^^ expected f32, found integer + | ^^^^ expected `f32`, found integer error: aborting due to 5 previous errors diff --git a/src/test/ui/discrim/discrim-ill-typed.rs b/src/test/ui/discrim/discrim-ill-typed.rs index 3844d21094eea..98c90f0ea6828 100644 --- a/src/test/ui/discrim/discrim-ill-typed.rs +++ b/src/test/ui/discrim/discrim-ill-typed.rs @@ -16,7 +16,7 @@ fn f_i8() { Ok2, OhNo = 0_u8, //~^ ERROR mismatched types - //~| expected i8, found u8 + //~| expected `i8`, found `u8` } let x = A::Ok; @@ -29,7 +29,7 @@ fn f_u8() { Ok2, OhNo = 0_i8, //~^ ERROR mismatched types - //~| expected u8, found i8 + //~| expected `u8`, found `i8` } let x = A::Ok; @@ -42,7 +42,7 @@ fn f_i16() { Ok2, OhNo = 0_u16, //~^ ERROR mismatched types - //~| expected i16, found u16 + //~| expected `i16`, found `u16` } let x = A::Ok; @@ -55,7 +55,7 @@ fn f_u16() { Ok2, OhNo = 0_i16, //~^ ERROR mismatched types - //~| expected u16, found i16 + //~| expected `u16`, found `i16` } let x = A::Ok; @@ -68,7 +68,7 @@ fn f_i32() { Ok2, OhNo = 0_u32, //~^ ERROR mismatched types - //~| expected i32, found u32 + //~| expected `i32`, found `u32` } let x = A::Ok; @@ -81,7 +81,7 @@ fn f_u32() { Ok2, OhNo = 0_i32, //~^ ERROR mismatched types - //~| expected u32, found i32 + //~| expected `u32`, found `i32` } let x = A::Ok; @@ -94,7 +94,7 @@ fn f_i64() { Ok2, OhNo = 0_u64, //~^ ERROR mismatched types - //~| expected i64, found u64 + //~| expected `i64`, found `u64` } let x = A::Ok; @@ -107,7 +107,7 @@ fn f_u64() { Ok2, OhNo = 0_i64, //~^ ERROR mismatched types - //~| expected u64, found i64 + //~| expected `u64`, found `i64` } let x = A::Ok; diff --git a/src/test/ui/discrim/discrim-ill-typed.stderr b/src/test/ui/discrim/discrim-ill-typed.stderr index d9675d65a2a84..7b9f086151a84 100644 --- a/src/test/ui/discrim/discrim-ill-typed.stderr +++ b/src/test/ui/discrim/discrim-ill-typed.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/discrim-ill-typed.rs:17:16 | LL | OhNo = 0_u8, - | ^^^^ expected i8, found u8 + | ^^^^ expected `i8`, found `u8` | help: change the type of the numeric literal from `u8` to `i8` | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/discrim-ill-typed.rs:30:16 | LL | OhNo = 0_i8, - | ^^^^ expected u8, found i8 + | ^^^^ expected `u8`, found `i8` | help: change the type of the numeric literal from `i8` to `u8` | @@ -24,7 +24,7 @@ error[E0308]: mismatched types --> $DIR/discrim-ill-typed.rs:43:16 | LL | OhNo = 0_u16, - | ^^^^^ expected i16, found u16 + | ^^^^^ expected `i16`, found `u16` | help: change the type of the numeric literal from `u16` to `i16` | @@ -35,7 +35,7 @@ error[E0308]: mismatched types --> $DIR/discrim-ill-typed.rs:56:16 | LL | OhNo = 0_i16, - | ^^^^^ expected u16, found i16 + | ^^^^^ expected `u16`, found `i16` | help: change the type of the numeric literal from `i16` to `u16` | @@ -46,7 +46,7 @@ error[E0308]: mismatched types --> $DIR/discrim-ill-typed.rs:69:16 | LL | OhNo = 0_u32, - | ^^^^^ expected i32, found u32 + | ^^^^^ expected `i32`, found `u32` | help: change the type of the numeric literal from `u32` to `i32` | @@ -57,7 +57,7 @@ error[E0308]: mismatched types --> $DIR/discrim-ill-typed.rs:82:16 | LL | OhNo = 0_i32, - | ^^^^^ expected u32, found i32 + | ^^^^^ expected `u32`, found `i32` | help: change the type of the numeric literal from `i32` to `u32` | @@ -68,7 +68,7 @@ error[E0308]: mismatched types --> $DIR/discrim-ill-typed.rs:95:16 | LL | OhNo = 0_u64, - | ^^^^^ expected i64, found u64 + | ^^^^^ expected `i64`, found `u64` | help: change the type of the numeric literal from `u64` to `i64` | @@ -79,7 +79,7 @@ error[E0308]: mismatched types --> $DIR/discrim-ill-typed.rs:108:16 | LL | OhNo = 0_i64, - | ^^^^^ expected u64, found i64 + | ^^^^^ expected `u64`, found `i64` | help: change the type of the numeric literal from `i64` to `u64` | diff --git a/src/test/ui/diverging-fn-tail-35849.stderr b/src/test/ui/diverging-fn-tail-35849.stderr index 3f3ef666f6639..21361489a2c3a 100644 --- a/src/test/ui/diverging-fn-tail-35849.stderr +++ b/src/test/ui/diverging-fn-tail-35849.stderr @@ -5,7 +5,7 @@ LL | fn assert_sizeof() -> ! { | - expected `!` because of return type LL | unsafe { LL | ::std::mem::transmute::(panic!()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected !, found array `[u8; 8]` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `!`, found array `[u8; 8]` | = note: expected type `!` found array `[u8; 8]` diff --git a/src/test/ui/diverging-tuple-parts-39485.stderr b/src/test/ui/diverging-tuple-parts-39485.stderr index de5cf274c5349..ad3e5ab3dc9d8 100644 --- a/src/test/ui/diverging-tuple-parts-39485.stderr +++ b/src/test/ui/diverging-tuple-parts-39485.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/diverging-tuple-parts-39485.rs:8:5 | LL | &panic!() - | ^^^^^^^^^ expected (), found reference + | ^^^^^^^^^ expected `()`, found reference | = note: expected unit type `()` found reference `&_` @@ -21,7 +21,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 tuple | = note: expected type `isize` found tuple `(!, !)` diff --git a/src/test/ui/dst/dst-bad-assign-3.rs b/src/test/ui/dst/dst-bad-assign-3.rs index 8218614134c38..e3b621b909a0c 100644 --- a/src/test/ui/dst/dst-bad-assign-3.rs +++ b/src/test/ui/dst/dst-bad-assign-3.rs @@ -32,7 +32,7 @@ pub fn main() { let z: Box = Box::new(Bar1 {f: 36}); f5.2 = Bar1 {f: 36}; //~^ ERROR mismatched types - //~| expected trait ToBar, found struct `Bar1` + //~| expected trait `ToBar`, found struct `Bar1` //~| expected trait object `dyn ToBar` //~| found struct `Bar1` //~| ERROR the size for values of type diff --git a/src/test/ui/dst/dst-bad-assign-3.stderr b/src/test/ui/dst/dst-bad-assign-3.stderr index 54bb4bf9a3a43..dc03f38e10387 100644 --- a/src/test/ui/dst/dst-bad-assign-3.stderr +++ b/src/test/ui/dst/dst-bad-assign-3.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-assign-3.rs:33:12 | LL | f5.2 = Bar1 {f: 36}; - | ^^^^^^^^^^^^ expected trait ToBar, found struct `Bar1` + | ^^^^^^^^^^^^ expected trait `ToBar`, found struct `Bar1` | = note: expected trait object `dyn ToBar` found struct `Bar1` diff --git a/src/test/ui/dst/dst-bad-assign.rs b/src/test/ui/dst/dst-bad-assign.rs index ad3b3c71f5777..ed94242f5bfd0 100644 --- a/src/test/ui/dst/dst-bad-assign.rs +++ b/src/test/ui/dst/dst-bad-assign.rs @@ -34,7 +34,7 @@ pub fn main() { let z: Box = Box::new(Bar1 {f: 36}); f5.ptr = Bar1 {f: 36}; //~^ ERROR mismatched types - //~| expected trait ToBar, found struct `Bar1` + //~| expected trait `ToBar`, found struct `Bar1` //~| expected trait object `dyn ToBar` //~| found struct `Bar1` //~| ERROR the size for values of type diff --git a/src/test/ui/dst/dst-bad-assign.stderr b/src/test/ui/dst/dst-bad-assign.stderr index 5a2d73c3b1ac3..8031f162482e3 100644 --- a/src/test/ui/dst/dst-bad-assign.stderr +++ b/src/test/ui/dst/dst-bad-assign.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-assign.rs:35:14 | LL | f5.ptr = Bar1 {f: 36}; - | ^^^^^^^^^^^^ expected trait ToBar, found struct `Bar1` + | ^^^^^^^^^^^^ expected trait `ToBar`, found struct `Bar1` | = note: expected trait object `dyn ToBar` found struct `Bar1` diff --git a/src/test/ui/dst/dst-bad-coercions.stderr b/src/test/ui/dst/dst-bad-coercions.stderr index 3c6111a345bb8..6058594d64ded 100644 --- a/src/test/ui/dst/dst-bad-coercions.stderr +++ b/src/test/ui/dst/dst-bad-coercions.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coercions.rs:14:17 | LL | let y: &S = x; - | ^ expected &S, found *-ptr + | ^ expected `&S`, found *-ptr | = note: expected reference `&S` found raw pointer `*const S` @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | let y: &dyn T = x; | ^ | | - | expected &dyn T, found *-ptr + | expected `&dyn T`, found *-ptr | help: consider borrowing here: `&x` | = note: expected reference `&dyn T` @@ -23,7 +23,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coercions.rs:19:17 | LL | let y: &S = x; - | ^ expected &S, found *-ptr + | ^ expected `&S`, found *-ptr | = note: expected reference `&S` found raw pointer `*mut S` @@ -34,7 +34,7 @@ error[E0308]: mismatched types LL | let y: &dyn T = x; | ^ | | - | expected &dyn T, found *-ptr + | expected `&dyn T`, found *-ptr | help: consider borrowing here: `&x` | = note: expected reference `&dyn T` diff --git a/src/test/ui/error-codes/E0070.stderr b/src/test/ui/error-codes/E0070.stderr index 779b6ea924c72..845833bc82f70 100644 --- a/src/test/ui/error-codes/E0070.stderr +++ b/src/test/ui/error-codes/E0070.stderr @@ -14,7 +14,7 @@ error[E0308]: mismatched types --> $DIR/E0070.rs:8:25 | LL | some_other_func() = 4; - | ^ expected (), found integer + | ^ expected `()`, found integer error[E0070]: invalid left-hand side expression --> $DIR/E0070.rs:8:5 diff --git a/src/test/ui/error-codes/E0271.stderr b/src/test/ui/error-codes/E0271.stderr index 3ed2f6f0d235b..b2dcdf8ee2ea2 100644 --- a/src/test/ui/error-codes/E0271.stderr +++ b/src/test/ui/error-codes/E0271.stderr @@ -5,7 +5,7 @@ LL | fn foo(t: T) where T: Trait { | --- ------------------ required by this bound in `foo` ... LL | foo(3_i8); - | ^^^ expected u32, found &str + | ^^^ expected `u32`, found `&str` error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0308-4.stderr b/src/test/ui/error-codes/E0308-4.stderr index 3c51106cae8c8..127fdaadbc5dd 100644 --- a/src/test/ui/error-codes/E0308-4.stderr +++ b/src/test/ui/error-codes/E0308-4.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match x { | - this match expression has type `u8` LL | 0u8..=3i8 => (), - | ^^^^^^^^^ expected u8, found i8 + | ^^^^^^^^^ expected `u8`, found `i8` error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0308.stderr b/src/test/ui/error-codes/E0308.stderr index 0251c3bee6a8a..b71fb95e706aa 100644 --- a/src/test/ui/error-codes/E0308.stderr +++ b/src/test/ui/error-codes/E0308.stderr @@ -2,7 +2,7 @@ error[E0308]: intrinsic has wrong type --> $DIR/E0308.rs:4:5 | LL | fn size_of(); - | ^^^^^^^^^^^^^^^^ expected (), found usize + | ^^^^^^^^^^^^^^^^ expected `()`, found `usize` | = note: expected fn pointer `extern "rust-intrinsic" fn()` found fn pointer `extern "rust-intrinsic" fn() -> usize` diff --git a/src/test/ui/estr-subtyping.stderr b/src/test/ui/estr-subtyping.stderr index 108df4ae1c9d2..e5dbab6441cb9 100644 --- a/src/test/ui/estr-subtyping.stderr +++ b/src/test/ui/estr-subtyping.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | wants_uniq(x); | ^ | | - | expected struct `std::string::String`, found &str + | expected struct `std::string::String`, found `&str` | help: try using a conversion method: `x.to_string()` error: aborting due to previous error diff --git a/src/test/ui/float-literal-inference-restrictions.stderr b/src/test/ui/float-literal-inference-restrictions.stderr index ea4db56482948..e6f84f4f35427 100644 --- a/src/test/ui/float-literal-inference-restrictions.stderr +++ b/src/test/ui/float-literal-inference-restrictions.stderr @@ -4,14 +4,14 @@ error[E0308]: mismatched types LL | let x: f32 = 1; | ^ | | - | expected f32, found integer + | expected `f32`, found integer | help: use a float literal: `1.0` error[E0308]: mismatched types --> $DIR/float-literal-inference-restrictions.rs:3:18 | LL | let y: f32 = 1f64; - | ^^^^ expected f32, found f64 + | ^^^^ expected `f32`, found `f64` | help: change the type of the numeric literal from `f64` to `f32` | diff --git a/src/test/ui/fn/fn-bad-block-type.stderr b/src/test/ui/fn/fn-bad-block-type.stderr index 5abee94653afb..13ebfd1e2033a 100644 --- a/src/test/ui/fn/fn-bad-block-type.stderr +++ b/src/test/ui/fn/fn-bad-block-type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/fn-bad-block-type.rs:3:19 | LL | fn f() -> isize { true } - | ----- ^^^^ expected isize, found bool + | ----- ^^^^ expected `isize`, found `bool` | | | expected `isize` because of return type diff --git a/src/test/ui/fn/fn-item-type.rs b/src/test/ui/fn/fn-item-type.rs index 3ab4e8f92153b..18146d52551f9 100644 --- a/src/test/ui/fn/fn-item-type.rs +++ b/src/test/ui/fn/fn-item-type.rs @@ -18,7 +18,7 @@ fn main() { eq(foo::, foo::); //~^ ERROR mismatched types - //~| expected u8, found i8 + //~| expected `u8`, found `i8` eq(bar::, bar::>); //~^ ERROR mismatched types @@ -29,5 +29,5 @@ fn main() { // Make sure we distinguish between trait methods correctly. eq(::foo, ::foo); //~^ ERROR mismatched types - //~| expected u8, found u16 + //~| expected `u8`, found `u16` } diff --git a/src/test/ui/fn/fn-item-type.stderr b/src/test/ui/fn/fn-item-type.stderr index f6c4f735939c4..e25e9c21c9fbc 100644 --- a/src/test/ui/fn/fn-item-type.stderr +++ b/src/test/ui/fn/fn-item-type.stderr @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/fn-item-type.rs:19:19 | LL | eq(foo::, foo::); - | ^^^^^^^^^ expected u8, found i8 + | ^^^^^^^^^ expected `u8`, found `i8` | = note: expected fn item `fn(isize) -> isize {foo::}` found fn item `fn(isize) -> isize {foo::}` @@ -29,7 +29,7 @@ error[E0308]: mismatched types --> $DIR/fn-item-type.rs:30:26 | LL | eq(::foo, ::foo); - | ^^^^^^^^^^^^^^^^^ expected u8, found u16 + | ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16` | = note: expected fn item `fn() {::foo}` found fn item `fn() {::foo}` diff --git a/src/test/ui/fn/fn-trait-formatting.stderr b/src/test/ui/fn/fn-trait-formatting.stderr index 44cc744809751..5e7d6ad9534de 100644 --- a/src/test/ui/fn/fn-trait-formatting.stderr +++ b/src/test/ui/fn/fn-trait-formatting.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/fn-trait-formatting.rs:6:17 | LL | let _: () = (box |_: isize| {}) as Box; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `std::boxed::Box` | = note: expected unit type `()` found struct `std::boxed::Box` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/fn-trait-formatting.rs:10:17 | LL | let _: () = (box |_: isize, isize| {}) as Box; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `std::boxed::Box` | = note: expected unit type `()` found struct `std::boxed::Box` @@ -20,7 +20,7 @@ error[E0308]: mismatched types --> $DIR/fn-trait-formatting.rs:14:17 | LL | let _: () = (box || -> isize { unimplemented!() }) as Box isize>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `std::boxed::Box` | = note: expected unit type `()` found struct `std::boxed::Box isize>` diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name4.rs b/src/test/ui/fully-qualified-type/fully-qualified-type-name4.rs index c41e6c4c9f03a..30cb3ee48e768 100644 --- a/src/test/ui/fully-qualified-type/fully-qualified-type-name4.rs +++ b/src/test/ui/fully-qualified-type/fully-qualified-type-name4.rs @@ -7,7 +7,7 @@ fn bar(x: usize) -> Option { //~^ ERROR mismatched types //~| expected enum `std::option::Option` //~| found type `usize` - //~| expected enum `std::option::Option`, found usize + //~| expected enum `std::option::Option`, found `usize` } fn main() { diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name4.stderr b/src/test/ui/fully-qualified-type/fully-qualified-type-name4.stderr index 26389f4671863..b388f38a7fac7 100644 --- a/src/test/ui/fully-qualified-type/fully-qualified-type-name4.stderr +++ b/src/test/ui/fully-qualified-type/fully-qualified-type-name4.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn bar(x: usize) -> Option { | ------------- expected `std::option::Option` because of return type LL | return x; - | ^ expected enum `std::option::Option`, found usize + | ^ expected enum `std::option::Option`, found `usize` | = note: expected enum `std::option::Option` found type `usize` diff --git a/src/test/ui/generator/type-mismatch-signature-deduction.stderr b/src/test/ui/generator/type-mismatch-signature-deduction.stderr index 7cae50f42f9e4..8606ecd33dab4 100644 --- a/src/test/ui/generator/type-mismatch-signature-deduction.stderr +++ b/src/test/ui/generator/type-mismatch-signature-deduction.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch-signature-deduction.rs:8:20 | LL | return Ok(6); - | ^^^^^ expected i32, found enum `std::result::Result` + | ^^^^^ expected `i32`, found enum `std::result::Result` | = note: expected type `i32` found enum `std::result::Result<{integer}, _>` diff --git a/src/test/ui/generic/generic-arg-mismatch-recover.stderr b/src/test/ui/generic/generic-arg-mismatch-recover.stderr index e544cd1bb3a47..4b86212e4862b 100644 --- a/src/test/ui/generic/generic-arg-mismatch-recover.stderr +++ b/src/test/ui/generic/generic-arg-mismatch-recover.stderr @@ -8,7 +8,7 @@ error[E0308]: mismatched types --> $DIR/generic-arg-mismatch-recover.rs:6:33 | LL | Foo::<'static, 'static, ()>(&0); - | ^^ expected (), found integer + | ^^ expected `()`, found integer | = note: expected reference `&'static ()` found reference `&{integer}` diff --git a/src/test/ui/generic/generic-type-params-name-repr.rs b/src/test/ui/generic/generic-type-params-name-repr.rs index 4b1af8e915c92..45dc85a252f40 100644 --- a/src/test/ui/generic/generic-type-params-name-repr.rs +++ b/src/test/ui/generic/generic-type-params-name-repr.rs @@ -12,40 +12,40 @@ fn main() { // Ensure that the printed type doesn't include the default type params... let _: Foo = (); //~^ ERROR mismatched types - //~| expected struct `Foo`, found () + //~| expected struct `Foo`, found `()` //~| expected struct `Foo` //~| found unit type `()` // ...even when they're present, but the same types as the defaults. let _: Foo = (); //~^ ERROR mismatched types - //~| expected struct `Foo`, found () + //~| expected struct `Foo`, found `()` //~| expected struct `Foo` //~| found unit type `()` // Including cases where the default is using previous type params. let _: HashMap = (); //~^ ERROR mismatched types - //~| expected struct `HashMap`, found () + //~| expected struct `HashMap`, found `()` //~| expected struct `HashMap` //~| found unit type `()` let _: HashMap> = (); //~^ ERROR mismatched types - //~| expected struct `HashMap`, found () + //~| expected struct `HashMap`, found `()` //~| expected struct `HashMap` //~| found unit type `()` // But not when there's a different type in between. let _: Foo = (); //~^ ERROR mismatched types - //~| expected struct `Foo`, found () + //~| expected struct `Foo`, found `()` //~| expected struct `Foo` //~| found unit type `()` // And don't print <> at all when there's just defaults. let _: Foo = (); //~^ ERROR mismatched types - //~| expected struct `Foo`, found () + //~| expected struct `Foo`, found `()` //~| expected struct `Foo` //~| found unit type `()` } diff --git a/src/test/ui/generic/generic-type-params-name-repr.stderr b/src/test/ui/generic/generic-type-params-name-repr.stderr index 12cc11236f850..f20bd1846d758 100644 --- a/src/test/ui/generic/generic-type-params-name-repr.stderr +++ b/src/test/ui/generic/generic-type-params-name-repr.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:13:25 | LL | let _: Foo = (); - | ^^ expected struct `Foo`, found () + | ^^ expected struct `Foo`, found `()` | = note: expected struct `Foo` found unit type `()` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:20:31 | LL | let _: Foo = (); - | ^^ expected struct `Foo`, found () + | ^^ expected struct `Foo`, found `()` | = note: expected struct `Foo` found unit type `()` @@ -20,7 +20,7 @@ error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:27:37 | LL | let _: HashMap = (); - | ^^ expected struct `HashMap`, found () + | ^^ expected struct `HashMap`, found `()` | = note: expected struct `HashMap` found unit type `()` @@ -29,7 +29,7 @@ error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:32:51 | LL | let _: HashMap> = (); - | ^^ expected struct `HashMap`, found () + | ^^ expected struct `HashMap`, found `()` | = note: expected struct `HashMap` found unit type `()` @@ -38,7 +38,7 @@ error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:39:31 | LL | let _: Foo = (); - | ^^ expected struct `Foo`, found () + | ^^ expected struct `Foo`, found `()` | = note: expected struct `Foo` found unit type `()` @@ -47,7 +47,7 @@ error[E0308]: mismatched types --> $DIR/generic-type-params-name-repr.rs:46:27 | LL | let _: Foo = (); - | ^^ expected struct `Foo`, found () + | ^^ expected struct `Foo`, found `()` | = note: expected struct `Foo` found unit type `()` diff --git a/src/test/ui/if-else-type-mismatch.stderr b/src/test/ui/if-else-type-mismatch.stderr index 6d36854545cab..14e8f87393ba1 100644 --- a/src/test/ui/if-else-type-mismatch.stderr +++ b/src/test/ui/if-else-type-mismatch.stderr @@ -7,7 +7,7 @@ LL | | 1i32 | | ---- expected because of this LL | | } else { LL | | 2u32 - | | ^^^^ expected i32, found u32 + | | ^^^^ expected `i32`, found `u32` LL | | }; | |_____- if and else have incompatible types @@ -15,7 +15,7 @@ error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:8:38 | LL | let _ = if true { 42i32 } else { 42u32 }; - | ----- ^^^^^ expected i32, found u32 + | ----- ^^^^^ expected `i32`, found `u32` | | | expected because of this @@ -31,7 +31,7 @@ LL | | 3u32; | | expected because of this LL | | } else { LL | | 4u32 - | | ^^^^ expected (), found u32 + | | ^^^^ expected `()`, found `u32` LL | | }; | |_____- if and else have incompatible types @@ -47,7 +47,7 @@ LL | | 6u32; | | ^^^^- | | | | | | | help: consider removing this semicolon - | | expected u32, found () + | | expected `u32`, found `()` LL | | }; | |_____- if and else have incompatible types @@ -60,7 +60,7 @@ LL | | 7i32; | | ----- expected because of this LL | | } else { LL | | 8u32 - | | ^^^^ expected (), found u32 + | | ^^^^ expected `()`, found `u32` LL | | }; | |_____- if and else have incompatible types @@ -73,7 +73,7 @@ LL | | 9i32 | | ---- expected because of this LL | | } else { LL | | 10u32; - | | ^^^^^^ expected i32, found () + | | ^^^^^^ expected `i32`, found `()` LL | | }; | |_____- if and else have incompatible types @@ -86,7 +86,7 @@ LL | | LL | | } else { | |_____- expected because of this LL | 11u32 - | ^^^^^ expected (), found u32 + | ^^^^^ expected `()`, found `u32` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:42:12 @@ -99,7 +99,7 @@ LL | } else { | ____________^ LL | | LL | | }; - | |_____^ expected i32, found () + | |_____^ expected `i32`, found `()` error: aborting due to 8 previous errors diff --git a/src/test/ui/if/if-branch-types.rs b/src/test/ui/if/if-branch-types.rs index b79a49eb5dec1..5c693194a76a1 100644 --- a/src/test/ui/if/if-branch-types.rs +++ b/src/test/ui/if/if-branch-types.rs @@ -1,5 +1,5 @@ fn main() { let x = if true { 10i32 } else { 10u32 }; //~^ ERROR if and else have incompatible types - //~| expected i32, found u32 + //~| expected `i32`, found `u32` } diff --git a/src/test/ui/if/if-branch-types.stderr b/src/test/ui/if/if-branch-types.stderr index bfaae2d31a01b..b5eacf5860f8a 100644 --- a/src/test/ui/if/if-branch-types.stderr +++ b/src/test/ui/if/if-branch-types.stderr @@ -2,7 +2,7 @@ error[E0308]: if and else have incompatible types --> $DIR/if-branch-types.rs:2:38 | LL | let x = if true { 10i32 } else { 10u32 }; - | ----- ^^^^^ expected i32, found u32 + | ----- ^^^^^ expected `i32`, found `u32` | | | expected because of this diff --git a/src/test/ui/if/if-let-arm-types.rs b/src/test/ui/if/if-let-arm-types.rs index f120b60c611f0..cae4f0974c6c4 100644 --- a/src/test/ui/if/if-let-arm-types.rs +++ b/src/test/ui/if/if-let-arm-types.rs @@ -7,5 +7,5 @@ fn main() { 1 }; //~^^ ERROR: if and else have incompatible types - //~| NOTE expected (), found integer + //~| NOTE expected `()`, found integer } diff --git a/src/test/ui/if/if-let-arm-types.stderr b/src/test/ui/if/if-let-arm-types.stderr index 088aa0e8554bb..da93dfc999507 100644 --- a/src/test/ui/if/if-let-arm-types.stderr +++ b/src/test/ui/if/if-let-arm-types.stderr @@ -8,7 +8,7 @@ LL | | () LL | | LL | | } else { LL | | 1 - | | ^ expected (), found integer + | | ^ expected `()`, found integer LL | | }; | |_____- if and else have incompatible types diff --git a/src/test/ui/if/if-no-match-bindings.stderr b/src/test/ui/if/if-no-match-bindings.stderr index add9ee86ac226..3f382e023a776 100644 --- a/src/test/ui/if/if-no-match-bindings.stderr +++ b/src/test/ui/if/if-no-match-bindings.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | if b_ref() {} | ^^^^^^^ | | - | expected bool, found &bool + | expected `bool`, found `&bool` | help: consider dereferencing the borrow: `*b_ref()` error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | if b_mut_ref() {} | ^^^^^^^^^^^ | | - | expected bool, found &mut bool + | expected `bool`, found `&mut bool` | help: consider dereferencing the borrow: `*b_mut_ref()` error[E0308]: mismatched types @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | if &true {} | ^^^^^ | | - | expected bool, found &bool + | expected `bool`, found `&bool` | help: consider removing the borrow: `true` error[E0308]: mismatched types @@ -31,7 +31,7 @@ error[E0308]: mismatched types LL | if &mut true {} | ^^^^^^^^^ | | - | expected bool, found &mut bool + | expected `bool`, found `&mut bool` | help: consider removing the borrow: `true` error[E0308]: mismatched types @@ -40,7 +40,7 @@ error[E0308]: mismatched types LL | while b_ref() {} | ^^^^^^^ | | - | expected bool, found &bool + | expected `bool`, found `&bool` | help: consider dereferencing the borrow: `*b_ref()` error[E0308]: mismatched types @@ -49,7 +49,7 @@ error[E0308]: mismatched types LL | while b_mut_ref() {} | ^^^^^^^^^^^ | | - | expected bool, found &mut bool + | expected `bool`, found `&mut bool` | help: consider dereferencing the borrow: `*b_mut_ref()` error[E0308]: mismatched types @@ -58,7 +58,7 @@ error[E0308]: mismatched types LL | while &true {} | ^^^^^ | | - | expected bool, found &bool + | expected `bool`, found `&bool` | help: consider removing the borrow: `true` error[E0308]: mismatched types @@ -67,7 +67,7 @@ error[E0308]: mismatched types LL | while &mut true {} | ^^^^^^^^^ | | - | expected bool, found &mut bool + | expected `bool`, found `&mut bool` | help: consider removing the borrow: `true` error: aborting due to 8 previous errors diff --git a/src/test/ui/if/if-typeck.stderr b/src/test/ui/if/if-typeck.stderr index 2bddcc707c6e4..74ed0ed0ae6bd 100644 --- a/src/test/ui/if/if-typeck.stderr +++ b/src/test/ui/if/if-typeck.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/if-typeck.rs:9:8 | LL | if f { } - | ^ expected bool, found fn item + | ^ expected `bool`, found fn item | = note: expected type `bool` found fn item `fn() {f}` diff --git a/src/test/ui/if/if-without-else-as-fn-expr.stderr b/src/test/ui/if/if-without-else-as-fn-expr.stderr index 472c85d96fbd7..9c7e7002360db 100644 --- a/src/test/ui/if/if-without-else-as-fn-expr.stderr +++ b/src/test/ui/if/if-without-else-as-fn-expr.stderr @@ -6,7 +6,7 @@ LL | fn foo(bar: usize) -> usize { LL | / if bar % 5 == 0 { LL | | return 3; LL | | } - | |_____^ expected usize, found () + | |_____^ expected `usize`, found `()` | = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -20,7 +20,7 @@ LL | let x: usize = if bar % 5 == 0 { | | expected because of this assignment LL | | return 3; LL | | }; - | |_____^ expected usize, found () + | |_____^ expected `usize`, found `()` | = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -33,7 +33,7 @@ LL | fn foo3(bar: usize) -> usize { LL | / if bar % 5 == 0 { LL | | 3 LL | | } - | |_____^ expected usize, found () + | |_____^ expected `usize`, found `()` | = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -46,7 +46,7 @@ LL | fn foo_let(bar: usize) -> usize { LL | / if let 0 = 1 { LL | | return 3; LL | | } - | |_____^ expected usize, found () + | |_____^ expected `usize`, found `()` | = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -60,7 +60,7 @@ LL | let x: usize = if let 0 = 1 { | | expected because of this assignment LL | | return 3; LL | | }; - | |_____^ expected usize, found () + | |_____^ expected `usize`, found `()` | = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -73,7 +73,7 @@ LL | fn foo3_let(bar: usize) -> usize { LL | / if let 0 = 1 { LL | | 3 LL | | } - | |_____^ expected usize, found () + | |_____^ expected `usize`, found `()` | = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/if/if-without-else-result.rs b/src/test/ui/if/if-without-else-result.rs index bd55973346665..e5fb7b26321e4 100644 --- a/src/test/ui/if/if-without-else-result.rs +++ b/src/test/ui/if/if-without-else-result.rs @@ -1,6 +1,6 @@ fn main() { let a = if true { true }; //~^ ERROR if may be missing an else clause [E0317] - //~| expected (), found bool + //~| expected `()`, found `bool` println!("{}", a); } diff --git a/src/test/ui/if/if-without-else-result.stderr b/src/test/ui/if/if-without-else-result.stderr index b2c700d3c8feb..66a8185774e6a 100644 --- a/src/test/ui/if/if-without-else-result.stderr +++ b/src/test/ui/if/if-without-else-result.stderr @@ -5,7 +5,7 @@ LL | let a = if true { true }; | ^^^^^^^^^^----^^ | | | | | found here - | expected (), found bool + | expected `()`, found `bool` | = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/if/ifmt-bad-arg.stderr b/src/test/ui/if/ifmt-bad-arg.stderr index 2f81c3938efa8..07917c2a540d5 100644 --- a/src/test/ui/if/ifmt-bad-arg.stderr +++ b/src/test/ui/if/ifmt-bad-arg.stderr @@ -300,7 +300,7 @@ error[E0308]: mismatched types --> $DIR/ifmt-bad-arg.rs:78:32 | LL | println!("{} {:.*} {}", 1, 3.2, 4); - | ^^^ expected usize, found floating-point number + | ^^^ expected `usize`, found floating-point number | = note: expected reference `&usize` found reference `&{float}` @@ -309,7 +309,7 @@ error[E0308]: mismatched types --> $DIR/ifmt-bad-arg.rs:81:35 | LL | println!("{} {:07$.*} {}", 1, 3.2, 4); - | ^^^ expected usize, found floating-point number + | ^^^ expected `usize`, found floating-point number | = note: expected reference `&usize` found reference `&{float}` diff --git a/src/test/ui/impl-trait/bound-normalization-fail.stderr b/src/test/ui/impl-trait/bound-normalization-fail.stderr index 0074ac314178c..fc4cddd02168e 100644 --- a/src/test/ui/impl-trait/bound-normalization-fail.stderr +++ b/src/test/ui/impl-trait/bound-normalization-fail.stderr @@ -10,7 +10,7 @@ error[E0271]: type mismatch resolving ` as FooLike>::Output == $DIR/bound-normalization-fail.rs:28:32 | LL | fn foo_fail() -> impl FooLike { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found associated type + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type | = note: expected type `()` found associated type `::Assoc` @@ -28,7 +28,7 @@ error[E0271]: type mismatch resolving ` as FooLike>::Output == $DIR/bound-normalization-fail.rs:44:41 | LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found associated type + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type | = note: expected type `()` found associated type `>::Assoc` diff --git a/src/test/ui/impl-trait/equality.rs b/src/test/ui/impl-trait/equality.rs index f6b0853284d51..14b0eeb739ae5 100644 --- a/src/test/ui/impl-trait/equality.rs +++ b/src/test/ui/impl-trait/equality.rs @@ -14,7 +14,7 @@ fn two(x: bool) -> impl Foo { } 0_u32 //~^ ERROR mismatched types - //~| expected i32, found u32 + //~| expected `i32`, found `u32` } fn sum_to(n: u32) -> impl Foo { diff --git a/src/test/ui/impl-trait/equality.stderr b/src/test/ui/impl-trait/equality.stderr index 7349ab12cda04..e53524e58d663 100644 --- a/src/test/ui/impl-trait/equality.stderr +++ b/src/test/ui/impl-trait/equality.stderr @@ -8,7 +8,7 @@ LL | return 1_i32; | ----- ...is found to be `i32` here LL | } LL | 0_u32 - | ^^^^^ expected i32, found u32 + | ^^^^^ expected `i32`, found `u32` error[E0277]: cannot add `impl Foo` to `u32` --> $DIR/equality.rs:24:11 diff --git a/src/test/ui/impl-trait/equality2.rs b/src/test/ui/impl-trait/equality2.rs index 29cd67a806d58..abce8c8c204bd 100644 --- a/src/test/ui/impl-trait/equality2.rs +++ b/src/test/ui/impl-trait/equality2.rs @@ -26,19 +26,19 @@ fn main() { //~^ ERROR mismatched types //~| expected type `u32` //~| found opaque type `impl Foo` - //~| expected u32, found opaque type + //~| expected `u32`, found opaque type let _: i32 = Leak::leak(hide(0_i32)); //~^ ERROR mismatched types //~| expected type `i32` //~| found associated type `::T` - //~| expected i32, found associated type + //~| expected `i32`, found associated type let mut x = (hide(0_u32), hide(0_i32)); x = (x.1, //~^ ERROR mismatched types - //~| expected u32, found i32 + //~| expected `u32`, found `i32` x.0); //~^ ERROR mismatched types - //~| expected i32, found u32 + //~| expected `i32`, found `u32` } diff --git a/src/test/ui/impl-trait/equality2.stderr b/src/test/ui/impl-trait/equality2.stderr index de85f5f6eec9f..7a656fca28b58 100644 --- a/src/test/ui/impl-trait/equality2.stderr +++ b/src/test/ui/impl-trait/equality2.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/equality2.rs:25:18 | LL | let _: u32 = hide(0_u32); - | ^^^^^^^^^^^ expected u32, found opaque type + | ^^^^^^^^^^^ expected `u32`, found opaque type | = note: expected type `u32` found opaque type `impl Foo` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/equality2.rs:31:18 | LL | let _: i32 = Leak::leak(hide(0_i32)); - | ^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found associated type + | ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found associated type | = note: expected type `i32` found associated type `::T` @@ -22,19 +22,19 @@ error[E0308]: mismatched types --> $DIR/equality2.rs:38:10 | LL | x = (x.1, - | ^^^ expected u32, found i32 + | ^^^ expected `u32`, found `i32` | - = note: expected opaque type `impl Foo` (u32) - found opaque type `impl Foo` (i32) + = note: expected opaque type `impl Foo` (`u32`) + found opaque type `impl Foo` (`i32`) error[E0308]: mismatched types --> $DIR/equality2.rs:41:10 | LL | x.0); - | ^^^ expected i32, found u32 + | ^^^ expected `i32`, found `u32` | - = note: expected opaque type `impl Foo` (i32) - found opaque type `impl Foo` (u32) + = note: expected opaque type `impl Foo` (`i32`) + found opaque type `impl Foo` (`u32`) error: aborting due to 4 previous errors diff --git a/src/test/ui/include-macros/mismatched-types.stderr b/src/test/ui/include-macros/mismatched-types.stderr index 43d8ba1d7a361..33daf372f986b 100644 --- a/src/test/ui/include-macros/mismatched-types.stderr +++ b/src/test/ui/include-macros/mismatched-types.stderr @@ -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 slice `[u8]`, found `str` | = note: expected reference `&[u8]` found reference `&'static str` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/mismatched-types.rs:3:19 | LL | let s: &str = include_bytes!("file.txt"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected str, found array `[u8; 0]` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `str`, found array `[u8; 0]` | = note: expected reference `&str` found reference `&'static [u8; 0]` diff --git a/src/test/ui/indexing-requires-a-uint.stderr b/src/test/ui/indexing-requires-a-uint.stderr index 7010a3ccbea83..70614cbbf9f63 100644 --- a/src/test/ui/indexing-requires-a-uint.stderr +++ b/src/test/ui/indexing-requires-a-uint.stderr @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/indexing-requires-a-uint.rs:12:18 | LL | bar::(i); // i should not be re-coerced back to an isize - | ^ expected isize, found usize + | ^ expected `isize`, found `usize` | help: you can convert an `usize` to `isize` and panic if the converted value wouldn't fit | diff --git a/src/test/ui/integer-literal-suffix-inference.rs b/src/test/ui/integer-literal-suffix-inference.rs index 2da3286c70056..3f4bedc4c2224 100644 --- a/src/test/ui/integer-literal-suffix-inference.rs +++ b/src/test/ui/integer-literal-suffix-inference.rs @@ -31,132 +31,132 @@ fn main() { id_i8(a8); // ok id_i8(a16); //~^ ERROR mismatched types - //~| expected i8, found i16 + //~| expected `i8`, found `i16` id_i8(a32); //~^ ERROR mismatched types - //~| expected i8, found i32 + //~| expected `i8`, found `i32` id_i8(a64); //~^ ERROR mismatched types - //~| expected i8, found i64 + //~| expected `i8`, found `i64` id_i16(a8); //~^ ERROR mismatched types - //~| expected i16, found i8 + //~| expected `i16`, found `i8` id_i16(a16); // ok id_i16(a32); //~^ ERROR mismatched types - //~| expected i16, found i32 + //~| expected `i16`, found `i32` id_i16(a64); //~^ ERROR mismatched types - //~| expected i16, found i64 + //~| expected `i16`, found `i64` id_i32(a8); //~^ ERROR mismatched types - //~| expected i32, found i8 + //~| expected `i32`, found `i8` id_i32(a16); //~^ ERROR mismatched types - //~| expected i32, found i16 + //~| expected `i32`, found `i16` id_i32(a32); // ok id_i32(a64); //~^ ERROR mismatched types - //~| expected i32, found i64 + //~| expected `i32`, found `i64` id_i64(a8); //~^ ERROR mismatched types - //~| expected i64, found i8 + //~| expected `i64`, found `i8` id_i64(a16); //~^ ERROR mismatched types - //~| expected i64, found i16 + //~| expected `i64`, found `i16` id_i64(a32); //~^ ERROR mismatched types - //~| expected i64, found i32 + //~| expected `i64`, found `i32` id_i64(a64); // ok id_i8(c8); // ok id_i8(c16); //~^ ERROR mismatched types - //~| expected i8, found i16 + //~| expected `i8`, found `i16` id_i8(c32); //~^ ERROR mismatched types - //~| expected i8, found i32 + //~| expected `i8`, found `i32` id_i8(c64); //~^ ERROR mismatched types - //~| expected i8, found i64 + //~| expected `i8`, found `i64` id_i16(c8); //~^ ERROR mismatched types - //~| expected i16, found i8 + //~| expected `i16`, found `i8` id_i16(c16); // ok id_i16(c32); //~^ ERROR mismatched types - //~| expected i16, found i32 + //~| expected `i16`, found `i32` id_i16(c64); //~^ ERROR mismatched types - //~| expected i16, found i64 + //~| expected `i16`, found `i64` id_i32(c8); //~^ ERROR mismatched types - //~| expected i32, found i8 + //~| expected `i32`, found `i8` id_i32(c16); //~^ ERROR mismatched types - //~| expected i32, found i16 + //~| expected `i32`, found `i16` id_i32(c32); // ok id_i32(c64); //~^ ERROR mismatched types - //~| expected i32, found i64 + //~| expected `i32`, found `i64` id_i64(a8); //~^ ERROR mismatched types - //~| expected i64, found i8 + //~| expected `i64`, found `i8` id_i64(a16); //~^ ERROR mismatched types - //~| expected i64, found i16 + //~| expected `i64`, found `i16` id_i64(a32); //~^ ERROR mismatched types - //~| expected i64, found i32 + //~| expected `i64`, found `i32` id_i64(a64); // ok id_u8(b8); // ok id_u8(b16); //~^ ERROR mismatched types - //~| expected u8, found u16 + //~| expected `u8`, found `u16` id_u8(b32); //~^ ERROR mismatched types - //~| expected u8, found u32 + //~| expected `u8`, found `u32` id_u8(b64); //~^ ERROR mismatched types - //~| expected u8, found u64 + //~| expected `u8`, found `u64` id_u16(b8); //~^ ERROR mismatched types - //~| expected u16, found u8 + //~| expected `u16`, found `u8` id_u16(b16); // ok id_u16(b32); //~^ ERROR mismatched types - //~| expected u16, found u32 + //~| expected `u16`, found `u32` id_u16(b64); //~^ ERROR mismatched types - //~| expected u16, found u64 + //~| expected `u16`, found `u64` id_u32(b8); //~^ ERROR mismatched types - //~| expected u32, found u8 + //~| expected `u32`, found `u8` id_u32(b16); //~^ ERROR mismatched types - //~| expected u32, found u16 + //~| expected `u32`, found `u16` id_u32(b32); // ok id_u32(b64); //~^ ERROR mismatched types - //~| expected u32, found u64 + //~| expected `u32`, found `u64` id_u64(b8); //~^ ERROR mismatched types - //~| expected u64, found u8 + //~| expected `u64`, found `u8` id_u64(b16); //~^ ERROR mismatched types - //~| expected u64, found u16 + //~| expected `u64`, found `u16` id_u64(b32); //~^ ERROR mismatched types - //~| expected u64, found u32 + //~| expected `u64`, found `u32` id_u64(b64); // ok } diff --git a/src/test/ui/integer-literal-suffix-inference.stderr b/src/test/ui/integer-literal-suffix-inference.stderr index bbb57d97c39f4..a34f0645c6b97 100644 --- a/src/test/ui/integer-literal-suffix-inference.stderr +++ b/src/test/ui/integer-literal-suffix-inference.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:32:11 | LL | id_i8(a16); - | ^^^ expected i8, found i16 + | ^^^ expected `i8`, found `i16` | help: you can convert an `i16` to `i8` and panic if the converted value wouldn't fit | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:35:11 | LL | id_i8(a32); - | ^^^ expected i8, found i32 + | ^^^ expected `i8`, found `i32` | help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit | @@ -24,7 +24,7 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:38:11 | LL | id_i8(a64); - | ^^^ expected i8, found i64 + | ^^^ expected `i8`, found `i64` | help: you can convert an `i64` to `i8` and panic if the converted value wouldn't fit | @@ -37,14 +37,14 @@ error[E0308]: mismatched types LL | id_i16(a8); | ^^ | | - | expected i16, found i8 + | expected `i16`, found `i8` | help: you can convert an `i8` to `i16`: `a8.into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:46:12 | LL | id_i16(a32); - | ^^^ expected i16, found i32 + | ^^^ expected `i16`, found `i32` | help: you can convert an `i32` to `i16` and panic if the converted value wouldn't fit | @@ -55,7 +55,7 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:49:12 | LL | id_i16(a64); - | ^^^ expected i16, found i64 + | ^^^ expected `i16`, found `i64` | help: you can convert an `i64` to `i16` and panic if the converted value wouldn't fit | @@ -68,7 +68,7 @@ error[E0308]: mismatched types LL | id_i32(a8); | ^^ | | - | expected i32, found i8 + | expected `i32`, found `i8` | help: you can convert an `i8` to `i32`: `a8.into()` error[E0308]: mismatched types @@ -77,14 +77,14 @@ error[E0308]: mismatched types LL | id_i32(a16); | ^^^ | | - | expected i32, found i16 + | expected `i32`, found `i16` | help: you can convert an `i16` to `i32`: `a16.into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:60:12 | LL | id_i32(a64); - | ^^^ expected i32, found i64 + | ^^^ expected `i32`, found `i64` | help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit | @@ -97,7 +97,7 @@ error[E0308]: mismatched types LL | id_i64(a8); | ^^ | | - | expected i64, found i8 + | expected `i64`, found `i8` | help: you can convert an `i8` to `i64`: `a8.into()` error[E0308]: mismatched types @@ -106,7 +106,7 @@ error[E0308]: mismatched types LL | id_i64(a16); | ^^^ | | - | expected i64, found i16 + | expected `i64`, found `i16` | help: you can convert an `i16` to `i64`: `a16.into()` error[E0308]: mismatched types @@ -115,14 +115,14 @@ error[E0308]: mismatched types LL | id_i64(a32); | ^^^ | | - | expected i64, found i32 + | expected `i64`, found `i32` | help: you can convert an `i32` to `i64`: `a32.into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:76:11 | LL | id_i8(c16); - | ^^^ expected i8, found i16 + | ^^^ expected `i8`, found `i16` | help: you can convert an `i16` to `i8` and panic if the converted value wouldn't fit | @@ -133,7 +133,7 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:79:11 | LL | id_i8(c32); - | ^^^ expected i8, found i32 + | ^^^ expected `i8`, found `i32` | help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit | @@ -144,7 +144,7 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:82:11 | LL | id_i8(c64); - | ^^^ expected i8, found i64 + | ^^^ expected `i8`, found `i64` | help: you can convert an `i64` to `i8` and panic if the converted value wouldn't fit | @@ -157,14 +157,14 @@ error[E0308]: mismatched types LL | id_i16(c8); | ^^ | | - | expected i16, found i8 + | expected `i16`, found `i8` | help: you can convert an `i8` to `i16`: `c8.into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:90:12 | LL | id_i16(c32); - | ^^^ expected i16, found i32 + | ^^^ expected `i16`, found `i32` | help: you can convert an `i32` to `i16` and panic if the converted value wouldn't fit | @@ -175,7 +175,7 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:93:12 | LL | id_i16(c64); - | ^^^ expected i16, found i64 + | ^^^ expected `i16`, found `i64` | help: you can convert an `i64` to `i16` and panic if the converted value wouldn't fit | @@ -188,7 +188,7 @@ error[E0308]: mismatched types LL | id_i32(c8); | ^^ | | - | expected i32, found i8 + | expected `i32`, found `i8` | help: you can convert an `i8` to `i32`: `c8.into()` error[E0308]: mismatched types @@ -197,14 +197,14 @@ error[E0308]: mismatched types LL | id_i32(c16); | ^^^ | | - | expected i32, found i16 + | expected `i32`, found `i16` | help: you can convert an `i16` to `i32`: `c16.into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:104:12 | LL | id_i32(c64); - | ^^^ expected i32, found i64 + | ^^^ expected `i32`, found `i64` | help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit | @@ -217,7 +217,7 @@ error[E0308]: mismatched types LL | id_i64(a8); | ^^ | | - | expected i64, found i8 + | expected `i64`, found `i8` | help: you can convert an `i8` to `i64`: `a8.into()` error[E0308]: mismatched types @@ -226,7 +226,7 @@ error[E0308]: mismatched types LL | id_i64(a16); | ^^^ | | - | expected i64, found i16 + | expected `i64`, found `i16` | help: you can convert an `i16` to `i64`: `a16.into()` error[E0308]: mismatched types @@ -235,14 +235,14 @@ error[E0308]: mismatched types LL | id_i64(a32); | ^^^ | | - | expected i64, found i32 + | expected `i64`, found `i32` | help: you can convert an `i32` to `i64`: `a32.into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:120:11 | LL | id_u8(b16); - | ^^^ expected u8, found u16 + | ^^^ expected `u8`, found `u16` | help: you can convert an `u16` to `u8` and panic if the converted value wouldn't fit | @@ -253,7 +253,7 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:123:11 | LL | id_u8(b32); - | ^^^ expected u8, found u32 + | ^^^ expected `u8`, found `u32` | help: you can convert an `u32` to `u8` and panic if the converted value wouldn't fit | @@ -264,7 +264,7 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:126:11 | LL | id_u8(b64); - | ^^^ expected u8, found u64 + | ^^^ expected `u8`, found `u64` | help: you can convert an `u64` to `u8` and panic if the converted value wouldn't fit | @@ -277,14 +277,14 @@ error[E0308]: mismatched types LL | id_u16(b8); | ^^ | | - | expected u16, found u8 + | expected `u16`, found `u8` | help: you can convert an `u8` to `u16`: `b8.into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:134:12 | LL | id_u16(b32); - | ^^^ expected u16, found u32 + | ^^^ expected `u16`, found `u32` | help: you can convert an `u32` to `u16` and panic if the converted value wouldn't fit | @@ -295,7 +295,7 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:137:12 | LL | id_u16(b64); - | ^^^ expected u16, found u64 + | ^^^ expected `u16`, found `u64` | help: you can convert an `u64` to `u16` and panic if the converted value wouldn't fit | @@ -308,7 +308,7 @@ error[E0308]: mismatched types LL | id_u32(b8); | ^^ | | - | expected u32, found u8 + | expected `u32`, found `u8` | help: you can convert an `u8` to `u32`: `b8.into()` error[E0308]: mismatched types @@ -317,14 +317,14 @@ error[E0308]: mismatched types LL | id_u32(b16); | ^^^ | | - | expected u32, found u16 + | expected `u32`, found `u16` | help: you can convert an `u16` to `u32`: `b16.into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:148:12 | LL | id_u32(b64); - | ^^^ expected u32, found u64 + | ^^^ expected `u32`, found `u64` | help: you can convert an `u64` to `u32` and panic if the converted value wouldn't fit | @@ -337,7 +337,7 @@ error[E0308]: mismatched types LL | id_u64(b8); | ^^ | | - | expected u64, found u8 + | expected `u64`, found `u8` | help: you can convert an `u8` to `u64`: `b8.into()` error[E0308]: mismatched types @@ -346,7 +346,7 @@ error[E0308]: mismatched types LL | id_u64(b16); | ^^^ | | - | expected u64, found u16 + | expected `u64`, found `u16` | help: you can convert an `u16` to `u64`: `b16.into()` error[E0308]: mismatched types @@ -355,7 +355,7 @@ error[E0308]: mismatched types LL | id_u64(b32); | ^^^ | | - | expected u64, found u32 + | expected `u64`, found `u32` | help: you can convert an `u32` to `u64`: `b32.into()` error: aborting due to 36 previous errors diff --git a/src/test/ui/issues/issue-10176.rs b/src/test/ui/issues/issue-10176.rs index 9f42214a5051b..6277aa05eb365 100644 --- a/src/test/ui/issues/issue-10176.rs +++ b/src/test/ui/issues/issue-10176.rs @@ -3,7 +3,7 @@ fn f() -> isize { //~^ ERROR mismatched types //~| expected type `isize` //~| found tuple `(!, !)` -//~| expected isize, found tuple +//~| expected `isize`, found tuple } fn main() {} diff --git a/src/test/ui/issues/issue-10176.stderr b/src/test/ui/issues/issue-10176.stderr index 7cab5a1f7c3a5..cd5361ffad398 100644 --- a/src/test/ui/issues/issue-10176.stderr +++ b/src/test/ui/issues/issue-10176.stderr @@ -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 tuple | = note: expected type `isize` found tuple `(!, !)` diff --git a/src/test/ui/issues/issue-11319.rs b/src/test/ui/issues/issue-11319.rs index f40d000516156..8c2bafe63bd69 100644 --- a/src/test/ui/issues/issue-11319.rs +++ b/src/test/ui/issues/issue-11319.rs @@ -7,7 +7,7 @@ fn main() { //~^ NOTE this is found to be of type `bool` None => (), //~^ ERROR match arms have incompatible types - //~| NOTE expected bool, found () + //~| NOTE expected `bool`, found `()` _ => true } } diff --git a/src/test/ui/issues/issue-11319.stderr b/src/test/ui/issues/issue-11319.stderr index 2ca49922d0612..7663a32883cca 100644 --- a/src/test/ui/issues/issue-11319.stderr +++ b/src/test/ui/issues/issue-11319.stderr @@ -10,7 +10,7 @@ LL | | Some(2) => true, | | ---- this is found to be of type `bool` LL | | LL | | None => (), - | | ^^ expected bool, found () + | | ^^ expected `bool`, found `()` ... | LL | | _ => true LL | | } diff --git a/src/test/ui/issues/issue-11374.stderr b/src/test/ui/issues/issue-11374.stderr index a5b9de0a0a316..bc7d1247502d3 100644 --- a/src/test/ui/issues/issue-11374.stderr +++ b/src/test/ui/issues/issue-11374.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | c.read_to(v); | ^ | | - | expected &mut [u8], found struct `std::vec::Vec` + | expected `&mut [u8]`, found struct `std::vec::Vec` | help: consider mutably borrowing here: `&mut v` | = note: expected mutable reference `&mut [u8]` diff --git a/src/test/ui/issues/issue-12997-2.stderr b/src/test/ui/issues/issue-12997-2.stderr index 102405cd0f674..01f8e34883605 100644 --- a/src/test/ui/issues/issue-12997-2.stderr +++ b/src/test/ui/issues/issue-12997-2.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-12997-2.rs:8:1 | LL | fn bar(x: isize) { } - | ^^^^^^^^^^^^^^^^^^^^ expected isize, found &mut test::Bencher + | ^^^^^^^^^^^^^^^^^^^^ expected `isize`, found `&mut test::Bencher` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-13359.rs b/src/test/ui/issues/issue-13359.rs index 7409426dc39b0..9129790c501e3 100644 --- a/src/test/ui/issues/issue-13359.rs +++ b/src/test/ui/issues/issue-13359.rs @@ -5,9 +5,9 @@ fn bar(_s: u32) { } fn main() { foo(1*(1 as isize)); //~^ ERROR mismatched types - //~| expected i16, found isize + //~| expected `i16`, found `isize` bar(1*(1 as usize)); //~^ ERROR mismatched types - //~| expected u32, found usize + //~| expected `u32`, found `usize` } diff --git a/src/test/ui/issues/issue-13359.stderr b/src/test/ui/issues/issue-13359.stderr index 76c5f39fe1094..68258a8888a40 100644 --- a/src/test/ui/issues/issue-13359.stderr +++ b/src/test/ui/issues/issue-13359.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-13359.rs:6:9 | LL | foo(1*(1 as isize)); - | ^^^^^^^^^^^^^^ expected i16, found isize + | ^^^^^^^^^^^^^^ expected `i16`, found `isize` | help: you can convert an `isize` to `i16` and panic if the converted value wouldn't fit | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/issue-13359.rs:10:9 | LL | bar(1*(1 as usize)); - | ^^^^^^^^^^^^^^ expected u32, found usize + | ^^^^^^^^^^^^^^ expected `u32`, found `usize` | help: you can convert an `usize` to `u32` and panic if the converted value wouldn't fit | diff --git a/src/test/ui/issues/issue-1362.stderr b/src/test/ui/issues/issue-1362.stderr index 7ffbbbce7a83b..de67a72a63980 100644 --- a/src/test/ui/issues/issue-1362.stderr +++ b/src/test/ui/issues/issue-1362.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-1362.rs:4:16 | LL | let x: u32 = 20i32; - | ^^^^^ expected u32, found i32 + | ^^^^^ expected `u32`, found `i32` | help: change the type of the numeric literal from `i32` to `u32` | diff --git a/src/test/ui/issues/issue-14091.stderr b/src/test/ui/issues/issue-14091.stderr index bb9f843dadfe3..7db4734780817 100644 --- a/src/test/ui/issues/issue-14091.stderr +++ b/src/test/ui/issues/issue-14091.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-14091.rs:2:5 | LL | assert!(1,1); - | ^^^^^^^^^^^^^ expected bool, found integer + | ^^^^^^^^^^^^^ expected `bool`, found integer error: aborting due to previous error diff --git a/src/test/ui/issues/issue-1448-2.stderr b/src/test/ui/issues/issue-1448-2.stderr index 28c561462d410..9cf2f09e17747 100644 --- a/src/test/ui/issues/issue-1448-2.stderr +++ b/src/test/ui/issues/issue-1448-2.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-1448-2.rs:6:24 | LL | println!("{}", foo(10i32)); - | ^^^^^ expected u32, found i32 + | ^^^^^ expected `u32`, found `i32` | help: change the type of the numeric literal from `i32` to `u32` | diff --git a/src/test/ui/issues/issue-16338.stderr b/src/test/ui/issues/issue-16338.stderr index cae09c2151908..c35edb0c8c0e3 100644 --- a/src/test/ui/issues/issue-16338.stderr +++ b/src/test/ui/issues/issue-16338.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-16338.rs:7:9 | LL | let Slice { data: data, len: len } = "foo"; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected str, found struct `Slice` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `str`, found struct `Slice` | = note: expected type `str` found struct `Slice<_>` diff --git a/src/test/ui/issues/issue-16401.rs b/src/test/ui/issues/issue-16401.rs index aaa38b8f1709d..332352ca727ac 100644 --- a/src/test/ui/issues/issue-16401.rs +++ b/src/test/ui/issues/issue-16401.rs @@ -9,7 +9,7 @@ fn main() { //~^ ERROR mismatched types //~| expected unit type `()` //~| found struct `Slice<_>` - //~| expected (), found struct `Slice` + //~| expected `()`, found struct `Slice` _ => unreachable!() } } diff --git a/src/test/ui/issues/issue-16401.stderr b/src/test/ui/issues/issue-16401.stderr index 872066bd3f765..d3d6108be9d1d 100644 --- a/src/test/ui/issues/issue-16401.stderr +++ b/src/test/ui/issues/issue-16401.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match () { | -- this match expression has type `()` LL | Slice { data: data, len: len } => (), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `Slice` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Slice` | = note: expected unit type `()` found struct `Slice<_>` diff --git a/src/test/ui/issues/issue-17033.rs b/src/test/ui/issues/issue-17033.rs index 715892397a479..72a8cd9823a4b 100644 --- a/src/test/ui/issues/issue-17033.rs +++ b/src/test/ui/issues/issue-17033.rs @@ -1,6 +1,6 @@ fn f<'r>(p: &'r mut fn(p: &mut ())) { (*p)(()) //~ ERROR mismatched types - //~| expected &mut (), found () + //~| expected `&mut ()`, found `()` } fn main() {} diff --git a/src/test/ui/issues/issue-17033.stderr b/src/test/ui/issues/issue-17033.stderr index 4bdc806f71763..518fc30142c94 100644 --- a/src/test/ui/issues/issue-17033.stderr +++ b/src/test/ui/issues/issue-17033.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | (*p)(()) | ^^ | | - | expected &mut (), found () + | expected `&mut ()`, found `()` | help: consider mutably borrowing here: `&mut ()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-19991.rs b/src/test/ui/issues/issue-19991.rs index e79a006afd9f7..62d5a6de760df 100644 --- a/src/test/ui/issues/issue-19991.rs +++ b/src/test/ui/issues/issue-19991.rs @@ -3,7 +3,7 @@ fn main() { if let Some(homura) = Some("madoka") { //~ ERROR missing an else clause - //~| expected (), found integer + //~| expected `()`, found integer 765 }; } diff --git a/src/test/ui/issues/issue-19991.stderr b/src/test/ui/issues/issue-19991.stderr index d06c3acfd12c6..b78f4a6d29344 100644 --- a/src/test/ui/issues/issue-19991.stderr +++ b/src/test/ui/issues/issue-19991.stderr @@ -6,7 +6,7 @@ LL | | LL | | 765 | | --- found here LL | | }; - | |_____^ expected (), found integer + | |_____^ expected `()`, found integer | = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/issues/issue-20225.stderr b/src/test/ui/issues/issue-20225.stderr index baee8b967992f..1c5911e05f767 100644 --- a/src/test/ui/issues/issue-20225.stderr +++ b/src/test/ui/issues/issue-20225.stderr @@ -4,7 +4,7 @@ error[E0053]: method `call` has an incompatible type for trait LL | impl<'a, T> Fn<(&'a T,)> for Foo { | - this type parameter LL | extern "rust-call" fn call(&self, (_,): (T,)) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &T, found type parameter `T` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&T`, found type parameter `T` | = note: expected fn pointer `extern "rust-call" fn(&Foo, (&'a T,))` found fn pointer `extern "rust-call" fn(&Foo, (T,))` @@ -17,7 +17,7 @@ error[E0053]: method `call_mut` has an incompatible type for trait LL | impl<'a, T> FnMut<(&'a T,)> for Foo { | - this type parameter LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &T, found type parameter `T` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&T`, found type parameter `T` | = note: expected fn pointer `extern "rust-call" fn(&mut Foo, (&'a T,))` found fn pointer `extern "rust-call" fn(&mut Foo, (T,))` @@ -31,7 +31,7 @@ LL | impl<'a, T> FnOnce<(&'a T,)> for Foo { | - this type parameter ... LL | extern "rust-call" fn call_once(self, (_,): (T,)) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &T, found type parameter `T` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&T`, found type parameter `T` | = note: expected fn pointer `extern "rust-call" fn(Foo, (&'a T,))` found fn pointer `extern "rust-call" fn(Foo, (T,))` diff --git a/src/test/ui/issues/issue-22684.stderr b/src/test/ui/issues/issue-22684.stderr index 3c6d3df7faee4..46524bc2c18e1 100644 --- a/src/test/ui/issues/issue-22684.stderr +++ b/src/test/ui/issues/issue-22684.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-22684.rs:17:17 | LL | let _: () = foo::Foo.bar(); - | ^^^^^^^^^^^^^^ expected (), found bool + | ^^^^^^^^^^^^^^ expected `()`, found `bool` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-23589.stderr b/src/test/ui/issues/issue-23589.stderr index a36b380b9c1f0..d126e1bf0b534 100644 --- a/src/test/ui/issues/issue-23589.stderr +++ b/src/test/ui/issues/issue-23589.stderr @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/issue-23589.rs:2:29 | LL | let v: Vec(&str) = vec!['1', '2']; - | ^^^ expected &str, found char + | ^^^ expected `&str`, found `char` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-27008.rs b/src/test/ui/issues/issue-27008.rs index 1a08647358ccc..e04de33f6ef2e 100644 --- a/src/test/ui/issues/issue-27008.rs +++ b/src/test/ui/issues/issue-27008.rs @@ -3,5 +3,5 @@ struct S; fn main() { let b = [0; S]; //~^ ERROR mismatched types - //~| expected usize, found struct `S` + //~| expected `usize`, found struct `S` } diff --git a/src/test/ui/issues/issue-27008.stderr b/src/test/ui/issues/issue-27008.stderr index 2c9eed0b3a54b..5b7e74c1c3012 100644 --- a/src/test/ui/issues/issue-27008.stderr +++ b/src/test/ui/issues/issue-27008.stderr @@ -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 struct `S` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-27042.stderr b/src/test/ui/issues/issue-27042.stderr index e379b23a5950a..71e4d7850143b 100644 --- a/src/test/ui/issues/issue-27042.stderr +++ b/src/test/ui/issues/issue-27042.stderr @@ -14,7 +14,7 @@ error[E0308]: mismatched types LL | loop { break }; | ^^^^^ | | - | expected i32, found () + | expected `i32`, found `()` | help: give it a value of the expected type: `break 42` error[E0308]: mismatched types @@ -23,21 +23,21 @@ error[E0308]: mismatched types LL | / 'b: LL | | LL | | while true { break }; // but here we cite the whole loop - | |____________________________^ expected i32, found () + | |____________________________^ expected `i32`, found `()` error[E0308]: mismatched types --> $DIR/issue-27042.rs:12:9 | LL | / 'c: LL | | for _ in None { break }; // but here we cite the whole loop - | |_______________________________^ expected i32, found () + | |_______________________________^ expected `i32`, found `()` error[E0308]: mismatched types --> $DIR/issue-27042.rs:15:9 | LL | / 'd: LL | | while let Some(_) = None { break }; - | |__________________________________________^ expected i32, found () + | |__________________________________________^ expected `i32`, found `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/issues/issue-29084.rs b/src/test/ui/issues/issue-29084.rs index c4c6b6f8183b9..d16252686698d 100644 --- a/src/test/ui/issues/issue-29084.rs +++ b/src/test/ui/issues/issue-29084.rs @@ -3,7 +3,7 @@ macro_rules! foo { fn bar(d: u8) { } bar(&mut $d); //~^ ERROR mismatched types - //~| expected u8, found &mut u8 + //~| expected `u8`, found `&mut u8` }} } diff --git a/src/test/ui/issues/issue-29084.stderr b/src/test/ui/issues/issue-29084.stderr index a91033e336020..3e7ea745ce49a 100644 --- a/src/test/ui/issues/issue-29084.stderr +++ b/src/test/ui/issues/issue-29084.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-29084.rs:4:13 | LL | bar(&mut $d); - | ^^^^^^^ expected u8, found &mut u8 + | ^^^^^^^ expected `u8`, found `&mut u8` ... LL | foo!(0u8); | ---------- in this macro invocation diff --git a/src/test/ui/issues/issue-31173.stderr b/src/test/ui/issues/issue-31173.stderr index 0cc64d2f9c1a9..38cf3c4f930e8 100644 --- a/src/test/ui/issues/issue-31173.stderr +++ b/src/test/ui/issues/issue-31173.stderr @@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving ` $DIR/issue-31173.rs:10:10 | LL | .cloned() - | ^^^^^^ expected u8, found reference + | ^^^^^^ expected `u8`, found reference | = note: expected type `u8` found reference `&_` diff --git a/src/test/ui/issues/issue-31910.rs b/src/test/ui/issues/issue-31910.rs index c62ed89c4ad00..e0655d3f6dbf6 100644 --- a/src/test/ui/issues/issue-31910.rs +++ b/src/test/ui/issues/issue-31910.rs @@ -1,7 +1,7 @@ enum Enum { X = Trait::Number, //~^ ERROR mismatched types - //~| expected isize, found i32 + //~| expected `isize`, found `i32` } trait Trait { diff --git a/src/test/ui/issues/issue-31910.stderr b/src/test/ui/issues/issue-31910.stderr index 19b67ef2a72cb..c5c988cdaa75a 100644 --- a/src/test/ui/issues/issue-31910.stderr +++ b/src/test/ui/issues/issue-31910.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-31910.rs:2:9 | LL | X = Trait::Number, - | ^^^^^^^^^^^^^ expected isize, found i32 + | ^^^^^^^^^^^^^ expected `isize`, found `i32` | help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit | diff --git a/src/test/ui/issues/issue-32323.stderr b/src/test/ui/issues/issue-32323.stderr index f0ca557e581d5..7c0928b192499 100644 --- a/src/test/ui/issues/issue-32323.stderr +++ b/src/test/ui/issues/issue-32323.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-32323.rs:5:30 | LL | pub fn f<'a, T: Tr<'a>>() -> >::Out {} - | - ^^^^^^^^^^^^^^^^^^ expected associated type, found () + | - ^^^^^^^^^^^^^^^^^^ expected associated type, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression | diff --git a/src/test/ui/issues/issue-34334.stderr b/src/test/ui/issues/issue-34334.stderr index c68056a8bd718..fc90e0674cf55 100644 --- a/src/test/ui/issues/issue-34334.stderr +++ b/src/test/ui/issues/issue-34334.stderr @@ -29,7 +29,7 @@ error[E0308]: mismatched types --> $DIR/issue-34334.rs:2:31 | LL | let sr: Vec<(u32, _, _) = vec![]; - | ^^^^^^ expected bool, found struct `std::vec::Vec` + | ^^^^^^ expected `bool`, found struct `std::vec::Vec` | = note: expected type `bool` found struct `std::vec::Vec<_>` diff --git a/src/test/ui/issues/issue-3477.rs b/src/test/ui/issues/issue-3477.rs index ae17e7d1e418a..3817d0e6a3ee9 100644 --- a/src/test/ui/issues/issue-3477.rs +++ b/src/test/ui/issues/issue-3477.rs @@ -1,5 +1,5 @@ fn main() { let _p: char = 100; //~^ ERROR mismatched types - //~| expected char, found u8 + //~| expected `char`, found `u8` } diff --git a/src/test/ui/issues/issue-3477.stderr b/src/test/ui/issues/issue-3477.stderr index 1b7f597d50e2a..6510c215fcf1f 100644 --- a/src/test/ui/issues/issue-3477.stderr +++ b/src/test/ui/issues/issue-3477.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-3477.rs:2:20 | LL | let _p: char = 100; - | ^^^ expected char, found u8 + | ^^^ expected `char`, found `u8` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-35869.stderr b/src/test/ui/issues/issue-35869.stderr index f70a9c8818a4e..be21569315b72 100644 --- a/src/test/ui/issues/issue-35869.stderr +++ b/src/test/ui/issues/issue-35869.stderr @@ -5,7 +5,7 @@ LL | fn foo(_: fn(u8) -> ()); | ------------ type in trait ... LL | fn foo(_: fn(u16) -> ()) {} - | ^^^^^^^^^^^^^ expected u8, found u16 + | ^^^^^^^^^^^^^ expected `u8`, found `u16` | = note: expected fn pointer `fn(fn(u8))` found fn pointer `fn(fn(u16))` @@ -17,7 +17,7 @@ LL | fn bar(_: Option); | ---------- type in trait ... LL | fn bar(_: Option) {} - | ^^^^^^^^^^^ expected u8, found u16 + | ^^^^^^^^^^^ expected `u8`, found `u16` | = note: expected fn pointer `fn(std::option::Option)` found fn pointer `fn(std::option::Option)` @@ -29,7 +29,7 @@ LL | fn baz(_: (u8, u16)); | --------- type in trait ... LL | fn baz(_: (u16, u16)) {} - | ^^^^^^^^^^ expected u8, found u16 + | ^^^^^^^^^^ expected `u8`, found `u16` | = note: expected fn pointer `fn((u8, u16))` found fn pointer `fn((u16, u16))` @@ -41,7 +41,7 @@ LL | fn qux() -> u8; | -- type in trait ... LL | fn qux() -> u16 { 5u16 } - | ^^^ expected u8, found u16 + | ^^^ expected `u8`, found `u16` | = note: expected fn pointer `fn() -> u8` found fn pointer `fn() -> u16` diff --git a/src/test/ui/issues/issue-37026.stderr b/src/test/ui/issues/issue-37026.stderr index 5613d3f1766b2..00952356b1830 100644 --- a/src/test/ui/issues/issue-37026.stderr +++ b/src/test/ui/issues/issue-37026.stderr @@ -2,13 +2,13 @@ error[E0308]: mismatched types --> $DIR/issue-37026.rs:6:9 | LL | let empty_struct::XEmpty2 = (); - | ^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty2` + | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `empty_struct::XEmpty2` error[E0308]: mismatched types --> $DIR/issue-37026.rs:7:9 | LL | let empty_struct::XEmpty6(..) = (); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty6` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `empty_struct::XEmpty6` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-37665.stderr b/src/test/ui/issues/issue-37665.stderr index f872557966bfe..8a9529a68b7fa 100644 --- a/src/test/ui/issues/issue-37665.stderr +++ b/src/test/ui/issues/issue-37665.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-37665.rs:10:17 | LL | let x: () = 0; - | ^ expected (), found integer + | ^ expected `()`, found integer error: aborting due to previous error diff --git a/src/test/ui/issues/issue-39970.stderr b/src/test/ui/issues/issue-39970.stderr index b758cccd8f7bf..6f342b459c076 100644 --- a/src/test/ui/issues/issue-39970.stderr +++ b/src/test/ui/issues/issue-39970.stderr @@ -5,7 +5,7 @@ LL | fn visit() {} | ---------- required by `Visit::visit` ... LL | <() as Visit>::visit(); - | ^^^^^^^^^^^^^^^^^^^^ expected &(), found () + | ^^^^^^^^^^^^^^^^^^^^ expected `&()`, found `()` | = note: required because of the requirements on the impl of `Visit` for `()` diff --git a/src/test/ui/issues/issue-39974.rs b/src/test/ui/issues/issue-39974.rs index 5c89a0dc0beb1..503647ef4a82f 100644 --- a/src/test/ui/issues/issue-39974.rs +++ b/src/test/ui/issues/issue-39974.rs @@ -3,7 +3,7 @@ const LENGTH: f64 = 2; struct Thing { f: [[f64; 2]; LENGTH], //~^ ERROR mismatched types - //~| expected usize, found f64 + //~| expected `usize`, found `f64` } fn main() { diff --git a/src/test/ui/issues/issue-39974.stderr b/src/test/ui/issues/issue-39974.stderr index 41bfb6dbb8542..56365e51e0a74 100644 --- a/src/test/ui/issues/issue-39974.stderr +++ b/src/test/ui/issues/issue-39974.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-39974.rs:4:19 | LL | f: [[f64; 2]; LENGTH], - | ^^^^^^ expected usize, found f64 + | ^^^^^^ expected `usize`, found `f64` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-40749.stderr b/src/test/ui/issues/issue-40749.stderr index 67d5d6be640b1..4170a96bddfb3 100644 --- a/src/test/ui/issues/issue-40749.stderr +++ b/src/test/ui/issues/issue-40749.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-40749.rs:2:9 | LL | [0; ..10]; - | ^^^^ expected usize, found struct `std::ops::RangeTo` + | ^^^^ expected `usize`, found struct `std::ops::RangeTo` | = note: expected type `usize` found struct `std::ops::RangeTo<{integer}>` diff --git a/src/test/ui/issues/issue-41549.stderr b/src/test/ui/issues/issue-41549.stderr index 6d2ef769a162a..62307d387c822 100644 --- a/src/test/ui/issues/issue-41549.stderr +++ b/src/test/ui/issues/issue-41549.stderr @@ -2,7 +2,7 @@ error[E0326]: implemented const `CONST` has an incompatible type for trait --> $DIR/issue-41549.rs:9:18 | LL | const CONST: () = (); - | ^^ expected u32, found () + | ^^ expected `u32`, found `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-41742.stderr b/src/test/ui/issues/issue-41742.stderr index d6e2146208e3d..61a0ae5fa91a7 100644 --- a/src/test/ui/issues/issue-41742.stderr +++ b/src/test/ui/issues/issue-41742.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-41742.rs:24:7 | LL | H["?"].f(); - | ^^^ expected u32, found &str + | ^^^ expected `u32`, found `&str` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-4201.rs b/src/test/ui/issues/issue-4201.rs index ba4e9f6fa9892..2d655e4b7e743 100644 --- a/src/test/ui/issues/issue-4201.rs +++ b/src/test/ui/issues/issue-4201.rs @@ -3,7 +3,7 @@ fn main() { 0 } else if false { //~^ ERROR if may be missing an else clause -//~| expected (), found integer +//~| expected `()`, found integer 1 }; } diff --git a/src/test/ui/issues/issue-4201.stderr b/src/test/ui/issues/issue-4201.stderr index 5ea4fdbf7ecc8..aacc426783d66 100644 --- a/src/test/ui/issues/issue-4201.stderr +++ b/src/test/ui/issues/issue-4201.stderr @@ -8,7 +8,7 @@ LL | | LL | | 1 | | - found here LL | | }; - | |_____^ expected (), found integer + | |_____^ expected `()`, found integer | = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/issues/issue-43162.stderr b/src/test/ui/issues/issue-43162.stderr index 76696873f4eef..0ed3d27c65b6e 100644 --- a/src/test/ui/issues/issue-43162.stderr +++ b/src/test/ui/issues/issue-43162.stderr @@ -14,7 +14,7 @@ error[E0308]: mismatched types --> $DIR/issue-43162.rs:1:13 | LL | fn foo() -> bool { - | --- ^^^^ expected bool, found () + | --- ^^^^ expected `bool`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression LL | diff --git a/src/test/ui/issues/issue-44023.stderr b/src/test/ui/issues/issue-44023.stderr index a55bb22986963..fc54e7c62bb24 100644 --- a/src/test/ui/issues/issue-44023.stderr +++ b/src/test/ui/issues/issue-44023.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-44023.rs:5:36 | LL | fn საჭმელად_გემრიელი_სადილი ( ) -> isize { - | ------------------------ ^^^^^ expected isize, found () + | ------------------------ ^^^^^ expected `isize`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression diff --git a/src/test/ui/issues/issue-4517.rs b/src/test/ui/issues/issue-4517.rs index df3da04f2e835..caf85d44aac5c 100644 --- a/src/test/ui/issues/issue-4517.rs +++ b/src/test/ui/issues/issue-4517.rs @@ -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 array `[u8; 4]` } diff --git a/src/test/ui/issues/issue-4517.stderr b/src/test/ui/issues/issue-4517.stderr index 6c5495484b33c..1ae97b69c6cac 100644 --- a/src/test/ui/issues/issue-4517.stderr +++ b/src/test/ui/issues/issue-4517.stderr @@ -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 array `[u8; 4]` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-46112.stderr b/src/test/ui/issues/issue-46112.stderr index ea1eca7552d7b..a861c38b0016f 100644 --- a/src/test/ui/issues/issue-46112.stderr +++ b/src/test/ui/issues/issue-46112.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn main() { test(Ok(())); } | ^^ | | - | expected enum `std::option::Option`, found () + | expected enum `std::option::Option`, found `()` | help: try using a variant of the expected enum: `Some(())` | = note: expected enum `std::option::Option<()>` diff --git a/src/test/ui/issues/issue-46302.stderr b/src/test/ui/issues/issue-46302.stderr index 073abdfefdc81..a6f97c3c9af65 100644 --- a/src/test/ui/issues/issue-46302.stderr +++ b/src/test/ui/issues/issue-46302.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let u: &str = if true { s[..2] } else { s }; | ^^^^^^ | | - | expected &str, found str + | expected `&str`, found `str` | help: consider borrowing here: `&s[..2]` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr b/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr index 7e356ba1c1164..2d666e2b66c25 100644 --- a/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr +++ b/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | light_flows_our_war_of_mocking_words(behold as usize); | ^^^^^^^^^^^^^^^ | | - | expected &usize, found usize + | expected `&usize`, found `usize` | help: consider borrowing here: `&(behold as usize)` error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | light_flows_our_war_of_mocking_words(with_tears + 4); | ^^^^^^^^^^^^^^ | | - | expected &usize, found usize + | expected `&usize`, found `usize` | help: consider borrowing here: `&(with_tears + 4)` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-47486.stderr b/src/test/ui/issues/issue-47486.stderr index 9237b93924a85..cf95d309c6344 100644 --- a/src/test/ui/issues/issue-47486.stderr +++ b/src/test/ui/issues/issue-47486.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-47486.rs:2:10 | LL | () < std::mem::size_of::<_>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found usize + | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `usize` error[E0282]: type annotations needed --> $DIR/issue-47486.rs:3:11 diff --git a/src/test/ui/issues/issue-48364.stderr b/src/test/ui/issues/issue-48364.stderr index 4fc534d59c899..e5bb9298cd584 100644 --- a/src/test/ui/issues/issue-48364.stderr +++ b/src/test/ui/issues/issue-48364.stderr @@ -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 slice `[u8]`, found `str` | = note: expected reference `&[u8]` found reference `&'static str` diff --git a/src/test/ui/issues/issue-48838.stderr b/src/test/ui/issues/issue-48838.stderr index 684e518c36f93..712a7bc33f840 100644 --- a/src/test/ui/issues/issue-48838.stderr +++ b/src/test/ui/issues/issue-48838.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-48838.rs:2:14 | LL | Square = |x| x, - | ^^^^^ expected isize, found closure + | ^^^^^ expected `isize`, found closure | = note: expected type `isize` found closure `[closure@$DIR/issue-48838.rs:2:14: 2:19]` diff --git a/src/test/ui/issues/issue-50577.stderr b/src/test/ui/issues/issue-50577.stderr index 2494bf7471bb9..0a150fbf53a0c 100644 --- a/src/test/ui/issues/issue-50577.stderr +++ b/src/test/ui/issues/issue-50577.stderr @@ -28,7 +28,7 @@ error[E0317]: if may be missing an else clause LL | Drop = assert_eq!(1, 1) | ^^^^^^^^^^^^^^^^ | | - | expected (), found isize + | expected `()`, found `isize` | found here | = note: `if` expressions without `else` evaluate to `()` diff --git a/src/test/ui/issues/issue-50585.stderr b/src/test/ui/issues/issue-50585.stderr index 9f60db917316e..c2630b664b55f 100644 --- a/src/test/ui/issues/issue-50585.stderr +++ b/src/test/ui/issues/issue-50585.stderr @@ -8,7 +8,7 @@ error[E0308]: mismatched types --> $DIR/issue-50585.rs:2:18 | LL | |y: Vec<[(); for x in 0..2 {}]>| {}; - | ^^^^^^^^^^^^^^^^ expected usize, found () + | ^^^^^^^^^^^^^^^^ expected `usize`, found `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-50600.stderr b/src/test/ui/issues/issue-50600.stderr index 8278b0af9f283..08d9a8399200a 100644 --- a/src/test/ui/issues/issue-50600.stderr +++ b/src/test/ui/issues/issue-50600.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-50600.rs:2:13 | LL | fn([u8; |x: u8| {}]), - | ^^^^^^^^^^ expected usize, found closure + | ^^^^^^^^^^ expected `usize`, found closure | = note: expected type `usize` found closure `[closure@$DIR/issue-50600.rs:2:13: 2:23]` diff --git a/src/test/ui/issues/issue-50688.stderr b/src/test/ui/issues/issue-50688.stderr index bb69744803d2f..1f348c4cf1f66 100644 --- a/src/test/ui/issues/issue-50688.stderr +++ b/src/test/ui/issues/issue-50688.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-50688.rs:2:9 | LL | [1; || {}]; - | ^^^^^ expected usize, found closure + | ^^^^^ expected `usize`, found closure | = note: expected type `usize` found closure `[closure@$DIR/issue-50688.rs:2:9: 2:14]` diff --git a/src/test/ui/issues/issue-5100.rs b/src/test/ui/issues/issue-5100.rs index 8f6928bf3798f..71dd237cad582 100644 --- a/src/test/ui/issues/issue-5100.rs +++ b/src/test/ui/issues/issue-5100.rs @@ -53,5 +53,5 @@ fn main() { // Make sure none of the errors above were fatal let x: char = true; //~ ERROR mismatched types - //~| expected char, found bool + //~| expected `char`, found `bool` } diff --git a/src/test/ui/issues/issue-5100.stderr b/src/test/ui/issues/issue-5100.stderr index 60d94478b3b8a..bcbcefef3b11a 100644 --- a/src/test/ui/issues/issue-5100.stderr +++ b/src/test/ui/issues/issue-5100.stderr @@ -57,7 +57,7 @@ error[E0308]: mismatched types --> $DIR/issue-5100.rs:55:19 | LL | let x: char = true; - | ^^^^ expected char, found bool + | ^^^^ expected `char`, found `bool` error: aborting due to 7 previous errors diff --git a/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.stderr b/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.stderr index 94178d512109b..aef6dc54747ce 100644 --- a/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.stderr +++ b/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.stderr @@ -5,7 +5,7 @@ LL | missing_discourses()? | ^^^^^^^^^^^^^^^^^^^^- | | | | | help: try removing this `?` - | expected enum `std::result::Result`, found isize + | expected enum `std::result::Result`, found `isize` | = note: expected enum `std::result::Result` found type `isize` diff --git a/src/test/ui/issues/issue-53348.rs b/src/test/ui/issues/issue-53348.rs index e453b0cfaa83b..bbfdd9c538946 100644 --- a/src/test/ui/issues/issue-53348.rs +++ b/src/test/ui/issues/issue-53348.rs @@ -9,7 +9,7 @@ fn main() { for i in v { a = *i.to_string(); //~^ ERROR mismatched types - //~| NOTE expected struct `std::string::String`, found str + //~| NOTE expected struct `std::string::String`, found `str` v2.push(a); } } diff --git a/src/test/ui/issues/issue-53348.stderr b/src/test/ui/issues/issue-53348.stderr index 2c117f52a26bf..433fe40ea03ce 100644 --- a/src/test/ui/issues/issue-53348.stderr +++ b/src/test/ui/issues/issue-53348.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-53348.rs:10:13 | LL | a = *i.to_string(); - | ^^^^^^^^^^^^^^ expected struct `std::string::String`, found str + | ^^^^^^^^^^^^^^ expected struct `std::string::String`, found `str` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-53692.stderr b/src/test/ui/issues/issue-53692.stderr index 8dc5c95b9b1e3..50a202d148948 100644 --- a/src/test/ui/issues/issue-53692.stderr +++ b/src/test/ui/issues/issue-53692.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let items_clone: Vec = ref_items.clone(); | ^^^^^^^^^^^^^^^^^ | | - | expected struct `std::vec::Vec`, found &[i32] + | expected struct `std::vec::Vec`, found `&[i32]` | help: try using a conversion method: `ref_items.to_vec()` | = note: expected struct `std::vec::Vec` @@ -16,7 +16,7 @@ error[E0308]: mismatched types LL | let string: String = s.clone(); | ^^^^^^^^^ | | - | expected struct `std::string::String`, found &str + | expected struct `std::string::String`, found `&str` | help: try using a conversion method: `s.to_string()` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-61106.stderr b/src/test/ui/issues/issue-61106.stderr index c8439ee18f4f3..163aa816ab789 100644 --- a/src/test/ui/issues/issue-61106.stderr +++ b/src/test/ui/issues/issue-61106.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | foo(x.clone()); | ^^^^^^^^^ | | - | expected &str, found struct `std::string::String` + | expected `&str`, found struct `std::string::String` | help: consider borrowing here: `&x` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-61882.stderr b/src/test/ui/issues/issue-61882.stderr index 86cc48aff06e9..09ffe8e64b1b1 100644 --- a/src/test/ui/issues/issue-61882.stderr +++ b/src/test/ui/issues/issue-61882.stderr @@ -2,13 +2,13 @@ error[E0308]: mismatched types --> $DIR/issue-61882.rs:4:27 | LL | const B: A = Self(0); - | ^ expected bool, found integer + | ^ expected `bool`, found integer error[E0308]: mismatched types --> $DIR/issue-61882.rs:4:22 | LL | const B: A = Self(0); - | ^^^^^^^ expected u8, found bool + | ^^^^^^^ expected `u8`, found `bool` | = note: expected struct `A` found struct `A` diff --git a/src/test/ui/issues/issue-6458-4.stderr b/src/test/ui/issues/issue-6458-4.stderr index d36297886df88..6537867bbf5a7 100644 --- a/src/test/ui/issues/issue-6458-4.stderr +++ b/src/test/ui/issues/issue-6458-4.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-6458-4.rs:1:20 | LL | fn foo(b: bool) -> Result { - | --- ^^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found () + | --- ^^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression LL | Err("bar".to_string()); diff --git a/src/test/ui/issues/issue-7061.stderr b/src/test/ui/issues/issue-7061.stderr index b498ff0b534b4..bf1450ca7658c 100644 --- a/src/test/ui/issues/issue-7061.stderr +++ b/src/test/ui/issues/issue-7061.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-7061.rs:4:46 | LL | fn foo(&'a mut self) -> Box { self } - | -------------- ^^^^ expected struct `std::boxed::Box`, found &mut BarStruct + | -------------- ^^^^ expected struct `std::boxed::Box`, found `&mut BarStruct` | | | expected `std::boxed::Box` because of return type | diff --git a/src/test/ui/issues/issue-8761.rs b/src/test/ui/issues/issue-8761.rs index e69927c8457cf..1453c3d757f7f 100644 --- a/src/test/ui/issues/issue-8761.rs +++ b/src/test/ui/issues/issue-8761.rs @@ -1,10 +1,10 @@ enum Foo { A = 1i64, //~^ ERROR mismatched types - //~| expected isize, found i64 + //~| expected `isize`, found `i64` B = 2u8 //~^ ERROR mismatched types - //~| expected isize, found u8 + //~| expected `isize`, found `u8` } fn main() {} diff --git a/src/test/ui/issues/issue-8761.stderr b/src/test/ui/issues/issue-8761.stderr index 5a657575c1dbf..836520a28ef34 100644 --- a/src/test/ui/issues/issue-8761.stderr +++ b/src/test/ui/issues/issue-8761.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-8761.rs:2:9 | LL | A = 1i64, - | ^^^^ expected isize, found i64 + | ^^^^ expected `isize`, found `i64` | help: change the type of the numeric literal from `i64` to `isize` | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/issue-8761.rs:5:9 | LL | B = 2u8 - | ^^^ expected isize, found u8 + | ^^^ expected `isize`, found `u8` | help: change the type of the numeric literal from `u8` to `isize` | diff --git a/src/test/ui/json-bom-plus-crlf-multifile.stderr b/src/test/ui/json-bom-plus-crlf-multifile.stderr index c1cc57ab5119e..494bbd7f284f1 100644 --- a/src/test/ui/json-bom-plus-crlf-multifile.stderr +++ b/src/test/ui/json-bom-plus-crlf-multifile.stderr @@ -72,7 +72,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"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 "} diff --git a/src/test/ui/json-bom-plus-crlf.stderr b/src/test/ui/json-bom-plus-crlf.stderr index 581605ca5bbfb..ea21a6b896141 100644 --- a/src/test/ui/json-bom-plus-crlf.stderr +++ b/src/test/ui/json-bom-plus-crlf.stderr @@ -72,7 +72,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:25:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:25:22: error[E0308]: mismatched types "} {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors "} diff --git a/src/test/ui/keyword/keyword-false-as-identifier.stderr b/src/test/ui/keyword/keyword-false-as-identifier.stderr index 7774349b75ae6..fcc3006401816 100644 --- a/src/test/ui/keyword/keyword-false-as-identifier.stderr +++ b/src/test/ui/keyword/keyword-false-as-identifier.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/keyword-false-as-identifier.rs:2:9 | LL | let false = 22; - | ^^^^^ expected integer, found bool + | ^^^^^ expected integer, found `bool` error: aborting due to previous error diff --git a/src/test/ui/keyword/keyword-true-as-identifier.stderr b/src/test/ui/keyword/keyword-true-as-identifier.stderr index b2c2fc744c3bb..b8cc2ffd2a826 100644 --- a/src/test/ui/keyword/keyword-true-as-identifier.stderr +++ b/src/test/ui/keyword/keyword-true-as-identifier.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/keyword-true-as-identifier.rs:2:9 | LL | let true = 22; - | ^^^^ expected integer, found bool + | ^^^^ expected integer, found `bool` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-closure-require-ret.stderr b/src/test/ui/liveness/liveness-closure-require-ret.stderr index db330c2f35408..07b2ef6cd1bc2 100644 --- a/src/test/ui/liveness/liveness-closure-require-ret.stderr +++ b/src/test/ui/liveness/liveness-closure-require-ret.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/liveness-closure-require-ret.rs:2:37 | LL | fn main() { println!("{}", force(|| {})); } - | ^^ expected isize, found () + | ^^ expected `isize`, found `()` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-forgot-ret.stderr b/src/test/ui/liveness/liveness-forgot-ret.stderr index 6b7bd1acdc7a7..95070322bddef 100644 --- a/src/test/ui/liveness/liveness-forgot-ret.stderr +++ b/src/test/ui/liveness/liveness-forgot-ret.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/liveness-forgot-ret.rs:3:19 | LL | fn f(a: isize) -> isize { if god_exists(a) { return 5; }; } - | - ^^^^^ expected isize, found () + | - ^^^^^ expected `isize`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression diff --git a/src/test/ui/liveness/liveness-issue-2163.stderr b/src/test/ui/liveness/liveness-issue-2163.stderr index 7606413f15ef8..2adc2d43809ba 100644 --- a/src/test/ui/liveness/liveness-issue-2163.stderr +++ b/src/test/ui/liveness/liveness-issue-2163.stderr @@ -5,7 +5,7 @@ LL | a.iter().all(|_| -> bool { | ______________________________^ LL | | LL | | }); - | |_____^ expected bool, found () + | |_____^ expected `bool`, found `()` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-missing-ret2.stderr b/src/test/ui/liveness/liveness-missing-ret2.stderr index 499dbf10ede28..afdb733cd030f 100644 --- a/src/test/ui/liveness/liveness-missing-ret2.stderr +++ b/src/test/ui/liveness/liveness-missing-ret2.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/liveness-missing-ret2.rs:1:11 | LL | fn f() -> isize { - | - ^^^^^ expected isize, found () + | - ^^^^^ expected `isize`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression diff --git a/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr index 93249fd5aff57..6b4de6618c51b 100644 --- a/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr +++ b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } } | --- ^^^ - help: consider removing this semicolon | | | - | | expected i32, found () + | | expected `i32`, found `()` | implicitly returns `()` as its body has no tail or `return` expression ... LL | test!(); @@ -14,7 +14,7 @@ error[E0308]: mismatched types --> $DIR/liveness-return-last-stmt-semi.rs:7:19 | LL | fn no_return() -> i32 {} - | --------- ^^^ expected i32, found () + | --------- ^^^ expected `i32`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression @@ -22,7 +22,7 @@ error[E0308]: mismatched types --> $DIR/liveness-return-last-stmt-semi.rs:9:19 | LL | fn bar(x: u32) -> u32 { - | --- ^^^ expected u32, found () + | --- ^^^ expected `u32`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression LL | x * 2; @@ -32,7 +32,7 @@ error[E0308]: mismatched types --> $DIR/liveness-return-last-stmt-semi.rs:13:19 | LL | fn baz(x: u64) -> u32 { - | --- ^^^ expected u32, found () + | --- ^^^ expected `u32`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression diff --git a/src/test/ui/loops/loop-break-value.stderr b/src/test/ui/loops/loop-break-value.stderr index 4588b7b02bbe0..81d25af1996be 100644 --- a/src/test/ui/loops/loop-break-value.stderr +++ b/src/test/ui/loops/loop-break-value.stderr @@ -98,7 +98,7 @@ error[E0308]: mismatched types --> $DIR/loop-break-value.rs:4:31 | LL | let val: ! = loop { break break; }; - | ^^^^^ expected !, found () + | ^^^^^ expected `!`, found `()` | = note: expected type `!` found unit type `()` @@ -107,31 +107,31 @@ error[E0308]: mismatched types --> $DIR/loop-break-value.rs:11:19 | LL | break 123; - | ^^^ expected &str, found integer + | ^^^ expected `&str`, found integer error[E0308]: mismatched types --> $DIR/loop-break-value.rs:16:15 | LL | break "asdf"; - | ^^^^^^ expected i32, found &str + | ^^^^^^ expected `i32`, found `&str` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:21:31 | LL | break 'outer_loop "nope"; - | ^^^^^^ expected i32, found &str + | ^^^^^^ expected `i32`, found `&str` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:73:26 | LL | break 'c 123; - | ^^^ expected (), found integer + | ^^^ expected `()`, found integer error[E0308]: mismatched types --> $DIR/loop-break-value.rs:80:15 | LL | break (break, break); - | ^^^^^^^^^^^^^^ expected (), found tuple + | ^^^^^^^^^^^^^^ expected `()`, found tuple | = note: expected unit type `()` found tuple `(!, !)` @@ -140,7 +140,7 @@ error[E0308]: mismatched types --> $DIR/loop-break-value.rs:85:15 | LL | break 2; - | ^ expected (), found integer + | ^ expected `()`, found integer error[E0308]: mismatched types --> $DIR/loop-break-value.rs:90:9 @@ -148,7 +148,7 @@ error[E0308]: mismatched types LL | break; | ^^^^^ | | - | expected integer, found () + | expected integer, found `()` | help: give it a value of the expected type: `break value` error: aborting due to 16 previous errors diff --git a/src/test/ui/loops/loop-labeled-break-value.stderr b/src/test/ui/loops/loop-labeled-break-value.stderr index c3d0ae28f74d7..aa04d330f25d7 100644 --- a/src/test/ui/loops/loop-labeled-break-value.stderr +++ b/src/test/ui/loops/loop-labeled-break-value.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let _: i32 = loop { break }; | ^^^^^ | | - | expected i32, found () + | expected `i32`, found `()` | help: give it a value of the expected type: `break 42` error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | let _: i32 = 'inner: loop { break 'inner }; | ^^^^^^^^^^^^ | | - | expected i32, found () + | expected `i32`, found `()` | help: give it a value of the expected type: `break 'inner 42` error[E0308]: mismatched types @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | let _: i32 = 'inner2: loop { loop { break 'inner2 } }; | ^^^^^^^^^^^^^ | | - | expected i32, found () + | expected `i32`, found `()` | help: give it a value of the expected type: `break 'inner2 42` error: aborting due to 3 previous errors diff --git a/src/test/ui/loops/loop-properly-diverging-2.stderr b/src/test/ui/loops/loop-properly-diverging-2.stderr index 9b4329ded18bd..5030a2935b9d7 100644 --- a/src/test/ui/loops/loop-properly-diverging-2.stderr +++ b/src/test/ui/loops/loop-properly-diverging-2.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let x: i32 = loop { break }; | ^^^^^ | | - | expected i32, found () + | expected `i32`, found `()` | help: give it a value of the expected type: `break 42` error: aborting due to previous error diff --git a/src/test/ui/match/match-arm-resolving-to-never.stderr b/src/test/ui/match/match-arm-resolving-to-never.stderr index 4598b512f1d1f..4482d5c6a791d 100644 --- a/src/test/ui/match/match-arm-resolving-to-never.stderr +++ b/src/test/ui/match/match-arm-resolving-to-never.stderr @@ -9,7 +9,7 @@ LL | | E::D => 4, LL | | E::E => unimplemented!(""), | | ------------------ this and all prior arms are found to be of type `{integer}` LL | | E::F => "", - | | ^^ expected integer, found &str + | | ^^ expected integer, found `&str` LL | | }; | |_____- `match` arms have incompatible types | diff --git a/src/test/ui/match/match-ill-type2.stderr b/src/test/ui/match/match-ill-type2.stderr index 83fae10d4cb4e..1cf61ebad4352 100644 --- a/src/test/ui/match/match-ill-type2.stderr +++ b/src/test/ui/match/match-ill-type2.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/match-ill-type2.rs:4:9 | LL | 2u32 => 1, - | ^^^^ expected i32, found u32 + | ^^^^ expected `i32`, found `u32` error: aborting due to previous error diff --git a/src/test/ui/match/match-range-fail.stderr b/src/test/ui/match/match-range-fail.stderr index 8ce2d8853de31..adaaf29aae4c8 100644 --- a/src/test/ui/match/match-range-fail.stderr +++ b/src/test/ui/match/match-range-fail.stderr @@ -28,7 +28,7 @@ error[E0308]: mismatched types --> $DIR/match-range-fail.rs:18:9 | LL | 'c' ..= 100 => { } - | ^^^^^^^^^^^ expected integer, found char + | ^^^^^^^^^^^ expected integer, found `char` error: aborting due to 4 previous errors diff --git a/src/test/ui/match/match-type-err-first-arm.rs b/src/test/ui/match/match-type-err-first-arm.rs index 2a0f01a0b093f..d73c7e8402ff3 100644 --- a/src/test/ui/match/match-type-err-first-arm.rs +++ b/src/test/ui/match/match-type-err-first-arm.rs @@ -7,7 +7,7 @@ fn test_func1(n: i32) -> i32 { //~ NOTE expected `i32` because of return type match n { 12 => 'b', //~^ ERROR mismatched types - //~| NOTE expected i32, found char + //~| NOTE expected `i32`, found `char` _ => 42, } } @@ -17,7 +17,7 @@ fn test_func2(n: i32) -> i32 { 12 => 'b', //~ NOTE this is found to be of type `char` _ => 42, //~^ ERROR match arms have incompatible types - //~| NOTE expected char, found integer + //~| NOTE expected `char`, found integer }; x } @@ -33,7 +33,7 @@ fn test_func3(n: i32) -> i32 { //~^ NOTE this and all prior arms are found to be of type `char` _ => 42, //~^ ERROR match arms have incompatible types - //~| NOTE expected char, found integer + //~| NOTE expected `char`, found integer }; x } @@ -45,6 +45,6 @@ fn test_func4() { }, None => {} //~^ ERROR match arms have incompatible types - //~| NOTE expected u32, found () + //~| NOTE expected `u32`, found `()` }; } diff --git a/src/test/ui/match/match-type-err-first-arm.stderr b/src/test/ui/match/match-type-err-first-arm.stderr index 39048e03296a9..1b3d8c61c862b 100644 --- a/src/test/ui/match/match-type-err-first-arm.stderr +++ b/src/test/ui/match/match-type-err-first-arm.stderr @@ -5,7 +5,7 @@ LL | fn test_func1(n: i32) -> i32 { | --- expected `i32` because of return type LL | match n { LL | 12 => 'b', - | ^^^ expected i32, found char + | ^^^ expected `i32`, found `char` error[E0308]: match arms have incompatible types --> $DIR/match-type-err-first-arm.rs:18:14 @@ -15,7 +15,7 @@ LL | let x = match n { LL | | 12 => 'b', | | --- this is found to be of type `char` LL | | _ => 42, - | | ^^ expected char, found integer + | | ^^ expected `char`, found integer LL | | LL | | LL | | }; @@ -34,7 +34,7 @@ LL | | 6 => 'b', | | --- this and all prior arms are found to be of type `char` LL | | LL | | _ => 42, - | | ^^ expected char, found integer + | | ^^ expected `char`, found integer LL | | LL | | LL | | }; @@ -49,7 +49,7 @@ LL | | x | | - this is found to be of type `u32` LL | | }, LL | | None => {} - | | ^^ expected u32, found () + | | ^^ expected `u32`, found `()` LL | | LL | | LL | | }; diff --git a/src/test/ui/meta-expected-error-correct-rev.a.stderr b/src/test/ui/meta-expected-error-correct-rev.a.stderr index 968b87288c015..535dbde612c03 100644 --- a/src/test/ui/meta-expected-error-correct-rev.a.stderr +++ b/src/test/ui/meta-expected-error-correct-rev.a.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/meta-expected-error-correct-rev.rs:7:18 | LL | let x: u32 = 22_usize; - | ^^^^^^^^ expected u32, found usize + | ^^^^^^^^ expected `u32`, found `usize` | help: change the type of the numeric literal from `usize` to `u32` | diff --git a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr index 8dfbde92f646b..87e95c2408037 100644 --- a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr +++ b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/method-ambig-one-trait-unknown-int-type.rs:33:20 | LL | let y: usize = x.foo(); - | ^^^^^^^ expected usize, found isize + | ^^^^^^^ expected `usize`, found `isize` | help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit | diff --git a/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs b/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs index a5dae1c71cdaa..5ceba64678410 100644 --- a/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs +++ b/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs @@ -83,7 +83,7 @@ fn objectcandidate_impl() { // Observe the type of `z` is `u32` let _seetype: () = z; //~ ERROR mismatched types - //~| expected (), found u32 + //~| expected `()`, found `u32` } fn traitcandidate_impl() { @@ -100,7 +100,7 @@ fn traitcandidate_impl() { // Observe the type of `z` is `u64` let _seetype: () = z; //~ ERROR mismatched types - //~| expected (), found u64 + //~| expected `()`, found `u64` } fn traitcandidate_impl_with_nuisance() { @@ -135,7 +135,7 @@ fn neither_impl() { // Observe the type of `z` is `u8` let _seetype: () = z; //~ ERROR mismatched types - //~| expected (), found u8 + //~| expected `()`, found `u8` } fn both_impls() { @@ -153,7 +153,7 @@ fn both_impls() { // Observe the type of `z` is `u32` let _seetype: () = z; //~ ERROR mismatched types - //~| expected (), found u32 + //~| expected `()`, found `u32` } @@ -170,7 +170,7 @@ fn both_impls_with_nuisance() { // Observe the type of `z` is `u32` let _seetype: () = z; //~ ERROR mismatched types - //~| expected (), found u32 + //~| expected `()`, found `u32` } fn main() { diff --git a/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr b/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr index 12f75d009e2e5..bfec363eb997a 100644 --- a/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr +++ b/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr @@ -2,13 +2,13 @@ error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:85:24 | LL | let _seetype: () = z; - | ^ expected (), found u32 + | ^ expected `()`, found `u32` error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:102:24 | LL | let _seetype: () = z; - | ^ expected (), found u64 + | ^ expected `()`, found `u64` error[E0034]: multiple applicable items in scope --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:120:15 @@ -39,19 +39,19 @@ error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:137:24 | LL | let _seetype: () = z; - | ^ expected (), found u8 + | ^ expected `()`, found `u8` error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:155:24 | LL | let _seetype: () = z; - | ^ expected (), found u32 + | ^ expected `()`, found `u32` error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:172:24 | LL | let _seetype: () = z; - | ^ expected (), found u32 + | ^ expected `()`, found `u32` error: aborting due to 6 previous errors diff --git a/src/test/ui/methods/method-self-arg-1.rs b/src/test/ui/methods/method-self-arg-1.rs index c58040cdf5fb7..f589f20d81ddf 100644 --- a/src/test/ui/methods/method-self-arg-1.rs +++ b/src/test/ui/methods/method-self-arg-1.rs @@ -9,7 +9,7 @@ impl Foo { fn main() { let x = Foo; Foo::bar(x); //~ ERROR mismatched types - //~| expected &Foo, found struct `Foo` + //~| expected `&Foo`, found struct `Foo` Foo::bar(&42); //~ ERROR mismatched types //~| expected struct `Foo`, found integer //~| expected reference `&Foo` diff --git a/src/test/ui/methods/method-self-arg-1.stderr b/src/test/ui/methods/method-self-arg-1.stderr index a56164db1b6c2..17ea61fc4bddb 100644 --- a/src/test/ui/methods/method-self-arg-1.stderr +++ b/src/test/ui/methods/method-self-arg-1.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | Foo::bar(x); | ^ | | - | expected &Foo, found struct `Foo` + | expected `&Foo`, found struct `Foo` | help: consider borrowing here: `&x` error[E0308]: mismatched types diff --git a/src/test/ui/mir-unpretty.stderr b/src/test/ui/mir-unpretty.stderr index d3e41dabba61d..5384dedb65a49 100644 --- a/src/test/ui/mir-unpretty.stderr +++ b/src/test/ui/mir-unpretty.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/mir-unpretty.rs:4:17 | LL | let x: () = 0; - | ^ expected (), found integer + | ^ expected `()`, found integer error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/E0053.stderr b/src/test/ui/mismatched_types/E0053.stderr index 4e6af20db1b94..fef83e6bbe2b6 100644 --- a/src/test/ui/mismatched_types/E0053.stderr +++ b/src/test/ui/mismatched_types/E0053.stderr @@ -5,7 +5,7 @@ LL | fn foo(x: u16); | --- type in trait ... LL | fn foo(x: i16) { } - | ^^^ expected u16, found i16 + | ^^^ expected `u16`, found `i16` | = note: expected fn pointer `fn(u16)` found fn pointer `fn(i16)` diff --git a/src/test/ui/mismatched_types/E0409.stderr b/src/test/ui/mismatched_types/E0409.stderr index 5a961f8948b92..098fd74a39da6 100644 --- a/src/test/ui/mismatched_types/E0409.stderr +++ b/src/test/ui/mismatched_types/E0409.stderr @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/E0409.rs:5:23 | LL | (0, ref y) | (y, 0) => {} - | ^ expected &{integer}, found integer + | ^ expected `&{integer}`, found integer error: aborting due to 2 previous errors diff --git a/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr b/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr index 97b1139abd599..f36fe64bffb9d 100644 --- a/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr +++ b/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/for-loop-has-unit-body.rs:3:9 | LL | x - | ^ expected (), found integer + | ^ expected `()`, found integer error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/issue-19109.stderr b/src/test/ui/mismatched_types/issue-19109.stderr index c790cc90a2cf5..c25e2687b752a 100644 --- a/src/test/ui/mismatched_types/issue-19109.stderr +++ b/src/test/ui/mismatched_types/issue-19109.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn function(t: &mut dyn Trait) { | - help: try adding a return type: `-> *mut dyn Trait` LL | t as *mut dyn Trait - | ^^^^^^^^^^^^^^^^^^^ expected (), found *-ptr + | ^^^^^^^^^^^^^^^^^^^ expected `()`, found *-ptr | = note: expected unit type `()` found raw pointer `*mut dyn Trait` diff --git a/src/test/ui/mismatched_types/issue-26480.stderr b/src/test/ui/mismatched_types/issue-26480.stderr index 9d5cd6eeb556c..d4dcb9a39a403 100644 --- a/src/test/ui/mismatched_types/issue-26480.stderr +++ b/src/test/ui/mismatched_types/issue-26480.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-26480.rs:16:19 | LL | $arr.len() * size_of($arr[0])); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u64, found usize + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `usize` ... LL | write!(hello); | -------------- in this macro invocation diff --git a/src/test/ui/mismatched_types/issue-35030.stderr b/src/test/ui/mismatched_types/issue-35030.stderr index c01f5d3ca4b94..6fb04ef5c998f 100644 --- a/src/test/ui/mismatched_types/issue-35030.stderr +++ b/src/test/ui/mismatched_types/issue-35030.stderr @@ -5,10 +5,10 @@ LL | impl Parser for bool { | ---- this type parameter LL | fn parse(text: &str) -> Option { LL | Some(true) - | ^^^^ expected type parameter `bool`, found bool + | ^^^^ expected type parameter `bool`, found `bool` | = note: expected type parameter `bool` (type parameter `bool`) - found type `bool` (bool) + found type `bool` (`bool`) = help: type parameters must be constrained to match other types = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters diff --git a/src/test/ui/mismatched_types/issue-38371.stderr b/src/test/ui/mismatched_types/issue-38371.stderr index 48a123fd28a13..802a2fef6bd40 100644 --- a/src/test/ui/mismatched_types/issue-38371.stderr +++ b/src/test/ui/mismatched_types/issue-38371.stderr @@ -16,7 +16,7 @@ error[E0308]: mismatched types LL | fn agh(&&bar: &u32) { | ^^^^ | | - | expected u32, found reference + | expected `u32`, found reference | help: you can probably remove the explicit borrow: `bar` | = note: expected type `u32` @@ -26,7 +26,7 @@ error[E0308]: mismatched types --> $DIR/issue-38371.rs:21:8 | LL | fn bgh(&&bar: u32) { - | ^^^^^ expected u32, found reference + | ^^^^^ expected `u32`, found reference | = note: expected type `u32` found reference `&_` diff --git a/src/test/ui/mismatched_types/main.stderr b/src/test/ui/mismatched_types/main.stderr index de66c504f8cce..51c8e5f5d4ad1 100644 --- a/src/test/ui/mismatched_types/main.stderr +++ b/src/test/ui/mismatched_types/main.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let x: u32 = ( | __________________^ LL | | ); - | |_____^ expected u32, found () + | |_____^ expected `u32`, found `()` error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/numeric-literal-cast.stderr b/src/test/ui/mismatched_types/numeric-literal-cast.stderr index 47ba1d26be50b..22a6df8902596 100644 --- a/src/test/ui/mismatched_types/numeric-literal-cast.stderr +++ b/src/test/ui/mismatched_types/numeric-literal-cast.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/numeric-literal-cast.rs:6:9 | LL | foo(1u8); - | ^^^ expected u16, found u8 + | ^^^ expected `u16`, found `u8` | help: change the type of the numeric literal from `u8` to `u16` | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/numeric-literal-cast.rs:8:10 | LL | foo1(2f32); - | ^^^^ expected f64, found f32 + | ^^^^ expected `f64`, found `f32` | help: change the type of the numeric literal from `f32` to `f64` | @@ -24,7 +24,7 @@ error[E0308]: mismatched types --> $DIR/numeric-literal-cast.rs:10:10 | LL | foo2(3i16); - | ^^^^ expected i32, found i16 + | ^^^^ expected `i32`, found `i16` | help: change the type of the numeric literal from `i16` to `i32` | diff --git a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr index b57ceb08b1725..5a5dd05626148 100644 --- a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr +++ b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/overloaded-calls-bad.rs:28:17 | LL | let ans = s("what"); - | ^^^^^^ expected isize, found &str + | ^^^^^^ expected `isize`, found `&str` error[E0057]: this function takes 1 parameter but 0 parameters were supplied --> $DIR/overloaded-calls-bad.rs:29:15 diff --git a/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr b/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr index 050bb326130d5..b20fddb05acf1 100644 --- a/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr +++ b/src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr @@ -5,7 +5,7 @@ LL | fn foo(x: u16); | --- type in trait ... LL | fn foo(x: i16) { } - | ^^^ expected u16, found i16 + | ^^^ expected `u16`, found `i16` | = note: expected fn pointer `fn(u16)` found fn pointer `fn(i16)` diff --git a/src/test/ui/missing/missing-return.stderr b/src/test/ui/missing/missing-return.stderr index 441551486a40c..ff7f261e03c7b 100644 --- a/src/test/ui/missing/missing-return.stderr +++ b/src/test/ui/missing/missing-return.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/missing-return.rs:3:11 | LL | fn f() -> isize { } - | - ^^^^^ expected isize, found () + | - ^^^^^ expected `isize`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression diff --git a/src/test/ui/mut/mut-cross-borrowing.stderr b/src/test/ui/mut/mut-cross-borrowing.stderr index d79d230ca9602..c262d1336a2be 100644 --- a/src/test/ui/mut/mut-cross-borrowing.stderr +++ b/src/test/ui/mut/mut-cross-borrowing.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | f(x) | ^ | | - | expected &mut isize, found struct `std::boxed::Box` + | expected `&mut isize`, found struct `std::boxed::Box` | help: consider mutably borrowing here: `&mut x` | = note: expected mutable reference `&mut isize` diff --git a/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr b/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr index d7013bf3c0fb0..eacef1dc3302d 100644 --- a/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr +++ b/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/call-fn-never-arg-wrong-type.rs:10:9 | LL | foo("wow"); - | ^^^^^ expected !, found &str + | ^^^^^ expected `!`, found `&str` | = note: expected type `!` found reference `&'static str` diff --git a/src/test/ui/never_type/never-assign-wrong-type.stderr b/src/test/ui/never_type/never-assign-wrong-type.stderr index 3f72b6914ca38..8d8a83567ab4e 100644 --- a/src/test/ui/never_type/never-assign-wrong-type.stderr +++ b/src/test/ui/never_type/never-assign-wrong-type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/never-assign-wrong-type.rs:7:16 | LL | let x: ! = "hello"; - | ^^^^^^^ expected !, found &str + | ^^^^^^^ expected `!`, found `&str` | = note: expected type `!` found reference `&'static str` diff --git a/src/test/ui/noexporttypeexe.rs b/src/test/ui/noexporttypeexe.rs index d3c04fc562fd2..0a8b40b08fe43 100644 --- a/src/test/ui/noexporttypeexe.rs +++ b/src/test/ui/noexporttypeexe.rs @@ -11,5 +11,5 @@ fn main() { //~^ ERROR mismatched types //~| expected type `isize` //~| found enum `std::option::Option` - //~| expected isize, found enum `std::option::Option` + //~| expected `isize`, found enum `std::option::Option` } diff --git a/src/test/ui/noexporttypeexe.stderr b/src/test/ui/noexporttypeexe.stderr index 3def891110d9e..18fb1755eb11f 100644 --- a/src/test/ui/noexporttypeexe.stderr +++ b/src/test/ui/noexporttypeexe.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/noexporttypeexe.rs:10:18 | LL | let x: isize = noexporttypelib::foo(); - | ^^^^^^^^^^^^^^^^^^^^^^ expected isize, found enum `std::option::Option` + | ^^^^^^^^^^^^^^^^^^^^^^ expected `isize`, found enum `std::option::Option` | = note: expected type `isize` found enum `std::option::Option` diff --git a/src/test/ui/numeric/const-scope.stderr b/src/test/ui/numeric/const-scope.stderr index c88495059224b..c6ddb35ddf5f2 100644 --- a/src/test/ui/numeric/const-scope.stderr +++ b/src/test/ui/numeric/const-scope.stderr @@ -2,31 +2,31 @@ error[E0308]: mismatched types --> $DIR/const-scope.rs:1:16 | LL | const C: i32 = 1i8; - | ^^^ expected i32, found i8 + | ^^^ expected `i32`, found `i8` error[E0308]: mismatched types --> $DIR/const-scope.rs:2:15 | LL | const D: i8 = C; - | ^ expected i8, found i32 + | ^ expected `i8`, found `i32` error[E0308]: mismatched types --> $DIR/const-scope.rs:5:18 | LL | let c: i32 = 1i8; - | ^^^ expected i32, found i8 + | ^^^ expected `i32`, found `i8` error[E0308]: mismatched types --> $DIR/const-scope.rs:6:17 | LL | let d: i8 = c; - | ^ expected i8, found i32 + | ^ expected `i8`, found `i32` error[E0308]: mismatched types --> $DIR/const-scope.rs:10:18 | LL | let c: i32 = 1i8; - | ^^^ expected i32, found i8 + | ^^^ expected `i32`, found `i8` | help: change the type of the numeric literal from `i8` to `i32` | @@ -37,7 +37,7 @@ error[E0308]: mismatched types --> $DIR/const-scope.rs:11:17 | LL | let d: i8 = c; - | ^ expected i8, found i32 + | ^ expected `i8`, found `i32` | help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit | diff --git a/src/test/ui/numeric/len.stderr b/src/test/ui/numeric/len.stderr index 1e8bff7f04aab..dba6c723829dc 100644 --- a/src/test/ui/numeric/len.stderr +++ b/src/test/ui/numeric/len.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/len.rs:3:10 | LL | test(array.len()); - | ^^^^^^^^^^^ expected u32, found usize + | ^^^^^^^^^^^ expected `u32`, found `usize` | help: you can convert an `usize` to `u32` and panic if the converted value wouldn't fit | diff --git a/src/test/ui/numeric/numeric-cast-2.stderr b/src/test/ui/numeric/numeric-cast-2.stderr index 9f08985bdb3c6..133db19780c34 100644 --- a/src/test/ui/numeric/numeric-cast-2.stderr +++ b/src/test/ui/numeric/numeric-cast-2.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-2.rs:5:18 | LL | let x: u16 = foo(); - | ^^^^^ expected u16, found i32 + | ^^^^^ expected `u16`, found `i32` | help: you can convert an `i32` to `u16` and panic if the converted value wouldn't fit | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-2.rs:7:18 | LL | let y: i64 = x + x; - | ^^^^^ expected i64, found u16 + | ^^^^^ expected `i64`, found `u16` | help: you can convert an `u16` to `i64` and panic if the converted value wouldn't fit | @@ -24,7 +24,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-2.rs:9:18 | LL | let z: i32 = x + x; - | ^^^^^ expected i32, found u16 + | ^^^^^ expected `i32`, found `u16` | help: you can convert an `u16` to `i32` and panic if the converted value wouldn't fit | diff --git a/src/test/ui/numeric/numeric-cast-without-suggestion.stderr b/src/test/ui/numeric/numeric-cast-without-suggestion.stderr index a79eaea16ebb0..a96518a34342d 100644 --- a/src/test/ui/numeric/numeric-cast-without-suggestion.stderr +++ b/src/test/ui/numeric/numeric-cast-without-suggestion.stderr @@ -2,127 +2,127 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:17:18 | LL | foo::(x_f64); - | ^^^^^ expected usize, found f64 + | ^^^^^ expected `usize`, found `f64` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:18:18 | LL | foo::(x_f32); - | ^^^^^ expected usize, found f32 + | ^^^^^ expected `usize`, found `f32` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:19:18 | LL | foo::(x_f64); - | ^^^^^ expected isize, found f64 + | ^^^^^ expected `isize`, found `f64` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:20:18 | LL | foo::(x_f32); - | ^^^^^ expected isize, found f32 + | ^^^^^ expected `isize`, found `f32` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:21:16 | LL | foo::(x_f64); - | ^^^^^ expected u64, found f64 + | ^^^^^ expected `u64`, found `f64` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:22:16 | LL | foo::(x_f32); - | ^^^^^ expected u64, found f32 + | ^^^^^ expected `u64`, found `f32` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:23:16 | LL | foo::(x_f64); - | ^^^^^ expected i64, found f64 + | ^^^^^ expected `i64`, found `f64` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:24:16 | LL | foo::(x_f32); - | ^^^^^ expected i64, found f32 + | ^^^^^ expected `i64`, found `f32` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:25:16 | LL | foo::(x_f64); - | ^^^^^ expected u32, found f64 + | ^^^^^ expected `u32`, found `f64` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:26:16 | LL | foo::(x_f32); - | ^^^^^ expected u32, found f32 + | ^^^^^ expected `u32`, found `f32` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:27:16 | LL | foo::(x_f64); - | ^^^^^ expected i32, found f64 + | ^^^^^ expected `i32`, found `f64` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:28:16 | LL | foo::(x_f32); - | ^^^^^ expected i32, found f32 + | ^^^^^ expected `i32`, found `f32` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:29:16 | LL | foo::(x_f64); - | ^^^^^ expected u16, found f64 + | ^^^^^ expected `u16`, found `f64` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:30:16 | LL | foo::(x_f32); - | ^^^^^ expected u16, found f32 + | ^^^^^ expected `u16`, found `f32` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:31:16 | LL | foo::(x_f64); - | ^^^^^ expected i16, found f64 + | ^^^^^ expected `i16`, found `f64` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:32:16 | LL | foo::(x_f32); - | ^^^^^ expected i16, found f32 + | ^^^^^ expected `i16`, found `f32` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:33:15 | LL | foo::(x_f64); - | ^^^^^ expected u8, found f64 + | ^^^^^ expected `u8`, found `f64` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:34:15 | LL | foo::(x_f32); - | ^^^^^ expected u8, found f32 + | ^^^^^ expected `u8`, found `f32` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:35:15 | LL | foo::(x_f64); - | ^^^^^ expected i8, found f64 + | ^^^^^ expected `i8`, found `f64` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:36:15 | LL | foo::(x_f32); - | ^^^^^ expected i8, found f32 + | ^^^^^ expected `i8`, found `f32` error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:37:16 | LL | foo::(x_f64); - | ^^^^^ expected f32, found f64 + | ^^^^^ expected `f32`, found `f64` error: aborting due to 21 previous errors diff --git a/src/test/ui/numeric/numeric-cast.stderr b/src/test/ui/numeric/numeric-cast.stderr index 983ea08402503..eef40cbdbe4e8 100644 --- a/src/test/ui/numeric/numeric-cast.stderr +++ b/src/test/ui/numeric/numeric-cast.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:23:18 | LL | foo::(x_u64); - | ^^^^^ expected usize, found u64 + | ^^^^^ expected `usize`, found `u64` | help: you can convert an `u64` to `usize` and panic if the converted value wouldn't fit | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:25:18 | LL | foo::(x_u32); - | ^^^^^ expected usize, found u32 + | ^^^^^ expected `usize`, found `u32` | help: you can convert an `u32` to `usize` and panic if the converted value wouldn't fit | @@ -24,7 +24,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:27:18 | LL | foo::(x_u16); - | ^^^^^ expected usize, found u16 + | ^^^^^ expected `usize`, found `u16` | help: you can convert an `u16` to `usize` and panic if the converted value wouldn't fit | @@ -35,7 +35,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:29:18 | LL | foo::(x_u8); - | ^^^^ expected usize, found u8 + | ^^^^ expected `usize`, found `u8` | help: you can convert an `u8` to `usize` and panic if the converted value wouldn't fit | @@ -46,7 +46,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:31:18 | LL | foo::(x_isize); - | ^^^^^^^ expected usize, found isize + | ^^^^^^^ expected `usize`, found `isize` | help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit | @@ -57,7 +57,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:33:18 | LL | foo::(x_i64); - | ^^^^^ expected usize, found i64 + | ^^^^^ expected `usize`, found `i64` | help: you can convert an `i64` to `usize` and panic if the converted value wouldn't fit | @@ -68,7 +68,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:35:18 | LL | foo::(x_i32); - | ^^^^^ expected usize, found i32 + | ^^^^^ expected `usize`, found `i32` | help: you can convert an `i32` to `usize` and panic if the converted value wouldn't fit | @@ -79,7 +79,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:37:18 | LL | foo::(x_i16); - | ^^^^^ expected usize, found i16 + | ^^^^^ expected `usize`, found `i16` | help: you can convert an `i16` to `usize` and panic if the converted value wouldn't fit | @@ -90,7 +90,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:39:18 | LL | foo::(x_i8); - | ^^^^ expected usize, found i8 + | ^^^^ expected `usize`, found `i8` | help: you can convert an `i8` to `usize` and panic if the converted value wouldn't fit | @@ -101,7 +101,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:44:18 | LL | foo::(x_usize); - | ^^^^^^^ expected isize, found usize + | ^^^^^^^ expected `isize`, found `usize` | help: you can convert an `usize` to `isize` and panic if the converted value wouldn't fit | @@ -112,7 +112,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:46:18 | LL | foo::(x_u64); - | ^^^^^ expected isize, found u64 + | ^^^^^ expected `isize`, found `u64` | help: you can convert an `u64` to `isize` and panic if the converted value wouldn't fit | @@ -123,7 +123,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:48:18 | LL | foo::(x_u32); - | ^^^^^ expected isize, found u32 + | ^^^^^ expected `isize`, found `u32` | help: you can convert an `u32` to `isize` and panic if the converted value wouldn't fit | @@ -134,7 +134,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:50:18 | LL | foo::(x_u16); - | ^^^^^ expected isize, found u16 + | ^^^^^ expected `isize`, found `u16` | help: you can convert an `u16` to `isize` and panic if the converted value wouldn't fit | @@ -145,7 +145,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:52:18 | LL | foo::(x_u8); - | ^^^^ expected isize, found u8 + | ^^^^ expected `isize`, found `u8` | help: you can convert an `u8` to `isize` and panic if the converted value wouldn't fit | @@ -156,7 +156,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:55:18 | LL | foo::(x_i64); - | ^^^^^ expected isize, found i64 + | ^^^^^ expected `isize`, found `i64` | help: you can convert an `i64` to `isize` and panic if the converted value wouldn't fit | @@ -167,7 +167,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:57:18 | LL | foo::(x_i32); - | ^^^^^ expected isize, found i32 + | ^^^^^ expected `isize`, found `i32` | help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit | @@ -178,7 +178,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:59:18 | LL | foo::(x_i16); - | ^^^^^ expected isize, found i16 + | ^^^^^ expected `isize`, found `i16` | help: you can convert an `i16` to `isize` and panic if the converted value wouldn't fit | @@ -189,7 +189,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:61:18 | LL | foo::(x_i8); - | ^^^^ expected isize, found i8 + | ^^^^ expected `isize`, found `i8` | help: you can convert an `i8` to `isize` and panic if the converted value wouldn't fit | @@ -200,7 +200,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:66:16 | LL | foo::(x_usize); - | ^^^^^^^ expected u64, found usize + | ^^^^^^^ expected `u64`, found `usize` | help: you can convert an `usize` to `u64` and panic if the converted value wouldn't fit | @@ -213,7 +213,7 @@ error[E0308]: mismatched types LL | foo::(x_u32); | ^^^^^ | | - | expected u64, found u32 + | expected `u64`, found `u32` | help: you can convert an `u32` to `u64`: `x_u32.into()` error[E0308]: mismatched types @@ -222,7 +222,7 @@ error[E0308]: mismatched types LL | foo::(x_u16); | ^^^^^ | | - | expected u64, found u16 + | expected `u64`, found `u16` | help: you can convert an `u16` to `u64`: `x_u16.into()` error[E0308]: mismatched types @@ -231,14 +231,14 @@ error[E0308]: mismatched types LL | foo::(x_u8); | ^^^^ | | - | expected u64, found u8 + | expected `u64`, found `u8` | help: you can convert an `u8` to `u64`: `x_u8.into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:75:16 | LL | foo::(x_isize); - | ^^^^^^^ expected u64, found isize + | ^^^^^^^ expected `u64`, found `isize` | help: you can convert an `isize` to `u64` and panic if the converted value wouldn't fit | @@ -249,7 +249,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:77:16 | LL | foo::(x_i64); - | ^^^^^ expected u64, found i64 + | ^^^^^ expected `u64`, found `i64` | help: you can convert an `i64` to `u64` and panic if the converted value wouldn't fit | @@ -260,7 +260,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:79:16 | LL | foo::(x_i32); - | ^^^^^ expected u64, found i32 + | ^^^^^ expected `u64`, found `i32` | help: you can convert an `i32` to `u64` and panic if the converted value wouldn't fit | @@ -271,7 +271,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:81:16 | LL | foo::(x_i16); - | ^^^^^ expected u64, found i16 + | ^^^^^ expected `u64`, found `i16` | help: you can convert an `i16` to `u64` and panic if the converted value wouldn't fit | @@ -282,7 +282,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:83:16 | LL | foo::(x_i8); - | ^^^^ expected u64, found i8 + | ^^^^ expected `u64`, found `i8` | help: you can convert an `i8` to `u64` and panic if the converted value wouldn't fit | @@ -293,7 +293,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:88:16 | LL | foo::(x_usize); - | ^^^^^^^ expected i64, found usize + | ^^^^^^^ expected `i64`, found `usize` | help: you can convert an `usize` to `i64` and panic if the converted value wouldn't fit | @@ -304,7 +304,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:90:16 | LL | foo::(x_u64); - | ^^^^^ expected i64, found u64 + | ^^^^^ expected `i64`, found `u64` | help: you can convert an `u64` to `i64` and panic if the converted value wouldn't fit | @@ -315,7 +315,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:92:16 | LL | foo::(x_u32); - | ^^^^^ expected i64, found u32 + | ^^^^^ expected `i64`, found `u32` | help: you can convert an `u32` to `i64` and panic if the converted value wouldn't fit | @@ -326,7 +326,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:94:16 | LL | foo::(x_u16); - | ^^^^^ expected i64, found u16 + | ^^^^^ expected `i64`, found `u16` | help: you can convert an `u16` to `i64` and panic if the converted value wouldn't fit | @@ -337,7 +337,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:96:16 | LL | foo::(x_u8); - | ^^^^ expected i64, found u8 + | ^^^^ expected `i64`, found `u8` | help: you can convert an `u8` to `i64` and panic if the converted value wouldn't fit | @@ -348,7 +348,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:98:16 | LL | foo::(x_isize); - | ^^^^^^^ expected i64, found isize + | ^^^^^^^ expected `i64`, found `isize` | help: you can convert an `isize` to `i64` and panic if the converted value wouldn't fit | @@ -361,7 +361,7 @@ error[E0308]: mismatched types LL | foo::(x_i32); | ^^^^^ | | - | expected i64, found i32 + | expected `i64`, found `i32` | help: you can convert an `i32` to `i64`: `x_i32.into()` error[E0308]: mismatched types @@ -370,7 +370,7 @@ error[E0308]: mismatched types LL | foo::(x_i16); | ^^^^^ | | - | expected i64, found i16 + | expected `i64`, found `i16` | help: you can convert an `i16` to `i64`: `x_i16.into()` error[E0308]: mismatched types @@ -379,14 +379,14 @@ error[E0308]: mismatched types LL | foo::(x_i8); | ^^^^ | | - | expected i64, found i8 + | expected `i64`, found `i8` | help: you can convert an `i8` to `i64`: `x_i8.into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:110:16 | LL | foo::(x_usize); - | ^^^^^^^ expected u32, found usize + | ^^^^^^^ expected `u32`, found `usize` | help: you can convert an `usize` to `u32` and panic if the converted value wouldn't fit | @@ -397,7 +397,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:112:16 | LL | foo::(x_u64); - | ^^^^^ expected u32, found u64 + | ^^^^^ expected `u32`, found `u64` | help: you can convert an `u64` to `u32` and panic if the converted value wouldn't fit | @@ -410,7 +410,7 @@ error[E0308]: mismatched types LL | foo::(x_u16); | ^^^^^ | | - | expected u32, found u16 + | expected `u32`, found `u16` | help: you can convert an `u16` to `u32`: `x_u16.into()` error[E0308]: mismatched types @@ -419,14 +419,14 @@ error[E0308]: mismatched types LL | foo::(x_u8); | ^^^^ | | - | expected u32, found u8 + | expected `u32`, found `u8` | help: you can convert an `u8` to `u32`: `x_u8.into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:119:16 | LL | foo::(x_isize); - | ^^^^^^^ expected u32, found isize + | ^^^^^^^ expected `u32`, found `isize` | help: you can convert an `isize` to `u32` and panic if the converted value wouldn't fit | @@ -437,7 +437,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:121:16 | LL | foo::(x_i64); - | ^^^^^ expected u32, found i64 + | ^^^^^ expected `u32`, found `i64` | help: you can convert an `i64` to `u32` and panic if the converted value wouldn't fit | @@ -448,7 +448,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:123:16 | LL | foo::(x_i32); - | ^^^^^ expected u32, found i32 + | ^^^^^ expected `u32`, found `i32` | help: you can convert an `i32` to `u32` and panic if the converted value wouldn't fit | @@ -459,7 +459,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:125:16 | LL | foo::(x_i16); - | ^^^^^ expected u32, found i16 + | ^^^^^ expected `u32`, found `i16` | help: you can convert an `i16` to `u32` and panic if the converted value wouldn't fit | @@ -470,7 +470,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:127:16 | LL | foo::(x_i8); - | ^^^^ expected u32, found i8 + | ^^^^ expected `u32`, found `i8` | help: you can convert an `i8` to `u32` and panic if the converted value wouldn't fit | @@ -481,7 +481,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:132:16 | LL | foo::(x_usize); - | ^^^^^^^ expected i32, found usize + | ^^^^^^^ expected `i32`, found `usize` | help: you can convert an `usize` to `i32` and panic if the converted value wouldn't fit | @@ -492,7 +492,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:134:16 | LL | foo::(x_u64); - | ^^^^^ expected i32, found u64 + | ^^^^^ expected `i32`, found `u64` | help: you can convert an `u64` to `i32` and panic if the converted value wouldn't fit | @@ -503,7 +503,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:136:16 | LL | foo::(x_u32); - | ^^^^^ expected i32, found u32 + | ^^^^^ expected `i32`, found `u32` | help: you can convert an `u32` to `i32` and panic if the converted value wouldn't fit | @@ -514,7 +514,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:138:16 | LL | foo::(x_u16); - | ^^^^^ expected i32, found u16 + | ^^^^^ expected `i32`, found `u16` | help: you can convert an `u16` to `i32` and panic if the converted value wouldn't fit | @@ -525,7 +525,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:140:16 | LL | foo::(x_u8); - | ^^^^ expected i32, found u8 + | ^^^^ expected `i32`, found `u8` | help: you can convert an `u8` to `i32` and panic if the converted value wouldn't fit | @@ -536,7 +536,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:142:16 | LL | foo::(x_isize); - | ^^^^^^^ expected i32, found isize + | ^^^^^^^ expected `i32`, found `isize` | help: you can convert an `isize` to `i32` and panic if the converted value wouldn't fit | @@ -547,7 +547,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:144:16 | LL | foo::(x_i64); - | ^^^^^ expected i32, found i64 + | ^^^^^ expected `i32`, found `i64` | help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit | @@ -560,7 +560,7 @@ error[E0308]: mismatched types LL | foo::(x_i16); | ^^^^^ | | - | expected i32, found i16 + | expected `i32`, found `i16` | help: you can convert an `i16` to `i32`: `x_i16.into()` error[E0308]: mismatched types @@ -569,14 +569,14 @@ error[E0308]: mismatched types LL | foo::(x_i8); | ^^^^ | | - | expected i32, found i8 + | expected `i32`, found `i8` | help: you can convert an `i8` to `i32`: `x_i8.into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:154:16 | LL | foo::(x_usize); - | ^^^^^^^ expected u16, found usize + | ^^^^^^^ expected `u16`, found `usize` | help: you can convert an `usize` to `u16` and panic if the converted value wouldn't fit | @@ -587,7 +587,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:156:16 | LL | foo::(x_u64); - | ^^^^^ expected u16, found u64 + | ^^^^^ expected `u16`, found `u64` | help: you can convert an `u64` to `u16` and panic if the converted value wouldn't fit | @@ -598,7 +598,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:158:16 | LL | foo::(x_u32); - | ^^^^^ expected u16, found u32 + | ^^^^^ expected `u16`, found `u32` | help: you can convert an `u32` to `u16` and panic if the converted value wouldn't fit | @@ -611,14 +611,14 @@ error[E0308]: mismatched types LL | foo::(x_u8); | ^^^^ | | - | expected u16, found u8 + | expected `u16`, found `u8` | help: you can convert an `u8` to `u16`: `x_u8.into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:163:16 | LL | foo::(x_isize); - | ^^^^^^^ expected u16, found isize + | ^^^^^^^ expected `u16`, found `isize` | help: you can convert an `isize` to `u16` and panic if the converted value wouldn't fit | @@ -629,7 +629,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:165:16 | LL | foo::(x_i64); - | ^^^^^ expected u16, found i64 + | ^^^^^ expected `u16`, found `i64` | help: you can convert an `i64` to `u16` and panic if the converted value wouldn't fit | @@ -640,7 +640,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:167:16 | LL | foo::(x_i32); - | ^^^^^ expected u16, found i32 + | ^^^^^ expected `u16`, found `i32` | help: you can convert an `i32` to `u16` and panic if the converted value wouldn't fit | @@ -651,7 +651,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:169:16 | LL | foo::(x_i16); - | ^^^^^ expected u16, found i16 + | ^^^^^ expected `u16`, found `i16` | help: you can convert an `i16` to `u16` and panic if the converted value wouldn't fit | @@ -662,7 +662,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:171:16 | LL | foo::(x_i8); - | ^^^^ expected u16, found i8 + | ^^^^ expected `u16`, found `i8` | help: you can convert an `i8` to `u16` and panic if the converted value wouldn't fit | @@ -673,7 +673,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:176:16 | LL | foo::(x_usize); - | ^^^^^^^ expected i16, found usize + | ^^^^^^^ expected `i16`, found `usize` | help: you can convert an `usize` to `i16` and panic if the converted value wouldn't fit | @@ -684,7 +684,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:178:16 | LL | foo::(x_u64); - | ^^^^^ expected i16, found u64 + | ^^^^^ expected `i16`, found `u64` | help: you can convert an `u64` to `i16` and panic if the converted value wouldn't fit | @@ -695,7 +695,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:180:16 | LL | foo::(x_u32); - | ^^^^^ expected i16, found u32 + | ^^^^^ expected `i16`, found `u32` | help: you can convert an `u32` to `i16` and panic if the converted value wouldn't fit | @@ -706,7 +706,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:182:16 | LL | foo::(x_u16); - | ^^^^^ expected i16, found u16 + | ^^^^^ expected `i16`, found `u16` | help: you can convert an `u16` to `i16` and panic if the converted value wouldn't fit | @@ -717,7 +717,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:184:16 | LL | foo::(x_u8); - | ^^^^ expected i16, found u8 + | ^^^^ expected `i16`, found `u8` | help: you can convert an `u8` to `i16` and panic if the converted value wouldn't fit | @@ -728,7 +728,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:186:16 | LL | foo::(x_isize); - | ^^^^^^^ expected i16, found isize + | ^^^^^^^ expected `i16`, found `isize` | help: you can convert an `isize` to `i16` and panic if the converted value wouldn't fit | @@ -739,7 +739,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:188:16 | LL | foo::(x_i64); - | ^^^^^ expected i16, found i64 + | ^^^^^ expected `i16`, found `i64` | help: you can convert an `i64` to `i16` and panic if the converted value wouldn't fit | @@ -750,7 +750,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:190:16 | LL | foo::(x_i32); - | ^^^^^ expected i16, found i32 + | ^^^^^ expected `i16`, found `i32` | help: you can convert an `i32` to `i16` and panic if the converted value wouldn't fit | @@ -763,14 +763,14 @@ error[E0308]: mismatched types LL | foo::(x_i8); | ^^^^ | | - | expected i16, found i8 + | expected `i16`, found `i8` | help: you can convert an `i8` to `i16`: `x_i8.into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:198:15 | LL | foo::(x_usize); - | ^^^^^^^ expected u8, found usize + | ^^^^^^^ expected `u8`, found `usize` | help: you can convert an `usize` to `u8` and panic if the converted value wouldn't fit | @@ -781,7 +781,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:200:15 | LL | foo::(x_u64); - | ^^^^^ expected u8, found u64 + | ^^^^^ expected `u8`, found `u64` | help: you can convert an `u64` to `u8` and panic if the converted value wouldn't fit | @@ -792,7 +792,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:202:15 | LL | foo::(x_u32); - | ^^^^^ expected u8, found u32 + | ^^^^^ expected `u8`, found `u32` | help: you can convert an `u32` to `u8` and panic if the converted value wouldn't fit | @@ -803,7 +803,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:204:15 | LL | foo::(x_u16); - | ^^^^^ expected u8, found u16 + | ^^^^^ expected `u8`, found `u16` | help: you can convert an `u16` to `u8` and panic if the converted value wouldn't fit | @@ -814,7 +814,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:207:15 | LL | foo::(x_isize); - | ^^^^^^^ expected u8, found isize + | ^^^^^^^ expected `u8`, found `isize` | help: you can convert an `isize` to `u8` and panic if the converted value wouldn't fit | @@ -825,7 +825,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:209:15 | LL | foo::(x_i64); - | ^^^^^ expected u8, found i64 + | ^^^^^ expected `u8`, found `i64` | help: you can convert an `i64` to `u8` and panic if the converted value wouldn't fit | @@ -836,7 +836,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:211:15 | LL | foo::(x_i32); - | ^^^^^ expected u8, found i32 + | ^^^^^ expected `u8`, found `i32` | help: you can convert an `i32` to `u8` and panic if the converted value wouldn't fit | @@ -847,7 +847,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:213:15 | LL | foo::(x_i16); - | ^^^^^ expected u8, found i16 + | ^^^^^ expected `u8`, found `i16` | help: you can convert an `i16` to `u8` and panic if the converted value wouldn't fit | @@ -858,7 +858,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:215:15 | LL | foo::(x_i8); - | ^^^^ expected u8, found i8 + | ^^^^ expected `u8`, found `i8` | help: you can convert an `i8` to `u8` and panic if the converted value wouldn't fit | @@ -869,7 +869,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:220:15 | LL | foo::(x_usize); - | ^^^^^^^ expected i8, found usize + | ^^^^^^^ expected `i8`, found `usize` | help: you can convert an `usize` to `i8` and panic if the converted value wouldn't fit | @@ -880,7 +880,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:222:15 | LL | foo::(x_u64); - | ^^^^^ expected i8, found u64 + | ^^^^^ expected `i8`, found `u64` | help: you can convert an `u64` to `i8` and panic if the converted value wouldn't fit | @@ -891,7 +891,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:224:15 | LL | foo::(x_u32); - | ^^^^^ expected i8, found u32 + | ^^^^^ expected `i8`, found `u32` | help: you can convert an `u32` to `i8` and panic if the converted value wouldn't fit | @@ -902,7 +902,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:226:15 | LL | foo::(x_u16); - | ^^^^^ expected i8, found u16 + | ^^^^^ expected `i8`, found `u16` | help: you can convert an `u16` to `i8` and panic if the converted value wouldn't fit | @@ -913,7 +913,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:228:15 | LL | foo::(x_u8); - | ^^^^ expected i8, found u8 + | ^^^^ expected `i8`, found `u8` | help: you can convert an `u8` to `i8` and panic if the converted value wouldn't fit | @@ -924,7 +924,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:230:15 | LL | foo::(x_isize); - | ^^^^^^^ expected i8, found isize + | ^^^^^^^ expected `i8`, found `isize` | help: you can convert an `isize` to `i8` and panic if the converted value wouldn't fit | @@ -935,7 +935,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:232:15 | LL | foo::(x_i64); - | ^^^^^ expected i8, found i64 + | ^^^^^ expected `i8`, found `i64` | help: you can convert an `i64` to `i8` and panic if the converted value wouldn't fit | @@ -946,7 +946,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:234:15 | LL | foo::(x_i32); - | ^^^^^ expected i8, found i32 + | ^^^^^ expected `i8`, found `i32` | help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit | @@ -957,7 +957,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:236:15 | LL | foo::(x_i16); - | ^^^^^ expected i8, found i16 + | ^^^^^ expected `i8`, found `i16` | help: you can convert an `i16` to `i8` and panic if the converted value wouldn't fit | @@ -968,7 +968,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:242:16 | LL | foo::(x_usize); - | ^^^^^^^ expected f64, found usize + | ^^^^^^^ expected `f64`, found `usize` | help: you can cast an `usize to `f64`, producing the floating point representation of the integer, | rounded if necessary @@ -979,7 +979,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:244:16 | LL | foo::(x_u64); - | ^^^^^ expected f64, found u64 + | ^^^^^ expected `f64`, found `u64` | help: you can cast an `u64 to `f64`, producing the floating point representation of the integer, | rounded if necessary @@ -990,7 +990,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:246:16 | LL | foo::(x_u32); - | ^^^^^ expected f64, found u32 + | ^^^^^ expected `f64`, found `u32` | help: you can convert an `u32` to `f64`, producing the floating point representation of the integer | @@ -1001,7 +1001,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:248:16 | LL | foo::(x_u16); - | ^^^^^ expected f64, found u16 + | ^^^^^ expected `f64`, found `u16` | help: you can convert an `u16` to `f64`, producing the floating point representation of the integer | @@ -1012,7 +1012,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:250:16 | LL | foo::(x_u8); - | ^^^^ expected f64, found u8 + | ^^^^ expected `f64`, found `u8` | help: you can convert an `u8` to `f64`, producing the floating point representation of the integer | @@ -1023,7 +1023,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:252:16 | LL | foo::(x_isize); - | ^^^^^^^ expected f64, found isize + | ^^^^^^^ expected `f64`, found `isize` | help: you can convert an `isize` to `f64`, producing the floating point representation of the integer, rounded if necessary | @@ -1034,7 +1034,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:254:16 | LL | foo::(x_i64); - | ^^^^^ expected f64, found i64 + | ^^^^^ expected `f64`, found `i64` | help: you can convert an `i64` to `f64`, producing the floating point representation of the integer, rounded if necessary | @@ -1045,7 +1045,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:256:16 | LL | foo::(x_i32); - | ^^^^^ expected f64, found i32 + | ^^^^^ expected `f64`, found `i32` | help: you can convert an `i32` to `f64`, producing the floating point representation of the integer | @@ -1056,7 +1056,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:258:16 | LL | foo::(x_i16); - | ^^^^^ expected f64, found i16 + | ^^^^^ expected `f64`, found `i16` | help: you can convert an `i16` to `f64`, producing the floating point representation of the integer | @@ -1067,7 +1067,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:260:16 | LL | foo::(x_i8); - | ^^^^ expected f64, found i8 + | ^^^^ expected `f64`, found `i8` | help: you can convert an `i8` to `f64`, producing the floating point representation of the integer | @@ -1080,14 +1080,14 @@ error[E0308]: mismatched types LL | foo::(x_f32); | ^^^^^ | | - | expected f64, found f32 + | expected `f64`, found `f32` | help: you can convert an `f32` to `f64`: `x_f32.into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:266:16 | LL | foo::(x_usize); - | ^^^^^^^ expected f32, found usize + | ^^^^^^^ expected `f32`, found `usize` | help: you can cast an `usize to `f32`, producing the floating point representation of the integer, | rounded if necessary @@ -1098,7 +1098,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:268:16 | LL | foo::(x_u64); - | ^^^^^ expected f32, found u64 + | ^^^^^ expected `f32`, found `u64` | help: you can cast an `u64 to `f32`, producing the floating point representation of the integer, | rounded if necessary @@ -1109,7 +1109,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:270:16 | LL | foo::(x_u32); - | ^^^^^ expected f32, found u32 + | ^^^^^ expected `f32`, found `u32` | help: you can cast an `u32 to `f32`, producing the floating point representation of the integer, | rounded if necessary @@ -1120,7 +1120,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:272:16 | LL | foo::(x_u16); - | ^^^^^ expected f32, found u16 + | ^^^^^ expected `f32`, found `u16` | help: you can convert an `u16` to `f32`, producing the floating point representation of the integer | @@ -1131,7 +1131,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:274:16 | LL | foo::(x_u8); - | ^^^^ expected f32, found u8 + | ^^^^ expected `f32`, found `u8` | help: you can convert an `u8` to `f32`, producing the floating point representation of the integer | @@ -1142,7 +1142,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:276:16 | LL | foo::(x_isize); - | ^^^^^^^ expected f32, found isize + | ^^^^^^^ expected `f32`, found `isize` | help: you can convert an `isize` to `f32`, producing the floating point representation of the integer, rounded if necessary | @@ -1153,7 +1153,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:278:16 | LL | foo::(x_i64); - | ^^^^^ expected f32, found i64 + | ^^^^^ expected `f32`, found `i64` | help: you can convert an `i64` to `f32`, producing the floating point representation of the integer, rounded if necessary | @@ -1164,7 +1164,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:280:16 | LL | foo::(x_i32); - | ^^^^^ expected f32, found i32 + | ^^^^^ expected `f32`, found `i32` | help: you can convert an `i32` to `f32`, producing the floating point representation of the integer, rounded if necessary | @@ -1175,7 +1175,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:282:16 | LL | foo::(x_i16); - | ^^^^^ expected f32, found i16 + | ^^^^^ expected `f32`, found `i16` | help: you can convert an `i16` to `f32`, producing the floating point representation of the integer | @@ -1186,7 +1186,7 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:284:16 | LL | foo::(x_i8); - | ^^^^ expected f32, found i8 + | ^^^^ expected `f32`, found `i8` | help: you can convert an `i8` to `f32`, producing the floating point representation of the integer | @@ -1199,7 +1199,7 @@ error[E0308]: mismatched types LL | foo::(x_u8 as u16); | ^^^^^^^^^^^ | | - | expected u32, found u16 + | expected `u32`, found `u16` | help: you can convert an `u16` to `u32`: `(x_u8 as u16).into()` error[E0308]: mismatched types @@ -1208,7 +1208,7 @@ error[E0308]: mismatched types LL | foo::(-x_i8); | ^^^^^ | | - | expected i32, found i8 + | expected `i32`, found `i8` | help: you can convert an `i8` to `i32`: `(-x_i8).into()` error: aborting due to 113 previous errors diff --git a/src/test/ui/numeric/numeric-suffix.stderr b/src/test/ui/numeric/numeric-suffix.stderr index 9bcae4a1888e6..00f6e1abe43cb 100644 --- a/src/test/ui/numeric/numeric-suffix.stderr +++ b/src/test/ui/numeric/numeric-suffix.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:7:18 | LL | foo::(42_u64); - | ^^^^^^ expected usize, found u64 + | ^^^^^^ expected `usize`, found `u64` | help: change the type of the numeric literal from `u64` to `usize` | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:9:18 | LL | foo::(42_u32); - | ^^^^^^ expected usize, found u32 + | ^^^^^^ expected `usize`, found `u32` | help: change the type of the numeric literal from `u32` to `usize` | @@ -24,7 +24,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:11:18 | LL | foo::(42_u16); - | ^^^^^^ expected usize, found u16 + | ^^^^^^ expected `usize`, found `u16` | help: change the type of the numeric literal from `u16` to `usize` | @@ -35,7 +35,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:13:18 | LL | foo::(42_u8); - | ^^^^^ expected usize, found u8 + | ^^^^^ expected `usize`, found `u8` | help: change the type of the numeric literal from `u8` to `usize` | @@ -46,7 +46,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:15:18 | LL | foo::(42_isize); - | ^^^^^^^^ expected usize, found isize + | ^^^^^^^^ expected `usize`, found `isize` | help: change the type of the numeric literal from `isize` to `usize` | @@ -57,7 +57,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:17:18 | LL | foo::(42_i64); - | ^^^^^^ expected usize, found i64 + | ^^^^^^ expected `usize`, found `i64` | help: change the type of the numeric literal from `i64` to `usize` | @@ -68,7 +68,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:19:18 | LL | foo::(42_i32); - | ^^^^^^ expected usize, found i32 + | ^^^^^^ expected `usize`, found `i32` | help: change the type of the numeric literal from `i32` to `usize` | @@ -79,7 +79,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:21:18 | LL | foo::(42_i16); - | ^^^^^^ expected usize, found i16 + | ^^^^^^ expected `usize`, found `i16` | help: change the type of the numeric literal from `i16` to `usize` | @@ -90,7 +90,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:23:18 | LL | foo::(42_i8); - | ^^^^^ expected usize, found i8 + | ^^^^^ expected `usize`, found `i8` | help: change the type of the numeric literal from `i8` to `usize` | @@ -101,7 +101,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:25:18 | LL | foo::(42.0_f64); - | ^^^^^^^^ expected usize, found f64 + | ^^^^^^^^ expected `usize`, found `f64` | help: change the type of the numeric literal from `f64` to `usize` | @@ -112,7 +112,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:27:18 | LL | foo::(42.0_f32); - | ^^^^^^^^ expected usize, found f32 + | ^^^^^^^^ expected `usize`, found `f32` | help: change the type of the numeric literal from `f32` to `usize` | @@ -123,7 +123,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:30:18 | LL | foo::(42_usize); - | ^^^^^^^^ expected isize, found usize + | ^^^^^^^^ expected `isize`, found `usize` | help: change the type of the numeric literal from `usize` to `isize` | @@ -134,7 +134,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:32:18 | LL | foo::(42_u64); - | ^^^^^^ expected isize, found u64 + | ^^^^^^ expected `isize`, found `u64` | help: change the type of the numeric literal from `u64` to `isize` | @@ -145,7 +145,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:34:18 | LL | foo::(42_u32); - | ^^^^^^ expected isize, found u32 + | ^^^^^^ expected `isize`, found `u32` | help: change the type of the numeric literal from `u32` to `isize` | @@ -156,7 +156,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:36:18 | LL | foo::(42_u16); - | ^^^^^^ expected isize, found u16 + | ^^^^^^ expected `isize`, found `u16` | help: change the type of the numeric literal from `u16` to `isize` | @@ -167,7 +167,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:38:18 | LL | foo::(42_u8); - | ^^^^^ expected isize, found u8 + | ^^^^^ expected `isize`, found `u8` | help: change the type of the numeric literal from `u8` to `isize` | @@ -178,7 +178,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:41:18 | LL | foo::(42_i64); - | ^^^^^^ expected isize, found i64 + | ^^^^^^ expected `isize`, found `i64` | help: change the type of the numeric literal from `i64` to `isize` | @@ -189,7 +189,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:43:18 | LL | foo::(42_i32); - | ^^^^^^ expected isize, found i32 + | ^^^^^^ expected `isize`, found `i32` | help: change the type of the numeric literal from `i32` to `isize` | @@ -200,7 +200,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:45:18 | LL | foo::(42_i16); - | ^^^^^^ expected isize, found i16 + | ^^^^^^ expected `isize`, found `i16` | help: change the type of the numeric literal from `i16` to `isize` | @@ -211,7 +211,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:47:18 | LL | foo::(42_i8); - | ^^^^^ expected isize, found i8 + | ^^^^^ expected `isize`, found `i8` | help: change the type of the numeric literal from `i8` to `isize` | @@ -222,7 +222,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:49:18 | LL | foo::(42.0_f64); - | ^^^^^^^^ expected isize, found f64 + | ^^^^^^^^ expected `isize`, found `f64` | help: change the type of the numeric literal from `f64` to `isize` | @@ -233,7 +233,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:51:18 | LL | foo::(42.0_f32); - | ^^^^^^^^ expected isize, found f32 + | ^^^^^^^^ expected `isize`, found `f32` | help: change the type of the numeric literal from `f32` to `isize` | @@ -244,7 +244,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:54:16 | LL | foo::(42_usize); - | ^^^^^^^^ expected u64, found usize + | ^^^^^^^^ expected `u64`, found `usize` | help: change the type of the numeric literal from `usize` to `u64` | @@ -255,7 +255,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:57:16 | LL | foo::(42_u32); - | ^^^^^^ expected u64, found u32 + | ^^^^^^ expected `u64`, found `u32` | help: change the type of the numeric literal from `u32` to `u64` | @@ -266,7 +266,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:59:16 | LL | foo::(42_u16); - | ^^^^^^ expected u64, found u16 + | ^^^^^^ expected `u64`, found `u16` | help: change the type of the numeric literal from `u16` to `u64` | @@ -277,7 +277,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:61:16 | LL | foo::(42_u8); - | ^^^^^ expected u64, found u8 + | ^^^^^ expected `u64`, found `u8` | help: change the type of the numeric literal from `u8` to `u64` | @@ -288,7 +288,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:63:16 | LL | foo::(42_isize); - | ^^^^^^^^ expected u64, found isize + | ^^^^^^^^ expected `u64`, found `isize` | help: change the type of the numeric literal from `isize` to `u64` | @@ -299,7 +299,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:65:16 | LL | foo::(42_i64); - | ^^^^^^ expected u64, found i64 + | ^^^^^^ expected `u64`, found `i64` | help: change the type of the numeric literal from `i64` to `u64` | @@ -310,7 +310,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:67:16 | LL | foo::(42_i32); - | ^^^^^^ expected u64, found i32 + | ^^^^^^ expected `u64`, found `i32` | help: change the type of the numeric literal from `i32` to `u64` | @@ -321,7 +321,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:69:16 | LL | foo::(42_i16); - | ^^^^^^ expected u64, found i16 + | ^^^^^^ expected `u64`, found `i16` | help: change the type of the numeric literal from `i16` to `u64` | @@ -332,7 +332,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:71:16 | LL | foo::(42_i8); - | ^^^^^ expected u64, found i8 + | ^^^^^ expected `u64`, found `i8` | help: change the type of the numeric literal from `i8` to `u64` | @@ -343,7 +343,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:73:16 | LL | foo::(42.0_f64); - | ^^^^^^^^ expected u64, found f64 + | ^^^^^^^^ expected `u64`, found `f64` | help: change the type of the numeric literal from `f64` to `u64` | @@ -354,7 +354,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:75:16 | LL | foo::(42.0_f32); - | ^^^^^^^^ expected u64, found f32 + | ^^^^^^^^ expected `u64`, found `f32` | help: change the type of the numeric literal from `f32` to `u64` | @@ -365,7 +365,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:78:16 | LL | foo::(42_usize); - | ^^^^^^^^ expected i64, found usize + | ^^^^^^^^ expected `i64`, found `usize` | help: change the type of the numeric literal from `usize` to `i64` | @@ -376,7 +376,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:80:16 | LL | foo::(42_u64); - | ^^^^^^ expected i64, found u64 + | ^^^^^^ expected `i64`, found `u64` | help: change the type of the numeric literal from `u64` to `i64` | @@ -387,7 +387,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:82:16 | LL | foo::(42_u32); - | ^^^^^^ expected i64, found u32 + | ^^^^^^ expected `i64`, found `u32` | help: change the type of the numeric literal from `u32` to `i64` | @@ -398,7 +398,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:84:16 | LL | foo::(42_u16); - | ^^^^^^ expected i64, found u16 + | ^^^^^^ expected `i64`, found `u16` | help: change the type of the numeric literal from `u16` to `i64` | @@ -409,7 +409,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:86:16 | LL | foo::(42_u8); - | ^^^^^ expected i64, found u8 + | ^^^^^ expected `i64`, found `u8` | help: change the type of the numeric literal from `u8` to `i64` | @@ -420,7 +420,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:88:16 | LL | foo::(42_isize); - | ^^^^^^^^ expected i64, found isize + | ^^^^^^^^ expected `i64`, found `isize` | help: change the type of the numeric literal from `isize` to `i64` | @@ -431,7 +431,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:91:16 | LL | foo::(42_i32); - | ^^^^^^ expected i64, found i32 + | ^^^^^^ expected `i64`, found `i32` | help: change the type of the numeric literal from `i32` to `i64` | @@ -442,7 +442,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:93:16 | LL | foo::(42_i16); - | ^^^^^^ expected i64, found i16 + | ^^^^^^ expected `i64`, found `i16` | help: change the type of the numeric literal from `i16` to `i64` | @@ -453,7 +453,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:95:16 | LL | foo::(42_i8); - | ^^^^^ expected i64, found i8 + | ^^^^^ expected `i64`, found `i8` | help: change the type of the numeric literal from `i8` to `i64` | @@ -464,7 +464,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:97:16 | LL | foo::(42.0_f64); - | ^^^^^^^^ expected i64, found f64 + | ^^^^^^^^ expected `i64`, found `f64` | help: change the type of the numeric literal from `f64` to `i64` | @@ -475,7 +475,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:99:16 | LL | foo::(42.0_f32); - | ^^^^^^^^ expected i64, found f32 + | ^^^^^^^^ expected `i64`, found `f32` | help: change the type of the numeric literal from `f32` to `i64` | @@ -486,7 +486,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:102:16 | LL | foo::(42_usize); - | ^^^^^^^^ expected u32, found usize + | ^^^^^^^^ expected `u32`, found `usize` | help: change the type of the numeric literal from `usize` to `u32` | @@ -497,7 +497,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:104:16 | LL | foo::(42_u64); - | ^^^^^^ expected u32, found u64 + | ^^^^^^ expected `u32`, found `u64` | help: change the type of the numeric literal from `u64` to `u32` | @@ -508,7 +508,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:107:16 | LL | foo::(42_u16); - | ^^^^^^ expected u32, found u16 + | ^^^^^^ expected `u32`, found `u16` | help: change the type of the numeric literal from `u16` to `u32` | @@ -519,7 +519,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:109:16 | LL | foo::(42_u8); - | ^^^^^ expected u32, found u8 + | ^^^^^ expected `u32`, found `u8` | help: change the type of the numeric literal from `u8` to `u32` | @@ -530,7 +530,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:111:16 | LL | foo::(42_isize); - | ^^^^^^^^ expected u32, found isize + | ^^^^^^^^ expected `u32`, found `isize` | help: change the type of the numeric literal from `isize` to `u32` | @@ -541,7 +541,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:113:16 | LL | foo::(42_i64); - | ^^^^^^ expected u32, found i64 + | ^^^^^^ expected `u32`, found `i64` | help: change the type of the numeric literal from `i64` to `u32` | @@ -552,7 +552,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:115:16 | LL | foo::(42_i32); - | ^^^^^^ expected u32, found i32 + | ^^^^^^ expected `u32`, found `i32` | help: change the type of the numeric literal from `i32` to `u32` | @@ -563,7 +563,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:117:16 | LL | foo::(42_i16); - | ^^^^^^ expected u32, found i16 + | ^^^^^^ expected `u32`, found `i16` | help: change the type of the numeric literal from `i16` to `u32` | @@ -574,7 +574,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:119:16 | LL | foo::(42_i8); - | ^^^^^ expected u32, found i8 + | ^^^^^ expected `u32`, found `i8` | help: change the type of the numeric literal from `i8` to `u32` | @@ -585,7 +585,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:121:16 | LL | foo::(42.0_f64); - | ^^^^^^^^ expected u32, found f64 + | ^^^^^^^^ expected `u32`, found `f64` | help: change the type of the numeric literal from `f64` to `u32` | @@ -596,7 +596,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:123:16 | LL | foo::(42.0_f32); - | ^^^^^^^^ expected u32, found f32 + | ^^^^^^^^ expected `u32`, found `f32` | help: change the type of the numeric literal from `f32` to `u32` | @@ -607,7 +607,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:126:16 | LL | foo::(42_usize); - | ^^^^^^^^ expected i32, found usize + | ^^^^^^^^ expected `i32`, found `usize` | help: change the type of the numeric literal from `usize` to `i32` | @@ -618,7 +618,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:128:16 | LL | foo::(42_u64); - | ^^^^^^ expected i32, found u64 + | ^^^^^^ expected `i32`, found `u64` | help: change the type of the numeric literal from `u64` to `i32` | @@ -629,7 +629,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:130:16 | LL | foo::(42_u32); - | ^^^^^^ expected i32, found u32 + | ^^^^^^ expected `i32`, found `u32` | help: change the type of the numeric literal from `u32` to `i32` | @@ -640,7 +640,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:132:16 | LL | foo::(42_u16); - | ^^^^^^ expected i32, found u16 + | ^^^^^^ expected `i32`, found `u16` | help: change the type of the numeric literal from `u16` to `i32` | @@ -651,7 +651,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:134:16 | LL | foo::(42_u8); - | ^^^^^ expected i32, found u8 + | ^^^^^ expected `i32`, found `u8` | help: change the type of the numeric literal from `u8` to `i32` | @@ -662,7 +662,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:136:16 | LL | foo::(42_isize); - | ^^^^^^^^ expected i32, found isize + | ^^^^^^^^ expected `i32`, found `isize` | help: change the type of the numeric literal from `isize` to `i32` | @@ -673,7 +673,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:138:16 | LL | foo::(42_i64); - | ^^^^^^ expected i32, found i64 + | ^^^^^^ expected `i32`, found `i64` | help: change the type of the numeric literal from `i64` to `i32` | @@ -684,7 +684,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:141:16 | LL | foo::(42_i16); - | ^^^^^^ expected i32, found i16 + | ^^^^^^ expected `i32`, found `i16` | help: change the type of the numeric literal from `i16` to `i32` | @@ -695,7 +695,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:143:16 | LL | foo::(42_i8); - | ^^^^^ expected i32, found i8 + | ^^^^^ expected `i32`, found `i8` | help: change the type of the numeric literal from `i8` to `i32` | @@ -706,7 +706,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:145:16 | LL | foo::(42.0_f64); - | ^^^^^^^^ expected i32, found f64 + | ^^^^^^^^ expected `i32`, found `f64` | help: change the type of the numeric literal from `f64` to `i32` | @@ -717,7 +717,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:147:16 | LL | foo::(42.0_f32); - | ^^^^^^^^ expected i32, found f32 + | ^^^^^^^^ expected `i32`, found `f32` | help: change the type of the numeric literal from `f32` to `i32` | @@ -728,7 +728,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:150:16 | LL | foo::(42_usize); - | ^^^^^^^^ expected u16, found usize + | ^^^^^^^^ expected `u16`, found `usize` | help: change the type of the numeric literal from `usize` to `u16` | @@ -739,7 +739,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:152:16 | LL | foo::(42_u64); - | ^^^^^^ expected u16, found u64 + | ^^^^^^ expected `u16`, found `u64` | help: change the type of the numeric literal from `u64` to `u16` | @@ -750,7 +750,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:154:16 | LL | foo::(42_u32); - | ^^^^^^ expected u16, found u32 + | ^^^^^^ expected `u16`, found `u32` | help: change the type of the numeric literal from `u32` to `u16` | @@ -761,7 +761,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:157:16 | LL | foo::(42_u8); - | ^^^^^ expected u16, found u8 + | ^^^^^ expected `u16`, found `u8` | help: change the type of the numeric literal from `u8` to `u16` | @@ -772,7 +772,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:159:16 | LL | foo::(42_isize); - | ^^^^^^^^ expected u16, found isize + | ^^^^^^^^ expected `u16`, found `isize` | help: change the type of the numeric literal from `isize` to `u16` | @@ -783,7 +783,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:161:16 | LL | foo::(42_i64); - | ^^^^^^ expected u16, found i64 + | ^^^^^^ expected `u16`, found `i64` | help: change the type of the numeric literal from `i64` to `u16` | @@ -794,7 +794,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:163:16 | LL | foo::(42_i32); - | ^^^^^^ expected u16, found i32 + | ^^^^^^ expected `u16`, found `i32` | help: change the type of the numeric literal from `i32` to `u16` | @@ -805,7 +805,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:165:16 | LL | foo::(42_i16); - | ^^^^^^ expected u16, found i16 + | ^^^^^^ expected `u16`, found `i16` | help: change the type of the numeric literal from `i16` to `u16` | @@ -816,7 +816,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:167:16 | LL | foo::(42_i8); - | ^^^^^ expected u16, found i8 + | ^^^^^ expected `u16`, found `i8` | help: change the type of the numeric literal from `i8` to `u16` | @@ -827,7 +827,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:169:16 | LL | foo::(42.0_f64); - | ^^^^^^^^ expected u16, found f64 + | ^^^^^^^^ expected `u16`, found `f64` | help: change the type of the numeric literal from `f64` to `u16` | @@ -838,7 +838,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:171:16 | LL | foo::(42.0_f32); - | ^^^^^^^^ expected u16, found f32 + | ^^^^^^^^ expected `u16`, found `f32` | help: change the type of the numeric literal from `f32` to `u16` | @@ -849,7 +849,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:174:16 | LL | foo::(42_usize); - | ^^^^^^^^ expected i16, found usize + | ^^^^^^^^ expected `i16`, found `usize` | help: change the type of the numeric literal from `usize` to `i16` | @@ -860,7 +860,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:176:16 | LL | foo::(42_u64); - | ^^^^^^ expected i16, found u64 + | ^^^^^^ expected `i16`, found `u64` | help: change the type of the numeric literal from `u64` to `i16` | @@ -871,7 +871,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:178:16 | LL | foo::(42_u32); - | ^^^^^^ expected i16, found u32 + | ^^^^^^ expected `i16`, found `u32` | help: change the type of the numeric literal from `u32` to `i16` | @@ -882,7 +882,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:180:16 | LL | foo::(42_u16); - | ^^^^^^ expected i16, found u16 + | ^^^^^^ expected `i16`, found `u16` | help: change the type of the numeric literal from `u16` to `i16` | @@ -893,7 +893,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:182:16 | LL | foo::(42_u8); - | ^^^^^ expected i16, found u8 + | ^^^^^ expected `i16`, found `u8` | help: change the type of the numeric literal from `u8` to `i16` | @@ -904,7 +904,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:184:16 | LL | foo::(42_isize); - | ^^^^^^^^ expected i16, found isize + | ^^^^^^^^ expected `i16`, found `isize` | help: change the type of the numeric literal from `isize` to `i16` | @@ -915,7 +915,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:186:16 | LL | foo::(42_i64); - | ^^^^^^ expected i16, found i64 + | ^^^^^^ expected `i16`, found `i64` | help: change the type of the numeric literal from `i64` to `i16` | @@ -926,7 +926,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:188:16 | LL | foo::(42_i32); - | ^^^^^^ expected i16, found i32 + | ^^^^^^ expected `i16`, found `i32` | help: change the type of the numeric literal from `i32` to `i16` | @@ -937,7 +937,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:191:16 | LL | foo::(42_i8); - | ^^^^^ expected i16, found i8 + | ^^^^^ expected `i16`, found `i8` | help: change the type of the numeric literal from `i8` to `i16` | @@ -948,7 +948,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:193:16 | LL | foo::(42.0_f64); - | ^^^^^^^^ expected i16, found f64 + | ^^^^^^^^ expected `i16`, found `f64` | help: change the type of the numeric literal from `f64` to `i16` | @@ -959,7 +959,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:195:16 | LL | foo::(42.0_f32); - | ^^^^^^^^ expected i16, found f32 + | ^^^^^^^^ expected `i16`, found `f32` | help: change the type of the numeric literal from `f32` to `i16` | @@ -970,7 +970,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:198:15 | LL | foo::(42_usize); - | ^^^^^^^^ expected u8, found usize + | ^^^^^^^^ expected `u8`, found `usize` | help: change the type of the numeric literal from `usize` to `u8` | @@ -981,7 +981,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:200:15 | LL | foo::(42_u64); - | ^^^^^^ expected u8, found u64 + | ^^^^^^ expected `u8`, found `u64` | help: change the type of the numeric literal from `u64` to `u8` | @@ -992,7 +992,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:202:15 | LL | foo::(42_u32); - | ^^^^^^ expected u8, found u32 + | ^^^^^^ expected `u8`, found `u32` | help: change the type of the numeric literal from `u32` to `u8` | @@ -1003,7 +1003,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:204:15 | LL | foo::(42_u16); - | ^^^^^^ expected u8, found u16 + | ^^^^^^ expected `u8`, found `u16` | help: change the type of the numeric literal from `u16` to `u8` | @@ -1014,7 +1014,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:207:15 | LL | foo::(42_isize); - | ^^^^^^^^ expected u8, found isize + | ^^^^^^^^ expected `u8`, found `isize` | help: change the type of the numeric literal from `isize` to `u8` | @@ -1025,7 +1025,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:209:15 | LL | foo::(42_i64); - | ^^^^^^ expected u8, found i64 + | ^^^^^^ expected `u8`, found `i64` | help: change the type of the numeric literal from `i64` to `u8` | @@ -1036,7 +1036,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:211:15 | LL | foo::(42_i32); - | ^^^^^^ expected u8, found i32 + | ^^^^^^ expected `u8`, found `i32` | help: change the type of the numeric literal from `i32` to `u8` | @@ -1047,7 +1047,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:213:15 | LL | foo::(42_i16); - | ^^^^^^ expected u8, found i16 + | ^^^^^^ expected `u8`, found `i16` | help: change the type of the numeric literal from `i16` to `u8` | @@ -1058,7 +1058,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:215:15 | LL | foo::(42_i8); - | ^^^^^ expected u8, found i8 + | ^^^^^ expected `u8`, found `i8` | help: change the type of the numeric literal from `i8` to `u8` | @@ -1069,7 +1069,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:217:15 | LL | foo::(42.0_f64); - | ^^^^^^^^ expected u8, found f64 + | ^^^^^^^^ expected `u8`, found `f64` | help: change the type of the numeric literal from `f64` to `u8` | @@ -1080,7 +1080,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:219:15 | LL | foo::(42.0_f32); - | ^^^^^^^^ expected u8, found f32 + | ^^^^^^^^ expected `u8`, found `f32` | help: change the type of the numeric literal from `f32` to `u8` | @@ -1091,7 +1091,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:222:15 | LL | foo::(42_usize); - | ^^^^^^^^ expected i8, found usize + | ^^^^^^^^ expected `i8`, found `usize` | help: change the type of the numeric literal from `usize` to `i8` | @@ -1102,7 +1102,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:224:15 | LL | foo::(42_u64); - | ^^^^^^ expected i8, found u64 + | ^^^^^^ expected `i8`, found `u64` | help: change the type of the numeric literal from `u64` to `i8` | @@ -1113,7 +1113,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:226:15 | LL | foo::(42_u32); - | ^^^^^^ expected i8, found u32 + | ^^^^^^ expected `i8`, found `u32` | help: change the type of the numeric literal from `u32` to `i8` | @@ -1124,7 +1124,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:228:15 | LL | foo::(42_u16); - | ^^^^^^ expected i8, found u16 + | ^^^^^^ expected `i8`, found `u16` | help: change the type of the numeric literal from `u16` to `i8` | @@ -1135,7 +1135,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:230:15 | LL | foo::(42_u8); - | ^^^^^ expected i8, found u8 + | ^^^^^ expected `i8`, found `u8` | help: change the type of the numeric literal from `u8` to `i8` | @@ -1146,7 +1146,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:232:15 | LL | foo::(42_isize); - | ^^^^^^^^ expected i8, found isize + | ^^^^^^^^ expected `i8`, found `isize` | help: change the type of the numeric literal from `isize` to `i8` | @@ -1157,7 +1157,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:234:15 | LL | foo::(42_i64); - | ^^^^^^ expected i8, found i64 + | ^^^^^^ expected `i8`, found `i64` | help: change the type of the numeric literal from `i64` to `i8` | @@ -1168,7 +1168,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:236:15 | LL | foo::(42_i32); - | ^^^^^^ expected i8, found i32 + | ^^^^^^ expected `i8`, found `i32` | help: change the type of the numeric literal from `i32` to `i8` | @@ -1179,7 +1179,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:238:15 | LL | foo::(42_i16); - | ^^^^^^ expected i8, found i16 + | ^^^^^^ expected `i8`, found `i16` | help: change the type of the numeric literal from `i16` to `i8` | @@ -1190,7 +1190,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:241:15 | LL | foo::(42.0_f64); - | ^^^^^^^^ expected i8, found f64 + | ^^^^^^^^ expected `i8`, found `f64` | help: change the type of the numeric literal from `f64` to `i8` | @@ -1201,7 +1201,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:243:15 | LL | foo::(42.0_f32); - | ^^^^^^^^ expected i8, found f32 + | ^^^^^^^^ expected `i8`, found `f32` | help: change the type of the numeric literal from `f32` to `i8` | @@ -1212,7 +1212,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:246:16 | LL | foo::(42_usize); - | ^^^^^^^^ expected f64, found usize + | ^^^^^^^^ expected `f64`, found `usize` | help: change the type of the numeric literal from `usize` to `f64` | @@ -1223,7 +1223,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:248:16 | LL | foo::(42_u64); - | ^^^^^^ expected f64, found u64 + | ^^^^^^ expected `f64`, found `u64` | help: change the type of the numeric literal from `u64` to `f64` | @@ -1234,7 +1234,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:250:16 | LL | foo::(42_u32); - | ^^^^^^ expected f64, found u32 + | ^^^^^^ expected `f64`, found `u32` | help: you can convert an `u32` to `f64`, producing the floating point representation of the integer | @@ -1245,7 +1245,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:252:16 | LL | foo::(42_u16); - | ^^^^^^ expected f64, found u16 + | ^^^^^^ expected `f64`, found `u16` | help: you can convert an `u16` to `f64`, producing the floating point representation of the integer | @@ -1256,7 +1256,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:254:16 | LL | foo::(42_u8); - | ^^^^^ expected f64, found u8 + | ^^^^^ expected `f64`, found `u8` | help: you can convert an `u8` to `f64`, producing the floating point representation of the integer | @@ -1267,7 +1267,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:256:16 | LL | foo::(42_isize); - | ^^^^^^^^ expected f64, found isize + | ^^^^^^^^ expected `f64`, found `isize` | help: change the type of the numeric literal from `isize` to `f64` | @@ -1278,7 +1278,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:258:16 | LL | foo::(42_i64); - | ^^^^^^ expected f64, found i64 + | ^^^^^^ expected `f64`, found `i64` | help: change the type of the numeric literal from `i64` to `f64` | @@ -1289,7 +1289,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:260:16 | LL | foo::(42_i32); - | ^^^^^^ expected f64, found i32 + | ^^^^^^ expected `f64`, found `i32` | help: you can convert an `i32` to `f64`, producing the floating point representation of the integer | @@ -1300,7 +1300,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:262:16 | LL | foo::(42_i16); - | ^^^^^^ expected f64, found i16 + | ^^^^^^ expected `f64`, found `i16` | help: you can convert an `i16` to `f64`, producing the floating point representation of the integer | @@ -1311,7 +1311,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:264:16 | LL | foo::(42_i8); - | ^^^^^ expected f64, found i8 + | ^^^^^ expected `f64`, found `i8` | help: you can convert an `i8` to `f64`, producing the floating point representation of the integer | @@ -1322,7 +1322,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:267:16 | LL | foo::(42.0_f32); - | ^^^^^^^^ expected f64, found f32 + | ^^^^^^^^ expected `f64`, found `f32` | help: change the type of the numeric literal from `f32` to `f64` | @@ -1333,7 +1333,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:270:16 | LL | foo::(42_usize); - | ^^^^^^^^ expected f32, found usize + | ^^^^^^^^ expected `f32`, found `usize` | help: change the type of the numeric literal from `usize` to `f32` | @@ -1344,7 +1344,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:272:16 | LL | foo::(42_u64); - | ^^^^^^ expected f32, found u64 + | ^^^^^^ expected `f32`, found `u64` | help: change the type of the numeric literal from `u64` to `f32` | @@ -1355,7 +1355,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:274:16 | LL | foo::(42_u32); - | ^^^^^^ expected f32, found u32 + | ^^^^^^ expected `f32`, found `u32` | help: change the type of the numeric literal from `u32` to `f32` | @@ -1366,7 +1366,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:276:16 | LL | foo::(42_u16); - | ^^^^^^ expected f32, found u16 + | ^^^^^^ expected `f32`, found `u16` | help: you can convert an `u16` to `f32`, producing the floating point representation of the integer | @@ -1377,7 +1377,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:278:16 | LL | foo::(42_u8); - | ^^^^^ expected f32, found u8 + | ^^^^^ expected `f32`, found `u8` | help: you can convert an `u8` to `f32`, producing the floating point representation of the integer | @@ -1388,7 +1388,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:280:16 | LL | foo::(42_isize); - | ^^^^^^^^ expected f32, found isize + | ^^^^^^^^ expected `f32`, found `isize` | help: change the type of the numeric literal from `isize` to `f32` | @@ -1399,7 +1399,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:282:16 | LL | foo::(42_i64); - | ^^^^^^ expected f32, found i64 + | ^^^^^^ expected `f32`, found `i64` | help: change the type of the numeric literal from `i64` to `f32` | @@ -1410,7 +1410,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:284:16 | LL | foo::(42_i32); - | ^^^^^^ expected f32, found i32 + | ^^^^^^ expected `f32`, found `i32` | help: change the type of the numeric literal from `i32` to `f32` | @@ -1421,7 +1421,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:286:16 | LL | foo::(42_i16); - | ^^^^^^ expected f32, found i16 + | ^^^^^^ expected `f32`, found `i16` | help: you can convert an `i16` to `f32`, producing the floating point representation of the integer | @@ -1432,7 +1432,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:288:16 | LL | foo::(42_i8); - | ^^^^^ expected f32, found i8 + | ^^^^^ expected `f32`, found `i8` | help: you can convert an `i8` to `f32`, producing the floating point representation of the integer | @@ -1443,7 +1443,7 @@ error[E0308]: mismatched types --> $DIR/numeric-suffix.rs:290:16 | LL | foo::(42.0_f64); - | ^^^^^^^^ expected f32, found f64 + | ^^^^^^^^ expected `f32`, found `f64` | help: change the type of the numeric literal from `f64` to `f32` | @@ -1456,7 +1456,7 @@ error[E0308]: mismatched types LL | foo::(42_u8 as u16); | ^^^^^^^^^^^^ | | - | expected u32, found u16 + | expected `u32`, found `u16` | help: you can convert an `u16` to `u32`: `(42_u8 as u16).into()` error[E0308]: mismatched types @@ -1465,7 +1465,7 @@ error[E0308]: mismatched types LL | foo::(-42_i8); | ^^^^^^ | | - | expected i32, found i8 + | expected `i32`, found `i8` | help: you can convert an `i8` to `i32`: `(-42_i8).into()` error: aborting due to 134 previous errors diff --git a/src/test/ui/or-patterns/consistent-bindings.stderr b/src/test/ui/or-patterns/consistent-bindings.stderr index d787cae434362..433a02dfb3139 100644 --- a/src/test/ui/or-patterns/consistent-bindings.stderr +++ b/src/test/ui/or-patterns/consistent-bindings.stderr @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/consistent-bindings.rs:44:9 | LL | let () = 0; - | ^^ expected integer, found () + | ^^ expected integer, found `()` error: aborting due to previous error diff --git a/src/test/ui/or-patterns/issue-64879-trailing-before-guard.stderr b/src/test/ui/or-patterns/issue-64879-trailing-before-guard.stderr index 4502ae0c0cc3e..94435f2118b8a 100644 --- a/src/test/ui/or-patterns/issue-64879-trailing-before-guard.stderr +++ b/src/test/ui/or-patterns/issue-64879-trailing-before-guard.stderr @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/issue-64879-trailing-before-guard.rs:12:42 | LL | let recovery_witness: bool = 0; - | ^ expected bool, found integer + | ^ expected `bool`, found integer error: aborting due to 2 previous errors diff --git a/src/test/ui/or-patterns/or-pattern-mismatch.stderr b/src/test/ui/or-patterns/or-pattern-mismatch.stderr index be06f3666cb3e..253f3ef772525 100644 --- a/src/test/ui/or-patterns/or-pattern-mismatch.stderr +++ b/src/test/ui/or-patterns/or-pattern-mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/or-pattern-mismatch.rs:3:68 | LL | fn main() { match Blah::A(1, 1, 2) { Blah::A(_, x, y) | Blah::B(x, y) => { } } } - | ^ expected usize, found isize + | ^ expected `usize`, found `isize` error: aborting due to previous error diff --git a/src/test/ui/output-type-mismatch.stderr b/src/test/ui/output-type-mismatch.stderr index 91ee46c55a786..533bd87c9cccb 100644 --- a/src/test/ui/output-type-mismatch.stderr +++ b/src/test/ui/output-type-mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/output-type-mismatch.rs:5:31 | LL | fn main() { let i: isize; i = f(); } - | ^^^ expected isize, found () + | ^^^ expected `isize`, found `()` error: aborting due to previous error diff --git a/src/test/ui/parser/expr-as-stmt.stderr b/src/test/ui/parser/expr-as-stmt.stderr index 2a751e9d43a37..4d93e130901e7 100644 --- a/src/test/ui/parser/expr-as-stmt.stderr +++ b/src/test/ui/parser/expr-as-stmt.stderr @@ -47,25 +47,25 @@ error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:7:6 | LL | {2} + {2} - | ^ expected (), found integer + | ^ expected `()`, found integer error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:12:6 | LL | {2} + 2 - | ^ expected (), found integer + | ^ expected `()`, found integer error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:18:7 | LL | { 42 } + foo; - | ^^ expected (), found integer + | ^^ expected `()`, found integer error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:24:7 | LL | { 3 } * 3 - | ^ expected (), found integer + | ^ expected `()`, found integer error[E0614]: type `{integer}` cannot be dereferenced --> $DIR/expr-as-stmt.rs:24:11 diff --git a/src/test/ui/parser/fn-arg-doc-comment.rs b/src/test/ui/parser/fn-arg-doc-comment.rs index ad28c9d3dce34..2d1554183cccc 100644 --- a/src/test/ui/parser/fn-arg-doc-comment.rs +++ b/src/test/ui/parser/fn-arg-doc-comment.rs @@ -17,10 +17,10 @@ fn main() { // verify that the parser recovered and properly typechecked the args f("", ""); //~^ ERROR mismatched types - //~| NOTE expected u8, found &str + //~| NOTE expected `u8`, found `&str` //~| ERROR mismatched types - //~| NOTE expected u8, found &str + //~| NOTE expected `u8`, found `&str` bar(""); //~^ ERROR mismatched types - //~| NOTE expected i32, found &str + //~| NOTE expected `i32`, found `&str` } diff --git a/src/test/ui/parser/fn-arg-doc-comment.stderr b/src/test/ui/parser/fn-arg-doc-comment.stderr index 5ea1eef0e4f0d..41f2c080b9465 100644 --- a/src/test/ui/parser/fn-arg-doc-comment.stderr +++ b/src/test/ui/parser/fn-arg-doc-comment.stderr @@ -20,19 +20,19 @@ error[E0308]: mismatched types --> $DIR/fn-arg-doc-comment.rs:18:7 | LL | f("", ""); - | ^^ expected u8, found &str + | ^^ expected `u8`, found `&str` error[E0308]: mismatched types --> $DIR/fn-arg-doc-comment.rs:18:11 | LL | f("", ""); - | ^^ expected u8, found &str + | ^^ expected `u8`, found `&str` error[E0308]: mismatched types --> $DIR/fn-arg-doc-comment.rs:23:9 | LL | bar(""); - | ^^ expected i32, found &str + | ^^ expected `i32`, found `&str` error: aborting due to 6 previous errors diff --git a/src/test/ui/parser/issue-33413.stderr b/src/test/ui/parser/issue-33413.stderr index b0d41a27dc909..ac320f095a238 100644 --- a/src/test/ui/parser/issue-33413.stderr +++ b/src/test/ui/parser/issue-33413.stderr @@ -8,7 +8,7 @@ error[E0308]: mismatched types --> $DIR/issue-33413.rs:4:23 | LL | fn f(*, a: u8) -> u8 {} - | - ^^ expected u8, found () + | - ^^ expected `u8`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression diff --git a/src/test/ui/parser/issue-62881.stderr b/src/test/ui/parser/issue-62881.stderr index ddb97b40e9590..fdf772fcbdb77 100644 --- a/src/test/ui/parser/issue-62881.stderr +++ b/src/test/ui/parser/issue-62881.stderr @@ -17,7 +17,7 @@ error[E0308]: mismatched types --> $DIR/issue-62881.rs:3:29 | LL | fn f() -> isize { fn f() -> isize {} pub f< - | - ^^^^^ expected isize, found () + | - ^^^^^ expected `isize`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression diff --git a/src/test/ui/parser/issue-62895.stderr b/src/test/ui/parser/issue-62895.stderr index e46152fad0e5e..ed4d2340fc5bb 100644 --- a/src/test/ui/parser/issue-62895.stderr +++ b/src/test/ui/parser/issue-62895.stderr @@ -37,7 +37,7 @@ error[E0308]: mismatched types --> $DIR/issue-62895.rs:3:11 | LL | fn v() -> isize { - | - ^^^^^ expected isize, found () + | - ^^^^^ expected `isize`, found `()` | | | implicitly returns `()` as its body has no tail or `return` expression diff --git a/src/test/ui/parser/lex-bad-char-literals-6.stderr b/src/test/ui/parser/lex-bad-char-literals-6.stderr index db2b9c70a03a7..8f304bdf7131b 100644 --- a/src/test/ui/parser/lex-bad-char-literals-6.stderr +++ b/src/test/ui/parser/lex-bad-char-literals-6.stderr @@ -43,7 +43,7 @@ error[E0308]: mismatched types --> $DIR/lex-bad-char-literals-6.rs:15:20 | LL | let a: usize = ""; - | ^^ expected usize, found &str + | ^^ expected `usize`, found `&str` error[E0277]: can't compare `&str` with `char` --> $DIR/lex-bad-char-literals-6.rs:12:10 diff --git a/src/test/ui/parser/match-vec-invalid.stderr b/src/test/ui/parser/match-vec-invalid.stderr index b9d0f13c0651f..58343e86d7b2d 100644 --- a/src/test/ui/parser/match-vec-invalid.stderr +++ b/src/test/ui/parser/match-vec-invalid.stderr @@ -34,7 +34,7 @@ error[E0308]: mismatched types --> $DIR/match-vec-invalid.rs:13:30 | LL | const RECOVERY_WITNESS: () = 0; - | ^ expected (), found integer + | ^ expected `()`, found integer error: aborting due to 5 previous errors diff --git a/src/test/ui/parser/numeric-lifetime.stderr b/src/test/ui/parser/numeric-lifetime.stderr index 2ef6aa6f113c5..d9585e7cbf2f4 100644 --- a/src/test/ui/parser/numeric-lifetime.stderr +++ b/src/test/ui/parser/numeric-lifetime.stderr @@ -14,7 +14,7 @@ error[E0308]: mismatched types --> $DIR/numeric-lifetime.rs:6:20 | LL | let x: usize = ""; - | ^^ expected usize, found &str + | ^^ expected `usize`, found `&str` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/pat-lt-bracket-6.stderr b/src/test/ui/parser/pat-lt-bracket-6.stderr index bfb8866437bcd..cb8bf62a8fe0b 100644 --- a/src/test/ui/parser/pat-lt-bracket-6.stderr +++ b/src/test/ui/parser/pat-lt-bracket-6.stderr @@ -17,7 +17,7 @@ error[E0308]: mismatched types --> $DIR/pat-lt-bracket-6.rs:10:30 | LL | const RECOVERY_WITNESS: () = 0; - | ^ expected (), found integer + | ^ expected `()`, found integer error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/pat-lt-bracket-7.stderr b/src/test/ui/parser/pat-lt-bracket-7.stderr index d30a3bc0b1499..aa115659d47a4 100644 --- a/src/test/ui/parser/pat-lt-bracket-7.stderr +++ b/src/test/ui/parser/pat-lt-bracket-7.stderr @@ -8,7 +8,7 @@ error[E0308]: mismatched types --> $DIR/pat-lt-bracket-7.rs:9:30 | LL | const RECOVERY_WITNESS: () = 0; - | ^ expected (), found integer + | ^ expected `()`, found integer error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/pat-tuple-4.stderr b/src/test/ui/parser/pat-tuple-4.stderr index 9472237a22ef4..6c64290e144c2 100644 --- a/src/test/ui/parser/pat-tuple-4.stderr +++ b/src/test/ui/parser/pat-tuple-4.stderr @@ -17,7 +17,7 @@ error[E0308]: mismatched types --> $DIR/pat-tuple-4.rs:11:30 | LL | const RECOVERY_WITNESS: () = 0; - | ^ expected (), found integer + | ^ expected `()`, found integer error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/pat-tuple-5.stderr b/src/test/ui/parser/pat-tuple-5.stderr index 3513b516ea81a..3579a2c4e0951 100644 --- a/src/test/ui/parser/pat-tuple-5.stderr +++ b/src/test/ui/parser/pat-tuple-5.stderr @@ -19,7 +19,7 @@ error[E0308]: mismatched types LL | match (0, 1) { | ------ this match expression has type `({integer}, {integer})` LL | (PAT ..) => {} - | ^^^^^^ expected tuple, found u8 + | ^^^^^^ expected tuple, found `u8` | = note: expected tuple `({integer}, {integer})` found type `u8` diff --git a/src/test/ui/parser/recover-for-loop-parens-around-head.stderr b/src/test/ui/parser/recover-for-loop-parens-around-head.stderr index 74ac926cb0283..e97cf544ac268 100644 --- a/src/test/ui/parser/recover-for-loop-parens-around-head.stderr +++ b/src/test/ui/parser/recover-for-loop-parens-around-head.stderr @@ -17,7 +17,7 @@ error[E0308]: mismatched types --> $DIR/recover-for-loop-parens-around-head.rs:13:38 | LL | const RECOVERY_WITNESS: () = 0; - | ^ expected (), found integer + | ^ expected `()`, found integer error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/recover-from-homoglyph.stderr b/src/test/ui/parser/recover-from-homoglyph.stderr index 3f5a986f08684..51a7c8e08026a 100644 --- a/src/test/ui/parser/recover-from-homoglyph.stderr +++ b/src/test/ui/parser/recover-from-homoglyph.stderr @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/recover-from-homoglyph.rs:3:20 | LL | let x: usize = (); - | ^^ expected usize, found () + | ^^ expected `usize`, found `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/recover-missing-semi.stderr b/src/test/ui/parser/recover-missing-semi.stderr index 1ccf8b22c5364..b824f92dfaac9 100644 --- a/src/test/ui/parser/recover-missing-semi.stderr +++ b/src/test/ui/parser/recover-missing-semi.stderr @@ -20,13 +20,13 @@ error[E0308]: mismatched types --> $DIR/recover-missing-semi.rs:2:20 | LL | let _: usize = () - | ^^ expected usize, found () + | ^^ expected `usize`, found `()` error[E0308]: mismatched types --> $DIR/recover-missing-semi.rs:9:20 | LL | let _: usize = () - | ^^ expected usize, found () + | ^^ expected `usize`, found `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/parser/recover-tuple.stderr b/src/test/ui/parser/recover-tuple.stderr index 1bd2e9867533e..e6e094dc2e3af 100644 --- a/src/test/ui/parser/recover-tuple.stderr +++ b/src/test/ui/parser/recover-tuple.stderr @@ -8,7 +8,7 @@ error[E0308]: mismatched types --> $DIR/recover-tuple.rs:6:20 | LL | let y: usize = ""; - | ^^ expected usize, found &str + | ^^ expected `usize`, found `&str` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/require-parens-for-chained-comparison.stderr b/src/test/ui/parser/require-parens-for-chained-comparison.stderr index f57668812490c..bece9a388008c 100644 --- a/src/test/ui/parser/require-parens-for-chained-comparison.stderr +++ b/src/test/ui/parser/require-parens-for-chained-comparison.stderr @@ -45,13 +45,13 @@ error[E0308]: mismatched types --> $DIR/require-parens-for-chained-comparison.rs:8:14 | LL | false == 0 < 2; - | ^ expected bool, found integer + | ^ expected `bool`, found integer error[E0308]: mismatched types --> $DIR/require-parens-for-chained-comparison.rs:8:18 | LL | false == 0 < 2; - | ^ expected bool, found integer + | ^ expected `bool`, found integer error: aborting due to 7 previous errors diff --git a/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr b/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr index 5f70588c0b206..d12ea0b2fcb9a 100644 --- a/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr +++ b/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr @@ -21,7 +21,7 @@ LL | while || Foo { | ___________^ LL | | x: 3 LL | | }.hi() { - | |__________^ expected bool, found closure + | |__________^ expected `bool`, found closure | = note: expected type `bool` found closure `[closure@$DIR/struct-literal-restrictions-in-lamda.rs:12:11: 14:11]` diff --git a/src/test/ui/parser/unclosed-delimiter-in-dep.stderr b/src/test/ui/parser/unclosed-delimiter-in-dep.stderr index c4a9251b1b1db..426748b5086bb 100644 --- a/src/test/ui/parser/unclosed-delimiter-in-dep.stderr +++ b/src/test/ui/parser/unclosed-delimiter-in-dep.stderr @@ -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 `std::result::Result` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found enum `std::result::Result` | = note: expected type `usize` found enum `std::result::Result` diff --git a/src/test/ui/pattern/pat-tuple-bad-type.stderr b/src/test/ui/pattern/pat-tuple-bad-type.stderr index a6224d8989437..95cca38f7de14 100644 --- a/src/test/ui/pattern/pat-tuple-bad-type.stderr +++ b/src/test/ui/pattern/pat-tuple-bad-type.stderr @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/pat-tuple-bad-type.rs:10:9 | LL | (..) => {} - | ^^^^ expected u8, found () + | ^^^^ expected `u8`, found `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/pattern/pattern-error-continue.rs b/src/test/ui/pattern/pattern-error-continue.rs index eb57210f45474..8635622ab37cc 100644 --- a/src/test/ui/pattern/pattern-error-continue.rs +++ b/src/test/ui/pattern/pattern-error-continue.rs @@ -21,13 +21,13 @@ fn main() { match 'c' { S { .. } => (), //~^ ERROR mismatched types - //~| expected char, found struct `S` + //~| expected `char`, found struct `S` _ => () } f(true); //~^ ERROR mismatched types - //~| expected char, found bool + //~| expected `char`, found `bool` match () { E::V => {} //~ ERROR failed to resolve: use of undeclared type or module `E` diff --git a/src/test/ui/pattern/pattern-error-continue.stderr b/src/test/ui/pattern/pattern-error-continue.stderr index 22da0d5e0db3a..2f9fe1981bcbc 100644 --- a/src/test/ui/pattern/pattern-error-continue.stderr +++ b/src/test/ui/pattern/pattern-error-continue.stderr @@ -30,13 +30,13 @@ error[E0308]: mismatched types LL | match 'c' { | --- this match expression has type `char` LL | S { .. } => (), - | ^^^^^^^^ expected char, found struct `S` + | ^^^^^^^^ expected `char`, found struct `S` error[E0308]: mismatched types --> $DIR/pattern-error-continue.rs:28:7 | LL | f(true); - | ^^^^ expected char, found bool + | ^^^^ expected `char`, found `bool` error: aborting due to 5 previous errors diff --git a/src/test/ui/pattern/pattern-ident-path-generics.stderr b/src/test/ui/pattern/pattern-ident-path-generics.stderr index 4805b0f2d57a2..338eb6ff0c83b 100644 --- a/src/test/ui/pattern/pattern-ident-path-generics.stderr +++ b/src/test/ui/pattern/pattern-ident-path-generics.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/pattern-ident-path-generics.rs:3:9 | LL | None:: => {} - | ^^^^^^^^^^^^^ expected &str, found isize + | ^^^^^^^^^^^^^ expected `&str`, found `isize` | = note: expected enum `std::option::Option<&str>` found enum `std::option::Option` diff --git a/src/test/ui/pattern/pattern-tyvar.stderr b/src/test/ui/pattern/pattern-tyvar.stderr index 54e0e5b53a438..b2afeacdf68c2 100644 --- a/src/test/ui/pattern/pattern-tyvar.stderr +++ b/src/test/ui/pattern/pattern-tyvar.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match t { | - this match expression has type `std::option::Option>` LL | Bar::T1(_, Some::(x)) => { - | ^^^^^^^^^^^^^^^^ expected struct `std::vec::Vec`, found isize + | ^^^^^^^^^^^^^^^^ expected struct `std::vec::Vec`, found `isize` | = note: expected enum `std::option::Option>` found enum `std::option::Option` diff --git a/src/test/ui/point-to-type-err-cause-on-impl-trait-return-2.stderr b/src/test/ui/point-to-type-err-cause-on-impl-trait-return-2.stderr index c61f9a7039b25..f5a5f1ab37ae6 100644 --- a/src/test/ui/point-to-type-err-cause-on-impl-trait-return-2.stderr +++ b/src/test/ui/point-to-type-err-cause-on-impl-trait-return-2.stderr @@ -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}` diff --git a/src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr b/src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr index b73ab6e5d9f18..d5ea2ba39a90e 100644 --- a/src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr +++ b/src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr @@ -8,7 +8,7 @@ LL | return 0i32; | ---- ...is found to be `i32` here LL | } LL | 1u32 - | ^^^^ expected i32, found u32 + | ^^^^ expected `i32`, found `u32` error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:13:16 @@ -20,7 +20,7 @@ LL | return 0i32; | ---- ...is found to be `i32` here LL | } else { LL | return 1u32; - | ^^^^ expected i32, found u32 + | ^^^^ expected `i32`, found `u32` error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:22:9 @@ -32,7 +32,7 @@ LL | return 0i32; | ---- ...is found to be `i32` here LL | } else { LL | 1u32 - | ^^^^ expected i32, found u32 + | ^^^^ expected `i32`, found `u32` error[E0308]: if and else have incompatible types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:31:9 @@ -42,7 +42,7 @@ LL | | 0i32 | | ---- expected because of this LL | | } else { LL | | 1u32 - | | ^^^^ expected i32, found u32 + | | ^^^^ expected `i32`, found `u32` LL | | LL | | } | |_____- if and else have incompatible types @@ -56,7 +56,7 @@ LL | match 13 { LL | 0 => return 0i32, | ---- ...is found to be `i32` here LL | _ => 1u32, - | ^^^^ expected i32, found u32 + | ^^^^ expected `i32`, found `u32` error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:45:5 @@ -70,7 +70,7 @@ LL | | 0 => return 0i32, LL | | 1 => 1u32, LL | | _ => 2u32, LL | | } - | |_____^ expected i32, found u32 + | |_____^ expected `i32`, found `u32` error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:59:13 @@ -82,7 +82,7 @@ LL | return 0i32; | ---- ...is found to be `i32` here ... LL | 1u32 - | ^^^^ expected i32, found u32 + | ^^^^ expected `i32`, found `u32` error: aborting due to 7 previous errors diff --git a/src/test/ui/pptypedef.rs b/src/test/ui/pptypedef.rs index 80ebf0242ecc8..e28d323f88371 100644 --- a/src/test/ui/pptypedef.rs +++ b/src/test/ui/pptypedef.rs @@ -3,9 +3,9 @@ fn let_in(x: T, f: F) where F: FnOnce(T) {} fn main() { let_in(3u32, |i| { assert!(i == 3i32); }); //~^ ERROR mismatched types - //~| expected u32, found i32 + //~| expected `u32`, found `i32` let_in(3i32, |i| { assert!(i == 3u32); }); //~^ ERROR mismatched types - //~| expected i32, found u32 + //~| expected `i32`, found `u32` } diff --git a/src/test/ui/pptypedef.stderr b/src/test/ui/pptypedef.stderr index 0886622247a77..40155de9c7702 100644 --- a/src/test/ui/pptypedef.stderr +++ b/src/test/ui/pptypedef.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/pptypedef.rs:4:37 | LL | let_in(3u32, |i| { assert!(i == 3i32); }); - | ^^^^ expected u32, found i32 + | ^^^^ expected `u32`, found `i32` | help: change the type of the numeric literal from `i32` to `u32` | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/pptypedef.rs:8:37 | LL | let_in(3i32, |i| { assert!(i == 3u32); }); - | ^^^^ expected i32, found u32 + | ^^^^ expected `i32`, found `u32` | help: change the type of the numeric literal from `u32` to `i32` | diff --git a/src/test/ui/proc-macro/attribute-spans-preserved.stderr b/src/test/ui/proc-macro/attribute-spans-preserved.stderr index 34a203300949b..d107697d2bf00 100644 --- a/src/test/ui/proc-macro/attribute-spans-preserved.stderr +++ b/src/test/ui/proc-macro/attribute-spans-preserved.stderr @@ -2,13 +2,13 @@ error[E0308]: mismatched types --> $DIR/attribute-spans-preserved.rs:7:23 | LL | #[ foo ( let y: u32 = "z"; ) ] - | ^^^ expected u32, found &str + | ^^^ expected `u32`, found `&str` error[E0308]: mismatched types --> $DIR/attribute-spans-preserved.rs:8:23 | LL | #[ bar { let x: u32 = "y"; } ] - | ^^^ expected u32, found &str + | ^^^ expected `u32`, found `&str` error: aborting due to 2 previous errors diff --git a/src/test/ui/proc-macro/attribute-with-error.stderr b/src/test/ui/proc-macro/attribute-with-error.stderr index e810e9ad65882..391a259c3800a 100644 --- a/src/test/ui/proc-macro/attribute-with-error.stderr +++ b/src/test/ui/proc-macro/attribute-with-error.stderr @@ -2,25 +2,25 @@ error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:10:18 | LL | let a: i32 = "foo"; - | ^^^^^ expected i32, found &str + | ^^^^^ expected `i32`, found `&str` error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:12:18 | LL | let b: i32 = "f'oo"; - | ^^^^^^ expected i32, found &str + | ^^^^^^ expected `i32`, found `&str` error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:25:22 | LL | let a: i32 = "foo"; - | ^^^^^ expected i32, found &str + | ^^^^^ expected `i32`, found `&str` error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:35:22 | LL | let a: i32 = "foo"; - | ^^^^^ expected i32, found &str + | ^^^^^ expected `i32`, found `&str` error: aborting due to 4 previous errors diff --git a/src/test/ui/proc-macro/issue-37788.stderr b/src/test/ui/proc-macro/issue-37788.stderr index 9c35115857f8c..f2c833e69f98c 100644 --- a/src/test/ui/proc-macro/issue-37788.stderr +++ b/src/test/ui/proc-macro/issue-37788.stderr @@ -7,7 +7,7 @@ LL | // Test that constructing the `visible_parent_map` (in `cstore_impl.rs` LL | std::cell::Cell::new(0) | ^^^^^^^^^^^^^^^^^^^^^^^- help: try adding a semicolon: `;` | | - | expected (), found struct `std::cell::Cell` + | expected `()`, found struct `std::cell::Cell` | = note: expected unit type `()` found struct `std::cell::Cell<{integer}>` diff --git a/src/test/ui/proc-macro/macro-brackets.stderr b/src/test/ui/proc-macro/macro-brackets.stderr index 7447b5c15eef0..9aaf612eb54a1 100644 --- a/src/test/ui/proc-macro/macro-brackets.stderr +++ b/src/test/ui/proc-macro/macro-brackets.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/macro-brackets.rs:11:21 | LL | id![static X: u32 = 'a';]; - | ^^^ expected u32, found char + | ^^^ expected `u32`, found `char` error: aborting due to previous error diff --git a/src/test/ui/proc-macro/nested-item-spans.stderr b/src/test/ui/proc-macro/nested-item-spans.stderr index e6d1c9356ea76..09e13c7014b07 100644 --- a/src/test/ui/proc-macro/nested-item-spans.stderr +++ b/src/test/ui/proc-macro/nested-item-spans.stderr @@ -2,13 +2,13 @@ error[E0308]: mismatched types --> $DIR/nested-item-spans.rs:9:22 | LL | let x: u32 = "x"; - | ^^^ expected u32, found &str + | ^^^ expected `u32`, found `&str` error[E0308]: mismatched types --> $DIR/nested-item-spans.rs:18:22 | LL | let x: u32 = "x"; - | ^^^ expected u32, found &str + | ^^^ expected `u32`, found `&str` error: aborting due to 2 previous errors diff --git a/src/test/ui/proc-macro/span-preservation.stderr b/src/test/ui/proc-macro/span-preservation.stderr index 86d2bee20683b..f669b4e9265d1 100644 --- a/src/test/ui/proc-macro/span-preservation.stderr +++ b/src/test/ui/proc-macro/span-preservation.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/span-preservation.rs:11:20 | LL | let x: usize = "hello"; - | ^^^^^^^ expected usize, found &str + | ^^^^^^^ expected `usize`, found `&str` error[E0308]: mismatched types --> $DIR/span-preservation.rs:17:29 @@ -11,13 +11,13 @@ LL | fn b(x: Option) -> usize { | ----- expected `usize` because of return type LL | match x { LL | Some(x) => { return x }, - | ^ expected usize, found isize + | ^ expected `usize`, found `isize` error[E0308]: mismatched types --> $DIR/span-preservation.rs:33:22 | LL | let x = Foo { a: 10isize }; - | ^^^^^^^ expected usize, found isize + | ^^^^^^^ expected `usize`, found `isize` error[E0560]: struct `c::Foo` has no field named `b` --> $DIR/span-preservation.rs:34:26 @@ -44,7 +44,7 @@ error[E0308]: mismatched types LL | extern "C" fn baz() { | - possibly return type missing here? LL | 0 - | ^ expected (), found integer + | ^ expected `()`, found integer error[E0308]: mismatched types --> $DIR/span-preservation.rs:49:5 diff --git a/src/test/ui/range/range-1.stderr b/src/test/ui/range/range-1.stderr index bbc2abea51df7..05009358106fa 100644 --- a/src/test/ui/range/range-1.stderr +++ b/src/test/ui/range/range-1.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/range-1.rs:5:19 | LL | let _ = 0u32..10i32; - | ^^^^^ expected u32, found i32 + | ^^^^^ expected `u32`, found `i32` error[E0277]: the trait bound `bool: std::iter::Step` is not satisfied --> $DIR/range-1.rs:9:14 diff --git a/src/test/ui/repeat_count.rs b/src/test/ui/repeat_count.rs index 7e899ec37d244..aca7af144a934 100644 --- a/src/test/ui/repeat_count.rs +++ b/src/test/ui/repeat_count.rs @@ -6,26 +6,26 @@ fn main() { //~^ ERROR attempt to use a non-constant value in a constant [E0435] let b = [0; ()]; //~^ ERROR mismatched types - //~| expected usize, found () + //~| expected `usize`, found `()` let c = [0; true]; //~^ ERROR mismatched types - //~| expected usize, found bool + //~| expected `usize`, found `bool` let d = [0; 0.5]; //~^ ERROR mismatched types - //~| expected usize, found floating-point number + //~| expected `usize`, found floating-point number let e = [0; "foo"]; //~^ ERROR mismatched types - //~| expected usize, found &str + //~| expected `usize`, found `&str` let f = [0; -4_isize]; //~^ ERROR mismatched types - //~| expected usize, found isize + //~| expected `usize`, found `isize` let f = [0_usize; -1_isize]; //~^ ERROR mismatched types - //~| expected usize, found isize + //~| expected `usize`, found `isize` struct G { g: (), } let g = [0; G { g: () }]; //~^ ERROR mismatched types - //~| expected usize, found struct `main::G` + //~| expected `usize`, found struct `main::G` } diff --git a/src/test/ui/repeat_count.stderr b/src/test/ui/repeat_count.stderr index 76e90af7557a8..efad00b272cdc 100644 --- a/src/test/ui/repeat_count.stderr +++ b/src/test/ui/repeat_count.stderr @@ -8,31 +8,31 @@ error[E0308]: mismatched types --> $DIR/repeat_count.rs:7:17 | LL | let b = [0; ()]; - | ^^ expected usize, found () + | ^^ expected `usize`, found `()` error[E0308]: mismatched types --> $DIR/repeat_count.rs:10:17 | LL | let c = [0; true]; - | ^^^^ expected usize, found bool + | ^^^^ expected `usize`, found `bool` error[E0308]: mismatched types --> $DIR/repeat_count.rs:13:17 | LL | let d = [0; 0.5]; - | ^^^ expected usize, found floating-point number + | ^^^ expected `usize`, found floating-point number error[E0308]: mismatched types --> $DIR/repeat_count.rs:16:17 | LL | let e = [0; "foo"]; - | ^^^^^ expected usize, found &str + | ^^^^^ expected `usize`, found `&str` error[E0308]: mismatched types --> $DIR/repeat_count.rs:19:17 | LL | let f = [0; -4_isize]; - | ^^^^^^^^ expected usize, found isize + | ^^^^^^^^ expected `usize`, found `isize` | help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit | @@ -43,7 +43,7 @@ error[E0308]: mismatched types --> $DIR/repeat_count.rs:22:23 | LL | let f = [0_usize; -1_isize]; - | ^^^^^^^^ expected usize, found isize + | ^^^^^^^^ expected `usize`, found `isize` | help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit | @@ -54,7 +54,7 @@ error[E0308]: mismatched types --> $DIR/repeat_count.rs:28:17 | LL | let g = [0; G { g: () }]; - | ^^^^^^^^^^^ expected usize, found struct `main::G` + | ^^^^^^^^^^^ expected `usize`, found struct `main::G` error: aborting due to 8 previous errors diff --git a/src/test/ui/resolve/name-clash-nullary.stderr b/src/test/ui/resolve/name-clash-nullary.stderr index 7977d7cd20f97..aeeb0c4519161 100644 --- a/src/test/ui/resolve/name-clash-nullary.stderr +++ b/src/test/ui/resolve/name-clash-nullary.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/name-clash-nullary.rs:2:7 | LL | let None: isize = 42; - | ^^^^ expected isize, found enum `std::option::Option` + | ^^^^ expected `isize`, found enum `std::option::Option` | = note: expected type `isize` found enum `std::option::Option<_>` diff --git a/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr b/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr index 361c79dabd14f..58455024d3827 100644 --- a/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr +++ b/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr @@ -24,13 +24,13 @@ error[E0308]: mismatched types --> $DIR/resolve-inconsistent-binding-mode.rs:7:32 | LL | Opts::A(ref i) | Opts::B(i) => {} - | ^ expected &isize, found isize + | ^ expected `&isize`, found `isize` error[E0308]: mismatched types --> $DIR/resolve-inconsistent-binding-mode.rs:16:32 | LL | Opts::A(ref i) | Opts::B(i) => {} - | ^ expected &isize, found isize + | ^ expected `&isize`, found `isize` error[E0308]: mismatched types --> $DIR/resolve-inconsistent-binding-mode.rs:25:36 diff --git a/src/test/ui/resolve/resolve-inconsistent-names.stderr b/src/test/ui/resolve/resolve-inconsistent-names.stderr index 04edc2da25651..271495012dab5 100644 --- a/src/test/ui/resolve/resolve-inconsistent-names.stderr +++ b/src/test/ui/resolve/resolve-inconsistent-names.stderr @@ -87,7 +87,7 @@ error[E0308]: mismatched types --> $DIR/resolve-inconsistent-names.rs:19:19 | LL | (A, B) | (ref B, c) | (c, A) => () - | ^^^^^ expected enum `E`, found &E + | ^^^^^ expected enum `E`, found `&E` error: aborting due to 9 previous errors diff --git a/src/test/ui/return/return-from-diverging.stderr b/src/test/ui/return/return-from-diverging.stderr index c1dcc1d5d8fb5..0c1fb4d9c593a 100644 --- a/src/test/ui/return/return-from-diverging.stderr +++ b/src/test/ui/return/return-from-diverging.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn fail() -> ! { | - expected `!` because of return type LL | return "wow"; - | ^^^^^ expected !, found &str + | ^^^^^ expected `!`, found `&str` | = note: expected type `!` found reference `&'static str` diff --git a/src/test/ui/return/return-type.stderr b/src/test/ui/return/return-type.stderr index 40f1234710123..535428f1c91f7 100644 --- a/src/test/ui/return/return-type.stderr +++ b/src/test/ui/return/return-type.stderr @@ -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 struct `S` | = note: expected unit type `()` found struct `S` diff --git a/src/test/ui/rfc-2005-default-binding-mode/const.stderr b/src/test/ui/rfc-2005-default-binding-mode/const.stderr index 8e1873c06593d..f25fc300d7f3f 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/const.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/const.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/const.rs:14:9 | LL | FOO => {}, - | ^^^ expected &Foo, found struct `Foo` + | ^^^ expected `&Foo`, found struct `Foo` error: aborting due to previous error diff --git a/src/test/ui/rfc-2005-default-binding-mode/lit.stderr b/src/test/ui/rfc-2005-default-binding-mode/lit.stderr index fd48c56c07b79..b0d60c7a4c83f 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/lit.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/lit.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/lit.rs:7:13 | LL | "abc" => true, - | ^^^^^ expected &str, found str + | ^^^^^ expected `&str`, found `str` | = note: expected type `&&str` found reference `&'static str` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/lit.rs:16:9 | LL | b"abc" => true, - | ^^^^^^ expected &[u8], found array `[u8; 3]` + | ^^^^^^ expected `&[u8]`, found array `[u8; 3]` | = note: expected type `&&[u8]` found reference `&'static [u8; 3]` diff --git a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr index a04b109ba6d3c..05e30a8010aa1 100644 --- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr +++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr @@ -537,7 +537,7 @@ error[E0308]: mismatched types LL | if &let 0 = 0 {} | ^^^^^^^^^^ | | - | expected bool, found &bool + | expected `bool`, found `&bool` | help: consider removing the borrow: `let 0 = 0` error[E0614]: type `bool` cannot be dereferenced @@ -578,14 +578,14 @@ error[E0308]: mismatched types LL | if x = let 0 = 0 {} | ^^^^^^^^^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `x == let 0 = 0` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:59:8 | LL | if true..(let 0 = 0) {} - | ^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` + | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -594,7 +594,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:61:8 | LL | if ..(let 0 = 0) {} - | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeTo` + | ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeTo` | = note: expected type `bool` found struct `std::ops::RangeTo` @@ -603,7 +603,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:63:8 | LL | if (let 0 = 0).. {} - | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeFrom` + | ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeFrom` | = note: expected type `bool` found struct `std::ops::RangeFrom` @@ -614,7 +614,7 @@ error[E0308]: mismatched types LL | if let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool` | | - | expected bool, found struct `std::ops::Range` + | expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -623,7 +623,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:67:8 | LL | if let Range { start: _, end: _ } = true..true && false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -634,7 +634,7 @@ error[E0308]: mismatched types LL | if let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool` | | - | expected bool, found struct `std::ops::Range` + | expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -643,7 +643,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:71:8 | LL | if let Range { start: _, end: _ } = true..true || false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -661,7 +661,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:78:41 | LL | if let Range { start: F, end } = F..|| true {} - | ^^^^^^^ expected bool, found closure + | ^^^^^^^ expected `bool`, found closure | = note: expected type `bool` found closure `[closure@$DIR/disallowed-positions.rs:78:41: 78:48]` @@ -670,7 +670,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:78:8 | LL | if let Range { start: F, end } = F..|| true {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -681,7 +681,7 @@ error[E0308]: mismatched types LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this match expression has type `bool` | | - | expected bool, found struct `std::ops::Range` + | expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -690,13 +690,13 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:86:44 | LL | if let Range { start: true, end } = t..&&false {} - | ^^^^^^^ expected bool, found &&bool + | ^^^^^^^ expected `bool`, found `&&bool` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:86:8 | LL | if let Range { start: true, end } = t..&&false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -716,7 +716,7 @@ error[E0308]: mismatched types LL | while &let 0 = 0 {} | ^^^^^^^^^^ | | - | expected bool, found &bool + | expected `bool`, found `&bool` | help: consider removing the borrow: `let 0 = 0` error[E0614]: type `bool` cannot be dereferenced @@ -757,14 +757,14 @@ error[E0308]: mismatched types LL | while x = let 0 = 0 {} | ^^^^^^^^^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `x == let 0 = 0` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:123:11 | LL | while true..(let 0 = 0) {} - | ^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` + | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -773,7 +773,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:125:11 | LL | while ..(let 0 = 0) {} - | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeTo` + | ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeTo` | = note: expected type `bool` found struct `std::ops::RangeTo` @@ -782,7 +782,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:127:11 | LL | while (let 0 = 0).. {} - | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeFrom` + | ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeFrom` | = note: expected type `bool` found struct `std::ops::RangeFrom` @@ -793,7 +793,7 @@ error[E0308]: mismatched types LL | while let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool` | | - | expected bool, found struct `std::ops::Range` + | expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -802,7 +802,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:131:11 | LL | while let Range { start: _, end: _ } = true..true && false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -813,7 +813,7 @@ error[E0308]: mismatched types LL | while let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool` | | - | expected bool, found struct `std::ops::Range` + | expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -822,7 +822,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:135:11 | LL | while let Range { start: _, end: _ } = true..true || false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -840,7 +840,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:142:44 | LL | while let Range { start: F, end } = F..|| true {} - | ^^^^^^^ expected bool, found closure + | ^^^^^^^ expected `bool`, found closure | = note: expected type `bool` found closure `[closure@$DIR/disallowed-positions.rs:142:44: 142:51]` @@ -849,7 +849,7 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:142:11 | LL | while let Range { start: F, end } = F..|| true {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -860,7 +860,7 @@ error[E0308]: mismatched types LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this match expression has type `bool` | | - | expected bool, found struct `std::ops::Range` + | expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -869,13 +869,13 @@ error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:150:47 | LL | while let Range { start: true, end } = t..&&false {} - | ^^^^^^^ expected bool, found &&bool + | ^^^^^^^ expected `bool`, found `&&bool` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:150:11 | LL | while let Range { start: true, end } = t..&&false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range` @@ -927,7 +927,7 @@ error[E0308]: mismatched types LL | (let Range { start: _, end: _ } = true..true || false); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool` | | - | expected bool, found struct `std::ops::Range` + | expected `bool`, found struct `std::ops::Range` | = note: expected type `bool` found struct `std::ops::Range<_>` @@ -939,7 +939,7 @@ LL | fn outside_if_and_while_expr() { | - help: try adding a return type: `-> &bool` ... LL | &let 0 = 0 - | ^^^^^^^^^^ expected (), found &bool + | ^^^^^^^^^^ expected `()`, found `&bool` error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try` --> $DIR/disallowed-positions.rs:179:17 diff --git a/src/test/ui/shift-various-bad-types.rs b/src/test/ui/shift-various-bad-types.rs index f3857461c9dce..31224bbca1efc 100644 --- a/src/test/ui/shift-various-bad-types.rs +++ b/src/test/ui/shift-various-bad-types.rs @@ -24,7 +24,7 @@ fn foo(p: &Panolpy) { // Type of the result follows the LHS, not the RHS: let _: i32 = 22_i64 >> 1_i32; //~^ ERROR mismatched types - //~| expected i32, found i64 + //~| expected `i32`, found `i64` } fn main() { diff --git a/src/test/ui/shift-various-bad-types.stderr b/src/test/ui/shift-various-bad-types.stderr index c7a9588322651..3be1217440b7e 100644 --- a/src/test/ui/shift-various-bad-types.stderr +++ b/src/test/ui/shift-various-bad-types.stderr @@ -26,7 +26,7 @@ error[E0308]: mismatched types --> $DIR/shift-various-bad-types.rs:25:18 | LL | let _: i32 = 22_i64 >> 1_i32; - | ^^^^^^^^^^^^^^^ expected i32, found i64 + | ^^^^^^^^^^^^^^^ expected `i32`, found `i64` | help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit | diff --git a/src/test/ui/span/coerce-suggestions.stderr b/src/test/ui/span/coerce-suggestions.stderr index da9ac04e34883..5918888ff89a3 100644 --- a/src/test/ui/span/coerce-suggestions.stderr +++ b/src/test/ui/span/coerce-suggestions.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:7:20 | LL | let x: usize = String::new(); - | ^^^^^^^^^^^^^ expected usize, found struct `std::string::String` + | ^^^^^^^^^^^^^ expected `usize`, found struct `std::string::String` error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:9:19 @@ -10,7 +10,7 @@ error[E0308]: mismatched types LL | let x: &str = String::new(); | ^^^^^^^^^^^^^ | | - | expected &str, found struct `std::string::String` + | expected `&str`, found struct `std::string::String` | help: consider borrowing here: `&String::new()` error[E0308]: mismatched types @@ -44,7 +44,7 @@ error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:21:9 | LL | s = format!("foo"); - | ^^^^^^^^^^^^^^ expected &mut std::string::String, found struct `std::string::String` + | ^^^^^^^^^^^^^^ expected `&mut std::string::String`, found struct `std::string::String` | = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) diff --git a/src/test/ui/span/issue-34264.stderr b/src/test/ui/span/issue-34264.stderr index c0e9d6cfab8cf..56a2686945ca2 100644 --- a/src/test/ui/span/issue-34264.stderr +++ b/src/test/ui/span/issue-34264.stderr @@ -55,7 +55,7 @@ error[E0308]: mismatched types --> $DIR/issue-34264.rs:8:13 | LL | bar("", ""); - | ^^ expected usize, found &str + | ^^ expected `usize`, found `&str` error[E0061]: this function takes 2 parameters but 3 parameters were supplied --> $DIR/issue-34264.rs:10:5 diff --git a/src/test/ui/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr index e2ba768d7a3e8..9637d1d82ec7e 100644 --- a/src/test/ui/span/issue-39018.stderr +++ b/src/test/ui/span/issue-39018.stderr @@ -70,7 +70,7 @@ error[E0308]: mismatched types LL | let _ = a + b; | ^ | | - | expected &str, found struct `std::string::String` + | expected `&str`, found struct `std::string::String` | help: consider borrowing here: `&b` error[E0369]: binary operation `+` cannot be applied to type `&std::string::String` diff --git a/src/test/ui/span/move-closure.stderr b/src/test/ui/span/move-closure.stderr index f6ee7d4d44e7f..9914d7e850711 100644 --- a/src/test/ui/span/move-closure.stderr +++ b/src/test/ui/span/move-closure.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/move-closure.rs:5:17 | LL | let x: () = move || (); - | ^^^^^^^^^^ expected (), found closure + | ^^^^^^^^^^ expected `()`, found closure | = note: expected unit type `()` found closure `[closure@$DIR/move-closure.rs:5:17: 5:27]` diff --git a/src/test/ui/specialization/specialization-default-projection.stderr b/src/test/ui/specialization/specialization-default-projection.stderr index bad7fc35edf3d..d03aec7ab30d4 100644 --- a/src/test/ui/specialization/specialization-default-projection.stderr +++ b/src/test/ui/specialization/specialization-default-projection.stderr @@ -5,7 +5,7 @@ LL | fn generic() -> ::Assoc { | ----------------- expected `::Assoc` because of return type ... LL | () - | ^^ expected associated type, found () + | ^^ expected associated type, found `()` | = note: expected associated type `::Assoc` found unit type `()` @@ -21,7 +21,7 @@ LL | fn monomorphic() -> () { LL | generic::<()>() | ^^^^^^^^^^^^^^^- help: try adding a semicolon: `;` | | - | expected (), found associated type + | expected `()`, found associated type | = note: expected unit type `()` found associated type `<() as Foo>::Assoc` diff --git a/src/test/ui/static/static-mut-bad-types.stderr b/src/test/ui/static/static-mut-bad-types.stderr index 88d62011fc4e8..ddd98ff40798a 100644 --- a/src/test/ui/static/static-mut-bad-types.stderr +++ b/src/test/ui/static/static-mut-bad-types.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/static-mut-bad-types.rs:5:13 | LL | a = true; - | ^^^^ expected isize, found bool + | ^^^^ expected `isize`, found `bool` error: aborting due to previous error diff --git a/src/test/ui/str/str-array-assignment.stderr b/src/test/ui/str/str-array-assignment.stderr index e8678b439d4a0..909ff1e0263b6 100644 --- a/src/test/ui/str/str-array-assignment.stderr +++ b/src/test/ui/str/str-array-assignment.stderr @@ -2,7 +2,7 @@ error[E0308]: if and else have incompatible types --> $DIR/str-array-assignment.rs:3:37 | LL | let t = if true { s[..2] } else { s }; - | ------ ^ expected str, found &str + | ------ ^ expected `str`, found `&str` | | | expected because of this @@ -12,7 +12,7 @@ error[E0308]: mismatched types LL | let u: &str = if true { s[..2] } else { s }; | ^^^^^^ | | - | expected &str, found str + | expected `&str`, found `str` | help: consider borrowing here: `&s[..2]` error[E0277]: the size for values of type `str` cannot be known at compilation time @@ -34,7 +34,7 @@ error[E0308]: mismatched types LL | let w: &str = s[..2]; | ^^^^^^ | | - | expected &str, found str + | expected `&str`, found `str` | help: consider borrowing here: `&s[..2]` error: aborting due to 4 previous errors diff --git a/src/test/ui/str/str-lit-type-mismatch.stderr b/src/test/ui/str/str-lit-type-mismatch.stderr index af66fe8b88049..7174fd972eb7f 100644 --- a/src/test/ui/str/str-lit-type-mismatch.stderr +++ b/src/test/ui/str/str-lit-type-mismatch.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let x: &[u8] = "foo"; | ^^^^^ | | - | expected slice `[u8]`, found str + | expected slice `[u8]`, found `str` | help: consider adding a leading `b`: `b"foo"` | = note: expected reference `&[u8]` @@ -16,7 +16,7 @@ error[E0308]: mismatched types LL | let y: &[u8; 4] = "baaa"; | ^^^^^^ | | - | expected array `[u8; 4]`, found str + | expected array `[u8; 4]`, found `str` | help: consider adding a leading `b`: `b"baaa"` | = note: expected reference `&[u8; 4]` @@ -28,7 +28,7 @@ error[E0308]: mismatched types LL | let z: &str = b"foo"; | ^^^^^^ | | - | expected str, found array `[u8; 3]` + | expected `str`, found array `[u8; 3]` | help: consider removing the leading `b`: `"foo"` | = note: expected reference `&str` diff --git a/src/test/ui/struct-literal-variant-in-if.stderr b/src/test/ui/struct-literal-variant-in-if.stderr index e89111ca2c8a8..b75a53915b526 100644 --- a/src/test/ui/struct-literal-variant-in-if.stderr +++ b/src/test/ui/struct-literal-variant-in-if.stderr @@ -56,14 +56,14 @@ error[E0308]: mismatched types LL | if x == E::V { field } {} | ---------------^^^^^--- help: consider using a semicolon here | | | - | | expected (), found bool + | | expected `()`, found `bool` | expected this to be `()` error[E0308]: mismatched types --> $DIR/struct-literal-variant-in-if.rs:21:20 | LL | let y: usize = (); - | ^^ expected usize, found () + | ^^ expected `usize`, found `()` error: aborting due to 7 previous errors diff --git a/src/test/ui/structs/struct-path-self-type-mismatch.stderr b/src/test/ui/structs/struct-path-self-type-mismatch.stderr index 63232a249f43d..b55a2cbf7527c 100644 --- a/src/test/ui/structs/struct-path-self-type-mismatch.stderr +++ b/src/test/ui/structs/struct-path-self-type-mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/struct-path-self-type-mismatch.rs:7:23 | LL | Self { inner: 1.5f32 }; - | ^^^^^^ expected i32, found f32 + | ^^^^^^ expected `i32`, found `f32` error[E0308]: mismatched types --> $DIR/struct-path-self-type-mismatch.rs:15:20 diff --git a/src/test/ui/structs/structure-constructor-type-mismatch.rs b/src/test/ui/structs/structure-constructor-type-mismatch.rs index 8850f6ea89fa3..01cc1764657e6 100644 --- a/src/test/ui/structs/structure-constructor-type-mismatch.rs +++ b/src/test/ui/structs/structure-constructor-type-mismatch.rs @@ -16,32 +16,32 @@ fn main() { let pt = PointF { x: 1, //~^ ERROR mismatched types - //~| expected f32, found integer + //~| expected `f32`, found integer y: 2, //~^ ERROR mismatched types - //~| expected f32, found integer + //~| expected `f32`, found integer }; let pt2 = Point:: { x: 3, //~^ ERROR mismatched types - //~| expected f32, found integer + //~| expected `f32`, found integer y: 4, //~^ ERROR mismatched types - //~| expected f32, found integer + //~| expected `f32`, found integer }; let pair = PairF { x: 5, //~^ ERROR mismatched types - //~| expected f32, found integer + //~| expected `f32`, found integer y: 6, }; let pair2 = PairF:: { x: 7, //~^ ERROR mismatched types - //~| expected f32, found integer + //~| expected `f32`, found integer y: 8, }; diff --git a/src/test/ui/structs/structure-constructor-type-mismatch.stderr b/src/test/ui/structs/structure-constructor-type-mismatch.stderr index f184f81647d13..4bd3acac532df 100644 --- a/src/test/ui/structs/structure-constructor-type-mismatch.stderr +++ b/src/test/ui/structs/structure-constructor-type-mismatch.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | x: 1, | ^ | | - | expected f32, found integer + | expected `f32`, found integer | help: use a float literal: `1.0` error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | y: 2, | ^ | | - | expected f32, found integer + | expected `f32`, found integer | help: use a float literal: `2.0` error[E0308]: mismatched types @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | x: 3, | ^ | | - | expected f32, found integer + | expected `f32`, found integer | help: use a float literal: `3.0` error[E0308]: mismatched types @@ -31,7 +31,7 @@ error[E0308]: mismatched types LL | y: 4, | ^ | | - | expected f32, found integer + | expected `f32`, found integer | help: use a float literal: `4.0` error[E0308]: mismatched types @@ -40,7 +40,7 @@ error[E0308]: mismatched types LL | x: 5, | ^ | | - | expected f32, found integer + | expected `f32`, found integer | help: use a float literal: `5.0` error[E0308]: mismatched types @@ -49,7 +49,7 @@ error[E0308]: mismatched types LL | x: 7, | ^ | | - | expected f32, found integer + | expected `f32`, found integer | help: use a float literal: `7.0` error[E0107]: wrong number of type arguments: expected 0, found 1 @@ -64,7 +64,7 @@ error[E0308]: mismatched types LL | x: 9, | ^ | | - | expected f32, found integer + | expected `f32`, found integer | help: use a float literal: `9.0` error[E0308]: mismatched types @@ -73,7 +73,7 @@ error[E0308]: mismatched types LL | y: 10, | ^^ | | - | expected f32, found integer + | expected `f32`, found integer | help: use a float literal: `10.0` error[E0107]: wrong number of type arguments: expected 0, found 1 @@ -88,7 +88,7 @@ error[E0308]: mismatched types LL | match (Point { x: 1, y: 2 }) { | ---------------------- this match expression has type `Point<{integer}>` LL | PointF:: { .. } => {} - | ^^^^^^^^^^^^^^^^^^^^ expected integer, found f32 + | ^^^^^^^^^^^^^^^^^^^^ expected integer, found `f32` | = note: expected struct `Point<{integer}>` found struct `Point` @@ -99,7 +99,7 @@ error[E0308]: mismatched types LL | match (Point { x: 1, y: 2 }) { | ---------------------- this match expression has type `Point<{integer}>` LL | PointF { .. } => {} - | ^^^^^^^^^^^^^ expected integer, found f32 + | ^^^^^^^^^^^^^ expected integer, found `f32` | = note: expected struct `Point<{integer}>` found struct `Point` @@ -110,7 +110,7 @@ error[E0308]: mismatched types LL | match (Pair { x: 1, y: 2 }) { | --------------------- this match expression has type `Pair<{integer}, {integer}>` LL | PairF:: { .. } => {} - | ^^^^^^^^^^^^^^^^^^^ expected integer, found f32 + | ^^^^^^^^^^^^^^^^^^^ expected integer, found `f32` | = note: expected struct `Pair<{integer}, {integer}>` found struct `Pair` diff --git a/src/test/ui/substs-ppaux.normal.stderr b/src/test/ui/substs-ppaux.normal.stderr index 2e23e7220b760..8a233105491e5 100644 --- a/src/test/ui/substs-ppaux.normal.stderr +++ b/src/test/ui/substs-ppaux.normal.stderr @@ -7,7 +7,7 @@ LL | fn bar<'a, T>() where T: 'a {} LL | let x: () = >::bar::<'static, char>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | - | expected (), found fn item + | expected `()`, found fn item | help: use parentheses to call this function: `>::bar::<'static, char>()` | = note: expected unit type `()` @@ -22,7 +22,7 @@ LL | fn bar<'a, T>() where T: 'a {} LL | let x: () = >::bar::<'static, char>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | - | expected (), found fn item + | expected `()`, found fn item | help: use parentheses to call this function: `>::bar::<'static, char>()` | = note: expected unit type `()` @@ -37,7 +37,7 @@ LL | fn baz() {} LL | let x: () = >::baz; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | - | expected (), found fn item + | expected `()`, found fn item | help: use parentheses to call this function: `>::baz()` | = note: expected unit type `()` @@ -52,7 +52,7 @@ LL | fn foo<'z>() where &'z (): Sized { LL | let x: () = foo::<'static>; | ^^^^^^^^^^^^^^ | | - | expected (), found fn item + | expected `()`, found fn item | help: use parentheses to call this function: `foo::<'static>()` | = note: expected unit type `()` diff --git a/src/test/ui/substs-ppaux.verbose.stderr b/src/test/ui/substs-ppaux.verbose.stderr index 0d26dcc4c1767..ab70d02e1578a 100644 --- a/src/test/ui/substs-ppaux.verbose.stderr +++ b/src/test/ui/substs-ppaux.verbose.stderr @@ -7,7 +7,7 @@ LL | fn bar<'a, T>() where T: 'a {} LL | let x: () = >::bar::<'static, char>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | - | expected (), found fn item + | expected `()`, found fn item | help: use parentheses to call this function: `>::bar::<'static, char>()` | = note: expected unit type `()` @@ -22,7 +22,7 @@ LL | fn bar<'a, T>() where T: 'a {} LL | let x: () = >::bar::<'static, char>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | - | expected (), found fn item + | expected `()`, found fn item | help: use parentheses to call this function: `>::bar::<'static, char>()` | = note: expected unit type `()` @@ -37,7 +37,7 @@ LL | fn baz() {} LL | let x: () = >::baz; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | - | expected (), found fn item + | expected `()`, found fn item | help: use parentheses to call this function: `>::baz()` | = note: expected unit type `()` @@ -52,7 +52,7 @@ LL | fn foo<'z>() where &'z (): Sized { LL | let x: () = foo::<'static>; | ^^^^^^^^^^^^^^ | | - | expected (), found fn item + | expected `()`, found fn item | help: use parentheses to call this function: `foo::<'static>()` | = note: expected unit type `()` diff --git a/src/test/ui/suggestions/as-ref.stderr b/src/test/ui/suggestions/as-ref.stderr index 5379f77ae5c31..1cc63f5c476db 100644 --- a/src/test/ui/suggestions/as-ref.stderr +++ b/src/test/ui/suggestions/as-ref.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/as-ref.rs:6:27 | LL | opt.map(|arg| takes_ref(arg)); - | --- ^^^ expected &Foo, found struct `Foo` + | --- ^^^ expected `&Foo`, found struct `Foo` | | | help: consider using `as_ref` instead: `as_ref().map` @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/as-ref.rs:8:37 | LL | opt.and_then(|arg| Some(takes_ref(arg))); - | -------- ^^^ expected &Foo, found struct `Foo` + | -------- ^^^ expected `&Foo`, found struct `Foo` | | | help: consider using `as_ref` instead: `as_ref().and_then` @@ -18,7 +18,7 @@ error[E0308]: mismatched types --> $DIR/as-ref.rs:11:27 | LL | opt.map(|arg| takes_ref(arg)); - | --- ^^^ expected &Foo, found struct `Foo` + | --- ^^^ expected `&Foo`, found struct `Foo` | | | help: consider using `as_ref` instead: `as_ref().map` @@ -26,7 +26,7 @@ error[E0308]: mismatched types --> $DIR/as-ref.rs:13:35 | LL | opt.and_then(|arg| Ok(takes_ref(arg))); - | -------- ^^^ expected &Foo, found struct `Foo` + | -------- ^^^ expected `&Foo`, found struct `Foo` | | | help: consider using `as_ref` instead: `as_ref().and_then` diff --git a/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr b/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr index 7ec1daacb6142..e37edc1dacafa 100644 --- a/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr +++ b/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr @@ -6,7 +6,7 @@ LL | | "abc" LL | | }; | | ^ | | | - | |______expected &str, found struct `std::string::String` + | |______expected `&str`, found struct `std::string::String` | in this macro invocation | = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) diff --git a/src/test/ui/suggestions/dont-suggest-try_into-in-macros.stderr b/src/test/ui/suggestions/dont-suggest-try_into-in-macros.stderr index f04306997a9ed..1f2252f4d4375 100644 --- a/src/test/ui/suggestions/dont-suggest-try_into-in-macros.stderr +++ b/src/test/ui/suggestions/dont-suggest-try_into-in-macros.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dont-suggest-try_into-in-macros.rs:2:5 | LL | assert_eq!(10u64, 10usize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u64, found usize + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `usize` | = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) diff --git a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr index 18e5c63ff48cf..e699a753d3aa2 100644 --- a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr +++ b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr @@ -21,7 +21,7 @@ LL | fn foo(a: usize, b: usize) -> usize { a } LL | let _: usize = foo; | ^^^ | | - | expected usize, found fn item + | expected `usize`, found fn item | help: use parentheses to call this function: `foo(a, b)` | = note: expected type `usize` @@ -51,7 +51,7 @@ LL | fn bar() -> usize { 42 } LL | let _: usize = bar; | ^^^ | | - | expected usize, found fn item + | expected `usize`, found fn item | help: use parentheses to call this function: `bar()` | = note: expected type `usize` @@ -81,7 +81,7 @@ LL | fn baz(x: usize, y: usize) -> usize { x } LL | let _: usize = T::baz; | ^^^^^^ | | - | expected usize, found fn item + | expected `usize`, found fn item | help: use parentheses to call this function: `T::baz(x, y)` | = note: expected type `usize` @@ -96,7 +96,7 @@ LL | fn bat(x: usize) -> usize { 42 } LL | let _: usize = T::bat; | ^^^^^^ | | - | expected usize, found fn item + | expected `usize`, found fn item | help: use parentheses to call this function: `T::bat(x)` | = note: expected type `usize` @@ -126,7 +126,7 @@ LL | fn baz(x: usize, y: usize) -> usize { x } LL | let _: usize = X::baz; | ^^^^^^ | | - | expected usize, found fn item + | expected `usize`, found fn item | help: use parentheses to call this function: `X::baz(x, y)` | = note: expected type `usize` @@ -141,7 +141,7 @@ LL | fn bat(x: usize) -> usize { 42 } LL | let _: usize = X::bat; | ^^^^^^ | | - | expected usize, found fn item + | expected `usize`, found fn item | help: use parentheses to call this function: `X::bat(x)` | = note: expected type `usize` @@ -156,7 +156,7 @@ LL | fn bax(x: usize) -> usize { 42 } LL | let _: usize = X::bax; | ^^^^^^ | | - | expected usize, found fn item + | expected `usize`, found fn item | help: use parentheses to call this function: `X::bax(x)` | = note: expected type `usize` @@ -171,7 +171,7 @@ LL | fn bach(x: usize) -> usize; LL | let _: usize = X::bach; | ^^^^^^^ | | - | expected usize, found fn item + | expected `usize`, found fn item | help: use parentheses to call this function: `X::bach(x)` | = note: expected type `usize` @@ -186,7 +186,7 @@ LL | fn ban(&self) -> usize { 42 } LL | let _: usize = X::ban; | ^^^^^^ | | - | expected usize, found fn item + | expected `usize`, found fn item | help: use parentheses to call this function: `X::ban(_)` | = note: expected type `usize` @@ -201,7 +201,7 @@ LL | fn bal(&self) -> usize; LL | let _: usize = X::bal; | ^^^^^^ | | - | expected usize, found fn item + | expected `usize`, found fn item | help: use parentheses to call this function: `X::bal(_)` | = note: expected type `usize` @@ -227,7 +227,7 @@ LL | let closure = || 42; LL | let _: usize = closure; | ^^^^^^^ | | - | expected usize, found closure + | expected `usize`, found closure | help: use parentheses to call this closure: `closure()` | = note: expected type `usize` diff --git a/src/test/ui/suggestions/format-borrow.stderr b/src/test/ui/suggestions/format-borrow.stderr index d43a249d9cc96..4b11139643194 100644 --- a/src/test/ui/suggestions/format-borrow.stderr +++ b/src/test/ui/suggestions/format-borrow.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let a: String = &String::from("a"); | ^^^^^^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found &std::string::String + | expected struct `std::string::String`, found `&std::string::String` | help: consider removing the borrow: `String::from("a")` error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | let b: String = &format!("b"); | ^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found &std::string::String + | expected struct `std::string::String`, found `&std::string::String` | help: consider removing the borrow: `format!("b")` error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/issue-52820.stderr b/src/test/ui/suggestions/issue-52820.stderr index ba7457df0693e..5ad6597b82e6e 100644 --- a/src/test/ui/suggestions/issue-52820.stderr +++ b/src/test/ui/suggestions/issue-52820.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | guts, | ^^^^ | | - | expected struct `std::string::String`, found &str + | expected struct `std::string::String`, found `&str` | help: try using a conversion method: `guts: guts.to_string()` error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | brains: guts.clone(), | ^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found &str + | expected struct `std::string::String`, found `&str` | help: try using a conversion method: `guts.to_string()` error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/issue-59819.stderr b/src/test/ui/suggestions/issue-59819.stderr index 331a6a53b1239..23991bbbe690b 100644 --- a/src/test/ui/suggestions/issue-59819.stderr +++ b/src/test/ui/suggestions/issue-59819.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let y: i32 = x; | ^ | | - | expected i32, found struct `Foo` + | expected `i32`, found struct `Foo` | help: consider dereferencing the type: `*x` error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | let b: i32 = a; | ^ | | - | expected i32, found &{integer} + | expected `i32`, found `&{integer}` | help: consider dereferencing the borrow: `*a` error[E0308]: mismatched types diff --git a/src/test/ui/suggestions/match-ergonomics.stderr b/src/test/ui/suggestions/match-ergonomics.stderr index 54aebb3bba262..abdb754acc5fa 100644 --- a/src/test/ui/suggestions/match-ergonomics.stderr +++ b/src/test/ui/suggestions/match-ergonomics.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | [&v] => {}, | ^^ | | - | expected i32, found reference + | expected `i32`, found reference | help: you can probably remove the explicit borrow: `v` | = note: expected type `i32` @@ -28,7 +28,7 @@ error[E0308]: mismatched types LL | &v => {}, | ^^ | | - | expected i32, found reference + | expected `i32`, found reference | help: you can probably remove the explicit borrow: `v` | = note: expected type `i32` @@ -40,7 +40,7 @@ error[E0308]: mismatched types LL | if let [&v] = &x[..] {} | ^^ | | - | expected i32, found reference + | expected `i32`, found reference | help: you can probably remove the explicit borrow: `v` | = note: expected type `i32` diff --git a/src/test/ui/suggestions/match-needing-semi.stderr b/src/test/ui/suggestions/match-needing-semi.stderr index c9e263d0db842..28abd089525df 100644 --- a/src/test/ui/suggestions/match-needing-semi.stderr +++ b/src/test/ui/suggestions/match-needing-semi.stderr @@ -5,7 +5,7 @@ LL | / match 3 { LL | | 4 => 1, LL | | 3 => { LL | | 2 - | | ^ expected (), found integer + | | ^ expected `()`, found integer LL | | } LL | | _ => 2 LL | | } @@ -23,7 +23,7 @@ LL | | _ => 2 LL | | } | | ^- help: consider using a semicolon here | |_____| - | expected (), found integer + | expected `()`, found integer error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/mismatched-types-numeric-from.stderr b/src/test/ui/suggestions/mismatched-types-numeric-from.stderr index 223b6747322c1..f2c67dd1fdb4d 100644 --- a/src/test/ui/suggestions/mismatched-types-numeric-from.stderr +++ b/src/test/ui/suggestions/mismatched-types-numeric-from.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/mismatched-types-numeric-from.rs:2:18 | LL | let _: u32 = i32::from(0_u8); - | ^^^^^^^^^^^^^^^ expected u32, found i32 + | ^^^^^^^^^^^^^^^ expected `u32`, found `i32` error: aborting due to previous error diff --git a/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr b/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr index 44c07a7c83a8b..a93eca0c99dc3 100644 --- a/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr +++ b/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr @@ -22,19 +22,19 @@ error[E0308]: mismatched types --> $DIR/recover-from-semicolon-trailing-item.rs:10:20 | LL | let _: usize = S {}; - | ^^^^ expected usize, found struct `S` + | ^^^^ expected `usize`, found struct `S` error[E0308]: mismatched types --> $DIR/recover-from-semicolon-trailing-item.rs:12:20 | LL | let _: usize = X {}; - | ^^^^ expected usize, found struct `main::X` + | ^^^^ expected `usize`, found struct `main::X` error[E0308]: mismatched types --> $DIR/recover-from-semicolon-trailing-item.rs:14:9 | LL | foo(""); - | ^^ expected usize, found &str + | ^^ expected `usize`, found `&str` error: aborting due to 6 previous errors diff --git a/src/test/ui/suggestions/type-mismatch-struct-field-shorthand-2.stderr b/src/test/ui/suggestions/type-mismatch-struct-field-shorthand-2.stderr index a25c644680ee0..f717cc7addb6b 100644 --- a/src/test/ui/suggestions/type-mismatch-struct-field-shorthand-2.stderr +++ b/src/test/ui/suggestions/type-mismatch-struct-field-shorthand-2.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let _ = RGB { r, g, c }; | ^ | | - | expected f64, found f32 + | expected `f64`, found `f32` | help: you can convert an `f32` to `f64`: `r: r.into()` error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | let _ = RGB { r, g, c }; | ^ | | - | expected f64, found f32 + | expected `f64`, found `f32` | help: you can convert an `f32` to `f64`: `g: g.into()` error[E0560]: struct `RGB` has no field named `c` diff --git a/src/test/ui/suggestions/type-mismatch-struct-field-shorthand.stderr b/src/test/ui/suggestions/type-mismatch-struct-field-shorthand.stderr index ed8013d5997e4..7521c253545e1 100644 --- a/src/test/ui/suggestions/type-mismatch-struct-field-shorthand.stderr +++ b/src/test/ui/suggestions/type-mismatch-struct-field-shorthand.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let _ = RGB { r, g, b }; | ^ | | - | expected f64, found f32 + | expected `f64`, found `f32` | help: you can convert an `f32` to `f64`: `r: r.into()` error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | let _ = RGB { r, g, b }; | ^ | | - | expected f64, found f32 + | expected `f64`, found `f32` | help: you can convert an `f32` to `f64`: `g: g.into()` error[E0308]: mismatched types @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | let _ = RGB { r, g, b }; | ^ | | - | expected f64, found f32 + | expected `f64`, found `f32` | help: you can convert an `f32` to `f64`: `b: b.into()` error: aborting due to 3 previous errors diff --git a/src/test/ui/suppressed-error.rs b/src/test/ui/suppressed-error.rs index 65da1ccd9758f..256ec1713d4c1 100644 --- a/src/test/ui/suppressed-error.rs +++ b/src/test/ui/suppressed-error.rs @@ -3,6 +3,6 @@ fn main() { //~^ ERROR mismatched types //~| expected unit type `()` //~| found tuple `(_, _)` -//~| expected (), found tuple +//~| expected `()`, found tuple return x; } diff --git a/src/test/ui/suppressed-error.stderr b/src/test/ui/suppressed-error.stderr index 994011f3f0ea1..846cd2adcd8fe 100644 --- a/src/test/ui/suppressed-error.stderr +++ b/src/test/ui/suppressed-error.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/suppressed-error.rs:2:9 | LL | let (x, y) = (); - | ^^^^^^ expected (), found tuple + | ^^^^^^ expected `()`, found tuple | = note: expected unit type `()` found tuple `(_, _)` diff --git a/src/test/ui/switched-expectations.stderr b/src/test/ui/switched-expectations.stderr index d65adea1ed426..dca9c6ce4d324 100644 --- a/src/test/ui/switched-expectations.stderr +++ b/src/test/ui/switched-expectations.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/switched-expectations.rs:3:30 | LL | let ref string: String = var; - | ^^^ expected struct `std::string::String`, found i32 + | ^^^ expected struct `std::string::String`, found `i32` error: aborting due to previous error diff --git a/src/test/ui/tag-that-dare-not-speak-its-name.rs b/src/test/ui/tag-that-dare-not-speak-its-name.rs index ebe81c314a892..4d9a98827de64 100644 --- a/src/test/ui/tag-that-dare-not-speak-its-name.rs +++ b/src/test/ui/tag-that-dare-not-speak-its-name.rs @@ -12,5 +12,5 @@ fn main() { //~^ ERROR mismatched types //~| expected type `char` //~| found enum `std::option::Option<_>` - //~| expected char, found enum `std::option::Option` + //~| expected `char`, found enum `std::option::Option` } diff --git a/src/test/ui/tag-that-dare-not-speak-its-name.stderr b/src/test/ui/tag-that-dare-not-speak-its-name.stderr index c71474ab26639..63280082e0e0b 100644 --- a/src/test/ui/tag-that-dare-not-speak-its-name.stderr +++ b/src/test/ui/tag-that-dare-not-speak-its-name.stderr @@ -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 `std::option::Option` + | ^^^^^^^ expected `char`, found enum `std::option::Option` | = note: expected type `char` found enum `std::option::Option<_>` diff --git a/src/test/ui/tail-typeck.stderr b/src/test/ui/tail-typeck.stderr index 1170f5c17c18a..eeeb258da215d 100644 --- a/src/test/ui/tail-typeck.stderr +++ b/src/test/ui/tail-typeck.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/tail-typeck.rs:3:26 | LL | fn f() -> isize { return g(); } - | ----- ^^^ expected isize, found usize + | ----- ^^^ expected `isize`, found `usize` | | | expected `isize` because of return type diff --git a/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr b/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr index 5e49fcdf95a87..64d0ea012c8dd 100644 --- a/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr +++ b/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr @@ -1,8 +1,8 @@ error[E0308]: mismatched types --> $DIR/non-whitespace-trimming-2.rs:4:311 | -LL | ...; let _: usize = 14; let _: usize = 15; let _: () = 42; let _: usize = 0; let _: usize = 1; let _: usize = 2; let _: usize = 3; let _:... - | ^^ expected (), found integer +LL | ... let _: usize = 14; let _: usize = 15; let _: () = 42; let _: usize = 0; let _: usize = 1; let _: usize = 2; let _: usize = 3; let _: ... + | ^^ expected `()`, found integer error: aborting due to previous error diff --git a/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr b/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr index cea937ca8b155..c1b6544cdc854 100644 --- a/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr +++ b/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr @@ -1,8 +1,8 @@ error[E0308]: mismatched types --> $DIR/non-whitespace-trimming-unicode.rs:4:415 | -LL | ...♯♰♱♲♳♴♵♶♷♸♹♺♻♼♽♾♿⚀⚁⚂⚃⚄⚅⚆⚈⚉4"; let _: () = 42; let _: &str = "🦀☀☁☂☃☄★☆☇☈☉☊☋☌☍☎☏☐☑☒☓ ☖☗☘☙☚☛☜☝☞☟☠☡☢☣☤☥☦☧☨☩☪☫☬☭☮☯☰☱☲☳☴☵☶☷☸☹☺☻☼☽☾☿♀♁♂♃♄♅♆... - | ^^ expected (), found integer +LL | ...♰♱♲♳♴♵♶♷♸♹♺♻♼♽♾♿⚀⚁⚂⚃⚄⚅⚆⚈⚉4"; let _: () = 42; let _: &str = "🦀☀☁☂☃☄★☆☇☈☉☊☋☌☍☎☏☐☑☒☓ ☖☗☘☙☚☛☜☝☞☟☠☡☢☣☤☥☦☧☨☩☪☫☬☭☮☯☰☱☲☳☴☵☶☷☸☹☺☻☼☽☾☿♀♁♂♃♄♅♆... + | ^^ expected `()`, found integer error: aborting due to previous error diff --git a/src/test/ui/terminal-width/non-whitespace-trimming.stderr b/src/test/ui/terminal-width/non-whitespace-trimming.stderr index b024d2ace37af..a8f2212b55725 100644 --- a/src/test/ui/terminal-width/non-whitespace-trimming.stderr +++ b/src/test/ui/terminal-width/non-whitespace-trimming.stderr @@ -1,8 +1,8 @@ error[E0308]: mismatched types --> $DIR/non-whitespace-trimming.rs:4:241 | -LL | ...) = (); let _: () = (); let _: () = (); let _: () = 42; let _: () = (); let _: () = (); let _: () = (); let _: () = (); let _: () = ()... - | ^^ expected (), found integer +LL | ... = (); let _: () = (); let _: () = (); let _: () = 42; let _: () = (); let _: () = (); let _: () = (); let _: () = (); let _: () = ();... + | ^^ expected `()`, found integer error: aborting due to previous error diff --git a/src/test/ui/terminal-width/whitespace-trimming-2.stderr b/src/test/ui/terminal-width/whitespace-trimming-2.stderr index 3013019df269f..97a64e603b761 100644 --- a/src/test/ui/terminal-width/whitespace-trimming-2.stderr +++ b/src/test/ui/terminal-width/whitespace-trimming-2.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | ...-> usize { | ----- expected `usize` because of return type LL | ... () - | ^^ expected usize, found () + | ^^ expected `usize`, found `()` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/whitespace-trimming.stderr b/src/test/ui/terminal-width/whitespace-trimming.stderr index d3064d8bfb976..903673266cc47 100644 --- a/src/test/ui/terminal-width/whitespace-trimming.stderr +++ b/src/test/ui/terminal-width/whitespace-trimming.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/whitespace-trimming.rs:4:193 | LL | ... let _: () = 42; - | ^^ expected (), found integer + | ^^ expected `()`, found integer error: aborting due to previous error diff --git a/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr b/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr index 19374ba49c5c7..5d0fb6b44cb29 100644 --- a/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr +++ b/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr @@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving ` as std::iter::It --> $DIR/traits-assoc-type-in-supertrait-bad.rs:11:6 | LL | impl Foo for IntoIter { - | ^^^ expected i32, found u32 + | ^^^ expected `i32`, found `u32` error: aborting due to previous error diff --git a/src/test/ui/traits/traits-multidispatch-bad.stderr b/src/test/ui/traits/traits-multidispatch-bad.stderr index f4ce548314d11..671faf45178f9 100644 --- a/src/test/ui/traits/traits-multidispatch-bad.stderr +++ b/src/test/ui/traits/traits-multidispatch-bad.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/traits-multidispatch-bad.rs:19:17 | LL | test(22i32, 44i32); - | ^^^^^ expected u32, found i32 + | ^^^^^ expected `u32`, found `i32` | help: change the type of the numeric literal from `i32` to `u32` | diff --git a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.stderr index 5820e4699c14f..08c79519dfe16 100644 --- a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.stderr +++ b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.stderr @@ -5,7 +5,7 @@ LL | fn global_bound_is_hidden() -> u8 | -- expected `u8` because of return type ... LL | B::get_x() - | ^^^^^^^^^^ expected u8, found i32 + | ^^^^^^^^^^ expected `u8`, found `i32` | help: you can convert an `i32` to `u8` and panic if the converted value wouldn't fit | diff --git a/src/test/ui/try-block/try-block-bad-type.stderr b/src/test/ui/try-block/try-block-bad-type.stderr index 75ff998d3bf07..414c3f24d3a05 100644 --- a/src/test/ui/try-block/try-block-bad-type.stderr +++ b/src/test/ui/try-block/try-block-bad-type.stderr @@ -17,13 +17,13 @@ error[E0271]: type mismatch resolving ` as std::op --> $DIR/try-block-bad-type.rs:12:9 | LL | "" - | ^^ expected i32, found &str + | ^^ expected `i32`, found `&str` error[E0271]: type mismatch resolving ` as std::ops::Try>::Ok == ()` --> $DIR/try-block-bad-type.rs:15:39 | LL | let res: Result = try { }; - | ^ expected i32, found () + | ^ expected `i32`, found `()` error[E0277]: the trait bound `(): std::ops::Try` is not satisfied --> $DIR/try-block-bad-type.rs:17:23 diff --git a/src/test/ui/try-block/try-block-type-error.stderr b/src/test/ui/try-block/try-block-type-error.stderr index 63f2c02bc7102..f779121bbc65a 100644 --- a/src/test/ui/try-block/try-block-type-error.stderr +++ b/src/test/ui/try-block/try-block-type-error.stderr @@ -4,14 +4,14 @@ error[E0271]: type mismatch resolving ` as std::ops::Tr LL | 42 | ^^ | | - | expected f32, found integer + | expected `f32`, found integer | help: use a float literal: `42.0` error[E0271]: type mismatch resolving ` as std::ops::Try>::Ok == ()` --> $DIR/try-block-type-error.rs:16:5 | LL | }; - | ^ expected i32, found () + | ^ expected `i32`, found `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/tutorial-suffix-inference-test.rs b/src/test/ui/tutorial-suffix-inference-test.rs index 2477c6365301b..849adfd53686b 100644 --- a/src/test/ui/tutorial-suffix-inference-test.rs +++ b/src/test/ui/tutorial-suffix-inference-test.rs @@ -8,10 +8,10 @@ fn main() { identity_u8(x); // after this, `x` is assumed to have type `u8` identity_u16(x); //~^ ERROR mismatched types - //~| expected u16, found u8 + //~| expected `u16`, found `u8` identity_u16(y); //~^ ERROR mismatched types - //~| expected u16, found i32 + //~| expected `u16`, found `i32` let a = 3; @@ -20,5 +20,5 @@ fn main() { identity_i(a); // ok identity_u16(a); //~^ ERROR mismatched types - //~| expected u16, found isize + //~| expected `u16`, found `isize` } diff --git a/src/test/ui/tutorial-suffix-inference-test.stderr b/src/test/ui/tutorial-suffix-inference-test.stderr index ae0cf124673db..c6c7ba2679410 100644 --- a/src/test/ui/tutorial-suffix-inference-test.stderr +++ b/src/test/ui/tutorial-suffix-inference-test.stderr @@ -4,14 +4,14 @@ error[E0308]: mismatched types LL | identity_u16(x); | ^ | | - | expected u16, found u8 + | expected `u16`, found `u8` | help: you can convert an `u8` to `u16`: `x.into()` error[E0308]: mismatched types --> $DIR/tutorial-suffix-inference-test.rs:12:18 | LL | identity_u16(y); - | ^ expected u16, found i32 + | ^ expected `u16`, found `i32` | help: you can convert an `i32` to `u16` and panic if the converted value wouldn't fit | @@ -22,7 +22,7 @@ error[E0308]: mismatched types --> $DIR/tutorial-suffix-inference-test.rs:21:18 | LL | identity_u16(a); - | ^ expected u16, found isize + | ^ expected `u16`, found `isize` | help: you can convert an `isize` to `u16` and panic if the converted value wouldn't fit | diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr index bbe152d69d755..412b4dbda4fde 100644 --- a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr +++ b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr @@ -5,7 +5,7 @@ LL | impl Enum { | - this type parameter LL | fn ts_variant() { LL | Self::TSVariant(()); - | ^^ expected type parameter `T`, found () + | ^^ expected type parameter `T`, found `()` | = note: expected type parameter `T` found unit type `()` @@ -31,7 +31,7 @@ LL | impl Enum { | - this type parameter ... LL | Self::<()>::TSVariant(()); - | ^^ expected type parameter `T`, found () + | ^^ expected type parameter `T`, found `()` | = note: expected type parameter `T` found unit type `()` @@ -57,7 +57,7 @@ LL | impl Enum { | - this type parameter ... LL | Self::SVariant { v: () }; - | ^^ expected type parameter `T`, found () + | ^^ expected type parameter `T`, found `()` | = note: expected type parameter `T` found unit type `()` @@ -77,7 +77,7 @@ LL | impl Enum { | - this type parameter ... LL | Self::SVariant::<()> { v: () }; - | ^^ expected type parameter `T`, found () + | ^^ expected type parameter `T`, found `()` | = note: expected type parameter `T` found unit type `()` @@ -97,7 +97,7 @@ LL | impl Enum { | - this type parameter ... LL | Self::<()>::SVariant { v: () }; - | ^^ expected type parameter `T`, found () + | ^^ expected type parameter `T`, found `()` | = note: expected type parameter `T` found unit type `()` @@ -123,7 +123,7 @@ LL | impl Enum { | - this type parameter ... LL | Self::<()>::SVariant::<()> { v: () }; - | ^^ expected type parameter `T`, found () + | ^^ expected type parameter `T`, found `()` | = note: expected type parameter `T` found unit type `()` diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr index a1afd5e9a0e25..078971b89f773 100644 --- a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr +++ b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/enum-variant-priority-higher-than-other-inherent.rs:22:17 | LL | let _: u8 = ::V; - | ^^^^^^^ expected u8, found enum `E2` + | ^^^^^^^ expected `u8`, found enum `E2` error: aborting due to 2 previous errors diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr index 7e744925a7ce2..4fe25d6d28739 100644 --- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr @@ -8,7 +8,7 @@ error[E0308]: mismatched types --> $DIR/generic_type_does_not_live_long_enough.rs:6:18 | LL | let z: i32 = x; - | ^ expected i32, found opaque type + | ^ expected `i32`, found opaque type | = note: expected type `i32` found opaque type `WrongGeneric::<&{integer}>` diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr index c1237e7e6df7e..2a037e6817469 100644 --- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr +++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr @@ -8,7 +8,7 @@ error[E0308]: mismatched types --> $DIR/generic_type_does_not_live_long_enough.rs:6:18 | LL | let z: i32 = x; - | ^ expected i32, found opaque type + | ^ expected `i32`, found opaque type | = note: expected type `i32` found opaque type `WrongGeneric::<&{integer}>` diff --git a/src/test/ui/type-alias-impl-trait/issue-63279.stderr b/src/test/ui/type-alias-impl-trait/issue-63279.stderr index bb5f1d3bbc97b..053ccee378542 100644 --- a/src/test/ui/type-alias-impl-trait/issue-63279.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-63279.stderr @@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `<[closure@$DIR/issue-63279.rs:6:5: 6:28] --> $DIR/issue-63279.rs:3:1 | LL | type Closure = impl FnOnce(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found () + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found `()` | = note: expected opaque type `Closure` found unit type `()` diff --git a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr index 5411456b34b98..89add864f9ada 100644 --- a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr +++ b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/never_reveal_concrete_type.rs:13:27 | LL | let _: &'static str = x; - | ^ expected &str, found opaque type + | ^ expected `&str`, found opaque type | = note: expected reference `&'static str` found opaque type `NoReveal` diff --git a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr index aaf5e286643f9..7650013e41b1e 100644 --- a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr +++ b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/no_revealing_outside_defining_module.rs:15:19 | LL | let _: &str = bomp(); - | ^^^^^^ expected &str, found opaque type + | ^^^^^^ expected `&str`, found opaque type | = note: expected reference `&str` found opaque type `Boo` @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | fn bomp() -> boo::Boo { | -------- expected `Boo` because of return type LL | "" - | ^^ expected opaque type, found &str + | ^^ expected opaque type, found `&str` | = note: expected opaque type `Boo` found reference `&'static str` diff --git a/src/test/ui/type/type-ascription-precedence.stderr b/src/test/ui/type/type-ascription-precedence.stderr index 5f42ed228dd0e..92d3f18e82f44 100644 --- a/src/test/ui/type/type-ascription-precedence.stderr +++ b/src/test/ui/type/type-ascription-precedence.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:31:7 | LL | &(S: &S); - | ^ expected &S, found struct `S` + | ^ expected `&S`, found struct `S` error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:35:7 diff --git a/src/test/ui/type/type-check/assignment-expected-bool.stderr b/src/test/ui/type/type-check/assignment-expected-bool.stderr index f210fd62d7dc7..58a9e643cf629 100644 --- a/src/test/ui/type/type-check/assignment-expected-bool.stderr +++ b/src/test/ui/type/type-check/assignment-expected-bool.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let _: bool = 0 = 0; | ^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `0 == 0` error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | 0 => 0 = 0, | ^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `0 == 0` error[E0308]: mismatched types @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | _ => 0 = 0, | ^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `0 == 0` error[E0308]: mismatched types @@ -31,7 +31,7 @@ error[E0308]: mismatched types LL | true => 0 = 0, | ^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `0 == 0` error[E0308]: mismatched types @@ -40,7 +40,7 @@ error[E0308]: mismatched types LL | if 0 = 0 {} | ^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `0 == 0` error[E0308]: mismatched types @@ -49,7 +49,7 @@ error[E0308]: mismatched types LL | let _: bool = if { 0 = 0 } { | ^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `0 == 0` error[E0308]: mismatched types @@ -58,7 +58,7 @@ error[E0308]: mismatched types LL | 0 = 0 | ^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `0 == 0` error[E0308]: mismatched types @@ -67,7 +67,7 @@ error[E0308]: mismatched types LL | 0 = 0 | ^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `0 == 0` error[E0308]: mismatched types @@ -76,7 +76,7 @@ error[E0308]: mismatched types LL | let _ = (0 = 0) | ^^^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `0 == 0` error[E0308]: mismatched types @@ -85,7 +85,7 @@ error[E0308]: mismatched types LL | && { 0 = 0 } | ^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `0 == 0` error[E0308]: mismatched types @@ -94,7 +94,7 @@ error[E0308]: mismatched types LL | || (0 = 0); | ^^^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `0 == 0` error[E0070]: invalid left-hand side expression @@ -107,7 +107,7 @@ error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:31:20 | LL | let _: usize = 0 = 0; - | ^^^^^ expected usize, found () + | ^^^^^ expected `usize`, found `()` error: aborting due to 13 previous errors diff --git a/src/test/ui/type/type-check/assignment-in-if.stderr b/src/test/ui/type/type-check/assignment-in-if.stderr index 789902bbb9455..0957dcb986b51 100644 --- a/src/test/ui/type/type-check/assignment-in-if.stderr +++ b/src/test/ui/type/type-check/assignment-in-if.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | if x = x { | ^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `x == x` error[E0308]: mismatched types @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | if (x = x) { | ^^^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `x == x` error[E0308]: mismatched types @@ -22,7 +22,7 @@ error[E0308]: mismatched types LL | if y = (Foo { foo: x }) { | ^^^^^^^^^^^^^^^^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `y == (Foo { foo: x })` error[E0308]: mismatched types @@ -31,7 +31,7 @@ error[E0308]: mismatched types LL | if 3 = x { | ^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `3 == x` error[E0308]: mismatched types @@ -40,7 +40,7 @@ error[E0308]: mismatched types LL | x = 4 | ^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `x == 4` error[E0308]: mismatched types @@ -49,7 +49,7 @@ error[E0308]: mismatched types LL | x = 5 | ^^^^^ | | - | expected bool, found () + | expected `bool`, found `()` | help: try comparing for equality: `x == 5` error: aborting due to 6 previous errors diff --git a/src/test/ui/type/type-error-break-tail.stderr b/src/test/ui/type/type-error-break-tail.stderr index 720bde9371132..16dc6475c6f9f 100644 --- a/src/test/ui/type/type-error-break-tail.stderr +++ b/src/test/ui/type/type-error-break-tail.stderr @@ -7,7 +7,7 @@ LL | loop { LL | if false { break; } | ^^^^^ | | - | expected i32, found () + | expected `i32`, found `()` | help: give it a value of the expected type: `break 42` error: aborting due to previous error diff --git a/src/test/ui/type/type-mismatch-multiple.rs b/src/test/ui/type/type-mismatch-multiple.rs index 6270ee6471301..55d6ceef1ded0 100644 --- a/src/test/ui/type/type-mismatch-multiple.rs +++ b/src/test/ui/type/type-mismatch-multiple.rs @@ -2,6 +2,6 @@ fn main() { let a: bool = 1; let b: i32 = true; } //~^ ERROR mismatched types -//~| expected bool, found integer +//~| expected `bool`, found integer //~| ERROR mismatched types -//~| expected i32, found bool +//~| expected `i32`, found `bool` diff --git a/src/test/ui/type/type-mismatch-multiple.stderr b/src/test/ui/type/type-mismatch-multiple.stderr index 6de8a056978cb..d615e599501be 100644 --- a/src/test/ui/type/type-mismatch-multiple.stderr +++ b/src/test/ui/type/type-mismatch-multiple.stderr @@ -2,13 +2,13 @@ error[E0308]: mismatched types --> $DIR/type-mismatch-multiple.rs:3:27 | LL | fn main() { let a: bool = 1; let b: i32 = true; } - | ^ expected bool, found integer + | ^ expected `bool`, found integer error[E0308]: mismatched types --> $DIR/type-mismatch-multiple.rs:3:43 | LL | fn main() { let a: bool = 1; let b: i32 = true; } - | ^^^^ expected i32, found bool + | ^^^^ expected `i32`, found `bool` error: aborting due to 2 previous errors diff --git a/src/test/ui/type/type-mismatch.stderr b/src/test/ui/type/type-mismatch.stderr index e6016bdef18ed..24c71c63103d3 100644 --- a/src/test/ui/type/type-mismatch.stderr +++ b/src/test/ui/type/type-mismatch.stderr @@ -2,19 +2,19 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:17:17 | LL | want::(f); - | ^ expected struct `foo`, found usize + | ^ expected struct `foo`, found `usize` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:18:17 | LL | want::(f); - | ^ expected struct `bar`, found usize + | ^ expected struct `bar`, found `usize` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:19:24 | LL | want::>(f); - | ^ expected struct `Foo`, found usize + | ^ expected struct `Foo`, found `usize` | = note: expected struct `Foo` found type `usize` @@ -23,7 +23,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:20:27 | LL | want::>(f); - | ^ expected struct `Foo`, found usize + | ^ expected struct `Foo`, found `usize` | = note: expected struct `Foo` found type `usize` @@ -32,7 +32,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:21:22 | LL | want::>(f); - | ^ expected struct `Foo`, found usize + | ^ expected struct `Foo`, found `usize` | = note: expected struct `Foo` found type `usize` @@ -41,7 +41,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:22:25 | LL | want::>(f); - | ^ expected struct `Foo`, found usize + | ^ expected struct `Foo`, found `usize` | = note: expected struct `Foo` found type `usize` @@ -50,7 +50,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:23:22 | LL | want::>(f); - | ^ expected struct `Foo`, found usize + | ^ expected struct `Foo`, found `usize` | = note: expected struct `Foo` found type `usize` @@ -59,7 +59,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:24:25 | LL | want::>(f); - | ^ expected struct `Foo`, found usize + | ^ expected struct `Foo`, found `usize` | = note: expected struct `Foo` found type `usize` @@ -68,7 +68,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:28:19 | LL | want::(f); - | ^ expected usize, found struct `foo` + | ^ expected `usize`, found struct `foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:29:17 @@ -134,7 +134,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:39:19 | LL | want::(f); - | ^ expected usize, found struct `Foo` + | ^ expected `usize`, found struct `Foo` | = note: expected type `usize` found struct `Foo` @@ -161,7 +161,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:42:24 | LL | want::>(f); - | ^ expected usize, found struct `foo` + | ^ expected `usize`, found struct `foo` | = note: expected struct `Foo` found struct `Foo` @@ -170,7 +170,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:43:27 | LL | want::>(f); - | ^ expected usize, found struct `foo` + | ^ expected `usize`, found struct `foo` | = note: expected struct `Foo` found struct `Foo` @@ -208,7 +208,7 @@ error[E0308]: mismatched types LL | want::<&Foo>(f); | ^ | | - | expected &Foo, found struct `Foo` + | expected `&Foo`, found struct `Foo` | help: consider borrowing here: `&f` | = note: expected reference `&Foo` @@ -218,7 +218,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:48:26 | LL | want::<&Foo>(f); - | ^ expected &Foo, found struct `Foo` + | ^ expected `&Foo`, found struct `Foo` | = note: expected reference `&Foo` found struct `Foo` @@ -227,7 +227,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:52:19 | LL | want::(f); - | ^ expected usize, found struct `Foo` + | ^ expected `usize`, found struct `Foo` | = note: expected type `usize` found struct `Foo` @@ -254,7 +254,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:55:24 | LL | want::>(f); - | ^ expected usize, found struct `foo` + | ^ expected `usize`, found struct `foo` | = note: expected struct `Foo` found struct `Foo` @@ -263,7 +263,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:56:27 | LL | want::>(f); - | ^ expected usize, found struct `foo` + | ^ expected `usize`, found struct `foo` | = note: expected struct `Foo` found struct `Foo` @@ -299,7 +299,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:60:23 | LL | want::<&Foo>(f); - | ^ expected &Foo, found struct `Foo` + | ^ expected `&Foo`, found struct `Foo` | = note: expected reference `&Foo` found struct `Foo` @@ -310,7 +310,7 @@ error[E0308]: mismatched types LL | want::<&Foo>(f); | ^ | | - | expected &Foo, found struct `Foo` + | expected `&Foo`, found struct `Foo` | help: consider borrowing here: `&f` | = note: expected reference `&Foo` @@ -320,7 +320,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:65:19 | LL | want::(f); - | ^ expected usize, found struct `Foo` + | ^ expected `usize`, found struct `Foo` | = note: expected type `usize` found struct `Foo` @@ -347,7 +347,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:68:24 | LL | want::>(f); - | ^ expected usize, found struct `foo` + | ^ expected `usize`, found struct `foo` | = note: expected struct `Foo` found struct `Foo` @@ -356,7 +356,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:69:27 | LL | want::>(f); - | ^ expected usize, found struct `foo` + | ^ expected `usize`, found struct `foo` | = note: expected struct `Foo` found struct `Foo` @@ -401,7 +401,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:74:23 | LL | want::<&Foo>(f); - | ^ expected &Foo, found struct `Foo` + | ^ expected `&Foo`, found struct `Foo` | = note: expected reference `&Foo` found struct `Foo` @@ -410,7 +410,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:75:26 | LL | want::<&Foo>(f); - | ^ expected &Foo, found struct `Foo` + | ^ expected `&Foo`, found struct `Foo` | = note: expected reference `&Foo` found struct `Foo` diff --git a/src/test/ui/type/type-shadow.stderr b/src/test/ui/type/type-shadow.stderr index 70be30ed53e83..b5a80766804a5 100644 --- a/src/test/ui/type/type-shadow.stderr +++ b/src/test/ui/type/type-shadow.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/type-shadow.rs:6:20 | LL | let y: Y = "hello"; - | ^^^^^^^ expected isize, found &str + | ^^^^^^^ expected `isize`, found `&str` error: aborting due to previous error diff --git a/src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr b/src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr index aca9c3f558a7b..14c09ade7dde3 100644 --- a/src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr +++ b/src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn ice(x: Box>) { | - possibly return type missing here? LL | *x - | ^^ expected (), found trait std::iter::Iterator + | ^^ expected `()`, found trait `std::iter::Iterator` | = note: expected unit type `()` found trait object `(dyn std::iter::Iterator + 'static)` diff --git a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr index a6f24984c8b9b..59f699b7024d1 100644 --- a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr +++ b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/ufcs-qpath-self-mismatch.rs:6:28 | LL | >::add(1u32, 2); - | ^^^^ expected i32, found u32 + | ^^^^ expected `i32`, found `u32` | help: change the type of the numeric literal from `u32` to `i32` | @@ -21,7 +21,7 @@ error[E0308]: mismatched types --> $DIR/ufcs-qpath-self-mismatch.rs:8:31 | LL | >::add(1, 2u32); - | ^^^^ expected i32, found u32 + | ^^^^ expected `i32`, found `u32` | help: change the type of the numeric literal from `u32` to `i32` | diff --git a/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr b/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr index 2479f3e601e2c..482b3ace65b4a 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/unboxed-closures-type-mismatch.rs:5:15 | LL | let z = f(1_usize, 2); - | ^^^^^^^ expected isize, found usize + | ^^^^^^^ expected `isize`, found `usize` | help: change the type of the numeric literal from `usize` to `isize` | diff --git a/src/test/ui/while-type-error.stderr b/src/test/ui/while-type-error.stderr index 850fcedf39ffa..529cbff0563bd 100644 --- a/src/test/ui/while-type-error.stderr +++ b/src/test/ui/while-type-error.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/while-type-error.rs:3:19 | LL | fn main() { while main { } } - | ^^^^ expected bool, found fn item + | ^^^^ expected `bool`, found fn item | = note: expected type `bool` found fn item `fn() {main}` diff --git a/src/test/ui/wrong-mul-method-signature.stderr b/src/test/ui/wrong-mul-method-signature.stderr index fb21980805fa8..c0888b3b9d4d5 100644 --- a/src/test/ui/wrong-mul-method-signature.stderr +++ b/src/test/ui/wrong-mul-method-signature.stderr @@ -2,7 +2,7 @@ error[E0053]: method `mul` has an incompatible type for trait --> $DIR/wrong-mul-method-signature.rs:16:5 | LL | fn mul(self, s: &f64) -> Vec1 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected f64, found &f64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `f64`, found `&f64` | = note: expected fn pointer `fn(Vec1, f64) -> Vec1` found fn pointer `fn(Vec1, &f64) -> Vec1` @@ -11,7 +11,7 @@ error[E0053]: method `mul` has an incompatible type for trait --> $DIR/wrong-mul-method-signature.rs:33:5 | LL | fn mul(self, s: f64) -> Vec2 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found f64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found `f64` | = note: expected fn pointer `fn(Vec2, Vec2) -> f64` found fn pointer `fn(Vec2, f64) -> Vec2` @@ -20,7 +20,7 @@ error[E0053]: method `mul` has an incompatible type for trait --> $DIR/wrong-mul-method-signature.rs:52:5 | LL | fn mul(self, s: f64) -> f64 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found f64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `f64` | = note: expected fn pointer `fn(Vec3, f64) -> i32` found fn pointer `fn(Vec3, f64) -> f64` @@ -35,7 +35,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 struct `Vec2`, found `f64` error: aborting due to 5 previous errors diff --git a/src/test/ui/wrong-ret-type.stderr b/src/test/ui/wrong-ret-type.stderr index cf59f42683d72..440620f40b1e2 100644 --- a/src/test/ui/wrong-ret-type.stderr +++ b/src/test/ui/wrong-ret-type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/wrong-ret-type.rs:2:49 | LL | fn mk_int() -> usize { let i: isize = 3; return i; } - | ----- ^ expected usize, found isize + | ----- ^ expected `usize`, found `isize` | | | expected `usize` because of return type From b3517cdee7ba611dae3111370b3f5a815a5b4369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Mon, 18 Nov 2019 10:33:05 -0800 Subject: [PATCH 5/6] review comments --- src/librustc/infer/error_reporting/mod.rs | 6 +-- src/librustc/ty/diagnostics.rs | 56 +++++++++++++++++++++++ src/librustc/ty/mod.rs | 46 +------------------ 3 files changed, 60 insertions(+), 48 deletions(-) create mode 100644 src/librustc/ty/diagnostics.rs diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs index cccdcc68a5793..f2607b23527a1 100644 --- a/src/librustc/infer/error_reporting/mod.rs +++ b/src/librustc/infer/error_reporting/mod.rs @@ -1197,10 +1197,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { }; if let Some((expected, found)) = expected_found { - let expected_label = exp_found.map(|ef| ef.expected.prefix_string()) - .unwrap_or("type".into()); - let found_label = exp_found.map(|ef| ef.found.prefix_string()) - .unwrap_or("type".into()); + let expected_label = exp_found.map_or("type".into(), |ef| ef.expected.prefix_string()); + let found_label = exp_found.map_or("type".into(), |ef| ef.found.prefix_string()); match (&terr, expected == found) { (TypeError::Sorts(values), extra) => { let sort_string = |ty: Ty<'tcx>| match (extra, &ty.kind) { diff --git a/src/librustc/ty/diagnostics.rs b/src/librustc/ty/diagnostics.rs new file mode 100644 index 0000000000000..95bdce2d22252 --- /dev/null +++ b/src/librustc/ty/diagnostics.rs @@ -0,0 +1,56 @@ +//! Diagnostics related methods for `TyS`. + +use crate::ty::TyS; +use crate::ty::TyKind::*; +use crate::ty::sty::InferTy; + +impl<'tcx> TyS<'tcx> { + /// Similar to `TyS::is_primitive`, but also considers inferred numeric values to be primitive. + pub fn is_primitive_ty(&self) -> bool { + match self.kind { + Bool | Char | Str | Int(_) | Uint(_) | Float(_) | + Infer(InferTy::IntVar(_)) | Infer(InferTy::FloatVar(_)) | + Infer(InferTy::FreshIntTy(_)) | Infer(InferTy::FreshFloatTy(_)) => true, + _ => false, + } + } + + /// Whether the type is succinctly representable as a type instead of just refered to with a + /// description in error messages. This is used in the main error message. + pub fn is_simple_ty(&self) -> bool { + match self.kind { + Bool | Char | Str | Int(_) | Uint(_) | Float(_) | + Infer(InferTy::IntVar(_)) | Infer(InferTy::FloatVar(_)) | + Infer(InferTy::FreshIntTy(_)) | Infer(InferTy::FreshFloatTy(_)) => true, + Ref(_, x, _) | Array(x, _) | Slice(x) => x.peel_refs().is_simple_ty(), + Tuple(tys) if tys.is_empty() => true, + _ => false, + } + } + + /// Whether the type is succinctly representable as a type instead of just refered to with a + /// description in error messages. This is used in the primary span label. Beyond what + /// `is_simple_ty` includes, it also accepts ADTs with no type arguments and references to + /// ADTs with no type arguments. + pub fn is_simple_text(&self) -> bool { + match self.kind { + Adt(_, substs) => substs.types().next().is_none(), + Ref(_, ty, _) => ty.is_simple_text(), + _ => self.is_simple_ty(), + } + } + + /// Whether the type can be safely suggested during error recovery. + pub fn is_suggestable(&self) -> bool { + match self.kind { + Opaque(..) | + FnDef(..) | + FnPtr(..) | + Dynamic(..) | + Closure(..) | + Infer(..) | + Projection(..) => false, + _ => true, + } + } +} diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 5fc2812fd97db..280a5a157e934 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -71,6 +71,7 @@ pub use self::sty::BoundRegion::*; pub use self::sty::InferTy::*; pub use self::sty::RegionKind::*; pub use self::sty::TyKind::*; +pub use crate::ty::diagnostics::*; pub use self::binding::BindingMode; pub use self::binding::BindingMode::*; @@ -122,6 +123,7 @@ mod instance; mod structural_impls; mod structural_match; mod sty; +mod diagnostics; // Data types @@ -552,50 +554,6 @@ impl<'tcx> Hash for TyS<'tcx> { } } -impl<'tcx> TyS<'tcx> { - pub fn is_primitive_ty(&self) -> bool { - match self.kind { - Bool | Char | Str | Int(_) | Uint(_) | Float(_) | - Infer(InferTy::IntVar(_)) | Infer(InferTy::FloatVar(_)) | - Infer(InferTy::FreshIntTy(_)) | Infer(InferTy::FreshFloatTy(_)) => true, - _ => false, - } - } - - pub fn is_simple_ty(&self) -> bool { - match self.kind { - Bool | Char | Str | Int(_) | Uint(_) | Float(_) | - Infer(InferTy::IntVar(_)) | Infer(InferTy::FloatVar(_)) | - Infer(InferTy::FreshIntTy(_)) | Infer(InferTy::FreshFloatTy(_)) => true, - Ref(_, x, _) | Array(x, _) | Slice(x) => x.peel_refs().is_simple_ty(), - Tuple(tys) if tys.is_empty() => true, - _ => false, - } - } - - pub fn is_simple_text(&self) -> bool { - match self.kind { - Adt(_, substs) => substs.types().next().is_none(), - Ref(_, ty, _) => ty.is_simple_text(), - _ if self.is_simple_ty() => true, - _ => false, - } - } - - pub fn is_suggestable(&self) -> bool { - match self.kind { - Opaque(..) | - FnDef(..) | - FnPtr(..) | - Dynamic(..) | - Closure(..) | - Infer(..) | - Projection(..) => false, - _ => true, - } - } -} - impl<'a, 'tcx> HashStable> for ty::TyS<'tcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) { let ty::TyS { From 468722b33c589ade04a11f05f53d0f3bff6c7a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Mon, 18 Nov 2019 11:01:02 -0800 Subject: [PATCH 6/6] fix rebase --- .../issue-66387-if-without-else.stderr | 4 +--- .../ui/proc-macro/span-preservation.stderr | 15 +++--------- .../ui/unboxed-closures/issue-30904.stderr | 24 ------------------- 3 files changed, 4 insertions(+), 39 deletions(-) delete mode 100644 src/test/ui/unboxed-closures/issue-30904.stderr diff --git a/src/test/ui/async-await/issue-66387-if-without-else.stderr b/src/test/ui/async-await/issue-66387-if-without-else.stderr index 32952059525a0..42e44472aca71 100644 --- a/src/test/ui/async-await/issue-66387-if-without-else.stderr +++ b/src/test/ui/async-await/issue-66387-if-without-else.stderr @@ -4,10 +4,8 @@ error[E0317]: if may be missing an else clause LL | / if true { LL | | return 0; LL | | } - | |_____^ expected (), found i32 + | |_____^ expected `()`, found `i32` | - = note: expected type `()` - found type `i32` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/proc-macro/span-preservation.stderr b/src/test/ui/proc-macro/span-preservation.stderr index f669b4e9265d1..c978380817791 100644 --- a/src/test/ui/proc-macro/span-preservation.stderr +++ b/src/test/ui/proc-macro/span-preservation.stderr @@ -33,10 +33,7 @@ error[E0308]: mismatched types LL | extern fn bar() { | - possibly return type missing here? LL | 0 - | ^ expected (), found integer - | - = note: expected type `()` - found type `{integer}` + | ^ expected `()`, found integer error[E0308]: mismatched types --> $DIR/span-preservation.rs:44:5 @@ -52,10 +49,7 @@ error[E0308]: mismatched types LL | extern "Rust" fn rust_abi() { | - possibly return type missing here? LL | 0 - | ^ expected (), found integer - | - = note: expected type `()` - found type `{integer}` + | ^ expected `()`, found integer error[E0308]: mismatched types --> $DIR/span-preservation.rs:54:5 @@ -63,10 +57,7 @@ error[E0308]: mismatched types LL | extern "\x43" fn c_abi_escaped() { | - possibly return type missing here? LL | 0 - | ^ expected (), found integer - | - = note: expected type `()` - found type `{integer}` + | ^ expected `()`, found integer error: aborting due to 8 previous errors diff --git a/src/test/ui/unboxed-closures/issue-30904.stderr b/src/test/ui/unboxed-closures/issue-30904.stderr deleted file mode 100644 index aa0e05e94203a..0000000000000 --- a/src/test/ui/unboxed-closures/issue-30904.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-30904.rs:20:45 - | -LL | let _: for<'a> fn(&'a str) -> Str<'a> = Str; - | ^^^ expected concrete lifetime, found bound lifetime parameter 'a - | - = note: expected fn pointer `for<'a> fn(&'a str) -> Str<'a>` - found fn item `fn(&str) -> Str<'_> {Str::<'_>}` - -error[E0631]: type mismatch in function arguments - --> $DIR/issue-30904.rs:26:10 - | -LL | fn test FnOnce<(&'x str,)>>(_: F) {} - | ---- -------------------------- required by this bound in `test` -... -LL | struct Str<'a>(&'a str); - | ------------------------ found signature of `fn(&str) -> _` -... -LL | test(Str); - | ^^^ expected signature of `for<'x> fn(&'x str) -> _` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`.