From b807926963f35902db80ec68eb3b8d3f509823c2 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 6 Apr 2025 13:12:59 +0300 Subject: [PATCH 1/2] UI tests: remove redundant colons in line annotations Search: `(//(\[.*\])?~.*(HELP|ERROR|NOTE|HELP|WARN|WARNING)):` Replace with: `$1` In: `./tests/{ui,ui-fulldeps,rustdoc-ui,incremental}/**/*.{rs,fixed}` --- .../const-generics/hash-tyvid-regression-1.rs | 6 +- .../const-generics/hash-tyvid-regression-2.rs | 2 +- .../const-generics/hash-tyvid-regression-3.rs | 2 +- .../const-generics/hash-tyvid-regression-4.rs | 2 +- .../issue-77708-1.rs | 2 +- .../issue-88022.rs | 8 +- tests/incremental/feature_gate.rs | 2 +- .../disambiguator-endswith-named-suffix.rs | 92 ++-- ...isambiguator-macro-endswith-exclamatory.rs | 2 +- .../infinite-recursive-type-2.rs | 2 +- .../infinite-recursive-type.rs | 2 +- .../feature-gate-intra-doc-pointers.rs | 4 +- tests/rustdoc-ui/issues/issue-120444-1.rs | 2 +- tests/rustdoc-ui/issues/issue-120444-2.rs | 2 +- ...-gate-rustdoc_missing_doc_code_examples.rs | 2 +- tests/rustdoc-ui/mismatched_arg_count.rs | 2 +- .../not-wf-ambiguous-normalization.rs | 2 +- tests/ui-fulldeps/hash-stable-is-unstable.rs | 28 +- tests/ui/abi/c-zst.rs | 2 +- tests/ui/abi/debug.rs | 22 +- tests/ui/abi/sysv64-zst.rs | 2 +- tests/ui/allocator/function-allocator.rs | 2 +- tests/ui/allocator/two-allocators.rs | 2 +- .../argument-suggestions/issue-109425.fixed | 14 +- tests/ui/argument-suggestions/issue-109425.rs | 14 +- .../ui/array-slice-vec/array-break-length.rs | 4 +- .../array-slice-vec/vector-cast-weirdness.rs | 6 +- tests/ui/asm/aarch64/srcloc.rs | 48 +-- tests/ui/asm/generic_const_simd_vec_len.rs | 4 +- tests/ui/asm/issue-72570.rs | 2 +- tests/ui/asm/issue-89305.rs | 2 +- tests/ui/asm/non-const.rs | 2 +- tests/ui/asm/x86_64/srcloc.rs | 50 +-- tests/ui/asm/x86_64/target-feature-attr.rs | 8 +- tests/ui/associated-consts/issue-47814.rs | 2 +- tests/ui/associated-consts/issue-58022.rs | 6 +- tests/ui/associated-consts/issue-63496.rs | 4 +- ...rojection-self-ty-invalid-bivariant-arg.rs | 2 +- ...ojection-self-ty-invalid-bivariant-arg2.rs | 2 +- .../associated-inherent-types/issue-109071.rs | 8 +- .../issue-109299-1.rs | 2 +- .../associated-inherent-types/issue-109768.rs | 2 +- .../associated-inherent-types/regionck-2.rs | 2 +- tests/ui/associated-item/issue-48027.rs | 4 +- .../ui/associated-type-bounds/issue-104916.rs | 2 +- .../associated-type-bounds/issue-71443-1.rs | 2 +- ...ing-associated-items-of-undefined-trait.rs | 6 +- tests/ui/associated-types/defaults-mixed.rs | 4 +- .../defaults-specialization.rs | 10 +- tests/ui/associated-types/issue-23595-1.rs | 2 +- tests/ui/associated-types/issue-23595-2.rs | 2 +- tests/ui/associated-types/issue-26681.rs | 2 +- tests/ui/associated-types/issue-44153.rs | 2 +- tests/ui/associated-types/issue-54108.rs | 2 +- tests/ui/associated-types/issue-63593.rs | 2 +- .../ui/async-await/for-await-consumes-iter.rs | 2 +- .../async-await/in-trait/fn-not-async-err.rs | 2 +- .../async-await/in-trait/generics-mismatch.rs | 2 +- .../in-trait/missing-feature-flag.rs | 6 +- .../in-trait/return-not-existing-pair.rs | 6 +- ...eturn-not-existing-type-wrapping-rpitit.rs | 2 +- .../inference_var_self_argument.rs | 2 +- tests/ui/async-await/issue-101715.rs | 6 +- tests/ui/async-await/issue-70594.rs | 2 +- tests/ui/async-await/issue-74047.rs | 2 +- tests/ui/async-await/issues/issue-102206.rs | 2 +- tests/ui/async-await/issues/issue-107280.rs | 2 +- tests/ui/async-await/issues/issue-112225-2.rs | 2 +- tests/ui/async-await/issues/issue-78654.rs | 4 +- tests/ui/async-await/issues/issue-95307.rs | 2 +- tests/ui/attributes/arg-error-issue-121425.rs | 12 +- tests/ui/attributes/dump_def_parents.rs | 8 +- .../ui/attributes/inline/attr-usage-inline.rs | 4 +- tests/ui/attributes/issue-100631.rs | 2 +- tests/ui/attributes/suffixed-literal-meta.rs | 24 +- .../unsafe/derive-unsafe-attributes.rs | 14 +- .../unsafe/extraneous-unsafe-attributes.rs | 20 +- .../unsafe/proc-unsafe-attributes.rs | 22 +- .../unsafe/unsafe-safe-attribute.rs | 2 +- .../unsafe-safe-attribute_diagnostic.rs | 2 +- .../typeck-auto-trait-no-supertraits-2.rs | 2 +- tests/ui/binop/binop-move-semantics.rs | 16 +- tests/ui/binop/issue-77910-1.rs | 2 +- tests/ui/binop/issue-77910-2.rs | 2 +- tests/ui/block-result/issue-20862.rs | 4 +- tests/ui/block-result/issue-22645.rs | 2 +- tests/ui/borrowck/borrowck-argument.rs | 8 +- ...owck-move-from-subpath-of-borrowed-path.rs | 2 +- .../borrowck/cloning-in-async-block-121547.rs | 4 +- tests/ui/borrowck/drop-in-loop.rs | 2 +- .../issue-109271-pass-self-into-closure.fixed | 10 +- .../issue-109271-pass-self-into-closure.rs | 10 +- tests/ui/borrowck/issue-17718-static-move.rs | 2 +- tests/ui/borrowck/issue-83924.fixed | 2 +- tests/ui/borrowck/issue-83924.rs | 2 +- tests/ui/borrowck/issue-85581.rs | 2 +- .../borrowck/issue-87456-point-to-closure.rs | 8 +- .../borrowck/move-in-pattern-mut-in-loop.rs | 2 +- ...-value-suggest-reborrow-issue-127285.fixed | 2 +- ...ved-value-suggest-reborrow-issue-127285.rs | 2 +- tests/ui/borrowck/tainted-promoteds.rs | 2 +- .../builtin-superkinds-self-type.rs | 2 +- ...ature-gate-extended_varargs_abi_support.rs | 6 +- tests/ui/c-variadic/issue-86053-2.rs | 2 +- tests/ui/c-variadic/variadic-ffi-1.rs | 2 +- tests/ui/c-variadic/variadic-ffi-2.rs | 2 +- tests/ui/c-variadic/variadic-ffi-4.rs | 22 +- .../ui/cannot-mutate-captured-non-mut-var.rs | 4 +- .../cast/cast_lit_suffix-issue-138392.fixed | 4 +- tests/ui/cast/cast_lit_suffix-issue-138392.rs | 4 +- tests/ui/cast/issue-10991.rs | 2 +- tests/ui/cast/issue-84213.fixed | 4 +- tests/ui/cast/issue-84213.rs | 4 +- tests/ui/cast/issue-85586.rs | 2 +- tests/ui/cast/issue-89497.fixed | 4 +- tests/ui/cast/issue-89497.rs | 4 +- .../cast/ptr-to-trait-obj-different-args.rs | 10 +- ...to-trait-obj-different-regions-id-trait.rs | 2 +- ...r-to-trait-obj-different-regions-lt-ext.rs | 2 +- ...ptr-to-trait-obj-different-regions-misc.rs | 22 +- tests/ui/cast/ptr-to-trait-obj-wrap-upcast.rs | 2 +- tests/ui/cast/unsized-struct-cast.rs | 2 +- .../arrays-completely-captured.rs | 16 +- .../2229_closure_analysis/by_value.rs | 14 +- .../capture-analysis-1.rs | 18 +- .../capture-analysis-2.rs | 16 +- .../capture-analysis-3.rs | 16 +- .../capture-analysis-4.rs | 12 +- .../capture-disjoint-field-struct.rs | 10 +- .../capture-disjoint-field-tuple.rs | 10 +- .../2229_closure_analysis/capture-enums.rs | 28 +- .../deep-multilevel-struct.rs | 22 +- .../deep-multilevel-tuple.rs | 22 +- .../destructure_patterns.rs | 58 +-- .../diagnostics/arrays.rs | 10 +- .../2229_closure_analysis/diagnostics/box.rs | 6 +- .../diagnostics/cant-mutate-imm-borrow.rs | 2 +- .../diagnostics/cant-mutate-imm.rs | 4 +- .../diagnostics/multilevel-path.rs | 2 +- .../diagnostics/mut_ref.rs | 4 +- .../diagnostics/repr_packed.rs | 2 +- .../diagnostics/simple-struct-min-capture.rs | 2 +- .../feature-gate-capture_disjoint_fields.rs | 14 +- .../filter-on-struct-member.rs | 8 +- .../2229_closure_analysis/issue-118144.rs | 2 +- .../2229_closure_analysis/issue-87378.rs | 14 +- .../2229_closure_analysis/issue-88118-2.rs | 2 +- .../2229_closure_analysis/issue-88476.rs | 28 +- .../match/issue-87097.rs | 6 +- .../match/issue-88331.rs | 4 +- .../match/match-edge-cases_2.rs | 2 +- .../match/non-exhaustive-match.rs | 8 +- .../match/pattern-matching-should-fail.rs | 2 +- .../match/patterns-capture-analysis.rs | 26 +- .../migrations/auto_traits.fixed | 36 +- .../migrations/auto_traits.rs | 36 +- .../closure-body-macro-fragment.fixed | 4 +- .../migrations/closure-body-macro-fragment.rs | 4 +- .../insignificant_drop_attr_migrations.fixed | 22 +- .../insignificant_drop_attr_migrations.rs | 22 +- .../migrations/issue-78720.rs | 2 +- .../migrations/macro.fixed | 12 +- .../2229_closure_analysis/migrations/macro.rs | 12 +- .../migrations/migrations_rustfix.fixed | 22 +- .../migrations/migrations_rustfix.rs | 22 +- .../migrations/mir_calls_to_shims.fixed | 14 +- .../migrations/mir_calls_to_shims.rs | 14 +- .../migrations/multi_diagnostics.fixed | 72 ++-- .../migrations/multi_diagnostics.rs | 72 ++-- .../migrations/precise.fixed | 30 +- .../migrations/precise.rs | 30 +- .../migrations/significant_drop.fixed | 118 ++--- .../migrations/significant_drop.rs | 118 ++--- .../2229_closure_analysis/move_closure.rs | 142 +++---- .../multilevel-path-1.rs | 14 +- .../multilevel-path-2.rs | 14 +- .../2229_closure_analysis/nested-closure.rs | 38 +- .../optimization/edge_case.rs | 14 +- .../path-with-array-access.rs | 14 +- .../preserve_field_drop_order.rs | 48 +-- .../2229_closure_analysis/repr_packed.rs | 52 +-- .../simple-struct-min-capture.rs | 20 +- .../unique-borrows-are-invariant-1.rs | 2 +- .../unique-borrows-are-invariant-2.rs | 2 +- .../2229_closure_analysis/unsafe_ptr.rs | 28 +- .../2229_closure_analysis/wild_patterns.rs | 42 +- .../binder/forbid_ambig_const_infers.rs | 2 +- .../binder/forbid_ambig_type_infers.rs | 2 +- .../ui/closures/binder/forbid_const_infer.rs | 2 +- tests/ui/closures/binder/implicit-stuff.rs | 2 +- .../ui/closures/closure-array-break-length.rs | 6 +- tests/ui/closures/issue-10398.rs | 2 +- tests/ui/closures/issue-11873.rs | 2 +- tests/ui/closures/issue-52437.rs | 4 +- tests/ui/closures/issue-67123.rs | 2 +- tests/ui/closures/issue-6801.rs | 2 +- tests/ui/closures/issue-87461.rs | 6 +- .../coercion/coerce-issue-49593-box-never.rs | 4 +- tests/ui/coherence/associated-type2.rs | 2 +- .../coherence-negative-outlives-lifetimes.rs | 2 +- ...nce-overlap-negate-not-use-feature-gate.rs | 2 +- .../ui/coherence/coherence-tuple-conflict.rs | 2 +- tests/ui/coherence/deep-bad-copy-reason.rs | 10 +- .../generic_const_type_mismatch.rs | 2 +- .../coherence/occurs-check/associated-type.rs | 2 +- tests/ui/compare-method/issue-90444.rs | 4 +- .../cfg-attr-multi-true.rs | 10 +- .../conditional-compilation/cfg-attr-parse.rs | 4 +- .../alias_const_param_ty-1.rs | 2 +- .../adt_const_params/const_param_ty_bad.rs | 12 +- .../const_param_ty_bad_empty_array.rs | 2 +- .../const_param_ty_dyn_compatibility.rs | 4 +- ...nst_param_ty_generic_bounds_do_not_hold.rs | 6 +- .../const_param_ty_impl_bad_field.rs | 4 +- .../const_param_ty_impl_no_structural_eq.rs | 4 +- .../non_valtreeable_const_arg-1.rs | 2 +- .../non_valtreeable_const_arg-2.rs | 6 +- .../reference_pointee_is_const_param-1.rs | 2 +- .../reference_pointee_is_const_param-2.rs | 2 +- .../suggest_feature_only_when_possible.rs | 28 +- .../trait_objects_as_a_const_generic.rs | 2 +- .../adt_const_params/unsized_field-1.rs | 6 +- .../adt_const_params/unsized_field-2.rs | 4 +- .../assoc_const_as_type_argument.rs | 4 +- .../ui/const-generics/bad-subst-const-kind.rs | 4 +- .../const-param-type-depends-on-type-param.rs | 4 +- .../defaults/generic-expr-default-concrete.rs | 2 +- .../generic-expr-default-mismatched-types.rs | 2 +- .../defaults/generic-expr-default.rs | 4 +- tests/ui/const-generics/defaults/mismatch.rs | 10 +- .../mismatched_ty_const_in_trait_impl.rs | 10 +- .../defaults/rp_impl_trait_fail.rs | 8 +- .../defaults/trait_objects_fail.rs | 4 +- tests/ui/const-generics/defaults/wfness.rs | 6 +- .../ui/const-generics/defaults/wrong-order.rs | 2 +- .../dont-evaluate-array-len-on-err-1.rs | 2 +- .../const_arg_trivial_macro_expansion-2.rs | 6 +- ...rivial-const-arg-macro-braced-expansion.rs | 2 +- ...trivial-const-arg-macro-nested-braces-2.rs | 2 +- .../trivial-const-arg-macro-nested-braces.rs | 2 +- .../early/trivial-const-arg-nested-braces.rs | 2 +- .../const-generics/ensure_is_evaluatable.rs | 2 +- ...ailing_goal_with_repeat_expr_anon_const.rs | 6 +- .../ui/const-generics/fn-const-param-call.rs | 4 +- .../ui/const-generics/fn-const-param-infer.rs | 6 +- .../fn_with_two_const_inputs.rs | 2 +- .../generic_arg_infer/issue-91614.rs | 2 +- .../abstract-const-as-cast-3.rs | 24 +- .../abstract-consts-as-cast-5.rs | 2 +- .../generic_const_exprs/adt_wf_hang.rs | 2 +- .../doesnt_unify_evaluatable.rs | 2 +- .../const-block-is-poly.rs | 2 +- .../const_kind_expr/issue_114151.rs | 12 +- .../const_kind_expr/relate_binop_arg_tys.rs | 4 +- .../const_kind_expr/relate_cast_arg_ty.rs | 4 +- .../const_kind_expr/wf_obligation.rs | 4 +- .../generic_const_exprs/error_in_ty.rs | 10 +- .../generic_const_exprs/issue-105257.rs | 2 +- .../generic_const_exprs/issue-105608.rs | 2 +- .../generic_const_exprs/issue-109141.rs | 2 +- .../generic_const_exprs/issue-62504.rs | 2 +- ...9518-default_trait_method_normalization.rs | 2 +- .../generic_const_exprs/issue-83765.rs | 6 +- .../generic_const_exprs/issue-85848.rs | 6 +- .../generic_const_exprs/lit_type_mismatch.rs | 6 +- .../generic_const_exprs/no_where_clause.rs | 4 +- .../non_local_anon_const_diagnostics.rs | 2 +- .../unresolved_lifetimes_error.rs | 2 +- .../bad_inference.rs | 4 +- .../forward_declared_type.rs | 4 +- .../lifetime_dependent_const_param.rs | 6 +- .../mismatched_args_with_value.rs | 4 +- .../no_const_param_ty_bound.rs | 2 +- tests/ui/const-generics/invalid-enum.rs | 14 +- .../ui/const-generics/issues/issue-56445-1.rs | 2 +- .../ui/const-generics/issues/issue-56445-2.rs | 2 +- .../ui/const-generics/issues/issue-56445-3.rs | 2 +- tests/ui/const-generics/issues/issue-62878.rs | 2 +- .../ui/const-generics/issues/issue-67945-3.rs | 6 +- .../ui/const-generics/issues/issue-67945-4.rs | 6 +- tests/ui/const-generics/issues/issue-68366.rs | 2 +- tests/ui/const-generics/issues/issue-71381.rs | 8 +- tests/ui/const-generics/issues/issue-71382.rs | 2 +- tests/ui/const-generics/issues/issue-71611.rs | 4 +- tests/ui/const-generics/issues/issue-72352.rs | 2 +- tests/ui/const-generics/issues/issue-82956.rs | 2 +- tests/ui/const-generics/issues/issue-83765.rs | 4 +- .../const-generics/issues/issue-84659.fixed | 2 +- tests/ui/const-generics/issues/issue-84659.rs | 2 +- tests/ui/const-generics/issues/issue-86530.rs | 2 +- tests/ui/const-generics/issues/issue-86820.rs | 2 +- tests/ui/const-generics/issues/issue-87493.rs | 4 +- tests/ui/const-generics/issues/issue-90318.rs | 4 +- tests/ui/const-generics/kind_mismatch.rs | 4 +- tests/ui/const-generics/lookup-method.rs | 2 +- .../min_const_generics/const_default_first.rs | 2 +- .../min_const_generics/macro-fail.rs | 10 +- .../const-generics/mistyped_const_in_pat.rs | 2 +- .../const-generics/not_wf_param_in_rpitit.rs | 4 +- tests/ui/const-generics/opaque_types.rs | 6 +- tests/ui/const-generics/opaque_types2.rs | 2 +- .../parent_generics_of_encoding_impl_trait.rs | 2 +- .../raw-ptr-const-param-deref.rs | 4 +- .../ui/const-generics/raw-ptr-const-param.rs | 4 +- .../repeat_expr_hack_gives_right_generics.rs | 4 +- .../sneaky-array-repeat-expr.rs | 8 +- tests/ui/const-generics/transmute-fail.rs | 22 +- tests/ui/const-generics/type_not_in_scope.rs | 4 +- .../const-generics/unify_with_nested_expr.rs | 2 +- .../variant-discrimiant-no-generics.rs | 8 +- tests/ui/const-ptr/forbidden_slices.rs | 24 +- tests/ui/consts/assert-type-intrinsics.rs | 6 +- tests/ui/consts/const-array-oob-arith.rs | 4 +- tests/ui/consts/const-array-oob.rs | 2 +- .../const_panic-normalize-tabs-115498.rs | 2 +- .../const-eval/heap/alloc_intrinsic_errors.rs | 2 +- .../const-eval/heap/alloc_intrinsic_uninit.rs | 2 +- .../heap/alloc_intrinsic_untyped.rs | 2 +- .../heap/dealloc_intrinsic_dangling.rs | 4 +- .../heap/dealloc_intrinsic_duplicate.rs | 2 +- .../dealloc_intrinsic_incorrect_layout.rs | 8 +- tests/ui/consts/const-eval/issue-52475.rs | 2 +- tests/ui/consts/const-eval/issue-85155.rs | 2 +- .../issue-91827-extern-types-field-offset.rs | 2 +- .../ui/consts/const-eval/nonnull_as_ref_ub.rs | 2 +- tests/ui/consts/const-eval/raw-bytes.rs | 16 +- tests/ui/consts/const-eval/raw-pointer-ub.rs | 16 +- .../ui/consts/const-eval/ub-invalid-values.rs | 2 +- .../const-eval/ub-write-through-immutable.rs | 4 +- .../validation-ice-extern-type-field.rs | 2 +- .../const-extern-fn-call-extern-fn.rs | 4 +- tests/ui/consts/const-mut-refs/issue-76510.rs | 2 +- tests/ui/consts/const-promoted-opaque.rs | 6 +- tests/ui/consts/const-unsized.rs | 4 +- tests/ui/consts/const-unstable-intrinsic.rs | 12 +- tests/ui/consts/const-unwrap.rs | 8 +- .../const_in_pattern/arrays-and-slices.rs | 10 +- .../issue-34784-match-on-non-int-raw-ptr.rs | 8 +- .../const_refs_to_static_fail_invalid.rs | 6 +- tests/ui/consts/control-flow/loop.rs | 8 +- tests/ui/consts/control-flow/try.rs | 4 +- .../consts/dangling-zst-ice-issue-126393.rs | 2 +- tests/ui/consts/effect_param.rs | 8 +- tests/ui/consts/escaping-bound-var.rs | 2 +- .../consts/extra-const-ub/detect-extra-ub.rs | 16 +- tests/ui/consts/issue-104609.rs | 4 +- tests/ui/consts/issue-104768.rs | 4 +- tests/ui/consts/issue-17458.rs | 2 +- .../ui/consts/issue-17718-const-bad-values.rs | 4 +- tests/ui/consts/issue-17718-const-borrow.rs | 6 +- .../issue-17718-constants-not-static.rs | 2 +- tests/ui/consts/issue-32829-2.rs | 6 +- tests/ui/consts/issue-63952.rs | 2 +- tests/ui/consts/issue-64506.rs | 2 +- tests/ui/consts/issue-64662.rs | 4 +- .../consts/issue-66693-panic-in-array-len.rs | 4 +- tests/ui/consts/issue-66693.rs | 8 +- tests/ui/consts/issue-87046.rs | 2 +- tests/ui/consts/issue-90870.rs | 12 +- tests/ui/consts/issue-91434.rs | 4 +- tests/ui/consts/issue-91560.fixed | 8 +- tests/ui/consts/issue-91560.rs | 8 +- tests/ui/consts/issue-94675.rs | 2 +- ...rsive_const_stab_unmarked_crate_imports.rs | 4 +- ...cursive_const_stab_unstable_if_unmarked.rs | 4 +- .../miri_unleashed/mutable_references.rs | 16 +- tests/ui/consts/missing_assoc_const_type2.rs | 2 +- tests/ui/consts/nested_erroneous_ctfe.rs | 2 +- ...no-ice-from-static-in-const-issue-52060.rs | 2 +- tests/ui/consts/overflowing-consts.rs | 340 +++++++-------- .../precise-drop-allow-const-fn-unstable.rs | 2 +- .../promoted-type-error-issue-133968.rs | 2 +- tests/ui/consts/promoted_const_call.rs | 12 +- tests/ui/consts/promoted_const_call2.rs | 10 +- tests/ui/consts/promoted_const_call3.rs | 14 +- tests/ui/consts/promoted_const_call5.rs | 8 +- ...oted_running_out_of_memory_issue-130687.rs | 2 +- tests/ui/consts/promoted_size_overflow.rs | 2 +- tests/ui/consts/recursive-block.rs | 2 +- tests/ui/consts/recursive-const-in-impl.rs | 2 +- tests/ui/consts/refs-to-cell-in-final.rs | 6 +- .../slice-index-overflow-issue-130284.rs | 2 +- ...slice_elem_ty_mismatch_in_unsizing_cast.rs | 2 +- tests/ui/coroutine/async_gen_fn.rs | 6 +- tests/ui/coroutine/borrowing.rs | 4 +- tests/ui/coroutine/gen_block.rs | 10 +- tests/ui/coroutine/gen_block_is_coro.rs | 6 +- tests/ui/coroutine/gen_block_move.fixed | 2 +- tests/ui/coroutine/gen_block_move.rs | 2 +- tests/ui/coroutine/gen_block_panic.rs | 2 +- tests/ui/coroutine/gen_fn.rs | 4 +- tests/ui/coroutine/invalid_attr_usage.rs | 4 +- .../issue-64620-yield-array-element.rs | 4 +- tests/ui/coroutine/issue-88653.rs | 14 +- tests/ui/coroutine/issue-91477.rs | 2 +- tests/ui/coroutine/not-send-sync.rs | 4 +- .../print/coroutine-print-verbose-2.rs | 4 +- .../coroutine/self_referential_gen_block.rs | 2 +- tests/ui/coroutine/too-many-parameters.rs | 2 +- tests/ui/coroutine/type-mismatch-error.rs | 2 +- tests/ui/crate-name-mismatch.rs | 2 +- tests/ui/cross-crate/private-by-default.rs | 20 +- ..._body_owner_parent_found_in_diagnostics.rs | 20 +- .../deprecation/deprecated_no_stack_check.rs | 2 +- tests/ui/deref-non-pointer.rs | 2 +- tests/ui/derives/clone-debug-dead-code.rs | 10 +- tests/ui/derives/deriving-non-type.rs | 18 +- .../deriving-with-repr-packed-move-errors.rs | 42 +- .../deriving/deriving-coerce-pointee-neg.rs | 34 +- .../do_not_recommend/type_mismatch.rs | 2 +- tests/ui/did_you_mean/issue-103909.rs | 4 +- .../did_you_mean/issue-105225-named-args.rs | 4 +- tests/ui/did_you_mean/issue-105225.fixed | 10 +- tests/ui/did_you_mean/issue-105225.rs | 10 +- ...issue-21659-show-relevant-trait-impls-1.rs | 2 +- ...issue-21659-show-relevant-trait-impls-2.rs | 2 +- .../if-let-rescope-borrowck-suggestions.rs | 6 +- tests/ui/drop/lint-if-let-rescope-gated.rs | 8 +- tests/ui/drop/lint-if-let-rescope.fixed | 66 +-- tests/ui/drop/lint-if-let-rescope.rs | 66 +-- .../lint-tail-expr-drop-order-borrowck.rs | 34 +- tests/ui/drop/lint-tail-expr-drop-order.rs | 172 ++++---- .../drop/nonsense-drop-impl-issue-139278.rs | 4 +- .../ui/drop/tail-expr-drop-order-negative.rs | 2 +- ...ined_by_assoc_type_equality_and_self_ty.rs | 2 +- tests/ui/dropck/dropck-union.rs | 2 +- .../relate_lt_in_type_outlives_bound.rs | 2 +- .../unconstrained_const_param_on_drop.rs | 4 +- .../ui/dyn-compatibility/assoc_type_bounds.rs | 4 +- .../dyn-compatibility/assoc_type_bounds2.rs | 4 +- .../assoc_type_bounds_sized_unnecessary.rs | 2 +- .../assoc_type_bounds_sized_used.rs | 4 +- .../avoid-ice-on-warning-2.rs | 2 +- .../mentions-Self-in-super-predicates.rs | 4 +- ...t-in-fn-inputs-and-outputs-issue-125139.rs | 84 ++-- tests/ui/dyn-keyword/issue-5153.rs | 2 +- tests/ui/dyn-star/pointer-like-impl-rules.rs | 40 +- .../edition-raw-pointer-method-2015.rs | 4 +- .../edition-raw-pointer-method-2018.rs | 2 +- .../never-type-fallback-breaking.e2021.fixed | 10 +- .../editions/never-type-fallback-breaking.rs | 10 +- tests/ui/empty/empty-linkname.rs | 2 +- .../auxiliary/bad_main_functions.rs | 2 +- .../env-macro/env-arg-2-not-string-literal.rs | 2 +- tests/ui/env-macro/env-no-args.rs | 2 +- tests/ui/env-macro/env-not-defined-custom.rs | 2 +- tests/ui/env-macro/env-not-defined-default.rs | 2 +- tests/ui/env-macro/env-not-string-literal.rs | 2 +- tests/ui/env-macro/env-too-many-args.rs | 2 +- tests/ui/env-macro/option_env-no-args.rs | 2 +- .../option_env-not-string-literal.rs | 2 +- .../ui/env-macro/option_env-too-many-args.rs | 2 +- tests/ui/ergonomic-clones/dotuse/parse.rs | 14 +- tests/ui/error-codes/E0084.rs | 2 +- .../error-codes/E0152-duplicate-lang-items.rs | 2 +- tests/ui/error-codes/E0517.rs | 8 +- tests/ui/error-codes/E0518.rs | 4 +- tests/ui/error-codes/E0637.rs | 6 +- .../explicit-tail-calls/become-operator.fixed | 14 +- .../ui/explicit-tail-calls/become-operator.rs | 14 +- .../ui/explicit-tail-calls/become-outside.rs | 4 +- .../become-uncallable.fixed | 6 +- .../explicit-tail-calls/become-uncallable.rs | 6 +- .../caller_is_track_caller.rs | 4 +- tests/ui/explicit-tail-calls/closure.fixed | 8 +- tests/ui/explicit-tail-calls/closure.rs | 8 +- tests/ui/explicit-tail-calls/constck.rs | 4 +- .../ctfe-arg-bad-borrow.rs | 2 +- .../explicit-tail-calls/ctfe-id-unlimited.rs | 2 +- tests/ui/explicit-tail-calls/in-closure.rs | 2 +- .../explicit-tail-calls/return-mismatches.rs | 6 +- .../explicit-tail-calls/signature-mismatch.rs | 8 +- tests/ui/explicit-tail-calls/unsafeck.rs | 2 +- tests/ui/expr/if/if-let-arm-types.rs | 2 +- tests/ui/expr/if/if-no-match-bindings.rs | 2 +- .../missing_braces_around_block.fixed | 4 +- .../missing_braces_around_block.rs | 4 +- .../malformed_closure/ruby_style_closure.rs | 2 +- tests/ui/extern/extern-main-fn.rs | 2 +- tests/ui/extern/fictional-abi.rs | 2 +- tests/ui/extern/issue-116203.rs | 8 +- .../issue-36122-accessing-externed-dst.rs | 4 +- tests/ui/extern/issue-80074.rs | 10 +- tests/ui/extern/issue-95829.rs | 4 +- .../feature-gate-abi_unadjusted.rs | 2 +- .../feature-gate-allocator_internals.rs | 2 +- .../feature-gates/feature-gate-cfg-version.rs | 22 +- .../feature-gate-deprecated_safe.rs | 4 +- .../ui/feature-gates/feature-gate-doc_cfg.rs | 2 +- .../feature-gates/feature-gate-doc_masked.rs | 2 +- .../feature-gate-doc_notable_trait.rs | 2 +- .../feature-gate-explicit_tail_calls.rs | 4 +- .../feature-gates/feature-gate-gen_blocks.rs | 14 +- ...ture-gate-generic-const-parameter-types.rs | 4 +- .../feature-gate-generic_arg_infer.rs | 6 +- .../feature-gate-guard-patterns.rs | 16 +- .../feature-gate-impl_trait_in_assoc_type.rs | 14 +- .../feature-gate-keylocker_x86.rs | 2 +- .../ui/feature-gates/feature-gate-link_cfg.rs | 2 +- .../ui/feature-gates/feature-gate-linkage.rs | 2 +- .../feature-gate-movrs_target_feature.rs | 2 +- .../feature-gate-naked_functions.rs | 4 +- ...ure-gate-naked_functions_target_feature.rs | 2 +- ...re-gate-native_link_modifiers_as_needed.rs | 2 +- .../feature-gate-patchable-function-entry.rs | 2 +- .../feature-gate-pattern-complexity-limit.rs | 2 +- .../feature-gate-raw-dylib-elf.rs | 2 +- .../feature-gates/feature-gate-repr-simd.rs | 12 +- .../feature-gate-rustdoc_internals.rs | 6 +- .../feature-gate-sha512_sm_x86.rs | 2 +- .../feature-gate-shorter_tail_lifetimes.rs | 2 +- .../feature-gate-trace_macros.rs | 2 +- .../feature-gate-unsized-const-params.rs | 6 +- .../feature-gate-x86_amx_intrinsics.rs | 2 +- .../feature-gate-xop_target_feature.rs | 2 +- .../feature-gated-feature-in-macro-arg.rs | 2 +- tests/ui/feature-gates/gated-bad-feature.rs | 2 +- ...sue-43106-gating-of-builtin-attrs-error.rs | 46 +- .../soft-syntax-gates-with-errors.rs | 4 +- .../soft-syntax-gates-without-errors.rs | 8 +- tests/ui/fmt/format-args-argument-span.rs | 8 +- .../ui/fmt/format-args-capture-issue-93378.rs | 4 +- .../ui/fmt/format-args-capture-issue-94010.rs | 4 +- .../fmt/format-args-capture-macro-hygiene.rs | 10 +- .../format-args-capture-missing-variables.rs | 10 +- tests/ui/fmt/format-expanded-string.rs | 4 +- tests/ui/fmt/ifmt-bad-arg.rs | 52 +-- tests/ui/fmt/ifmt-bad-format-args.rs | 4 +- tests/ui/fmt/ifmt-unimpl.rs | 2 +- tests/ui/fmt/ifmt-unknown-trait.rs | 2 +- tests/ui/fmt/issue-86085.rs | 2 +- tests/ui/fmt/issue-89173.rs | 12 +- tests/ui/fmt/issue-91556.rs | 10 +- tests/ui/fmt/raw-idents.rs | 8 +- tests/ui/fn-main/wrong-type.rs | 2 +- tests/ui/fn/bad-main.rs | 2 +- .../ui/fn/bad-turbofish-hints-issue-121901.rs | 4 +- tests/ui/fn/fn_def_coercion.rs | 4 +- .../ui/fn/fn_def_opaque_coercion_to_fn_ptr.rs | 4 +- tests/ui/fn/suggest-return-closure.rs | 16 +- tests/ui/for-loop-while/break-outside-loop.rs | 10 +- .../ui/function-pointer/signature-mismatch.rs | 2 +- .../const_params_have_right_type.rs | 2 +- ...ds-not-checked-with-right-substitutions.rs | 2 +- .../gat-in-trait-path-undeclared-lifetime.rs | 10 +- .../gat-trait-path-generic-type-arg.rs | 6 +- .../gat-trait-path-missing-lifetime.rs | 2 +- .../gat-trait-path-parenthesised-args.rs | 10 +- .../generic-associated-types/issue-67510.rs | 6 +- .../generic-associated-types/issue-68648-2.rs | 2 +- .../generic-associated-types/issue-70304.rs | 4 +- .../generic-associated-types/issue-71176.rs | 12 +- .../generic-associated-types/issue-74684-1.rs | 2 +- .../generic-associated-types/issue-74684-2.rs | 4 +- .../generic-associated-types/issue-74816.rs | 2 +- .../generic-associated-types/issue-78671.rs | 4 +- .../generic-associated-types/issue-79636-1.rs | 6 +- .../generic-associated-types/issue-79636-2.rs | 2 +- .../generic-associated-types/issue-84931.rs | 4 +- .../generic-associated-types/issue-88287.rs | 2 +- .../generic-associated-types/issue-88595.rs | 4 +- .../generic-associated-types/issue-90014.rs | 2 +- .../parse/trait-path-expected-token.rs | 2 +- .../parse/trait-path-expressions.rs | 4 +- .../parse/trait-path-missing-gen_arg.rs | 4 +- .../parse/trait-path-segments.rs | 6 +- .../parse/trait-path-types.rs | 6 +- .../static-lifetime-tip-with-default-type.rs | 16 +- tests/ui/generic-const-items/recursive.rs | 2 +- .../post_monomorphization_error_backtrace.rs | 22 +- ...gate-half-open-range-patterns-in-slices.rs | 2 +- ...f-open-range-pats-inclusive-match-arrow.rs | 6 +- .../half-open-range-pats-inclusive-no-end.rs | 4 +- .../range_pat_interactions1.rs | 4 +- .../slice_pattern_syntax_problem1.rs | 2 +- .../subtype/placeholder-pattern-fail.rs | 4 +- .../higher-ranked/trait-bounds/issue-59311.rs | 6 +- .../normalize-under-binder/issue-89118.rs | 6 +- ...rm-before-method-resolution-opaque-type.rs | 2 +- tests/ui/impl-trait/associated-type-cycle.rs | 2 +- .../ui/impl-trait/associated-type-undefine.rs | 4 +- tests/ui/impl-trait/auto-trait-leak.rs | 2 +- .../impl-trait/auto-trait-selection-freeze.rs | 2 +- tests/ui/impl-trait/auto-trait-selection.rs | 2 +- .../ui/impl-trait/bound-normalization-fail.rs | 4 +- ...l_method_on_inherent_impl_on_rigid_type.rs | 4 +- .../impl-trait/call_method_without_import.rs | 4 +- .../impl-trait/extra-impl-in-trait-impl.fixed | 8 +- .../ui/impl-trait/extra-impl-in-trait-impl.rs | 8 +- .../generic-with-implicit-hrtb-without-dyn.rs | 6 +- ...-type-whensubstituting-in-region-112823.rs | 2 +- .../impl-trait/in-assoc-type-unconstrained.rs | 8 +- tests/ui/impl-trait/in-assoc-type.rs | 2 +- .../in-trait/return-dont-satisfy-bounds.rs | 6 +- tests/ui/impl-trait/issue-72911.rs | 4 +- ...issue-21659-show-relevant-trait-impls-3.rs | 2 +- tests/ui/impl-trait/issues/issue-70877.rs | 8 +- tests/ui/impl-trait/issues/issue-86800.rs | 4 +- tests/ui/impl-trait/issues/issue-92305.rs | 4 +- tests/ui/impl-trait/method-resolution2.rs | 2 +- tests/ui/impl-trait/method-resolution3.rs | 2 +- .../must_outlive_least_region_or_bound.rs | 14 +- tests/ui/impl-trait/nested-rpit-hrtb.rs | 2 +- .../impl-trait/opt-out-bound-not-satisfied.rs | 4 +- tests/ui/impl-trait/recursive-bound-eval.rs | 2 +- ...alias-impl-trait-declaration-too-subtle.rs | 8 +- .../static-return-lifetime-infered.rs | 4 +- .../trait_upcasting_reference_mismatch.rs | 2 +- .../two_tait_defining_each_other2.rs | 2 +- .../type-alias-impl-trait-in-fn-body.rs | 2 +- .../impl-trait/unactionable_diagnostic.fixed | 4 +- .../ui/impl-trait/unactionable_diagnostic.rs | 4 +- tests/ui/impl-trait/unsized_coercion.rs | 2 +- tests/ui/impl-trait/unsized_coercion2.rs | 2 +- tests/ui/impl-trait/unsized_coercion3.rs | 4 +- tests/ui/impl-trait/unsized_coercion5.rs | 2 +- tests/ui/impl-trait/where-allowed.rs | 4 +- tests/ui/imports/append-import-suggestion.rs | 2 +- tests/ui/imports/cycle-import-in-std-1.rs | 2 +- tests/ui/imports/cycle-import-in-std-2.rs | 2 +- tests/ui/imports/glob-resolve1.rs | 8 +- tests/ui/imports/inaccessible_type_aliases.rs | 4 +- tests/ui/imports/issue-114682-2.rs | 2 +- tests/ui/imports/issue-13404.rs | 2 +- tests/ui/imports/issue-8208.rs | 6 +- .../multiple-extern-by-macro-for-buitlin.rs | 2 +- .../multiple-extern-by-macro-for-custom.rs | 2 +- .../multiple-extern-by-macro-for-inexist.rs | 4 +- ...multiple-extern-by-macro-for-underscore.rs | 2 +- tests/ui/imports/no-pub-reexports-but-used.rs | 6 +- tests/ui/imports/no-std-inject.rs | 2 +- tests/ui/imports/pub-reexport-empty.rs | 4 +- tests/ui/imports/resolve-other-libc.rs | 2 +- .../shadow-glob-module-resolution-1.rs | 6 +- .../shadow-glob-module-resolution-2.rs | 6 +- .../shadow-glob-module-resolution-3.rs | 6 +- .../shadow-glob-module-resolution-4.rs | 6 +- .../imports/unresolved-seg-after-ambiguous.rs | 6 +- tests/ui/indexing/indexing-requires-a-uint.rs | 4 +- .../hint-closure-signature-119266.rs | 12 +- tests/ui/inference/issue-71309.rs | 2 +- tests/ui/inference/issue-80816.rs | 8 +- tests/ui/inference/issue-86162-1.rs | 2 +- tests/ui/inference/issue-86162-2.rs | 2 +- .../incompat-call-after-qualified-path-0.rs | 4 +- .../incompat-call-after-qualified-path-1.rs | 4 +- .../ui/inference/need_type_info/type-alias.rs | 2 +- tests/ui/infinite/infinite-assoc.rs | 4 +- .../infinite-type-alias-mutual-recursion.rs | 6 +- .../infinite/infinite-vec-type-recursion.rs | 2 +- .../inline-const/const-expr-generic-err2.rs | 2 +- .../cross-const-control-flow-125846.rs | 18 +- tests/ui/inline-const/promotion.rs | 2 +- .../referencing-local-variables.rs | 2 +- tests/ui/inline-const/uninit-local.rs | 2 +- tests/ui/intrinsics/issue-28575.rs | 2 +- tests/ui/intrinsics/not-overridden.rs | 2 +- tests/ui/issues/issue-10465.rs | 2 +- tests/ui/issues/issue-10545.rs | 2 +- tests/ui/issues/issue-10877.rs | 8 +- tests/ui/issues/issue-11192.rs | 2 +- tests/ui/issues/issue-11680.rs | 4 +- tests/ui/issues/issue-11844.rs | 2 +- tests/ui/issues/issue-12041.rs | 2 +- tests/ui/issues/issue-12127.rs | 2 +- tests/ui/issues/issue-12567.rs | 4 +- tests/ui/issues/issue-13407.rs | 4 +- tests/ui/issues/issue-16725.rs | 2 +- tests/ui/issues/issue-17252.rs | 2 +- tests/ui/issues/issue-17999.rs | 4 +- tests/ui/issues/issue-20225.rs | 6 +- tests/ui/issues/issue-20413.rs | 8 +- tests/ui/issues/issue-20714.rs | 2 +- tests/ui/issues/issue-21160.rs | 2 +- tests/ui/issues/issue-21174.rs | 2 +- tests/ui/issues/issue-21202.rs | 2 +- tests/ui/issues/issue-2150.rs | 2 +- tests/ui/issues/issue-21701.rs | 4 +- tests/ui/issues/issue-22468.rs | 2 +- tests/ui/issues/issue-22599.rs | 2 +- tests/ui/issues/issue-2848.rs | 2 +- tests/ui/issues/issue-28971.rs | 2 +- tests/ui/issues/issue-31511.rs | 2 +- tests/ui/issues/issue-31910.rs | 2 +- tests/ui/issues/issue-37665.rs | 2 +- tests/ui/issues/issue-3993.rs | 2 +- tests/ui/issues/issue-4265.rs | 2 +- tests/ui/issues/issue-43424.rs | 2 +- tests/ui/issues/issue-44405.rs | 2 +- tests/ui/issues/issue-47486.rs | 4 +- tests/ui/issues/issue-48276.rs | 6 +- tests/ui/issues/issue-49919.rs | 2 +- tests/ui/issues/issue-50571.fixed | 2 +- tests/ui/issues/issue-50571.rs | 2 +- ...ue-51632-try-desugar-incompatible-types.rs | 2 +- tests/ui/issues/issue-51714.rs | 24 +- tests/ui/issues/issue-54062.rs | 2 +- tests/ui/issues/issue-5439.rs | 2 +- tests/ui/issues/issue-5844.rs | 2 +- tests/ui/issues/issue-65131.rs | 2 +- .../issue-66702-break-outside-loop-val.rs | 4 +- tests/ui/issues/issue-6738.rs | 2 +- tests/ui/issues/issue-69455.rs | 2 +- tests/ui/issues/issue-74082.rs | 4 +- tests/ui/issues/issue-83048.rs | 2 +- tests/ui/issues/issue-87199.rs | 8 +- tests/ui/issues/issue-9725.rs | 4 +- tests/ui/issues/issue-98299.rs | 6 +- .../ui/keyword/keyword-false-as-identifier.rs | 2 +- .../ui/keyword/keyword-true-as-identifier.rs | 2 +- tests/ui/kindck/kindck-impl-type-params.rs | 2 +- tests/ui/kindck/kindck-send-object1.rs | 2 +- tests/ui/kinds-of-primitive-impl.rs | 10 +- tests/ui/lang-items/duplicate.rs | 2 +- tests/ui/lang-items/issue-83471.rs | 14 +- tests/ui/lang-items/issue-87573.rs | 4 +- .../lang-item-generic-requirements.rs | 4 +- .../mismatched_arg_count.rs | 2 +- tests/ui/layout/debug.rs | 40 +- tests/ui/layout/enum-scalar-pair-int-ptr.rs | 4 +- tests/ui/layout/enum.rs | 6 +- .../ui/layout/gce-rigid-const-in-array-len.rs | 4 +- tests/ui/layout/hexagon-enum.rs | 10 +- .../invalid-unsized-in-always-sized-tail.rs | 2 +- ...6158-scalarpair-payload-might-be-uninit.rs | 10 +- .../ui/layout/issue-96185-overaligned-enum.rs | 4 +- tests/ui/layout/layout-cycle.rs | 4 +- tests/ui/layout/normalization-failure.rs | 6 +- tests/ui/layout/struct.rs | 4 +- .../ui/layout/thaw-transmute-invalid-enum.rs | 12 +- tests/ui/layout/thaw-validate-invalid-enum.rs | 4 +- tests/ui/layout/thumb-enum.rs | 10 +- tests/ui/layout/too-big-with-padding.rs | 2 +- .../layout/unconstrained-param-ice-137308.rs | 4 +- .../ui/layout/zero-sized-array-enum-niche.rs | 8 +- .../ui/let-else/let-else-binding-immutable.rs | 2 +- tests/ui/let-else/let-else-no-double-error.rs | 2 +- tests/ui/lexer/lex-bad-char-literals-1.rs | 8 +- tests/ui/lexer/lex-bad-char-literals-2.rs | 2 +- tests/ui/lexer/lex-bad-char-literals-3.rs | 4 +- tests/ui/lexer/lex-bad-char-literals-4.rs | 2 +- tests/ui/lexer/lex-bad-char-literals-5.rs | 4 +- tests/ui/lexer/lex-bad-char-literals-6.rs | 8 +- tests/ui/lexer/lex-bad-char-literals-7.rs | 6 +- tests/ui/lexer/lex-bad-numeric-literals.rs | 52 +-- tests/ui/lexer/lex-bad-token.rs | 2 +- .../lex-bare-cr-string-literal-doc-comment.rs | 14 +- tests/ui/lexer/lex-emoji-identifiers.rs | 16 +- tests/ui/lexer/lex-stray-backslash.rs | 2 +- tests/ui/lifetimes/issue-17728.rs | 2 +- tests/ui/lifetimes/issue-34979.rs | 2 +- .../lifetimes/issue-64173-unused-lifetimes.rs | 8 +- .../ui/lifetimes/issue-76168-hr-outlives-3.rs | 10 +- .../ui/lifetimes/missing-lifetime-in-alias.rs | 4 +- tests/ui/lifetimes/noisy-follow-up-erro.rs | 4 +- tests/ui/lifetimes/refcell-in-tail-expr.rs | 2 +- .../lifetimes/shorter-tail-expr-lifetime.rs | 2 +- tests/ui/link-native-libs/kind-framework.rs | 2 +- tests/ui/linkage-attr/linkage2.rs | 2 +- tests/ui/linkage-attr/linkage3.rs | 2 +- tests/ui/linkage-attr/linkage4.rs | 2 +- .../windows/raw-dylib-windows-only.rs | 4 +- tests/ui/lint/dead-code/closure-bang.rs | 2 +- tests/ui/lint/dead-code/issue-85071-2.rs | 4 +- tests/ui/lint/dead-code/issue-85071.rs | 4 +- tests/ui/lint/dead-code/issue-85255.rs | 12 +- tests/ui/lint/dead-code/lint-dead-code-1.rs | 18 +- tests/ui/lint/dead-code/lint-dead-code-2.rs | 4 +- tests/ui/lint/dead-code/lint-dead-code-3.rs | 14 +- tests/ui/lint/dead-code/lint-dead-code-4.rs | 4 +- tests/ui/lint/dead-code/lint-dead-code-5.rs | 6 +- tests/ui/lint/dead-code/newline-span.rs | 6 +- tests/ui/lint/dead-code/self-assign.rs | 12 +- tests/ui/lint/dead-code/tuple-struct-field.rs | 20 +- tests/ui/lint/dead-code/unused-variant.rs | 6 +- tests/ui/lint/deny-overflowing-literals.rs | 4 +- tests/ui/lint/extern-C-fnptr-lints-slices.rs | 2 +- .../allowed-cli-deny-by-default-lint.rs | 2 +- .../allowed-deny-by-default-lint.rs | 2 +- .../lint/force-warn/deny-by-default-lint.rs | 2 +- tests/ui/lint/inline-exported.rs | 6 +- tests/ui/lint/internal_features.rs | 4 +- tests/ui/lint/invalid_value.rs | 102 ++--- tests/ui/lint/issue-117949.rs | 16 +- tests/ui/lint/issue-17718-const-naming.rs | 4 +- tests/ui/lint/issue-63364.rs | 2 +- ...0819-dont-override-forbid-in-same-scope.rs | 2 +- tests/ui/lint/lint-change-warnings.rs | 6 +- tests/ui/lint/lint-ctypes-73249-2.rs | 2 +- tests/ui/lint/lint-ctypes-73249-3.rs | 2 +- tests/ui/lint/lint-ctypes-73249-5.rs | 2 +- tests/ui/lint/lint-ctypes-73251-1.rs | 2 +- tests/ui/lint/lint-ctypes-73251-2.rs | 2 +- tests/ui/lint/lint-ctypes-fn.rs | 18 +- tests/ui/lint/lint-ctypes.rs | 28 +- ...int-directives-on-use-items-issue-10534.rs | 4 +- .../ui/lint/lint-enum-intrinsics-non-enums.rs | 18 +- tests/ui/lint/lint-forbid-internal-unsafe.rs | 2 +- tests/ui/lint/lint-impl-fn.rs | 6 +- tests/ui/lint/lint-missing-doc.rs | 50 +-- tests/ui/lint/lint-overflowing-ops.rs | 402 +++++++++--------- tests/ui/lint/lint-qualification.fixed | 16 +- tests/ui/lint/lint-qualification.rs | 14 +- tests/ui/lint/lint-type-overflow.rs | 36 +- ...lint-unconditional-recursion-tail-calls.rs | 8 +- tests/ui/lint/lint-unsafe-code.rs | 56 +-- tests/ui/lint/lints-in-foreign-macros.rs | 10 +- tests/ui/lint/recommend-literal.rs | 4 +- tests/ui/lint/special-upper-lower-cases.rs | 8 +- tests/ui/lint/unconditional_panic_98444.rs | 2 +- tests/ui/lint/unconditional_panic_promoted.rs | 2 +- tests/ui/lint/unqualified_local_imports.rs | 2 +- .../unsafe_code/lint-global-asm-as-unsafe.rs | 4 +- tests/ui/lint/unused/issue-30730.rs | 2 +- .../issue-74883-unused-paren-baren-yield.rs | 12 +- tests/ui/lint/unused/issue-85913.rs | 2 +- .../lint/unused/lint-unused-extern-crate.rs | 2 +- .../ui/lint/unused/lint-unused-mut-self.fixed | 4 +- tests/ui/lint/unused/lint-unused-mut-self.rs | 4 +- .../lint/unused/lint-unused-mut-variables.rs | 54 +-- tests/ui/lint/unused/unused-allocation.rs | 2 +- .../unused/unused-doc-comments-edge-cases.rs | 20 +- .../unused/unused-doc-comments-for-macros.rs | 4 +- .../unused-macro-rules-compile-error.rs | 6 +- .../ui/lint/unused/unused-macro-rules-decl.rs | 6 +- .../unused-macro-rules-malformed-rule.rs | 2 +- tests/ui/lint/unused/unused-macro-rules.rs | 6 +- tests/ui/lint/unused/unused-macros-decl.rs | 6 +- .../unused/unused-macros-malformed-rule.rs | 6 +- tests/ui/lint/unused/unused-macros.rs | 6 +- .../unused-mut-warning-captured-var.fixed | 2 +- .../unused/unused-mut-warning-captured-var.rs | 2 +- tests/ui/lint/unused/unused-result.rs | 18 +- tests/ui/lint/wasm_c_abi_transition.rs | 12 +- tests/ui/liveness/liveness-dead.rs | 8 +- tests/ui/loops/label-on-block-suggest-move.rs | 58 +-- tests/ui/macros/compile_error_macro.rs | 2 +- tests/ui/macros/concat.rs | 8 +- tests/ui/macros/expand-full-no-resolution.rs | 4 +- .../macros/expr_2021_cargo_fix_edition.fixed | 8 +- .../ui/macros/expr_2021_cargo_fix_edition.rs | 8 +- tests/ui/macros/expr_2021_inline_const.rs | 4 +- tests/ui/macros/expr_2024_underscore_expr.rs | 4 +- .../genercs-in-path-with-prettry-hir.rs | 2 +- tests/ui/macros/invalid-fragment-specifier.rs | 4 +- tests/ui/macros/issue-21356.rs | 2 +- tests/ui/macros/issue-58490.rs | 2 +- tests/ui/macros/issue-68060.rs | 10 +- tests/ui/macros/issue-83340.rs | 2 +- tests/ui/macros/issue-83344.rs | 2 +- .../macro-expand-within-generics-in-path.rs | 4 +- tests/ui/macros/nonterminal-matching.rs | 8 +- tests/ui/match/match_non_exhaustive.rs | 6 +- tests/ui/mir/issue-67947.rs | 4 +- .../assignment-operator-unimplemented.rs | 2 +- .../closure-arg-type-mismatch.rs | 6 +- tests/ui/mismatched_types/issue-19109.rs | 2 +- .../ui/missing-trait-bounds/issue-69725.fixed | 2 +- tests/ui/missing-trait-bounds/issue-69725.rs | 2 +- tests/ui/modules/issue-107649.rs | 2 +- ...ased-on-type-no-recursive-stack-closure.rs | 2 +- tests/ui/never_type/defaulted-never-note.rs | 4 +- .../dependency-on-fallback-to-unit.rs | 8 +- .../diverging-fallback-control-flow.rs | 8 +- .../never_type/diverging-fallback-no-leak.rs | 4 +- ...diverging-fallback-unconstrained-return.rs | 4 +- tests/ui/never_type/fallback-closure-ret.rs | 4 +- .../from_infer_breaking_with_unit_fallback.rs | 2 +- tests/ui/never_type/impl_trait_fallback.rs | 4 +- tests/ui/never_type/issue-51506.rs | 2 +- ...never-type-fallback-flowing-into-unsafe.rs | 62 +-- tests/ui/nll/continue-after-missing-main.rs | 4 +- tests/ui/nll/issue-30438-a.rs | 2 +- tests/ui/nll/issue-30438-b.rs | 2 +- tests/ui/nll/issue-30438-c.rs | 2 +- tests/ui/nll/issue-54556-niconii.rs | 2 +- tests/ui/nll/issue-61424.fixed | 2 +- tests/ui/nll/issue-61424.rs | 2 +- tests/ui/nll/issue-73159-rpit-static.rs | 2 +- tests/ui/nll/issue-75777.rs | 2 +- tests/ui/nll/trait-associated-constant.rs | 2 +- tests/ui/nll/unused-mut-issue-50343.fixed | 2 +- tests/ui/nll/unused-mut-issue-50343.rs | 2 +- .../numbers-arithmetic/overflowing-lsh-4.rs | 2 +- .../numbers-arithmetic/overflowing-rsh-4.rs | 2 +- tests/ui/offset-of/offset-of-inference.rs | 2 +- tests/ui/or-patterns/missing-bindings.rs | 4 +- tests/ui/panic-runtime/needs-gate.rs | 4 +- tests/ui/panics/panic-2021.rs | 10 +- tests/ui/parser/bad-name.rs | 6 +- tests/ui/parser/brace-in-let-chain.rs | 2 +- .../char/whitespace-character-literal.rs | 6 +- ...hesized-type-arguments-ice-issue-122345.rs | 4 +- tests/ui/parser/eq-less-to-less-eq.rs | 2 +- ...nthesized-type-arguments-issue-120892-1.rs | 8 +- ...nthesized-type-arguments-issue-120892-2.rs | 6 +- ...nthesized-type-arguments-issue-120892-3.rs | 8 +- tests/ui/parser/issues/issue-10392-2.fixed | 2 +- tests/ui/parser/issues/issue-10392-2.rs | 2 +- tests/ui/parser/issues/issue-10636-1.rs | 2 +- .../ui/parser/issues/issue-17718-const-mut.rs | 2 +- tests/ui/parser/issues/issue-20616-1.rs | 2 +- tests/ui/parser/issues/issue-20616-2.rs | 2 +- tests/ui/parser/issues/issue-20616-3.rs | 2 +- tests/ui/parser/issues/issue-20616-4.rs | 2 +- tests/ui/parser/issues/issue-20616-5.rs | 2 +- tests/ui/parser/issues/issue-20616-6.rs | 2 +- tests/ui/parser/issues/issue-20616-7.rs | 2 +- tests/ui/parser/issues/issue-20616-8.rs | 2 +- tests/ui/parser/issues/issue-20616-9.rs | 2 +- tests/ui/parser/issues/issue-24197.rs | 2 +- tests/ui/parser/issues/issue-24375.rs | 2 +- tests/ui/parser/issues/issue-3036.fixed | 2 +- tests/ui/parser/issues/issue-3036.rs | 2 +- .../issues/issue-35813-postfix-after-cast.rs | 56 +-- tests/ui/parser/issues/issue-76597.fixed | 2 +- tests/ui/parser/issues/issue-76597.rs | 2 +- tests/ui/parser/issues/issue-81806.rs | 2 +- tests/ui/parser/issues/issue-84148-1.rs | 4 +- .../issues/issue-87086-colon-path-sep.rs | 40 +- .../issue-87197-missing-semicolon.fixed | 6 +- .../issues/issue-87197-missing-semicolon.rs | 6 +- tests/ui/parser/issues/issue-87635.rs | 2 +- tests/ui/parser/issues/issue-88818.rs | 6 +- tests/ui/parser/issues/issue-89388.rs | 2 +- tests/ui/parser/issues/issue-89396.fixed | 8 +- tests/ui/parser/issues/issue-89396.rs | 8 +- tests/ui/parser/issues/issue-90728.rs | 6 +- tests/ui/parser/issues/issue-90993.rs | 6 +- tests/ui/parser/issues/issue-91421.rs | 4 +- tests/ui/parser/issues/issue-91461.rs | 2 +- tests/ui/parser/keyword-as-as-identifier.rs | 2 +- .../ui/parser/keyword-break-as-identifier.rs | 2 +- .../ui/parser/keyword-const-as-identifier.rs | 2 +- .../parser/keyword-continue-as-identifier.rs | 2 +- tests/ui/parser/keyword-else-as-identifier.rs | 2 +- tests/ui/parser/keyword-enum-as-identifier.rs | 2 +- tests/ui/parser/keyword-fn-as-identifier.rs | 2 +- tests/ui/parser/keyword-for-as-identifier.rs | 2 +- tests/ui/parser/keyword-if-as-identifier.rs | 2 +- tests/ui/parser/keyword-impl-as-identifier.rs | 2 +- tests/ui/parser/keyword-in-as-identifier.rs | 2 +- tests/ui/parser/keyword-let-as-identifier.rs | 2 +- tests/ui/parser/keyword-loop-as-identifier.rs | 2 +- .../ui/parser/keyword-match-as-identifier.rs | 2 +- tests/ui/parser/keyword-mod-as-identifier.rs | 2 +- tests/ui/parser/keyword-move-as-identifier.rs | 2 +- tests/ui/parser/keyword-mut-as-identifier.rs | 2 +- tests/ui/parser/keyword-pub-as-identifier.rs | 2 +- tests/ui/parser/keyword-ref-as-identifier.rs | 2 +- .../ui/parser/keyword-return-as-identifier.rs | 2 +- .../ui/parser/keyword-static-as-identifier.rs | 2 +- .../ui/parser/keyword-struct-as-identifier.rs | 2 +- .../ui/parser/keyword-trait-as-identifier.rs | 2 +- .../keyword-try-as-identifier-edition2018.rs | 2 +- tests/ui/parser/keyword-type-as-identifier.rs | 2 +- .../ui/parser/keyword-unsafe-as-identifier.rs | 2 +- tests/ui/parser/keyword-use-as-identifier.rs | 2 +- .../ui/parser/keyword-where-as-identifier.rs | 2 +- .../ui/parser/keyword-while-as-identifier.rs | 2 +- .../ui/parser/lifetime_starts_expressions.rs | 12 +- ...literals-are-validated-before-expansion.rs | 4 +- tests/ui/parser/macros-no-semicolon.rs | 4 +- ...ing-closing-angle-bracket-eq-constraint.rs | 10 +- tests/ui/parser/misspelled-macro-rules.fixed | 4 +- tests/ui/parser/misspelled-macro-rules.rs | 4 +- ...ultibyte-char-use-seperator-issue-80134.rs | 8 +- tests/ui/parser/multitrait.rs | 2 +- .../nested-missing-closing-angle-bracket.rs | 2 +- tests/ui/parser/pat-lt-bracket-1.rs | 2 +- tests/ui/parser/pat-lt-bracket-2.rs | 2 +- tests/ui/parser/pat-lt-bracket-5.rs | 4 +- tests/ui/parser/pat-lt-bracket-6.rs | 4 +- tests/ui/parser/pat-lt-bracket-7.rs | 2 +- tests/ui/parser/pat-ranges-1.rs | 2 +- tests/ui/parser/pat-ranges-2.rs | 2 +- tests/ui/parser/pat-ranges-3.rs | 4 +- tests/ui/parser/range-exclusive-dotdotlt.rs | 20 +- tests/ui/parser/recover/recover-enum2.rs | 4 +- tests/ui/parser/recover/recover-pat-exprs.rs | 90 ++-- tests/ui/parser/recover/recover-pat-issues.rs | 12 +- tests/ui/parser/recover/recover-pat-lets.rs | 10 +- tests/ui/parser/recover/recover-pat-ranges.rs | 30 +- .../parser/recover/recover-pat-wildcards.rs | 22 +- .../ui/parser/recover/recover-ref-dyn-mut.rs | 6 +- .../recover/recover-unticked-labels.fixed | 6 +- .../parser/recover/recover-unticked-labels.rs | 6 +- .../suggest-remove-compount-assign-let-ice.rs | 2 +- .../ui/parser/unicode-character-literal.fixed | 18 +- tests/ui/parser/unicode-character-literal.rs | 18 +- tests/ui/parser/unmatched-langle-1.rs | 6 +- tests/ui/parser/unmatched-langle-2.rs | 2 +- .../use-as-where-use-ends-with-mod-sep.rs | 2 +- .../variadic-ffi-nested-syntactic-fail.rs | 2 +- .../patchable-function-entry-attribute.rs | 10 +- tests/ui/pattern/box-pattern-type-mismatch.rs | 2 +- tests/ui/pattern/complexity_limit.rs | 2 +- .../cant_move_out_of_pattern.rs | 4 +- .../ui/pattern/deref-patterns/typeck_fail.rs | 4 +- tests/ui/pattern/issue-14221.rs | 2 +- tests/ui/pattern/issue-17718-patterns.rs | 4 +- tests/ui/pattern/issue-72565.rs | 2 +- tests/ui/pattern/issue-72574-1.rs | 4 +- tests/ui/pattern/issue-72574-2.rs | 4 +- tests/ui/pattern/issue-74539.rs | 6 +- tests/ui/pattern/issue-74702.rs | 6 +- tests/ui/pattern/missing_lifetime.rs | 4 +- .../pattern/mut_preserve_binding_mode_2021.rs | 4 +- .../ui/pattern/non-constant-in-const-path.rs | 8 +- tests/ui/pattern/overflowing-literals.rs | 6 +- .../pattern/pattern-binding-disambiguation.rs | 4 +- .../experimental/borrowck-errors.rs | 12 +- .../cannot-mutably-deref-shared-ref.rs | 10 +- ...feature-gate-ref_pat_eat_one_layer_2024.rs | 16 +- .../experimental/mixed-editions.rs | 28 +- .../experimental/mut-ref-mut.rs | 6 +- .../experimental/pattern-errors.rs | 52 +-- .../ref-binding-on-inh-ref-errors.rs | 30 +- ...ut-inside-shared-ref-pat.classic2024.fixed | 22 +- .../ref-mut-inside-shared-ref-pat.rs | 22 +- ...inside-shared-ref-pat.structural2024.fixed | 22 +- .../experimental/trait-selection-sanity.rs | 2 +- .../migration_lint.fixed | 120 +++--- .../migration_lint.rs | 120 +++--- tests/ui/pattern/type_mismatch.rs | 2 +- .../usefulness/conflicting_bindings.rs | 18 +- tests/ui/pattern/usefulness/issue-12369.rs | 2 +- tests/ui/pattern/usefulness/issue-13727.rs | 2 +- tests/ui/pattern/usefulness/issue-2111.rs | 2 +- tests/ui/pattern/usefulness/issue-50900.rs | 2 +- tests/ui/privacy/export-tag-variant.rs | 2 +- ...111220-2-tuple-struct-fields-projection.rs | 2 +- .../issue-111220-tuple-struct-fields.rs | 6 +- tests/ui/privacy/issue-11593.rs | 2 +- tests/ui/privacy/issue-119463.rs | 4 +- tests/ui/privacy/issue-13641.rs | 4 +- tests/ui/privacy/issue-17718-const-privacy.rs | 4 +- tests/ui/privacy/privacy1.rs | 36 +- tests/ui/privacy/privacy4.rs | 2 +- tests/ui/privacy/projections.rs | 14 +- tests/ui/privacy/projections2.rs | 6 +- tests/ui/privacy/struct-field-type.rs | 4 +- tests/ui/privacy/useless-pub.rs | 2 +- tests/ui/privacy/xc-private-method.rs | 4 +- .../proc-macro/attribute-spans-preserved.rs | 4 +- tests/ui/proc-macro/attribute-with-error.rs | 8 +- tests/ui/proc-macro/attribute.rs | 26 +- tests/ui/proc-macro/attributes-included.rs | 2 +- tests/ui/proc-macro/expand-expr.rs | 14 +- tests/ui/proc-macro/expand-to-unstable.rs | 2 +- tests/ui/proc-macro/exports.rs | 8 +- .../illegal-proc-macro-derive-use.rs | 4 +- tests/ui/proc-macro/import.rs | 2 +- tests/ui/proc-macro/issue-66286.rs | 2 +- tests/ui/proc-macro/issue-75801.rs | 2 +- tests/ui/proc-macro/issue-83510.rs | 8 +- tests/ui/proc-macro/item-error.rs | 2 +- tests/ui/proc-macro/load-panic-backtrace.rs | 2 +- tests/ui/proc-macro/load-panic.rs | 2 +- tests/ui/proc-macro/macro-brackets.rs | 2 +- tests/ui/proc-macro/nested-item-spans.rs | 4 +- tests/ui/proc-macro/proc-macro-gates.rs | 18 +- tests/ui/proc-macro/proc-macro-gates2.rs | 4 +- tests/ui/proc-macro/pub-at-crate-root.rs | 4 +- tests/ui/proc-macro/signature.rs | 2 +- tests/ui/query-system/issue-83479.rs | 10 +- tests/ui/query-system/query_depth.rs | 2 +- tests/ui/reachable/unreachable-code.rs | 2 +- tests/ui/regions/issue-78262.rs | 4 +- ...ion-lifetime-bounds-on-fns-where-clause.rs | 4 +- ...ple-lifetime-bounds-on-fns-where-clause.rs | 4 +- .../regions/regions-lifetime-bounds-on-fns.rs | 4 +- .../copy-check-deferred-after-fallback.rs | 2 +- .../copy-inference-side-effects-are-lazy.rs | 2 +- .../no-conservative-copy-impl-requirement.rs | 2 +- tests/ui/repr/attr-usage-repr.rs | 8 +- tests/ui/repr/invalid_repr_list_help.rs | 12 +- tests/ui/repr/issue-83505-repr-simd.rs | 8 +- tests/ui/repr/malformed-repr-hints.rs | 20 +- tests/ui/repr/repr-align.rs | 16 +- tests/ui/repr/repr-packed-contains-align.rs | 16 +- tests/ui/repr/repr-transparent-issue-87496.rs | 2 +- tests/ui/resolve/issue-116164.rs | 2 +- tests/ui/resolve/issue-81508.rs | 4 +- tests/ui/resolve/issue-82865.rs | 4 +- tests/ui/resolve/issue-85348.rs | 6 +- tests/ui/resolve/issue-88472.rs | 22 +- tests/ui/resolve/issue-90113.rs | 2 +- tests/ui/resolve/path-attr-in-const-block.rs | 2 +- tests/ui/resolve/prelude-order.rs | 2 +- tests/ui/resolve/shadow-const-param.rs | 4 +- .../suggest-constructor-cycle-error.rs | 2 +- tests/ui/resolve/token-error-correct-2.rs | 2 +- tests/ui/resolve/token-error-correct.rs | 2 +- .../typo-suggestion-named-underscore.rs | 4 +- .../issue-86188-return-not-in-fn-body.rs | 20 +- tests/ui/return/return-match-array-const.rs | 24 +- .../ICE-119271-never-arm-attr-in-guard.rs | 4 +- ...CE-130779-never-arm-no-oatherwise-block.rs | 6 +- .../rfcs/rfc-0000-never_patterns/bindings.rs | 16 +- .../ui/rfcs/rfc-0000-never_patterns/check.rs | 4 +- .../rfc-0000-never_patterns/diverges-not.rs | 14 +- .../ui/rfcs/rfc-0000-never_patterns/parse.rs | 2 +- .../ui/rfcs/rfc-0000-never_patterns/typeck.rs | 16 +- .../rfc-2294-if-let-guard/guard-lifetime-1.rs | 2 +- .../higher-ranked-regions-basic.rs | 10 +- .../higher-ranked-regions-gat.rs | 2 +- tests/ui/rust-2018/async-ident-allowed.rs | 2 +- .../edition-lint-infer-outlives-macro.fixed | 24 +- .../edition-lint-infer-outlives-macro.rs | 24 +- .../edition-lint-infer-outlives-multispan.rs | 8 +- .../ice-return-unsized-can-impl-2.rs | 8 +- .../rust-2021/ice-return-unsized-can-impl.rs | 4 +- tests/ui/rust-2021/ice-unsized-fn-params-2.rs | 2 +- tests/ui/rust-2021/ice-unsized-fn-params.rs | 8 +- tests/ui/rust-2024/safe-outside-extern.rs | 12 +- .../in_2024_compatibility.rs | 2 +- .../unsafe-attributes-fix.fixed | 14 +- .../unsafe-attributes-fix.rs | 14 +- .../unsafe-attributes/unsafe-attributes.rs | 2 +- .../extern-items-unsafe.rs | 4 +- .../unsafe-extern-blocks/unsafe-items.rs | 4 +- tests/ui/rustdoc/doc_keyword.rs | 2 +- .../self/arbitrary-self-from-method-substs.rs | 16 +- tests/ui/self/arbitrary-self-opaque.rs | 4 +- tests/ui/self/arbitrary_self_types_nonnull.rs | 4 +- .../self/arbitrary_self_types_pin_getref.rs | 2 +- ...elf_types_pin_lifetime_impl_trait-async.rs | 2 +- ...rary_self_types_pin_lifetime_impl_trait.rs | 2 +- .../self/arbitrary_self_types_unshadowing.rs | 12 +- .../arbitrary_self_types_unshadowing_ptrs.rs | 14 +- tests/ui/self/arbitrary_self_types_weak.rs | 4 +- tests/ui/simd/intrinsic/issue-85855.rs | 6 +- tests/ui/simd/not-out-of-bounds.rs | 12 +- .../borrowck-call-is-borrow-issue-12224.rs | 4 +- tests/ui/span/issue-71363.rs | 4 +- tests/ui/span/issue-81800.rs | 4 +- tests/ui/span/lint-unused-unsafe.rs | 348 +++++++-------- tests/ui/specialization/issue-33017.rs | 2 +- tests/ui/specialization/issue-44861.rs | 2 +- tests/ui/specialization/issue-51892.rs | 2 +- tests/ui/specialization/issue-59435.rs | 2 +- .../issue-68830-spurious-diagnostics.rs | 2 +- .../bad-const-wf-doesnt-specialize.rs | 2 +- .../min_specialization/impl-on-opaque2.rs | 2 +- .../min_specialization/issue-79224.rs | 8 +- .../specialization/non-defaulted-item-fail.rs | 12 +- ...ity-attribute-non-staged-force-unstable.rs | 4 +- .../stability-attribute-non-staged.rs | 4 +- .../auxiliary/static-priv-by-default.rs | 6 +- tests/ui/static/missing-type.rs | 2 +- .../ui/static/raw-ref-deref-without-unsafe.rs | 2 +- tests/ui/static/static-mut-bad-types.rs | 2 +- .../static-mut-foreign-requires-unsafe.rs | 6 +- tests/ui/static/static-mut-requires-unsafe.rs | 6 +- tests/ui/static/static-priv-by-default2.rs | 4 +- .../static/static-vec-repeat-not-constant.rs | 2 +- tests/ui/statics/issue-17718-static-sync.rs | 2 +- tests/ui/statics/mutable_memory_validation.rs | 2 +- tests/ui/statics/nested_thread_local.rs | 2 +- tests/ui/statics/uninhabited-static.rs | 8 +- tests/ui/std-uncopyable-atomics.rs | 8 +- tests/ui/structs-enums/issue-103869.fixed | 4 +- tests/ui/structs-enums/issue-103869.rs | 4 +- tests/ui/structs/struct-field-privacy.rs | 10 +- tests/ui/structs/struct-tuple-field-names.rs | 4 +- .../ui/suggestions/box-future-wrong-output.rs | 2 +- tests/ui/suggestions/count2len.rs | 6 +- .../dont-try-removing-the-field.rs | 2 +- tests/ui/suggestions/fn-trait-notation.fixed | 6 +- tests/ui/suggestions/fn-trait-notation.rs | 6 +- .../ignore-nested-field-binding.fixed | 8 +- .../ignore-nested-field-binding.rs | 8 +- ...t-static-bound-needing-more-suggestions.rs | 6 +- ...on-dyn-trait-with-implicit-static-bound.rs | 4 +- tests/ui/suggestions/issue-102892.rs | 2 +- tests/ui/suggestions/issue-103112.rs | 2 +- tests/ui/suggestions/issue-72766.rs | 2 +- ...l-trait-with-missing-bounds-on-async-fn.rs | 4 +- tests/ui/suggestions/issue-81098.rs | 4 +- tests/ui/suggestions/issue-82566-1.rs | 6 +- tests/ui/suggestions/issue-82566-2.rs | 6 +- tests/ui/suggestions/issue-84973-2.rs | 2 +- tests/ui/suggestions/issue-84973-blacklist.rs | 10 +- tests/ui/suggestions/issue-84973-negative.rs | 4 +- tests/ui/suggestions/issue-84973.rs | 2 +- .../issue-86100-tuple-paren-comma.rs | 14 +- tests/ui/suggestions/issue-86667.rs | 4 +- tests/ui/suggestions/many-type-ascription.rs | 2 +- .../missing-impl-trait-block-but-not-ascii.rs | 6 +- tests/ui/suggestions/multibyte-escapes.rs | 18 +- tests/ui/suggestions/option-content-move2.rs | 4 +- tests/ui/suggestions/pattern-slice-vec.fixed | 20 +- tests/ui/suggestions/pattern-slice-vec.rs | 20 +- tests/ui/suggestions/private-field.rs | 2 +- .../range-index-instead-of-colon.rs | 4 +- .../ui/suggestions/raw-byte-string-prefix.rs | 6 +- .../suggestions/sugg-else-for-closure.fixed | 2 +- tests/ui/suggestions/sugg-else-for-closure.rs | 2 +- .../try-operator-dont-suggest-semicolon.rs | 16 +- .../ui/suggestions/try-removing-the-field.rs | 6 +- .../suggestions/type-mismatch-byte-literal.rs | 18 +- tests/ui/suggestions/unnamable-types.rs | 32 +- tests/ui/svh/changing-crates.rs | 2 +- tests/ui/svh/svh-change-lit.rs | 2 +- tests/ui/svh/svh-change-significant-cfg.rs | 2 +- tests/ui/svh/svh-change-trait-bound.rs | 2 +- tests/ui/svh/svh-change-type-arg.rs | 2 +- tests/ui/svh/svh-change-type-ret.rs | 2 +- tests/ui/svh/svh-change-type-static.rs | 2 +- tests/ui/svh/svh-use-trait.rs | 2 +- tests/ui/tag-type-args.rs | 2 +- ...dden-hardfloat-target-feature-attribute.rs | 2 +- .../forbidden-target-feature-attribute.rs | 2 +- tests/ui/target-feature/gate.rs | 2 +- tests/ui/target-feature/invalid-attribute.rs | 10 +- tests/ui/test-attrs/test-on-not-fn.rs | 24 +- tests/ui/test-attrs/test-should-panic-attr.rs | 8 +- tests/ui/test-attrs/test-warns-dead-code.rs | 2 +- tests/ui/tool-attributes/tool_lints-fail.rs | 2 +- .../trait-bounds/suggest-maybe-sized-bound.rs | 4 +- .../ui/traits/alias/infinite_normalization.rs | 2 +- .../suggest-trait-alias-instead-of-type.fixed | 2 +- .../suggest-trait-alias-instead-of-type.rs | 2 +- .../bound/on-structs-and-enums-static.rs | 2 +- .../bound/unknown-assoc-with-const-arg.rs | 6 +- .../call-generic-method-nonconst.rs | 2 +- .../const-traits/const-impl-norecover.rs | 2 +- .../const-traits/const-impl-recovery.rs | 4 +- .../const-impl-requires-const-trait.rs | 2 +- ...nst_closure-const_trait_impl-ice-113381.rs | 2 +- tests/ui/traits/const-traits/cross-crate.rs | 6 +- tests/ui/traits/const-traits/gate.rs | 2 +- tests/ui/traits/const-traits/issue-79450.rs | 2 +- .../const-traits/mismatched_generic_args.rs | 12 +- .../const-traits/no-explicit-const-params.rs | 8 +- ...-const-op-const-closure-non-const-outer.rs | 2 +- .../traits/const-traits/spec-effectvar-ice.rs | 10 +- .../const-traits/super-traits-fail-2.rs | 12 +- .../const-traits/super-traits-fail-3.rs | 30 +- .../default_auto_traits/extern-types.rs | 2 +- tests/ui/traits/dyn-star-drop-principal.rs | 2 +- ...aram_mismatch_in_unsatisfied_projection.rs | 2 +- tests/ui/traits/impl-1.rs | 2 +- .../ui/traits/inductive-overflow/lifetime.rs | 6 +- tests/ui/traits/issue-28576.rs | 4 +- .../ui/traits/issue-33140-hack-boundaries.rs | 2 +- tests/ui/traits/issue-33140.rs | 4 +- tests/ui/traits/issue-72410.rs | 2 +- tests/ui/traits/issue-78372.rs | 2 +- tests/ui/traits/issue-85735.rs | 2 +- ...d-argument-mismatch-variance-ice-119867.rs | 4 +- ...elate_error_uses_structurally_normalize.rs | 2 +- .../dont-pick-fnptr-bound-as-leaf.rs | 10 +- tests/ui/traits/next-solver/fn-trait.rs | 8 +- .../ui/traits/normalize-conflicting-impls.rs | 4 +- ...onicalize-fresh-infer-vars-issue-103626.rs | 4 +- tests/ui/traits/object/issue-44454-1.rs | 2 +- tests/ui/traits/object/issue-44454-2.rs | 2 +- tests/ui/traits/object/issue-44454-3.rs | 2 +- .../self-without-lifetime-constraint.rs | 2 +- .../deref-upcast-shadowing-lint.rs | 2 +- .../inference-behavior-change-deref.rs | 2 +- .../migrate-lint-deny-regions.rs | 2 +- .../migrate-lint-different-substs.rs | 2 +- tests/ui/traits/trivial_impl.rs | 2 +- tests/ui/traits/trivial_impl2.rs | 2 +- tests/ui/traits/trivial_impl_sized.rs | 4 +- tests/ui/traits/upcast_soundness_bug.rs | 2 +- tests/ui/transmutability/assoc-bound.rs | 4 +- tests/ui/transmutability/maybeuninit.rs | 2 +- .../transmutability/references/unsafecell.rs | 4 +- .../transmute_infinitely_recursive_type.rs | 4 +- tests/ui/transmutability/uninhabited.rs | 16 +- .../bad-question-mark-on-trait-object.rs | 10 +- tests/ui/tuple/array-diagnostics.rs | 2 +- .../auto-trait-leakage2.rs | 2 +- .../bounds-are-checked3.rs | 2 +- .../coherence_cross_crate.rs | 2 +- .../const_generic_type.rs | 2 +- .../constrain_in_projection2.rs | 6 +- .../define_opaques_attr/foreign_type.rs | 2 +- .../define_opaques_attr/generics.rs | 6 +- .../define_opaques_attr/invalid_path.rs | 2 +- .../define_opaques_attr/missing_parens.rs | 2 +- .../define_opaques_attr/non_type.rs | 2 +- .../different_defining_uses_never_type.rs | 2 +- .../different_lifetimes_defining_uses.rs | 2 +- tests/ui/type-alias-impl-trait/fallback.rs | 2 +- tests/ui/type-alias-impl-trait/future.rs | 2 +- .../generic_nondefining_use.rs | 6 +- .../type-alias-impl-trait/generic_not_used.rs | 2 +- .../generic_type_does_not_live_long_enough.rs | 2 +- ...n_behind_projection_behind_struct_field.rs | 4 +- .../hidden_behind_struct_field2.rs | 4 +- .../hidden_behind_struct_field3.rs | 2 +- .../type-alias-impl-trait/hkl_forbidden2.rs | 2 +- .../type-alias-impl-trait/hkl_forbidden3.rs | 2 +- .../type-alias-impl-trait/hkl_forbidden4.rs | 2 +- ...mpl-trait-in-type-alias-with-bad-substs.rs | 2 +- .../impl_trait_for_tait_bound.rs | 2 +- .../impl_trait_for_tait_bound2.rs | 2 +- ...pl_trait_in_trait_defined_outside_trait.rs | 4 +- ...l_trait_in_trait_defined_outside_trait2.rs | 2 +- .../implied_lifetime_wf_check3.rs | 8 +- .../implied_lifetime_wf_check4_static.rs | 4 +- .../type-alias-impl-trait/in-where-clause.rs | 4 +- .../incomplete-inference.rs | 2 +- .../invalid_impl_trait_in_assoc_ty.rs | 4 +- .../ui/type-alias-impl-trait/issue-109054.rs | 2 +- tests/ui/type-alias-impl-trait/issue-52843.rs | 2 +- tests/ui/type-alias-impl-trait/issue-63279.rs | 8 +- tests/ui/type-alias-impl-trait/issue-63355.rs | 2 +- tests/ui/type-alias-impl-trait/issue-65384.rs | 2 +- tests/ui/type-alias-impl-trait/issue-74244.rs | 2 +- .../issue-84660-unsoundness.rs | 4 +- tests/ui/type-alias-impl-trait/issue-89686.rs | 2 +- .../ui/type-alias-impl-trait/issue-90400-1.rs | 2 +- .../ui/type-alias-impl-trait/issue-90400-2.rs | 2 +- tests/ui/type-alias-impl-trait/issue-94429.rs | 2 +- .../lazy_subtyping_of_opaques.rs | 6 +- .../method_resolution.rs | 2 +- .../method_resolution3.rs | 4 +- .../method_resolution4.rs | 4 +- ...hod_resolution_trait_method_from_opaque.rs | 4 +- .../missing_lifetime_bound.rs | 2 +- .../nested-tait-inference.rs | 2 +- .../nested-tait-inference2.rs | 4 +- .../nested-tait-inference3.rs | 2 +- tests/ui/type-alias-impl-trait/nested.rs | 2 +- .../no_inferrable_concrete_type.rs | 2 +- .../not-matching-trait-refs-isnt-defining.rs | 2 +- .../type-alias-impl-trait/param_mismatch.rs | 2 +- .../type-alias-impl-trait/param_mismatch2.rs | 2 +- .../type-alias-impl-trait/param_mismatch3.rs | 2 +- .../path_resolution_taint.rs | 2 +- .../ui/type-alias-impl-trait/reveal_local.rs | 2 +- tests/ui/type-alias-impl-trait/taint.rs | 2 +- .../type-alias-impl-trait-fn-type.rs | 2 +- .../type-alias-impl-trait-fns.rs | 2 +- ...alias-impl-trait-unconstrained-lifetime.rs | 2 +- .../type-alias-impl-trait-with-no-traits.rs | 4 +- .../underef-index-out-of-bounds-121472.rs | 2 +- .../type-alias-impl-trait/unnameable_type.rs | 2 +- tests/ui/type-alias-impl-trait/variance.rs | 22 +- tests/ui/type/issue-101866.rs | 4 +- tests/ui/type/issue-102598.rs | 8 +- tests/ui/type/issue-58355.rs | 2 +- tests/ui/type/pattern_types/assoc_const.rs | 8 +- tests/ui/type/pattern_types/bad_pat.rs | 6 +- tests/ui/type/pattern_types/derives.rs | 2 +- .../feature-gate-pattern_types2.rs | 2 +- tests/ui/type/pattern_types/literals.rs | 4 +- tests/ui/type/pattern_types/nested.rs | 22 +- .../pattern_types/pattern_type_mismatch.rs | 8 +- tests/ui/type/pattern_types/range_patterns.rs | 2 +- .../range_patterns_trait_impls2.rs | 2 +- .../pattern_types/range_patterns_unusable.rs | 2 +- tests/ui/type/pattern_types/reverse_range.rs | 4 +- tests/ui/type/pattern_types/signed_ranges.rs | 4 +- .../type/pattern_types/unimplemented_pat.rs | 4 +- tests/ui/type/pattern_types/validity.rs | 16 +- tests/ui/typeck/check-args-on-fn-err.rs | 2 +- tests/ui/typeck/const-in-fn-call-generics.rs | 2 +- tests/ui/typeck/cyclic_type_ice.rs | 4 +- tests/ui/typeck/issue-100164.fixed | 4 +- tests/ui/typeck/issue-100164.rs | 4 +- tests/ui/typeck/issue-10401.rs | 2 +- tests/ui/typeck/issue-104582.rs | 4 +- tests/ui/typeck/issue-105946.rs | 8 +- .../const-in-impl-fn-return-type.rs | 2 +- tests/ui/typeck/issue-57404.rs | 2 +- tests/ui/typeck/issue-75883.rs | 8 +- tests/ui/typeck/issue-80779.rs | 4 +- tests/ui/typeck/issue-81293.rs | 6 +- ...ssue-83621-placeholder-static-in-extern.rs | 2 +- tests/ui/typeck/issue-83693.rs | 8 +- tests/ui/typeck/issue-84768.rs | 4 +- .../ui/typeck/issue-86721-return-expr-ice.rs | 4 +- tests/ui/typeck/issue-88643.rs | 6 +- tests/ui/typeck/issue-88844.rs | 6 +- tests/ui/typeck/issue-89856.fixed | 6 +- tests/ui/typeck/issue-89856.rs | 6 +- tests/ui/typeck/issue-91210-ptr-method.fixed | 4 +- tests/ui/typeck/issue-91210-ptr-method.rs | 4 +- tests/ui/typeck/issue-91267.rs | 6 +- tests/ui/typeck/issue-91328.fixed | 24 +- tests/ui/typeck/issue-91328.rs | 24 +- tests/ui/typeck/issue-91450-inner-ty-error.rs | 4 +- tests/ui/typeck/issue-96530.rs | 2 +- tests/ui/typeck/issue-96738.rs | 4 +- tests/ui/typeck/issue-98260.rs | 2 +- tests/ui/typeck/repeat-expr-checks-wf.rs | 2 +- .../ui/typeck/type-placeholder-fn-in-const.rs | 8 +- tests/ui/ufcs/ufcs-explicit-self-bad.rs | 6 +- tests/ui/unboxed-closures/issue-30906.rs | 2 +- .../non-tupled-arg-mismatch.rs | 2 +- tests/ui/union/union-lint-dead-code.rs | 2 +- tests/ui/unop/unop-move-semantics.rs | 10 +- tests/ui/unpretty/mir-unpretty.rs | 2 +- tests/ui/unsafe/unsafe-assign.rs | 2 +- tests/ui/unsafe/unsafe-borrow.rs | 6 +- tests/ui/unsafe/unsafe-not-inherited.rs | 16 +- tests/ui/unsigned-literal-negation.rs | 6 +- .../unsized-locals-using-unsized-fn-params.rs | 6 +- tests/ui/unsized/issue-71659.rs | 2 +- tests/ui/unsized/issue-75707.rs | 2 +- ...use-after-move-implicity-coerced-object.rs | 2 +- .../ui/variance/variance-associated-consts.rs | 2 +- tests/ui/variance/variance-regions-direct.rs | 2 +- .../ui/variance/variance-regions-indirect.rs | 8 +- tests/ui/variance/variance-trait-bounds.rs | 6 +- tests/ui/wasm/wasm-bindgen-broken-error.rs | 4 +- .../wasm/wasm-custom-section-relocations.rs | 4 +- tests/ui/wasm/wasm-import-module.rs | 12 +- tests/ui/wf/issue-87495.rs | 2 +- tests/ui/wf/wf-foreign-fn-decl-ret.rs | 4 +- .../wf/wf-in-foreign-fn-decls-issue-80468.rs | 2 +- .../normalization-of-unknown-type.rs | 2 +- .../self-in-where-clause-allowed.rs | 2 +- tests/ui/where-clauses/where-for-self.rs | 2 +- 1421 files changed, 5481 insertions(+), 5481 deletions(-) diff --git a/tests/incremental/const-generics/hash-tyvid-regression-1.rs b/tests/incremental/const-generics/hash-tyvid-regression-1.rs index 727dceb2d2729..d7ae6d9517a59 100644 --- a/tests/incremental/const-generics/hash-tyvid-regression-1.rs +++ b/tests/incremental/const-generics/hash-tyvid-regression-1.rs @@ -20,9 +20,9 @@ where { use std::convert::TryFrom; <[T; N.get()]>::try_from(()) - //~^ error: the trait bound - //~| error: the trait bound - //~| error: mismatched types + //~^ error the trait bound + //~| error the trait bound + //~| error mismatched types } fn main() {} diff --git a/tests/incremental/const-generics/hash-tyvid-regression-2.rs b/tests/incremental/const-generics/hash-tyvid-regression-2.rs index dbac296eb4a77..7e376d3f4d355 100644 --- a/tests/incremental/const-generics/hash-tyvid-regression-2.rs +++ b/tests/incremental/const-generics/hash-tyvid-regression-2.rs @@ -23,7 +23,7 @@ where { fn eq(&self, other: &&'a [A]) -> bool { self.0 == other - //~^ error: can't compare + //~^ error can't compare } } diff --git a/tests/incremental/const-generics/hash-tyvid-regression-3.rs b/tests/incremental/const-generics/hash-tyvid-regression-3.rs index 77e87c47cdc0a..614b35095a74a 100644 --- a/tests/incremental/const-generics/hash-tyvid-regression-3.rs +++ b/tests/incremental/const-generics/hash-tyvid-regression-3.rs @@ -16,7 +16,7 @@ where fn new() -> Self { let mut node = Node::new(); node.keys.some_function(); - //~^ error: no method named + //~^ error no method named node } } diff --git a/tests/incremental/const-generics/hash-tyvid-regression-4.rs b/tests/incremental/const-generics/hash-tyvid-regression-4.rs index 621ca16230b29..5a5b22f5e1c28 100644 --- a/tests/incremental/const-generics/hash-tyvid-regression-4.rs +++ b/tests/incremental/const-generics/hash-tyvid-regression-4.rs @@ -22,7 +22,7 @@ where fn split(&mut self, i: usize, k: K, right: bool) -> Node { let mut node = Node::new(); node.keys.push(k); - //~^ error: no method named + //~^ error no method named node } } diff --git a/tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-1.rs b/tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-1.rs index 0233a0b197ab1..d4fddcfcbe64c 100644 --- a/tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-1.rs +++ b/tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-77708-1.rs @@ -11,7 +11,7 @@ where C: Delegates>, { writes_to_specific_path(&cap); - //~^ error: the trait bound + //~^ error the trait bound } fn writes_to_specific_path(cap: &C) diff --git a/tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs b/tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs index 99eb92f432c27..1c0cf6128d5cb 100644 --- a/tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs +++ b/tests/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs @@ -14,13 +14,13 @@ where [(); { S * 2 }]: Default; impl<'a, T, const S: usize> Iterator for BufferIter<'a, T, S> { - //~^ error: the trait bound - //~^^ error: unconstrained generic constant + //~^ error the trait bound + //~^^ error unconstrained generic constant type Item = &'a T; fn next(&mut self) -> Option { - //~^ error: the trait bound - //~^^ error: unconstrained generic constant + //~^ error the trait bound + //~^^ error unconstrained generic constant None } } diff --git a/tests/incremental/feature_gate.rs b/tests/incremental/feature_gate.rs index 332cf944b5d65..09ce20f105b34 100644 --- a/tests/incremental/feature_gate.rs +++ b/tests/incremental/feature_gate.rs @@ -10,4 +10,4 @@ fn main() { } extern "unadjusted" fn foo() {} -//[cfail2]~^ ERROR: "unadjusted" ABI is an implementation detail and perma-unstable +//[cfail2]~^ ERROR "unadjusted" ABI is an implementation detail and perma-unstable diff --git a/tests/rustdoc-ui/disambiguator-endswith-named-suffix.rs b/tests/rustdoc-ui/disambiguator-endswith-named-suffix.rs index 1174e16dd53fd..278dea747a7aa 100644 --- a/tests/rustdoc-ui/disambiguator-endswith-named-suffix.rs +++ b/tests/rustdoc-ui/disambiguator-endswith-named-suffix.rs @@ -1,107 +1,107 @@ //@ check-pass //@ normalize-stderr: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL" -//! [struct@m!()] //~ WARN: unmatched disambiguator `struct` and suffix `!()` +//! [struct@m!()] //~ WARN unmatched disambiguator `struct` and suffix `!()` //! [struct@m!{}] //! [struct@m![]] -//! [struct@f()] //~ WARN: unmatched disambiguator `struct` and suffix `()` -//! [struct@m!] //~ WARN: unmatched disambiguator `struct` and suffix `!` +//! [struct@f()] //~ WARN unmatched disambiguator `struct` and suffix `()` +//! [struct@m!] //~ WARN unmatched disambiguator `struct` and suffix `!` //! -//! [enum@m!()] //~ WARN: unmatched disambiguator `enum` and suffix `!()` +//! [enum@m!()] //~ WARN unmatched disambiguator `enum` and suffix `!()` //! [enum@m!{}] //! [enum@m![]] -//! [enum@f()] //~ WARN: unmatched disambiguator `enum` and suffix `()` -//! [enum@m!] //~ WARN: unmatched disambiguator `enum` and suffix `!` +//! [enum@f()] //~ WARN unmatched disambiguator `enum` and suffix `()` +//! [enum@m!] //~ WARN unmatched disambiguator `enum` and suffix `!` //! -//! [trait@m!()] //~ WARN: unmatched disambiguator `trait` and suffix `!()` +//! [trait@m!()] //~ WARN unmatched disambiguator `trait` and suffix `!()` //! [trait@m!{}] //! [trait@m![]] -//! [trait@f()] //~ WARN: unmatched disambiguator `trait` and suffix `()` -//! [trait@m!] //~ WARN: unmatched disambiguator `trait` and suffix `!` +//! [trait@f()] //~ WARN unmatched disambiguator `trait` and suffix `()` +//! [trait@m!] //~ WARN unmatched disambiguator `trait` and suffix `!` //! -//! [module@m!()] //~ WARN: unmatched disambiguator `module` and suffix `!()` +//! [module@m!()] //~ WARN unmatched disambiguator `module` and suffix `!()` //! [module@m!{}] //! [module@m![]] -//! [module@f()] //~ WARN: unmatched disambiguator `module` and suffix `()` -//! [module@m!] //~ WARN: unmatched disambiguator `module` and suffix `!` +//! [module@f()] //~ WARN unmatched disambiguator `module` and suffix `()` +//! [module@m!] //~ WARN unmatched disambiguator `module` and suffix `!` //! -//! [mod@m!()] //~ WARN: unmatched disambiguator `mod` and suffix `!()` +//! [mod@m!()] //~ WARN unmatched disambiguator `mod` and suffix `!()` //! [mod@m!{}] //! [mod@m![]] -//! [mod@f()] //~ WARN: unmatched disambiguator `mod` and suffix `()` -//! [mod@m!] //~ WARN: unmatched disambiguator `mod` and suffix `!` +//! [mod@f()] //~ WARN unmatched disambiguator `mod` and suffix `()` +//! [mod@m!] //~ WARN unmatched disambiguator `mod` and suffix `!` //! -//! [const@m!()] //~ WARN: unmatched disambiguator `const` and suffix `!()` +//! [const@m!()] //~ WARN unmatched disambiguator `const` and suffix `!()` //! [const@m!{}] //! [const@m![]] -//! [const@f()] //~ WARN: incompatible link kind for `f` -//! [const@m!] //~ WARN: unmatched disambiguator `const` and suffix `!` +//! [const@f()] //~ WARN incompatible link kind for `f` +//! [const@m!] //~ WARN unmatched disambiguator `const` and suffix `!` //! -//! [constant@m!()] //~ WARN: unmatched disambiguator `constant` and suffix `!()` +//! [constant@m!()] //~ WARN unmatched disambiguator `constant` and suffix `!()` //! [constant@m!{}] //! [constant@m![]] -//! [constant@f()] //~ WARN: incompatible link kind for `f` -//! [constant@m!] //~ WARN: unmatched disambiguator `constant` and suffix `!` +//! [constant@f()] //~ WARN incompatible link kind for `f` +//! [constant@m!] //~ WARN unmatched disambiguator `constant` and suffix `!` //! -//! [static@m!()] //~ WARN: unmatched disambiguator `static` and suffix `!()` +//! [static@m!()] //~ WARN unmatched disambiguator `static` and suffix `!()` //! [static@m!{}] //! [static@m![]] -//! [static@f()] //~ WARN: incompatible link kind for `f` -//! [static@m!] //~ WARN: unmatched disambiguator `static` and suffix `!` +//! [static@f()] //~ WARN incompatible link kind for `f` +//! [static@m!] //~ WARN unmatched disambiguator `static` and suffix `!` //! -//! [function@m!()] //~ WARN: unmatched disambiguator `function` and suffix `!()` +//! [function@m!()] //~ WARN unmatched disambiguator `function` and suffix `!()` //! [function@m!{}] //! [function@m![]] //! [function@f()] -//! [function@m!] //~ WARN: unmatched disambiguator `function` and suffix `!` +//! [function@m!] //~ WARN unmatched disambiguator `function` and suffix `!` //! -//! [fn@m!()] //~ WARN: unmatched disambiguator `fn` and suffix `!()` +//! [fn@m!()] //~ WARN unmatched disambiguator `fn` and suffix `!()` //! [fn@m!{}] //! [fn@m![]] //! [fn@f()] -//! [fn@m!] //~ WARN: unmatched disambiguator `fn` and suffix `!` +//! [fn@m!] //~ WARN unmatched disambiguator `fn` and suffix `!` //! -//! [method@m!()] //~ WARN: unmatched disambiguator `method` and suffix `!()` +//! [method@m!()] //~ WARN unmatched disambiguator `method` and suffix `!()` //! [method@m!{}] //! [method@m![]] //! [method@f()] -//! [method@m!] //~ WARN: unmatched disambiguator `method` and suffix `!` +//! [method@m!] //~ WARN unmatched disambiguator `method` and suffix `!` //! -//! [derive@m!()] //~ WARN: incompatible link kind for `m` -//! [derive@m!{}] //~ WARN: incompatible link kind for `m` +//! [derive@m!()] //~ WARN incompatible link kind for `m` +//! [derive@m!{}] //~ WARN incompatible link kind for `m` //! [derive@m![]] -//! [derive@f()] //~ WARN: unmatched disambiguator `derive` and suffix `()` -//! [derive@m!] //~ WARN: incompatible link kind for `m` +//! [derive@f()] //~ WARN unmatched disambiguator `derive` and suffix `()` +//! [derive@m!] //~ WARN incompatible link kind for `m` //! -//! [type@m!()] //~ WARN: unmatched disambiguator `type` and suffix `!()` +//! [type@m!()] //~ WARN unmatched disambiguator `type` and suffix `!()` //! [type@m!{}] //! [type@m![]] -//! [type@f()] //~ WARN: unmatched disambiguator `type` and suffix `()` -//! [type@m!] //~ WARN: unmatched disambiguator `type` and suffix `!` +//! [type@f()] //~ WARN unmatched disambiguator `type` and suffix `()` +//! [type@m!] //~ WARN unmatched disambiguator `type` and suffix `!` //! -//! [value@m!()] //~ WARN: unmatched disambiguator `value` and suffix `!()` +//! [value@m!()] //~ WARN unmatched disambiguator `value` and suffix `!()` //! [value@m!{}] //! [value@m![]] //! [value@f()] -//! [value@m!] //~ WARN: unmatched disambiguator `value` and suffix `!` +//! [value@m!] //~ WARN unmatched disambiguator `value` and suffix `!` //! //! [macro@m!()] //! [macro@m!{}] //! [macro@m![]] -//! [macro@f()] //~ WARN: unmatched disambiguator `macro` and suffix `()` +//! [macro@f()] //~ WARN unmatched disambiguator `macro` and suffix `()` //! [macro@m!] //! -//! [prim@m!()] //~ WARN: unmatched disambiguator `prim` and suffix `!()` +//! [prim@m!()] //~ WARN unmatched disambiguator `prim` and suffix `!()` //! [prim@m!{}] //! [prim@m![]] -//! [prim@f()] //~ WARN: unmatched disambiguator `prim` and suffix `()` -//! [prim@m!] //~ WARN: unmatched disambiguator `prim` and suffix `!` +//! [prim@f()] //~ WARN unmatched disambiguator `prim` and suffix `()` +//! [prim@m!] //~ WARN unmatched disambiguator `prim` and suffix `!` //! -//! [primitive@m!()] //~ WARN: unmatched disambiguator `primitive` and suffix `!()` +//! [primitive@m!()] //~ WARN unmatched disambiguator `primitive` and suffix `!()` //! [primitive@m!{}] //! [primitive@m![]] -//! [primitive@f()] //~ WARN: unmatched disambiguator `primitive` and suffix `()` -//! [primitive@m!] //~ WARN: unmatched disambiguator `primitive` and suffix `!` +//! [primitive@f()] //~ WARN unmatched disambiguator `primitive` and suffix `()` +//! [primitive@m!] //~ WARN unmatched disambiguator `primitive` and suffix `!` #[macro_export] macro_rules! m { diff --git a/tests/rustdoc-ui/disambiguator-macro-endswith-exclamatory.rs b/tests/rustdoc-ui/disambiguator-macro-endswith-exclamatory.rs index b955090e8944c..274fdeecbad58 100644 --- a/tests/rustdoc-ui/disambiguator-macro-endswith-exclamatory.rs +++ b/tests/rustdoc-ui/disambiguator-macro-endswith-exclamatory.rs @@ -1,6 +1,6 @@ //@ check-pass -//! [macro@m!] //~ WARN: unresolved link to `m` +//! [macro@m!] //~ WARN unresolved link to `m` //issue#126986 diff --git a/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type-2.rs b/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type-2.rs index 7151ebd599f6d..32b796ef91c5c 100644 --- a/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type-2.rs +++ b/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type-2.rs @@ -1,6 +1,6 @@ pub fn f() -> impl Sized { pub enum E { - //~^ ERROR: recursive type + //~^ ERROR recursive type V(E), } diff --git a/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type.rs b/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type.rs index 1f85505172938..9eb2f810978d9 100644 --- a/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type.rs +++ b/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type.rs @@ -1,6 +1,6 @@ fn f() -> impl Sized { enum E { - //~^ ERROR: recursive type + //~^ ERROR recursive type V(E), } diff --git a/tests/rustdoc-ui/intra-doc/feature-gate-intra-doc-pointers.rs b/tests/rustdoc-ui/intra-doc/feature-gate-intra-doc-pointers.rs index 3cfac942ca85e..33f2ffeb738e9 100644 --- a/tests/rustdoc-ui/intra-doc/feature-gate-intra-doc-pointers.rs +++ b/tests/rustdoc-ui/intra-doc/feature-gate-intra-doc-pointers.rs @@ -1,6 +1,6 @@ //! [pointer::add] -//~^ ERROR: experimental +//~^ ERROR experimental //! [pointer::wrapping_add] -//~^ ERROR: experimental +//~^ ERROR experimental //! [pointer] // This is explicitly allowed //! [reference] // This is explicitly allowed diff --git a/tests/rustdoc-ui/issues/issue-120444-1.rs b/tests/rustdoc-ui/issues/issue-120444-1.rs index 51f2b98fb3048..d31e6053102f8 100644 --- a/tests/rustdoc-ui/issues/issue-120444-1.rs +++ b/tests/rustdoc-ui/issues/issue-120444-1.rs @@ -9,7 +9,7 @@ mod webdavfs { /// [`Vfs`][crate::Vfs] pub use webdavfs::A; -//~^^ error: redundant explicit link target +//~^^ error redundant explicit link target /// [`Vfs`] pub use webdavfs::B; diff --git a/tests/rustdoc-ui/issues/issue-120444-2.rs b/tests/rustdoc-ui/issues/issue-120444-2.rs index f0e842fd8587c..a3721e68fdb36 100644 --- a/tests/rustdoc-ui/issues/issue-120444-2.rs +++ b/tests/rustdoc-ui/issues/issue-120444-2.rs @@ -9,7 +9,7 @@ pub mod webdavfs { /// [`Vfs`][crate::Vfs] pub use webdavfs::A; -//~^^ error: redundant explicit link target +//~^^ error redundant explicit link target /// [`Vfs`] pub use webdavfs::B; diff --git a/tests/rustdoc-ui/lints/feature-gate-rustdoc_missing_doc_code_examples.rs b/tests/rustdoc-ui/lints/feature-gate-rustdoc_missing_doc_code_examples.rs index 46e337cf2b3fa..4601966848659 100644 --- a/tests/rustdoc-ui/lints/feature-gate-rustdoc_missing_doc_code_examples.rs +++ b/tests/rustdoc-ui/lints/feature-gate-rustdoc_missing_doc_code_examples.rs @@ -5,4 +5,4 @@ //~^ ERROR unknown lint //~| NOTE lint is unstable //~| NOTE see issue -//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +//~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/rustdoc-ui/mismatched_arg_count.rs b/tests/rustdoc-ui/mismatched_arg_count.rs index 7841442987b72..18bbef5e21a3f 100644 --- a/tests/rustdoc-ui/mismatched_arg_count.rs +++ b/tests/rustdoc-ui/mismatched_arg_count.rs @@ -5,4 +5,4 @@ trait Trait<'a> { type Alias<'a, T> = >::Assoc; fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {} -//~^ error: type alias takes 1 lifetime argument but 2 lifetime arguments were supplied +//~^ error type alias takes 1 lifetime argument but 2 lifetime arguments were supplied diff --git a/tests/rustdoc-ui/not-wf-ambiguous-normalization.rs b/tests/rustdoc-ui/not-wf-ambiguous-normalization.rs index 9f7d6db5d26e9..c0747a0e58065 100644 --- a/tests/rustdoc-ui/not-wf-ambiguous-normalization.rs +++ b/tests/rustdoc-ui/not-wf-ambiguous-normalization.rs @@ -12,7 +12,7 @@ struct DefaultAllocator; // `::Buffer` to be ambiguous, // which caused an ICE with `-Znormalize-docs`. impl Allocator for DefaultAllocator { - //~^ ERROR: the type parameter `T` is not constrained + //~^ ERROR the type parameter `T` is not constrained type Buffer = (); } diff --git a/tests/ui-fulldeps/hash-stable-is-unstable.rs b/tests/ui-fulldeps/hash-stable-is-unstable.rs index a4b8533eb0455..edc7563c836d6 100644 --- a/tests/ui-fulldeps/hash-stable-is-unstable.rs +++ b/tests/ui-fulldeps/hash-stable-is-unstable.rs @@ -1,30 +1,30 @@ //@ compile-flags: -Zdeduplicate-diagnostics=yes extern crate rustc_data_structures; //~^ use of unstable library feature `rustc_private` -//~| NOTE: issue #27812 for more information -//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +//~| NOTE issue #27812 for more information +//~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date extern crate rustc_macros; //~^ use of unstable library feature `rustc_private` -//~| NOTE: see issue #27812 for more information -//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +//~| NOTE see issue #27812 for more information +//~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date extern crate rustc_query_system; //~^ use of unstable library feature `rustc_private` -//~| NOTE: see issue #27812 for more information -//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +//~| NOTE see issue #27812 for more information +//~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date use rustc_macros::HashStable; //~^ use of unstable library feature `rustc_private` -//~| NOTE: see issue #27812 for more information -//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +//~| NOTE see issue #27812 for more information +//~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date #[derive(HashStable)] //~^ use of unstable library feature `rustc_private` -//~| NOTE: in this expansion of #[derive(HashStable)] -//~| NOTE: in this expansion of #[derive(HashStable)] -//~| NOTE: in this expansion of #[derive(HashStable)] -//~| NOTE: in this expansion of #[derive(HashStable)] -//~| NOTE: see issue #27812 for more information -//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +//~| NOTE in this expansion of #[derive(HashStable)] +//~| NOTE in this expansion of #[derive(HashStable)] +//~| NOTE in this expansion of #[derive(HashStable)] +//~| NOTE in this expansion of #[derive(HashStable)] +//~| NOTE see issue #27812 for more information +//~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date struct Test; fn main() {} diff --git a/tests/ui/abi/c-zst.rs b/tests/ui/abi/c-zst.rs index c1dac41f876a2..18a5c845f5924 100644 --- a/tests/ui/abi/c-zst.rs +++ b/tests/ui/abi/c-zst.rs @@ -61,4 +61,4 @@ extern crate minicore; use minicore::*; #[rustc_abi(debug)] -extern "C" fn pass_zst(_: ()) {} //~ ERROR: fn_abi +extern "C" fn pass_zst(_: ()) {} //~ ERROR fn_abi diff --git a/tests/ui/abi/debug.rs b/tests/ui/abi/debug.rs index 6dbc316146412..6ef7fcb807dab 100644 --- a/tests/ui/abi/debug.rs +++ b/tests/ui/abi/debug.rs @@ -13,42 +13,42 @@ struct S(u16); #[rustc_abi(debug)] -fn test(_x: u8) -> bool { true } //~ ERROR: fn_abi +fn test(_x: u8) -> bool { true } //~ ERROR fn_abi #[rustc_abi(debug)] -type TestFnPtr = fn(bool) -> u8; //~ ERROR: fn_abi +type TestFnPtr = fn(bool) -> u8; //~ ERROR fn_abi #[rustc_abi(debug)] -fn test_generic(_x: *const T) { } //~ ERROR: fn_abi +fn test_generic(_x: *const T) { } //~ ERROR fn_abi #[rustc_abi(debug)] -const C: () = (); //~ ERROR: can only be applied to +const C: () = (); //~ ERROR can only be applied to impl S { #[rustc_abi(debug)] - const C: () = (); //~ ERROR: can only be applied to + const C: () = (); //~ ERROR can only be applied to } impl S { #[rustc_abi(debug)] - fn assoc_test(&self) { } //~ ERROR: fn_abi + fn assoc_test(&self) { } //~ ERROR fn_abi } #[rustc_abi(assert_eq)] type TestAbiEq = (fn(bool), fn(bool)); #[rustc_abi(assert_eq)] -type TestAbiNe = (fn(u8), fn(u32)); //~ ERROR: ABIs are not compatible +type TestAbiNe = (fn(u8), fn(u32)); //~ ERROR ABIs are not compatible #[rustc_abi(assert_eq)] -type TestAbiNeLarger = (fn([u8; 32]), fn([u32; 32])); //~ ERROR: ABIs are not compatible +type TestAbiNeLarger = (fn([u8; 32]), fn([u32; 32])); //~ ERROR ABIs are not compatible #[rustc_abi(assert_eq)] -type TestAbiNeFloat = (fn(f32), fn(u32)); //~ ERROR: ABIs are not compatible +type TestAbiNeFloat = (fn(f32), fn(u32)); //~ ERROR ABIs are not compatible // Sign matters on some targets (such as s390x), so let's make sure we never accept this. #[rustc_abi(assert_eq)] -type TestAbiNeSign = (fn(i32), fn(u32)); //~ ERROR: ABIs are not compatible +type TestAbiNeSign = (fn(i32), fn(u32)); //~ ERROR ABIs are not compatible #[rustc_abi(assert_eq)] -type TestAbiEqNonsense = (fn((str, str)), fn((str, str))); //~ ERROR: cannot be known at compilation time +type TestAbiEqNonsense = (fn((str, str)), fn((str, str))); //~ ERROR cannot be known at compilation time diff --git a/tests/ui/abi/sysv64-zst.rs b/tests/ui/abi/sysv64-zst.rs index 42ba1fb5f03a0..a2b0531ca8d2d 100644 --- a/tests/ui/abi/sysv64-zst.rs +++ b/tests/ui/abi/sysv64-zst.rs @@ -5,4 +5,4 @@ #![crate_type = "lib"] #[rustc_abi(debug)] -extern "sysv64" fn pass_zst(_: ()) {} //~ ERROR: fn_abi +extern "sysv64" fn pass_zst(_: ()) {} //~ ERROR fn_abi diff --git a/tests/ui/allocator/function-allocator.rs b/tests/ui/allocator/function-allocator.rs index d53f6e9b72e88..5811124bed042 100644 --- a/tests/ui/allocator/function-allocator.rs +++ b/tests/ui/allocator/function-allocator.rs @@ -1,4 +1,4 @@ #[global_allocator] -fn foo() {} //~ ERROR: allocators must be statics +fn foo() {} //~ ERROR allocators must be statics fn main() {} diff --git a/tests/ui/allocator/two-allocators.rs b/tests/ui/allocator/two-allocators.rs index aa1291e77aecb..838185cca36da 100644 --- a/tests/ui/allocator/two-allocators.rs +++ b/tests/ui/allocator/two-allocators.rs @@ -4,6 +4,6 @@ use std::alloc::System; static A: System = System; #[global_allocator] static B: System = System; -//~^ ERROR: cannot define multiple global allocators +//~^ ERROR cannot define multiple global allocators fn main() {} diff --git a/tests/ui/argument-suggestions/issue-109425.fixed b/tests/ui/argument-suggestions/issue-109425.fixed index 4b3aaa46d86dc..62687988bdcdd 100644 --- a/tests/ui/argument-suggestions/issue-109425.fixed +++ b/tests/ui/argument-suggestions/issue-109425.fixed @@ -8,17 +8,17 @@ fn s(_: &str) {} fn main() { // code expected suggestion f(); // f() - //~^ error: this function takes 0 arguments but 2 arguments were supplied + //~^ error this function takes 0 arguments but 2 arguments were supplied i(0,); // i(0,) - //~^ error: this function takes 1 argument but 3 arguments were supplied + //~^ error this function takes 1 argument but 3 arguments were supplied i(0); // i(0) - //~^ error: this function takes 1 argument but 3 arguments were supplied + //~^ error this function takes 1 argument but 3 arguments were supplied is(0, ""); // is(0, "") - //~^ error: this function takes 2 arguments but 4 arguments were supplied + //~^ error this function takes 2 arguments but 4 arguments were supplied is(1, ""); - //~^ error: this function takes 2 arguments but 4 arguments were supplied + //~^ error this function takes 2 arguments but 4 arguments were supplied is(1, ""); - //~^ error: this function takes 2 arguments but 4 arguments were supplied + //~^ error this function takes 2 arguments but 4 arguments were supplied s(""); // s("") - //~^ error: this function takes 1 argument but 3 arguments were supplied + //~^ error this function takes 1 argument but 3 arguments were supplied } diff --git a/tests/ui/argument-suggestions/issue-109425.rs b/tests/ui/argument-suggestions/issue-109425.rs index 56816681337c8..395f2d8ec0b1b 100644 --- a/tests/ui/argument-suggestions/issue-109425.rs +++ b/tests/ui/argument-suggestions/issue-109425.rs @@ -8,17 +8,17 @@ fn s(_: &str) {} fn main() { // code expected suggestion f(0, 1,); // f() - //~^ error: this function takes 0 arguments but 2 arguments were supplied + //~^ error this function takes 0 arguments but 2 arguments were supplied i(0, 1, 2,); // i(0,) - //~^ error: this function takes 1 argument but 3 arguments were supplied + //~^ error this function takes 1 argument but 3 arguments were supplied i(0, 1, 2); // i(0) - //~^ error: this function takes 1 argument but 3 arguments were supplied + //~^ error this function takes 1 argument but 3 arguments were supplied is(0, 1, 2, ""); // is(0, "") - //~^ error: this function takes 2 arguments but 4 arguments were supplied + //~^ error this function takes 2 arguments but 4 arguments were supplied is((), 1, "", ()); - //~^ error: this function takes 2 arguments but 4 arguments were supplied + //~^ error this function takes 2 arguments but 4 arguments were supplied is(1, (), "", ()); - //~^ error: this function takes 2 arguments but 4 arguments were supplied + //~^ error this function takes 2 arguments but 4 arguments were supplied s(0, 1, ""); // s("") - //~^ error: this function takes 1 argument but 3 arguments were supplied + //~^ error this function takes 1 argument but 3 arguments were supplied } diff --git a/tests/ui/array-slice-vec/array-break-length.rs b/tests/ui/array-slice-vec/array-break-length.rs index 60589f7c264a6..c154cd64bbefd 100644 --- a/tests/ui/array-slice-vec/array-break-length.rs +++ b/tests/ui/array-slice-vec/array-break-length.rs @@ -1,9 +1,9 @@ fn main() { loop { - |_: [_; break]| {} //~ ERROR: `break` outside of a loop + |_: [_; break]| {} //~ ERROR `break` outside of a loop } loop { - |_: [_; continue]| {} //~ ERROR: `continue` outside of a loop + |_: [_; continue]| {} //~ ERROR `continue` outside of a loop } } diff --git a/tests/ui/array-slice-vec/vector-cast-weirdness.rs b/tests/ui/array-slice-vec/vector-cast-weirdness.rs index e8f2c71477a5f..229e0d77f9d1f 100644 --- a/tests/ui/array-slice-vec/vector-cast-weirdness.rs +++ b/tests/ui/array-slice-vec/vector-cast-weirdness.rs @@ -17,13 +17,13 @@ fn main() { // No longer a type mismatch - the `_` can be fully resolved by type inference. let p1: *const u8 = &x1.y as *const _; let p1: *mut u8 = &x1.y as *mut _; - //~^ ERROR: casting `&[u8; 2]` as `*mut u8` is invalid + //~^ ERROR casting `&[u8; 2]` as `*mut u8` is invalid let t1: *const [u8; 2] = &x1.y as *const _; let t1: *mut [u8; 2] = &x1.y as *mut _; - //~^ ERROR: casting `&[u8; 2]` as `*mut [u8; 2]` is invalid + //~^ ERROR casting `&[u8; 2]` as `*mut [u8; 2]` is invalid let h1: *const [u8; 2] = &x1.y as *const [u8; 2]; let t1: *mut [u8; 2] = &x1.y as *mut [u8; 2]; - //~^ ERROR: casting `&[u8; 2]` as `*mut [u8; 2]` is invalid + //~^ ERROR casting `&[u8; 2]` as `*mut [u8; 2]` is invalid let mut x1 = X { y: [0, 0] }; diff --git a/tests/ui/asm/aarch64/srcloc.rs b/tests/ui/asm/aarch64/srcloc.rs index c635fa6ba700a..acce4b927d86d 100644 --- a/tests/ui/asm/aarch64/srcloc.rs +++ b/tests/ui/asm/aarch64/srcloc.rs @@ -10,75 +10,75 @@ use std::arch::asm; fn main() { unsafe { asm!("invalid_instruction"); - //~^ ERROR: unrecognized instruction mnemonic + //~^ ERROR unrecognized instruction mnemonic asm!(" invalid_instruction "); - //~^^ ERROR: unrecognized instruction mnemonic + //~^^ ERROR unrecognized instruction mnemonic asm!(r#" invalid_instruction "#); - //~^^ ERROR: unrecognized instruction mnemonic + //~^^ ERROR unrecognized instruction mnemonic asm!(" mov x0, x0 invalid_instruction mov x0, x0 "); - //~^^^ ERROR: unrecognized instruction mnemonic + //~^^^ ERROR unrecognized instruction mnemonic asm!(r#" mov x0, x0 invalid_instruction mov x0, x0 "#); - //~^^^ ERROR: unrecognized instruction mnemonic + //~^^^ ERROR unrecognized instruction mnemonic asm!(concat!("invalid", "_", "instruction")); - //~^ ERROR: unrecognized instruction mnemonic + //~^ ERROR unrecognized instruction mnemonic asm!( "invalid_instruction", ); - //~^^ ERROR: unrecognized instruction mnemonic + //~^^ ERROR unrecognized instruction mnemonic asm!( "mov x0, x0", "invalid_instruction", "mov x0, x0", ); - //~^^^ ERROR: unrecognized instruction mnemonic + //~^^^ ERROR unrecognized instruction mnemonic asm!( "mov x0, x0\n", "invalid_instruction", "mov x0, x0", ); - //~^^^ ERROR: unrecognized instruction mnemonic + //~^^^ ERROR unrecognized instruction mnemonic asm!( "mov x0, x0", concat!("invalid", "_", "instruction"), "mov x0, x0", ); - //~^^^ ERROR: unrecognized instruction mnemonic + //~^^^ ERROR unrecognized instruction mnemonic asm!( concat!("mov x0", ", ", "x0"), concat!("invalid", "_", "instruction"), concat!("mov x0", ", ", "x0"), ); - //~^^^ ERROR: unrecognized instruction mnemonic + //~^^^ ERROR unrecognized instruction mnemonic // Make sure template strings get separated asm!( "invalid_instruction1", "invalid_instruction2", ); - //~^^^ ERROR: unrecognized instruction mnemonic - //~^^^ ERROR: unrecognized instruction mnemonic + //~^^^ ERROR unrecognized instruction mnemonic + //~^^^ ERROR unrecognized instruction mnemonic asm!( concat!( @@ -86,8 +86,8 @@ fn main() { "invalid", "_", "instruction2", ), ); - //~^^^^^ ERROR: unrecognized instruction mnemonic - //~^^^^^^ ERROR: unrecognized instruction mnemonic + //~^^^^^ ERROR unrecognized instruction mnemonic + //~^^^^^^ ERROR unrecognized instruction mnemonic asm!( concat!( @@ -99,10 +99,10 @@ fn main() { "invalid", "_", "instruction4", ), ); - //~^^^^^^^^^ ERROR: unrecognized instruction mnemonic - //~^^^^^^^^^^ ERROR: unrecognized instruction mnemonic - //~^^^^^^^ ERROR: unrecognized instruction mnemonic - //~^^^^^^^^ ERROR: unrecognized instruction mnemonic + //~^^^^^^^^^ ERROR unrecognized instruction mnemonic + //~^^^^^^^^^^ ERROR unrecognized instruction mnemonic + //~^^^^^^^ ERROR unrecognized instruction mnemonic + //~^^^^^^^^ ERROR unrecognized instruction mnemonic asm!( concat!( @@ -114,16 +114,16 @@ fn main() { "invalid", "_", "instruction4", "\n", ), ); - //~^^^^^^^^^ ERROR: unrecognized instruction mnemonic - //~^^^^^^^^^^ ERROR: unrecognized instruction mnemonic - //~^^^^^^^ ERROR: unrecognized instruction mnemonic - //~^^^^^^^^ ERROR: unrecognized instruction mnemonic + //~^^^^^^^^^ ERROR unrecognized instruction mnemonic + //~^^^^^^^^^^ ERROR unrecognized instruction mnemonic + //~^^^^^^^ ERROR unrecognized instruction mnemonic + //~^^^^^^^^ ERROR unrecognized instruction mnemonic asm!( "", "\n", "invalid_instruction" ); - //~^^ ERROR: unrecognized instruction mnemonic + //~^^ ERROR unrecognized instruction mnemonic } } diff --git a/tests/ui/asm/generic_const_simd_vec_len.rs b/tests/ui/asm/generic_const_simd_vec_len.rs index fb8c5274ddb82..3968e5e92d207 100644 --- a/tests/ui/asm/generic_const_simd_vec_len.rs +++ b/tests/ui/asm/generic_const_simd_vec_len.rs @@ -8,13 +8,13 @@ #[repr(simd)] #[derive(Copy, Clone)] pub struct Foo([u8; C]); -//~^ ERROR: cannot evaluate SIMD vector length +//~^ ERROR cannot evaluate SIMD vector length pub unsafe fn foo(a: Foo) { std::arch::asm!( "movaps {src}, {src}", src = in(xmm_reg) a, - //~^ NOTE: SIMD vector length needs to be known statically + //~^ NOTE SIMD vector length needs to be known statically ); } diff --git a/tests/ui/asm/issue-72570.rs b/tests/ui/asm/issue-72570.rs index 2b0e3628de566..f0123e4796328 100644 --- a/tests/ui/asm/issue-72570.rs +++ b/tests/ui/asm/issue-72570.rs @@ -5,6 +5,6 @@ use std::arch::asm; fn main() { unsafe { asm!("", in("invalid") "".len()); - //~^ ERROR: invalid register `invalid`: unknown register + //~^ ERROR invalid register `invalid`: unknown register } } diff --git a/tests/ui/asm/issue-89305.rs b/tests/ui/asm/issue-89305.rs index 84425c4a8f647..77a61558a17e5 100644 --- a/tests/ui/asm/issue-89305.rs +++ b/tests/ui/asm/issue-89305.rs @@ -11,6 +11,6 @@ use std::arch::asm; fn main() { unsafe { let x: () = asm!("nop"); - //~^ WARNING: unused variable: `x` + //~^ WARNING unused variable: `x` } } diff --git a/tests/ui/asm/non-const.rs b/tests/ui/asm/non-const.rs index dc9317b90b117..7f92a69cacf48 100644 --- a/tests/ui/asm/non-const.rs +++ b/tests/ui/asm/non-const.rs @@ -8,4 +8,4 @@ fn main() {} fn non_const_fn(x: i32) -> i32 { x } global_asm!("/* {} */", const non_const_fn(0)); -//~^ERROR: cannot call non-const function +//~^ERROR cannot call non-const function diff --git a/tests/ui/asm/x86_64/srcloc.rs b/tests/ui/asm/x86_64/srcloc.rs index 2938bafe5e70c..07d08469cd98a 100644 --- a/tests/ui/asm/x86_64/srcloc.rs +++ b/tests/ui/asm/x86_64/srcloc.rs @@ -9,78 +9,78 @@ use std::arch::asm; fn main() { unsafe { asm!("invalid_instruction"); - //~^ ERROR: invalid instruction mnemonic 'invalid_instruction' + //~^ ERROR invalid instruction mnemonic 'invalid_instruction' asm!(" invalid_instruction "); - //~^^ ERROR: invalid instruction mnemonic 'invalid_instruction' + //~^^ ERROR invalid instruction mnemonic 'invalid_instruction' asm!(r#" invalid_instruction "#); - //~^^ ERROR: invalid instruction mnemonic 'invalid_instruction' + //~^^ ERROR invalid instruction mnemonic 'invalid_instruction' asm!(" mov eax, eax invalid_instruction mov eax, eax "); - //~^^^ ERROR: invalid instruction mnemonic 'invalid_instruction' + //~^^^ ERROR invalid instruction mnemonic 'invalid_instruction' asm!(r#" mov eax, eax invalid_instruction mov eax, eax "#); - //~^^^ ERROR: invalid instruction mnemonic 'invalid_instruction' + //~^^^ ERROR invalid instruction mnemonic 'invalid_instruction' asm!(concat!("invalid", "_", "instruction")); - //~^ ERROR: invalid instruction mnemonic 'invalid_instruction' + //~^ ERROR invalid instruction mnemonic 'invalid_instruction' asm!("movaps %xmm3, (%esi, 2)", options(att_syntax)); - //~^ WARN: scale factor without index register is ignored + //~^ WARN scale factor without index register is ignored asm!( "invalid_instruction", ); - //~^^ ERROR: invalid instruction mnemonic 'invalid_instruction' + //~^^ ERROR invalid instruction mnemonic 'invalid_instruction' asm!( "mov eax, eax", "invalid_instruction", "mov eax, eax", ); - //~^^^ ERROR: invalid instruction mnemonic 'invalid_instruction' + //~^^^ ERROR invalid instruction mnemonic 'invalid_instruction' asm!( "mov eax, eax\n", "invalid_instruction", "mov eax, eax", ); - //~^^^ ERROR: invalid instruction mnemonic 'invalid_instruction' + //~^^^ ERROR invalid instruction mnemonic 'invalid_instruction' asm!( "mov eax, eax", concat!("invalid", "_", "instruction"), "mov eax, eax", ); - //~^^^ ERROR: invalid instruction mnemonic 'invalid_instruction' + //~^^^ ERROR invalid instruction mnemonic 'invalid_instruction' asm!( concat!("mov eax", ", ", "eax"), concat!("invalid", "_", "instruction"), concat!("mov eax", ", ", "eax"), ); - //~^^^ ERROR: invalid instruction mnemonic 'invalid_instruction' + //~^^^ ERROR invalid instruction mnemonic 'invalid_instruction' // Make sure template strings get separated asm!( "invalid_instruction1", "invalid_instruction2", ); - //~^^^ ERROR: invalid instruction mnemonic 'invalid_instruction1' - //~^^^ ERROR: invalid instruction mnemonic 'invalid_instruction2' + //~^^^ ERROR invalid instruction mnemonic 'invalid_instruction1' + //~^^^ ERROR invalid instruction mnemonic 'invalid_instruction2' asm!( concat!( @@ -88,8 +88,8 @@ fn main() { "invalid", "_", "instruction2", ), ); - //~^^^^^ ERROR: invalid instruction mnemonic 'invalid_instruction1' - //~^^^^^^ ERROR: invalid instruction mnemonic 'invalid_instruction2' + //~^^^^^ ERROR invalid instruction mnemonic 'invalid_instruction1' + //~^^^^^^ ERROR invalid instruction mnemonic 'invalid_instruction2' asm!( concat!( @@ -101,10 +101,10 @@ fn main() { "invalid", "_", "instruction4", ), ); - //~^^^^^^^^^ ERROR: invalid instruction mnemonic 'invalid_instruction1' - //~^^^^^^^^^^ ERROR: invalid instruction mnemonic 'invalid_instruction2' - //~^^^^^^^ ERROR: invalid instruction mnemonic 'invalid_instruction3' - //~^^^^^^^^ ERROR: invalid instruction mnemonic 'invalid_instruction4' + //~^^^^^^^^^ ERROR invalid instruction mnemonic 'invalid_instruction1' + //~^^^^^^^^^^ ERROR invalid instruction mnemonic 'invalid_instruction2' + //~^^^^^^^ ERROR invalid instruction mnemonic 'invalid_instruction3' + //~^^^^^^^^ ERROR invalid instruction mnemonic 'invalid_instruction4' asm!( concat!( @@ -116,16 +116,16 @@ fn main() { "invalid", "_", "instruction4", "\n", ), ); - //~^^^^^^^^^ ERROR: invalid instruction mnemonic 'invalid_instruction1' - //~^^^^^^^^^^ ERROR: invalid instruction mnemonic 'invalid_instruction2' - //~^^^^^^^ ERROR: invalid instruction mnemonic 'invalid_instruction3' - //~^^^^^^^^ ERROR: invalid instruction mnemonic 'invalid_instruction4' + //~^^^^^^^^^ ERROR invalid instruction mnemonic 'invalid_instruction1' + //~^^^^^^^^^^ ERROR invalid instruction mnemonic 'invalid_instruction2' + //~^^^^^^^ ERROR invalid instruction mnemonic 'invalid_instruction3' + //~^^^^^^^^ ERROR invalid instruction mnemonic 'invalid_instruction4' asm!( "", "\n", "invalid_instruction" ); - //~^^ ERROR: invalid instruction mnemonic 'invalid_instruction' + //~^^ ERROR invalid instruction mnemonic 'invalid_instruction' } } diff --git a/tests/ui/asm/x86_64/target-feature-attr.rs b/tests/ui/asm/x86_64/target-feature-attr.rs index 6bb277ac16598..a2463db67c440 100644 --- a/tests/ui/asm/x86_64/target-feature-attr.rs +++ b/tests/ui/asm/x86_64/target-feature-attr.rs @@ -18,9 +18,9 @@ unsafe fn bar() { let mut x = 1; let y = 2; asm!("vaddps {2:y}, {0:y}, {1:y}", in(ymm_reg) x, in(ymm_reg) y, lateout(ymm_reg) x); - //~^ ERROR: register class `ymm_reg` requires the `avx` target feature - //~| ERROR: register class `ymm_reg` requires the `avx` target feature - //~| ERROR: register class `ymm_reg` requires the `avx` target feature + //~^ ERROR register class `ymm_reg` requires the `avx` target feature + //~| ERROR register class `ymm_reg` requires the `avx` target feature + //~| ERROR register class `ymm_reg` requires the `avx` target feature assert_eq!(x, 3); } @@ -33,7 +33,7 @@ unsafe fn baz() { unsafe fn baz2() { let x = 1; asm!("/* {0} */", in(kreg) x); - //~^ ERROR: register class `kreg` requires at least one of the following target features: avx512bw, avx512f + //~^ ERROR register class `kreg` requires at least one of the following target features: avx512bw, avx512f } fn main() { diff --git a/tests/ui/associated-consts/issue-47814.rs b/tests/ui/associated-consts/issue-47814.rs index a28b1c00113c9..a6a227a95b351 100644 --- a/tests/ui/associated-consts/issue-47814.rs +++ b/tests/ui/associated-consts/issue-47814.rs @@ -6,7 +6,7 @@ impl<'a> ArpIPv4<'a> { const LENGTH: usize = 20; pub fn to_buffer() -> [u8; Self::LENGTH] { - //~^ ERROR: generic `Self` types are currently not permitted in anonymous constants + //~^ ERROR generic `Self` types are currently not permitted in anonymous constants unimplemented!() } } diff --git a/tests/ui/associated-consts/issue-58022.rs b/tests/ui/associated-consts/issue-58022.rs index 8e2a441f2390d..f1983939104cb 100644 --- a/tests/ui/associated-consts/issue-58022.rs +++ b/tests/ui/associated-consts/issue-58022.rs @@ -2,7 +2,7 @@ pub trait Foo: Sized { const SIZE: usize; fn new(slice: &[u8; Foo::SIZE]) -> Self; - //~^ ERROR: E0790 + //~^ ERROR E0790 } pub struct Bar(T); @@ -11,9 +11,9 @@ impl Bar<[u8]> { const SIZE: usize = 32; fn new(slice: &[u8; Self::SIZE]) -> Self { - //~^ ERROR: the size for values of type `[u8]` cannot be known at compilation time + //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time Foo(Box::new(*slice)) - //~^ ERROR: expected function, tuple struct or tuple variant, found trait `Foo` + //~^ ERROR expected function, tuple struct or tuple variant, found trait `Foo` } } diff --git a/tests/ui/associated-consts/issue-63496.rs b/tests/ui/associated-consts/issue-63496.rs index 67ef4e74cf2e0..4b54fa4b35a6a 100644 --- a/tests/ui/associated-consts/issue-63496.rs +++ b/tests/ui/associated-consts/issue-63496.rs @@ -2,8 +2,8 @@ trait A { const C: usize; fn f() -> ([u8; A::C], [u8; A::C]); - //~^ ERROR: E0790 - //~| ERROR: E0790 + //~^ ERROR E0790 + //~| ERROR E0790 } fn main() {} diff --git a/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg.rs b/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg.rs index a33d4928f0145..231290743331d 100644 --- a/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg.rs +++ b/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg.rs @@ -1,5 +1,5 @@ struct Fail; -//~^ ERROR: type parameter `T` is never used +//~^ ERROR type parameter `T` is never used impl Fail { const C: () = (); diff --git a/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg2.rs b/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg2.rs index d891b7bd62b4a..4e1b201b84a9a 100644 --- a/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg2.rs +++ b/tests/ui/associated-consts/wrong-projection-self-ty-invalid-bivariant-arg2.rs @@ -13,6 +13,6 @@ impl Fail { fn main() { Fail::::C - //~^ ERROR: type mismatch + //~^ ERROR type mismatch //~| ERROR no associated item named `C` found for struct `Fail` in the current scope } diff --git a/tests/ui/associated-inherent-types/issue-109071.rs b/tests/ui/associated-inherent-types/issue-109071.rs index 97803ae7191e1..1511cfe6aeb6c 100644 --- a/tests/ui/associated-inherent-types/issue-109071.rs +++ b/tests/ui/associated-inherent-types/issue-109071.rs @@ -4,16 +4,16 @@ struct Windows { t: T } -impl Windows { //~ ERROR: missing generics for struct `Windows` - type Item = &[T]; //~ ERROR: `&` without an explicit lifetime name cannot be used here - //[no_gate]~^ ERROR: inherent associated types are unstable +impl Windows { //~ ERROR missing generics for struct `Windows` + type Item = &[T]; //~ ERROR `&` without an explicit lifetime name cannot be used here + //[no_gate]~^ ERROR inherent associated types are unstable fn next() -> Option {} } impl Windows { fn T() -> Option {} - //[no_gate]~^ ERROR: ambiguous associated type + //[no_gate]~^ ERROR ambiguous associated type } fn main() {} diff --git a/tests/ui/associated-inherent-types/issue-109299-1.rs b/tests/ui/associated-inherent-types/issue-109299-1.rs index 4546785f0b1c4..6c24daf901149 100644 --- a/tests/ui/associated-inherent-types/issue-109299-1.rs +++ b/tests/ui/associated-inherent-types/issue-109299-1.rs @@ -10,6 +10,6 @@ impl Lexer { type X = impl for Fn() -> Lexer::Cursor; //~^ ERROR associated type `Cursor` not found for `Lexer` in the current scope //~| ERROR associated type `Cursor` not found for `Lexer` in the current scope -//~| ERROR: unconstrained opaque type +//~| ERROR unconstrained opaque type fn main() {} diff --git a/tests/ui/associated-inherent-types/issue-109768.rs b/tests/ui/associated-inherent-types/issue-109768.rs index 00873ccc8cf48..1dcafd264a35c 100644 --- a/tests/ui/associated-inherent-types/issue-109768.rs +++ b/tests/ui/associated-inherent-types/issue-109768.rs @@ -8,6 +8,6 @@ impl Local { //~ ERROR missing generics for struct `Local` type AssocType3 = T; //~ ERROR inherent associated types are unstable const WRAPPED_ASSOC_3: Wrapper = Wrapper(); - //~^ ERROR: this struct takes 1 argument but 0 arguments were supplied + //~^ ERROR this struct takes 1 argument but 0 arguments were supplied } //~^ ERROR `main` function not found diff --git a/tests/ui/associated-inherent-types/regionck-2.rs b/tests/ui/associated-inherent-types/regionck-2.rs index 573dd359bf2b0..da41a0bc87788 100644 --- a/tests/ui/associated-inherent-types/regionck-2.rs +++ b/tests/ui/associated-inherent-types/regionck-2.rs @@ -10,6 +10,6 @@ impl Lexer<'static> { } fn test(_: Lexer::Cursor) {} //~ ERROR mismatched types -//~^ ERROR: lifetime may not live long enough +//~^ ERROR lifetime may not live long enough fn main() {} diff --git a/tests/ui/associated-item/issue-48027.rs b/tests/ui/associated-item/issue-48027.rs index 715f3935107b4..aaf187c770c85 100644 --- a/tests/ui/associated-item/issue-48027.rs +++ b/tests/ui/associated-item/issue-48027.rs @@ -1,8 +1,8 @@ trait Bar { const X: usize; - fn return_n(&self) -> [u8; Bar::X]; //~ ERROR: E0790 + fn return_n(&self) -> [u8; Bar::X]; //~ ERROR E0790 } -impl dyn Bar {} //~ ERROR: the trait `Bar` is not dyn compatible +impl dyn Bar {} //~ ERROR the trait `Bar` is not dyn compatible fn main() {} diff --git a/tests/ui/associated-type-bounds/issue-104916.rs b/tests/ui/associated-type-bounds/issue-104916.rs index 75f327e6ee79e..4689888719f08 100644 --- a/tests/ui/associated-type-bounds/issue-104916.rs +++ b/tests/ui/associated-type-bounds/issue-104916.rs @@ -5,7 +5,7 @@ trait B { fn f() where dyn for<'j> B:, - //~^ ERROR: associated type bounds are not allowed in `dyn` types + //~^ ERROR associated type bounds are not allowed in `dyn` types { } diff --git a/tests/ui/associated-type-bounds/issue-71443-1.rs b/tests/ui/associated-type-bounds/issue-71443-1.rs index 58341ac3d3a82..d3e2f3c0f34af 100644 --- a/tests/ui/associated-type-bounds/issue-71443-1.rs +++ b/tests/ui/associated-type-bounds/issue-71443-1.rs @@ -1,7 +1,7 @@ struct Incorrect; fn hello Iterator>() { - Incorrect //~ERROR: mismatched types + Incorrect //~ERROR mismatched types } fn main() {} diff --git a/tests/ui/associated-types/avoid-getting-associated-items-of-undefined-trait.rs b/tests/ui/associated-types/avoid-getting-associated-items-of-undefined-trait.rs index f6b749a5100b9..2e4cda0595223 100644 --- a/tests/ui/associated-types/avoid-getting-associated-items-of-undefined-trait.rs +++ b/tests/ui/associated-types/avoid-getting-associated-items-of-undefined-trait.rs @@ -6,7 +6,7 @@ trait Tr { fn main() { let _: dyn Tr + ?Foo; - //~^ ERROR: `?Trait` is not permitted in trait object types - //~| ERROR: cannot find trait `Foo` in this scope - //~| ERROR: the value of the associated type `Item` in `Tr` must be specified + //~^ ERROR `?Trait` is not permitted in trait object types + //~| ERROR cannot find trait `Foo` in this scope + //~| ERROR the value of the associated type `Item` in `Tr` must be specified } diff --git a/tests/ui/associated-types/defaults-mixed.rs b/tests/ui/associated-types/defaults-mixed.rs index c91b8de39f52e..4a6910022e280 100644 --- a/tests/ui/associated-types/defaults-mixed.rs +++ b/tests/ui/associated-types/defaults-mixed.rs @@ -9,10 +9,10 @@ trait Trait { // `Bar` must be specified impl Trait for () {} -//~^ error: not all trait items implemented, missing: `Bar` +//~^ error not all trait items implemented, missing: `Bar` impl Trait for bool { -//~^ error: not all trait items implemented, missing: `Bar` +//~^ error not all trait items implemented, missing: `Bar` type Foo = (); } diff --git a/tests/ui/associated-types/defaults-specialization.rs b/tests/ui/associated-types/defaults-specialization.rs index 553705b2a4fab..91085eaecdf3e 100644 --- a/tests/ui/associated-types/defaults-specialization.rs +++ b/tests/ui/associated-types/defaults-specialization.rs @@ -8,7 +8,7 @@ trait Tr { fn make() -> Self::Ty { 0u8 - //~^ error: mismatched types + //~^ error mismatched types } } @@ -84,10 +84,10 @@ fn main() { //let _: as Tr>::Ty = 0u8; //let _: as Tr>::Ty = 0u8; - let _: as Tr>::Ty = 0u8; //~ error: mismatched types - let _: as Tr>::Ty = true; //~ error: mismatched types - let _: as Tr>::Ty = 0u8; //~ error: mismatched types - let _: as Tr>::Ty = true; //~ error: mismatched types + let _: as Tr>::Ty = 0u8; //~ error mismatched types + let _: as Tr>::Ty = true; //~ error mismatched types + let _: as Tr>::Ty = 0u8; //~ error mismatched types + let _: as Tr>::Ty = true; //~ error mismatched types let _: as Tr>::Ty = true; diff --git a/tests/ui/associated-types/issue-23595-1.rs b/tests/ui/associated-types/issue-23595-1.rs index 579fde34f53b4..9906e5dd3f824 100644 --- a/tests/ui/associated-types/issue-23595-1.rs +++ b/tests/ui/associated-types/issue-23595-1.rs @@ -6,7 +6,7 @@ trait Hierarchy { type Value; type ChildKey; type Children = dyn Index; - //~^ ERROR: the value of the associated types + //~^ ERROR the value of the associated types fn data(&self) -> Option<(Self::Value, Self::Children)>; } diff --git a/tests/ui/associated-types/issue-23595-2.rs b/tests/ui/associated-types/issue-23595-2.rs index 2bfee7a35faab..6f31d855a7da5 100644 --- a/tests/ui/associated-types/issue-23595-2.rs +++ b/tests/ui/associated-types/issue-23595-2.rs @@ -4,7 +4,7 @@ pub struct C {a:AType} pub trait A { type B = C; - //~^ ERROR: associated type `anything_here_kills_it` not found for `Self` + //~^ ERROR associated type `anything_here_kills_it` not found for `Self` } fn main() {} diff --git a/tests/ui/associated-types/issue-26681.rs b/tests/ui/associated-types/issue-26681.rs index a0a8c86d94954..734a02e0462bd 100644 --- a/tests/ui/associated-types/issue-26681.rs +++ b/tests/ui/associated-types/issue-26681.rs @@ -14,7 +14,7 @@ impl Foo for u8 { trait Baz { type Fv: Foo = u8; - const C: ::Bar = 6665; //~ error: mismatched types + const C: ::Bar = 6665; //~ error mismatched types } fn main() {} diff --git a/tests/ui/associated-types/issue-44153.rs b/tests/ui/associated-types/issue-44153.rs index 2101cb61a94d1..336c5994d06e2 100644 --- a/tests/ui/associated-types/issue-44153.rs +++ b/tests/ui/associated-types/issue-44153.rs @@ -15,5 +15,5 @@ impl<'a> Visit for () where {} fn main() { - <() as Visit>::visit(); //~ ERROR: type mismatch resolving + <() as Visit>::visit(); //~ ERROR type mismatch resolving } diff --git a/tests/ui/associated-types/issue-54108.rs b/tests/ui/associated-types/issue-54108.rs index bcc54f333621c..1bc25c280fa2c 100644 --- a/tests/ui/associated-types/issue-54108.rs +++ b/tests/ui/associated-types/issue-54108.rs @@ -21,7 +21,7 @@ where T: SubEncoder, { type Size = ::ActualSize; - //~^ ERROR: cannot add `::ActualSize` to `::ActualSize` + //~^ ERROR cannot add `::ActualSize` to `::ActualSize` fn foo(&self) -> Self::Size { self.bar() + self.bar() diff --git a/tests/ui/associated-types/issue-63593.rs b/tests/ui/associated-types/issue-63593.rs index dea81f729b4e0..fbb4e6fefa40c 100644 --- a/tests/ui/associated-types/issue-63593.rs +++ b/tests/ui/associated-types/issue-63593.rs @@ -10,7 +10,7 @@ trait Inner {} trait MyTrait { - type This = Self; //~ error: size for values of type `Self` cannot be known + type This = Self; //~ error size for values of type `Self` cannot be known fn something>(i: I); } diff --git a/tests/ui/async-await/for-await-consumes-iter.rs b/tests/ui/async-await/for-await-consumes-iter.rs index fd9bbe1c11500..ef32e37d82a4b 100644 --- a/tests/ui/async-await/for-await-consumes-iter.rs +++ b/tests/ui/async-await/for-await-consumes-iter.rs @@ -12,7 +12,7 @@ async fn real_main() { } // make sure iter has been moved and we can't iterate over it again. for await i in iter { - //~^ ERROR: use of moved value: `iter` + //~^ ERROR use of moved value: `iter` } } diff --git a/tests/ui/async-await/in-trait/fn-not-async-err.rs b/tests/ui/async-await/in-trait/fn-not-async-err.rs index a67f7fd182c5e..597fdafbdfe0b 100644 --- a/tests/ui/async-await/in-trait/fn-not-async-err.rs +++ b/tests/ui/async-await/in-trait/fn-not-async-err.rs @@ -6,7 +6,7 @@ trait MyTrait { impl MyTrait for i32 { fn foo(&self) -> i32 { - //~^ ERROR: method should be `async` or return a future, but it is synchronous + //~^ ERROR method should be `async` or return a future, but it is synchronous *self } } diff --git a/tests/ui/async-await/in-trait/generics-mismatch.rs b/tests/ui/async-await/in-trait/generics-mismatch.rs index a5c81a9299810..02b30583d732b 100644 --- a/tests/ui/async-await/in-trait/generics-mismatch.rs +++ b/tests/ui/async-await/in-trait/generics-mismatch.rs @@ -6,7 +6,7 @@ trait Foo { impl Foo for () { async fn foo() {} - //~^ ERROR: associated function `foo` has an incompatible generic parameter for trait `Foo` [E0053] + //~^ ERROR associated function `foo` has an incompatible generic parameter for trait `Foo` [E0053] } fn main() {} diff --git a/tests/ui/async-await/in-trait/missing-feature-flag.rs b/tests/ui/async-await/in-trait/missing-feature-flag.rs index 5bcbffbea4816..a00f9b007a2de 100644 --- a/tests/ui/async-await/in-trait/missing-feature-flag.rs +++ b/tests/ui/async-await/in-trait/missing-feature-flag.rs @@ -9,12 +9,12 @@ trait MyTrait { } impl MyTrait for MyStruct {} -//~^ ERROR: not all trait items implemented, missing: `foo` [E0046] +//~^ ERROR not all trait items implemented, missing: `foo` [E0046] impl MyTrait for MyStruct { async fn foo(_: i32) -> &'static str {} - //~^ ERROR: `foo` specializes an item from a parent `impl`, but that item is not marked `default` [E0520] - //~| ERROR: mismatched types [E0308] + //~^ ERROR `foo` specializes an item from a parent `impl`, but that item is not marked `default` [E0520] + //~| ERROR mismatched types [E0308] } fn main() {} diff --git a/tests/ui/async-await/in-trait/return-not-existing-pair.rs b/tests/ui/async-await/in-trait/return-not-existing-pair.rs index 3889efe1f2a3c..1f8e138e9bf54 100644 --- a/tests/ui/async-await/in-trait/return-not-existing-pair.rs +++ b/tests/ui/async-await/in-trait/return-not-existing-pair.rs @@ -3,13 +3,13 @@ trait MyTrait<'a, 'b, T> { async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T); - //~^ ERROR: cannot find type `ConnImpl` in this scope [E0412] + //~^ ERROR cannot find type `ConnImpl` in this scope [E0412] } impl<'a, 'b, T, U> MyTrait for U { - //~^ ERROR: implicit elided lifetime not allowed here [E0726] + //~^ ERROR implicit elided lifetime not allowed here [E0726] async fn foo(_: T) -> (&'a U, &'b T) {} - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] } fn main() {} diff --git a/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs index e45fca6de770f..032ca22c08d7a 100644 --- a/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs +++ b/tests/ui/async-await/in-trait/return-not-existing-type-wrapping-rpitit.rs @@ -5,7 +5,7 @@ struct Wrapper(T); trait Foo { fn bar() -> Wrapper>; - //~^ ERROR: cannot find type `Missing` in this scope [E0412] + //~^ ERROR cannot find type `Missing` in this scope [E0412] } impl Foo for () { diff --git a/tests/ui/async-await/inference_var_self_argument.rs b/tests/ui/async-await/inference_var_self_argument.rs index d03f2b5c50bff..3587f07df48e1 100644 --- a/tests/ui/async-await/inference_var_self_argument.rs +++ b/tests/ui/async-await/inference_var_self_argument.rs @@ -3,7 +3,7 @@ trait Foo { async fn foo(self: &dyn Foo) { - //~^ ERROR: `Foo` is not dyn compatible + //~^ ERROR `Foo` is not dyn compatible //~| ERROR invalid `self` parameter type: `&dyn Foo` todo!() } diff --git a/tests/ui/async-await/issue-101715.rs b/tests/ui/async-await/issue-101715.rs index 289fc5d30f55c..95aef8ab4ad26 100644 --- a/tests/ui/async-await/issue-101715.rs +++ b/tests/ui/async-await/issue-101715.rs @@ -9,9 +9,9 @@ impl S { async fn foo() { S.very_long_method_name_the_longest_method_name_in_the_whole_universe() .await - //~^ error: `()` is not a future - //~| help: remove the `.await` - //~| help: the trait `Future` is not implemented for `()` + //~^ error `()` is not a future + //~| help remove the `.await` + //~| help the trait `Future` is not implemented for `()` } fn main() {} diff --git a/tests/ui/async-await/issue-70594.rs b/tests/ui/async-await/issue-70594.rs index 422248c9eba15..db285819159ac 100644 --- a/tests/ui/async-await/issue-70594.rs +++ b/tests/ui/async-await/issue-70594.rs @@ -2,7 +2,7 @@ async fn fun() { [1; ().await]; - //~^ error: `await` is only allowed inside `async` functions and blocks + //~^ error `await` is only allowed inside `async` functions and blocks } fn main() {} diff --git a/tests/ui/async-await/issue-74047.rs b/tests/ui/async-await/issue-74047.rs index 769772c17e7b4..9205fcd39d7ed 100644 --- a/tests/ui/async-await/issue-74047.rs +++ b/tests/ui/async-await/issue-74047.rs @@ -12,6 +12,6 @@ pub async fn connect() -> io::Result { } impl TryFrom for MyStream {} -//~^ ERROR: missing +//~^ ERROR missing fn main() {} diff --git a/tests/ui/async-await/issues/issue-102206.rs b/tests/ui/async-await/issues/issue-102206.rs index 98da133a07998..1a0868932c3d0 100644 --- a/tests/ui/async-await/issues/issue-102206.rs +++ b/tests/ui/async-await/issues/issue-102206.rs @@ -4,5 +4,5 @@ async fn foo() {} fn main() { std::mem::size_of_val(foo()); - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/async-await/issues/issue-107280.rs b/tests/ui/async-await/issues/issue-107280.rs index 18c1962669f3d..fafa754ed617c 100644 --- a/tests/ui/async-await/issues/issue-107280.rs +++ b/tests/ui/async-await/issues/issue-107280.rs @@ -2,7 +2,7 @@ async fn foo() { inner::().await - //~^ ERROR: function takes 2 generic arguments but 1 generic argument was supplied + //~^ ERROR function takes 2 generic arguments but 1 generic argument was supplied } async fn inner() {} diff --git a/tests/ui/async-await/issues/issue-112225-2.rs b/tests/ui/async-await/issues/issue-112225-2.rs index 6a4da91b1475a..ffbb19fc8d816 100644 --- a/tests/ui/async-await/issues/issue-112225-2.rs +++ b/tests/ui/async-await/issues/issue-112225-2.rs @@ -11,7 +11,7 @@ use core::future::Future; fn main() { let x = Default::default(); - //~^ ERROR: type annotations needed + //~^ ERROR type annotations needed do_async( async { x.0; }, { || { let _: &(i32,) = &x; } }, diff --git a/tests/ui/async-await/issues/issue-78654.rs b/tests/ui/async-await/issues/issue-78654.rs index eb8bf27ff837d..575c97422b781 100644 --- a/tests/ui/async-await/issues/issue-78654.rs +++ b/tests/ui/async-await/issues/issue-78654.rs @@ -7,8 +7,8 @@ struct Foo; impl Foo { -//~^ ERROR: expected type, found built-in attribute `feature` -//~^^ ERROR: the const parameter `H` is not constrained by the impl trait, self type, or predicates +//~^ ERROR expected type, found built-in attribute `feature` +//~^^ ERROR the const parameter `H` is not constrained by the impl trait, self type, or predicates async fn biz() {} } diff --git a/tests/ui/async-await/issues/issue-95307.rs b/tests/ui/async-await/issues/issue-95307.rs index 27903a667fb5c..1c2b3c686b9c6 100644 --- a/tests/ui/async-await/issues/issue-95307.rs +++ b/tests/ui/async-await/issues/issue-95307.rs @@ -5,7 +5,7 @@ pub trait C { async fn new() -> [u8; _]; - //~^ ERROR: the placeholder `_` is not allowed within types on item signatures for functions + //~^ ERROR the placeholder `_` is not allowed within types on item signatures for functions //~| ERROR using `_` for array lengths is unstable } diff --git a/tests/ui/attributes/arg-error-issue-121425.rs b/tests/ui/attributes/arg-error-issue-121425.rs index c15b276ad4eb2..460bf7afab1bf 100644 --- a/tests/ui/attributes/arg-error-issue-121425.rs +++ b/tests/ui/attributes/arg-error-issue-121425.rs @@ -2,28 +2,28 @@ const N: usize = 8; #[repr(align(N))] -//~^ ERROR: incorrect `repr(align)` attribute format +//~^ ERROR incorrect `repr(align)` attribute format struct T; #[repr(align('a'))] -//~^ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer [E0589] +//~^ ERROR invalid `repr(align)` attribute: not an unsuffixed integer [E0589] struct H; #[repr(align("str"))] -//~^ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer [E0589] +//~^ ERROR invalid `repr(align)` attribute: not an unsuffixed integer [E0589] struct L; #[repr(align())] -//~^ ERROR: attribute format: `align` takes exactly one argument in parentheses +//~^ ERROR attribute format: `align` takes exactly one argument in parentheses struct X; const P: usize = 8; #[repr(packed(P))] -//~^ ERROR: attribute format: `packed` expects a literal integer as argument +//~^ ERROR attribute format: `packed` expects a literal integer as argument struct A; #[repr(packed())] -//~^ ERROR: attribute format: `packed` takes exactly one parenthesized argument, or no parentheses at all +//~^ ERROR attribute format: `packed` takes exactly one parenthesized argument, or no parentheses at all struct B; #[repr(packed)] diff --git a/tests/ui/attributes/dump_def_parents.rs b/tests/ui/attributes/dump_def_parents.rs index af117e4fa636b..997dd29908183 100644 --- a/tests/ui/attributes/dump_def_parents.rs +++ b/tests/ui/attributes/dump_def_parents.rs @@ -5,15 +5,15 @@ fn bar() { fn foo() { #[rustc_dump_def_parents] fn baz() { - //~^ ERROR: rustc_dump_def_parents: DefId + //~^ ERROR rustc_dump_def_parents: DefId || { qux::< { - //~^ ERROR: rustc_dump_def_parents: DefId + //~^ ERROR rustc_dump_def_parents: DefId fn inhibits_dump() { qux::< { - //~^ ERROR: rustc_dump_def_parents: DefId + //~^ ERROR rustc_dump_def_parents: DefId "hi"; 1 }, @@ -21,7 +21,7 @@ fn bar() { } qux::<{ 1 + 1 }>(); - //~^ ERROR: rustc_dump_def_parents: DefId + //~^ ERROR rustc_dump_def_parents: DefId 1 }, >(); diff --git a/tests/ui/attributes/inline/attr-usage-inline.rs b/tests/ui/attributes/inline/attr-usage-inline.rs index d8ca0fce1631d..6383f92784435 100644 --- a/tests/ui/attributes/inline/attr-usage-inline.rs +++ b/tests/ui/attributes/inline/attr-usage-inline.rs @@ -4,7 +4,7 @@ #[inline] fn f() {} -#[inline] //~ ERROR: attribute should be applied to function or closure +#[inline] //~ ERROR attribute should be applied to function or closure struct S; struct I { @@ -18,7 +18,7 @@ macro_rules! m_e { () => {}; } -#[inline] //~ ERROR: attribute should be applied to function or closure +#[inline] //~ ERROR attribute should be applied to function or closure macro_rules! m { () => {}; } diff --git a/tests/ui/attributes/issue-100631.rs b/tests/ui/attributes/issue-100631.rs index 0fefcf83fd516..60a6e2f605ca1 100644 --- a/tests/ui/attributes/issue-100631.rs +++ b/tests/ui/attributes/issue-100631.rs @@ -1,7 +1,7 @@ // issue #100631, make sure `TyCtxt::get_attr` only called by case that compiler // can reasonably deal with multiple attributes. // `repr` will use `TyCtxt::get_attrs` since it's `DuplicatesOk`. -#[repr(C)] //~ ERROR: unsupported representation for zero-variant enum [E0084] +#[repr(C)] //~ ERROR unsupported representation for zero-variant enum [E0084] #[repr(C)] enum Foo {} diff --git a/tests/ui/attributes/suffixed-literal-meta.rs b/tests/ui/attributes/suffixed-literal-meta.rs index a6531490c0159..bbb134ac27397 100644 --- a/tests/ui/attributes/suffixed-literal-meta.rs +++ b/tests/ui/attributes/suffixed-literal-meta.rs @@ -1,15 +1,15 @@ #![feature(rustc_attrs)] -#[rustc_dummy = 1usize] //~ ERROR: suffixed literals are not allowed in attributes -#[rustc_dummy = 1u8] //~ ERROR: suffixed literals are not allowed in attributes -#[rustc_dummy = 1u16] //~ ERROR: suffixed literals are not allowed in attributes -#[rustc_dummy = 1u32] //~ ERROR: suffixed literals are not allowed in attributes -#[rustc_dummy = 1u64] //~ ERROR: suffixed literals are not allowed in attributes -#[rustc_dummy = 1isize] //~ ERROR: suffixed literals are not allowed in attributes -#[rustc_dummy = 1i8] //~ ERROR: suffixed literals are not allowed in attributes -#[rustc_dummy = 1i16] //~ ERROR: suffixed literals are not allowed in attributes -#[rustc_dummy = 1i32] //~ ERROR: suffixed literals are not allowed in attributes -#[rustc_dummy = 1i64] //~ ERROR: suffixed literals are not allowed in attributes -#[rustc_dummy = 1.0f32] //~ ERROR: suffixed literals are not allowed in attributes -#[rustc_dummy = 1.0f64] //~ ERROR: suffixed literals are not allowed in attributes +#[rustc_dummy = 1usize] //~ ERROR suffixed literals are not allowed in attributes +#[rustc_dummy = 1u8] //~ ERROR suffixed literals are not allowed in attributes +#[rustc_dummy = 1u16] //~ ERROR suffixed literals are not allowed in attributes +#[rustc_dummy = 1u32] //~ ERROR suffixed literals are not allowed in attributes +#[rustc_dummy = 1u64] //~ ERROR suffixed literals are not allowed in attributes +#[rustc_dummy = 1isize] //~ ERROR suffixed literals are not allowed in attributes +#[rustc_dummy = 1i8] //~ ERROR suffixed literals are not allowed in attributes +#[rustc_dummy = 1i16] //~ ERROR suffixed literals are not allowed in attributes +#[rustc_dummy = 1i32] //~ ERROR suffixed literals are not allowed in attributes +#[rustc_dummy = 1i64] //~ ERROR suffixed literals are not allowed in attributes +#[rustc_dummy = 1.0f32] //~ ERROR suffixed literals are not allowed in attributes +#[rustc_dummy = 1.0f64] //~ ERROR suffixed literals are not allowed in attributes fn main() {} diff --git a/tests/ui/attributes/unsafe/derive-unsafe-attributes.rs b/tests/ui/attributes/unsafe/derive-unsafe-attributes.rs index 95fc19f506b24..02b2098800c25 100644 --- a/tests/ui/attributes/unsafe/derive-unsafe-attributes.rs +++ b/tests/ui/attributes/unsafe/derive-unsafe-attributes.rs @@ -1,13 +1,13 @@ #[derive(unsafe(Debug))] -//~^ ERROR: expected identifier, found keyword `unsafe` -//~| ERROR: traits in `#[derive(...)]` don't accept arguments -//~| ERROR: expected identifier, found keyword `unsafe` -//~| ERROR: expected identifier, found keyword `unsafe` -//~| ERROR: cannot find derive macro `r#unsafe` in this scope -//~| ERROR: cannot find derive macro `r#unsafe` in this scope +//~^ ERROR expected identifier, found keyword `unsafe` +//~| ERROR traits in `#[derive(...)]` don't accept arguments +//~| ERROR expected identifier, found keyword `unsafe` +//~| ERROR expected identifier, found keyword `unsafe` +//~| ERROR cannot find derive macro `r#unsafe` in this scope +//~| ERROR cannot find derive macro `r#unsafe` in this scope struct Foo; -#[unsafe(derive(Debug))] //~ ERROR: is not an unsafe attribute +#[unsafe(derive(Debug))] //~ ERROR is not an unsafe attribute struct Bar; fn main() {} diff --git a/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs b/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs index 19046c08ca8bd..0784eeb98676b 100644 --- a/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs +++ b/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs @@ -1,33 +1,33 @@ //@ edition: 2024 -#[unsafe(cfg(any()))] //~ ERROR: is not an unsafe attribute +#[unsafe(cfg(any()))] //~ ERROR is not an unsafe attribute fn a() {} -#[unsafe(cfg_attr(any(), allow(dead_code)))] //~ ERROR: is not an unsafe attribute +#[unsafe(cfg_attr(any(), allow(dead_code)))] //~ ERROR is not an unsafe attribute fn b() {} -#[unsafe(test)] //~ ERROR: is not an unsafe attribute +#[unsafe(test)] //~ ERROR is not an unsafe attribute fn aa() {} -#[unsafe(ignore = "test")] //~ ERROR: is not an unsafe attribute +#[unsafe(ignore = "test")] //~ ERROR is not an unsafe attribute fn bb() {} -#[unsafe(should_panic(expected = "test"))] //~ ERROR: is not an unsafe attribute +#[unsafe(should_panic(expected = "test"))] //~ ERROR is not an unsafe attribute fn cc() {} -#[unsafe(macro_use)] //~ ERROR: is not an unsafe attribute +#[unsafe(macro_use)] //~ ERROR is not an unsafe attribute mod inner { - #[unsafe(macro_export)] //~ ERROR: is not an unsafe attribute + #[unsafe(macro_export)] //~ ERROR is not an unsafe attribute macro_rules! m { () => {}; } } -#[unsafe(used)] //~ ERROR: is not an unsafe attribute +#[unsafe(used)] //~ ERROR is not an unsafe attribute static FOO: usize = 0; fn main() { let _a = cfg!(unsafe(foo)); - //~^ ERROR: expected identifier, found keyword `unsafe` - //~^^ ERROR: invalid predicate `r#unsafe` + //~^ ERROR expected identifier, found keyword `unsafe` + //~^^ ERROR invalid predicate `r#unsafe` } diff --git a/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs b/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs index eaf8706369a5a..b3460947a5ad6 100644 --- a/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs +++ b/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs @@ -1,35 +1,35 @@ #[unsafe(proc_macro)] -//~^ ERROR: is not an unsafe attribute +//~^ ERROR is not an unsafe attribute //~| ERROR attribute is only usable with crates of the `proc-macro` crate type pub fn a() {} #[unsafe(proc_macro_derive(Foo))] -//~^ ERROR: is not an unsafe attribute +//~^ ERROR is not an unsafe attribute //~| ERROR attribute is only usable with crates of the `proc-macro` crate type pub fn b() {} #[proc_macro_derive(unsafe(Foo))] //~^ ERROR attribute is only usable with crates of the `proc-macro` crate type -//~| ERROR: expected identifier, found keyword `unsafe` +//~| ERROR expected identifier, found keyword `unsafe` pub fn c() {} #[unsafe(proc_macro_attribute)] -//~^ ERROR: is not an unsafe attribute +//~^ ERROR is not an unsafe attribute //~| ERROR attribute is only usable with crates of the `proc-macro` crate type pub fn d() {} #[unsafe(allow(dead_code))] -//~^ ERROR: is not an unsafe attribute +//~^ ERROR is not an unsafe attribute pub fn e() {} #[unsafe(allow(unsafe(dead_code)))] -//~^ ERROR: is not an unsafe attribute -//~| ERROR: malformed lint attribute input -//~| ERROR: malformed lint attribute input -//~| ERROR: expected identifier, found keyword `unsafe` -//~| ERROR: malformed lint attribute input -//~| ERROR: malformed lint attribute input +//~^ ERROR is not an unsafe attribute +//~| ERROR malformed lint attribute input +//~| ERROR malformed lint attribute input +//~| ERROR expected identifier, found keyword `unsafe` +//~| ERROR malformed lint attribute input +//~| ERROR malformed lint attribute input pub fn f() {} fn main() {} diff --git a/tests/ui/attributes/unsafe/unsafe-safe-attribute.rs b/tests/ui/attributes/unsafe/unsafe-safe-attribute.rs index 5af03a2b8d137..68987ddbf1acf 100644 --- a/tests/ui/attributes/unsafe/unsafe-safe-attribute.rs +++ b/tests/ui/attributes/unsafe/unsafe-safe-attribute.rs @@ -1,4 +1,4 @@ -#[unsafe(repr(C))] //~ ERROR: is not an unsafe attribute +#[unsafe(repr(C))] //~ ERROR is not an unsafe attribute struct Foo {} fn main() {} diff --git a/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.rs b/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.rs index 0f241cc439f34..daff29e96f929 100644 --- a/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.rs +++ b/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.rs @@ -1,4 +1,4 @@ -#[unsafe(diagnostic::on_unimplemented( //~ ERROR: is not an unsafe attribute +#[unsafe(diagnostic::on_unimplemented( //~ ERROR is not an unsafe attribute message = "testing", ))] trait Foo {} diff --git a/tests/ui/auto-traits/typeck-auto-trait-no-supertraits-2.rs b/tests/ui/auto-traits/typeck-auto-trait-no-supertraits-2.rs index c0ed1e00f3b48..4f4729f92534a 100644 --- a/tests/ui/auto-traits/typeck-auto-trait-no-supertraits-2.rs +++ b/tests/ui/auto-traits/typeck-auto-trait-no-supertraits-2.rs @@ -6,7 +6,7 @@ auto trait Magic : Sized where Option : Magic {} //~ ERROR E0568 impl Magic for T {} fn copy(x: T) -> (T, T) { (x, x) } -//~^ ERROR: use of moved value +//~^ ERROR use of moved value #[derive(Debug)] struct NoClone; diff --git a/tests/ui/binop/binop-move-semantics.rs b/tests/ui/binop/binop-move-semantics.rs index b5133ea7c92a0..1b53ca75255e4 100644 --- a/tests/ui/binop/binop-move-semantics.rs +++ b/tests/ui/binop/binop-move-semantics.rs @@ -5,31 +5,31 @@ use std::ops::Add; fn double_move>(x: T) { x + - x; //~ ERROR: use of moved value + x; //~ ERROR use of moved value } fn move_then_borrow + Clone>(x: T) { x + - x.clone(); //~ ERROR: borrow of moved value + x.clone(); //~ ERROR borrow of moved value } fn move_borrowed>(x: T, mut y: T) { let m = &x; let n = &mut y; - x //~ ERROR: cannot move out of `x` because it is borrowed + x //~ ERROR cannot move out of `x` because it is borrowed + - y; //~ ERROR: cannot move out of `y` because it is borrowed + y; //~ ERROR cannot move out of `y` because it is borrowed use_mut(n); use_imm(m); } fn illegal_dereference>(mut x: T, y: T) { let m = &mut x; let n = &y; - *m //~ ERROR: cannot move + *m //~ ERROR cannot move + - *n; //~ ERROR: cannot move + *n; //~ ERROR cannot move use_imm(n); use_mut(m); } struct Foo; @@ -51,7 +51,7 @@ fn mut_plus_immut() { &mut f + - &f; //~ ERROR: cannot borrow `f` as immutable because it is also borrowed as mutable + &f; //~ ERROR cannot borrow `f` as immutable because it is also borrowed as mutable } fn immut_plus_mut() { @@ -59,7 +59,7 @@ fn immut_plus_mut() { &f + - &mut f; //~ ERROR: cannot borrow `f` as mutable because it is also borrowed as immutable + &mut f; //~ ERROR cannot borrow `f` as mutable because it is also borrowed as immutable } fn main() {} diff --git a/tests/ui/binop/issue-77910-1.rs b/tests/ui/binop/issue-77910-1.rs index 4b7ee77b46dc8..5e22fdc79c7d1 100644 --- a/tests/ui/binop/issue-77910-1.rs +++ b/tests/ui/binop/issue-77910-1.rs @@ -1,6 +1,6 @@ fn foo(s: &i32) -> &i32 { let xs; - xs //~ ERROR: isn't initialized + xs //~ ERROR isn't initialized } fn main() { let y; diff --git a/tests/ui/binop/issue-77910-2.rs b/tests/ui/binop/issue-77910-2.rs index 5ea03e82b2fe9..2c646a8755b68 100644 --- a/tests/ui/binop/issue-77910-2.rs +++ b/tests/ui/binop/issue-77910-2.rs @@ -1,6 +1,6 @@ fn foo(s: &i32) -> &i32 { let xs; - xs //~ ERROR: isn't initialized + xs //~ ERROR isn't initialized } fn main() { let y; diff --git a/tests/ui/block-result/issue-20862.rs b/tests/ui/block-result/issue-20862.rs index e435fd7aee9e8..af8478f7533ec 100644 --- a/tests/ui/block-result/issue-20862.rs +++ b/tests/ui/block-result/issue-20862.rs @@ -1,9 +1,9 @@ fn foo(x: i32) { |y| x + y -//~^ ERROR: mismatched types +//~^ ERROR mismatched types } fn main() { let x = foo(5)(2); -//~^ ERROR: expected function, found `()` +//~^ ERROR expected function, found `()` } diff --git a/tests/ui/block-result/issue-22645.rs b/tests/ui/block-result/issue-22645.rs index 5f7fb8dd32bd2..dbc796bf15c97 100644 --- a/tests/ui/block-result/issue-22645.rs +++ b/tests/ui/block-result/issue-22645.rs @@ -13,5 +13,5 @@ impl Add for Bob { fn main() { let b = Bob + 3.5; b + 3 //~ ERROR E0277 - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/borrowck/borrowck-argument.rs b/tests/ui/borrowck/borrowck-argument.rs index 5d776d4fca475..4d321d52be95e 100644 --- a/tests/ui/borrowck/borrowck-argument.rs +++ b/tests/ui/borrowck/borrowck-argument.rs @@ -7,18 +7,18 @@ impl S { } fn func(arg: S) { - arg.mutate(); //~ ERROR: cannot borrow `arg` as mutable, as it is not declared as mutable + arg.mutate(); //~ ERROR cannot borrow `arg` as mutable, as it is not declared as mutable } impl S { fn method(&self, arg: S) { - arg.mutate(); //~ ERROR: cannot borrow `arg` as mutable, as it is not declared as mutable + arg.mutate(); //~ ERROR cannot borrow `arg` as mutable, as it is not declared as mutable } } trait T { fn default(&self, arg: S) { - arg.mutate(); //~ ERROR: cannot borrow `arg` as mutable, as it is not declared as mutable + arg.mutate(); //~ ERROR cannot borrow `arg` as mutable, as it is not declared as mutable } } @@ -30,5 +30,5 @@ fn main() { s.method(s); s.default(s); (|arg: S| { arg.mutate() })(s); - //~^ ERROR: cannot borrow `arg` as mutable, as it is not declared as mutable + //~^ ERROR cannot borrow `arg` as mutable, as it is not declared as mutable } diff --git a/tests/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs b/tests/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs index 71405f7a7329d..05f0244910cd8 100644 --- a/tests/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs +++ b/tests/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs @@ -9,7 +9,7 @@ fn main() { let a: Box> = Box::new(Box::new(2)); let b = &a; - let z = *a; //~ ERROR: cannot move out of `*a` because it is borrowed + let z = *a; //~ ERROR cannot move out of `*a` because it is borrowed b.use_ref(); } diff --git a/tests/ui/borrowck/cloning-in-async-block-121547.rs b/tests/ui/borrowck/cloning-in-async-block-121547.rs index b2d8dbae977e4..9d45fba9617ab 100644 --- a/tests/ui/borrowck/cloning-in-async-block-121547.rs +++ b/tests/ui/borrowck/cloning-in-async-block-121547.rs @@ -2,9 +2,9 @@ async fn clone_async_block(value: String) { for _ in 0..10 { - async { //~ ERROR: use of moved value: `value` [E0382] + async { //~ ERROR use of moved value: `value` [E0382] drop(value); - //~^ HELP: consider cloning the value if the performance cost is acceptable + //~^ HELP consider cloning the value if the performance cost is acceptable }.await } } diff --git a/tests/ui/borrowck/drop-in-loop.rs b/tests/ui/borrowck/drop-in-loop.rs index 866c27ef20324..ee495ee99f999 100644 --- a/tests/ui/borrowck/drop-in-loop.rs +++ b/tests/ui/borrowck/drop-in-loop.rs @@ -15,7 +15,7 @@ fn drop_in_loop() { let mut base = true; let mut wrapper = WrapperWithDrop(&mut base); loop { - base = false; //~ ERROR: cannot assign to `base` + base = false; //~ ERROR cannot assign to `base` wrapper = WrapperWithDrop(&mut base); } } diff --git a/tests/ui/borrowck/issue-109271-pass-self-into-closure.fixed b/tests/ui/borrowck/issue-109271-pass-self-into-closure.fixed index 6eef44d8e590a..78f621f170bd0 100644 --- a/tests/ui/borrowck/issue-109271-pass-self-into-closure.fixed +++ b/tests/ui/borrowck/issue-109271-pass-self-into-closure.fixed @@ -17,14 +17,14 @@ fn main() { let mut v = S; v.call(|(), this: &mut S| this.get()); - //~^ error: cannot borrow `v` as mutable because it is also borrowed as immutable + //~^ error cannot borrow `v` as mutable because it is also borrowed as immutable v.call(|(), this: &mut S| this.set()); - //~^ error: cannot borrow `v` as mutable more than once at a time - //~| error: cannot borrow `v` as mutable more than once at a time + //~^ error cannot borrow `v` as mutable more than once at a time + //~| error cannot borrow `v` as mutable more than once at a time v.call(|(), this: &mut S| { - //~^ error: cannot borrow `v` as mutable more than once at a time - //~| error: cannot borrow `v` as mutable more than once at a time + //~^ error cannot borrow `v` as mutable more than once at a time + //~| error cannot borrow `v` as mutable more than once at a time _ = this; this.set(); diff --git a/tests/ui/borrowck/issue-109271-pass-self-into-closure.rs b/tests/ui/borrowck/issue-109271-pass-self-into-closure.rs index cd5121d7d4561..bbfa063c7ecab 100644 --- a/tests/ui/borrowck/issue-109271-pass-self-into-closure.rs +++ b/tests/ui/borrowck/issue-109271-pass-self-into-closure.rs @@ -17,14 +17,14 @@ fn main() { let mut v = S; v.call(|(), this: &mut S| v.get()); - //~^ error: cannot borrow `v` as mutable because it is also borrowed as immutable + //~^ error cannot borrow `v` as mutable because it is also borrowed as immutable v.call(|(), this: &mut S| v.set()); - //~^ error: cannot borrow `v` as mutable more than once at a time - //~| error: cannot borrow `v` as mutable more than once at a time + //~^ error cannot borrow `v` as mutable more than once at a time + //~| error cannot borrow `v` as mutable more than once at a time v.call(|(), this: &mut S| { - //~^ error: cannot borrow `v` as mutable more than once at a time - //~| error: cannot borrow `v` as mutable more than once at a time + //~^ error cannot borrow `v` as mutable more than once at a time + //~| error cannot borrow `v` as mutable more than once at a time _ = v; v.set(); diff --git a/tests/ui/borrowck/issue-17718-static-move.rs b/tests/ui/borrowck/issue-17718-static-move.rs index 015487a06aafe..f07c3d6057a5a 100644 --- a/tests/ui/borrowck/issue-17718-static-move.rs +++ b/tests/ui/borrowck/issue-17718-static-move.rs @@ -3,5 +3,5 @@ const INIT: Foo = Foo; static FOO: Foo = INIT; fn main() { - let _a = FOO; //~ ERROR: cannot move out of static item + let _a = FOO; //~ ERROR cannot move out of static item } diff --git a/tests/ui/borrowck/issue-83924.fixed b/tests/ui/borrowck/issue-83924.fixed index 891b0bf06509a..5c11340a1a831 100644 --- a/tests/ui/borrowck/issue-83924.fixed +++ b/tests/ui/borrowck/issue-83924.fixed @@ -13,7 +13,7 @@ fn main() { println!("max is {}", max); println!("Converting to percentages of maximum value..."); for n in v { - //~^ ERROR: use of moved value: `v` [E0382] + //~^ ERROR use of moved value: `v` [E0382] *n = 100 * (*n) / max; } println!("values: {:#?}", values); diff --git a/tests/ui/borrowck/issue-83924.rs b/tests/ui/borrowck/issue-83924.rs index 9781f6e527b3d..d5a6a6a809d91 100644 --- a/tests/ui/borrowck/issue-83924.rs +++ b/tests/ui/borrowck/issue-83924.rs @@ -13,7 +13,7 @@ fn main() { println!("max is {}", max); println!("Converting to percentages of maximum value..."); for n in v { - //~^ ERROR: use of moved value: `v` [E0382] + //~^ ERROR use of moved value: `v` [E0382] *n = 100 * (*n) / max; } println!("values: {:#?}", values); diff --git a/tests/ui/borrowck/issue-85581.rs b/tests/ui/borrowck/issue-85581.rs index ccc120c5421f5..d0e7513d2bcfd 100644 --- a/tests/ui/borrowck/issue-85581.rs +++ b/tests/ui/borrowck/issue-85581.rs @@ -7,7 +7,7 @@ use std::collections::BinaryHeap; fn foo(heap: &mut BinaryHeap) { match heap.peek_mut() { Some(_) => { heap.pop(); }, - //~^ ERROR: cannot borrow `*heap` as mutable more than once at a time + //~^ ERROR cannot borrow `*heap` as mutable more than once at a time None => (), } } diff --git a/tests/ui/borrowck/issue-87456-point-to-closure.rs b/tests/ui/borrowck/issue-87456-point-to-closure.rs index 9fc12ba749042..d1179903bae8c 100644 --- a/tests/ui/borrowck/issue-87456-point-to-closure.rs +++ b/tests/ui/borrowck/issue-87456-point-to-closure.rs @@ -4,11 +4,11 @@ fn take_mut(_val: impl FnMut()) {} fn main() { let val = String::new(); - //~^ NOTE: captured outer variable + //~^ NOTE captured outer variable take_mut(|| { - //~^ NOTE: captured by this `FnMut` closure + //~^ NOTE captured by this `FnMut` closure let _foo: String = val; - //~^ ERROR: cannot move out of `val`, a captured variable in an `FnMut` closure [E0507] - //~| NOTE: move occurs because + //~^ ERROR cannot move out of `val`, a captured variable in an `FnMut` closure [E0507] + //~| NOTE move occurs because }) } diff --git a/tests/ui/borrowck/move-in-pattern-mut-in-loop.rs b/tests/ui/borrowck/move-in-pattern-mut-in-loop.rs index 4b42f9d4cd580..b57150c0c19eb 100644 --- a/tests/ui/borrowck/move-in-pattern-mut-in-loop.rs +++ b/tests/ui/borrowck/move-in-pattern-mut-in-loop.rs @@ -5,6 +5,6 @@ fn main() { let mut opt = Some(&mut x); for _ in 0..5 { if let Some(mut _x) = opt {} - //~^ ERROR: use of moved value + //~^ ERROR use of moved value } } diff --git a/tests/ui/borrowck/moved-value-suggest-reborrow-issue-127285.fixed b/tests/ui/borrowck/moved-value-suggest-reborrow-issue-127285.fixed index cec52272feeb9..03c69167a4437 100644 --- a/tests/ui/borrowck/moved-value-suggest-reborrow-issue-127285.fixed +++ b/tests/ui/borrowck/moved-value-suggest-reborrow-issue-127285.fixed @@ -8,7 +8,7 @@ impl X { fn f(&mut self) { generic(&mut *self); self.0 += 1; - //~^ ERROR: use of moved value: `self` [E0382] + //~^ ERROR use of moved value: `self` [E0382] } } diff --git a/tests/ui/borrowck/moved-value-suggest-reborrow-issue-127285.rs b/tests/ui/borrowck/moved-value-suggest-reborrow-issue-127285.rs index dd015697fdcdb..9daaaf83a9371 100644 --- a/tests/ui/borrowck/moved-value-suggest-reborrow-issue-127285.rs +++ b/tests/ui/borrowck/moved-value-suggest-reborrow-issue-127285.rs @@ -8,7 +8,7 @@ impl X { fn f(&mut self) { generic(self); self.0 += 1; - //~^ ERROR: use of moved value: `self` [E0382] + //~^ ERROR use of moved value: `self` [E0382] } } diff --git a/tests/ui/borrowck/tainted-promoteds.rs b/tests/ui/borrowck/tainted-promoteds.rs index 2b6f0ddbd6c7f..6d83b54a78d66 100644 --- a/tests/ui/borrowck/tainted-promoteds.rs +++ b/tests/ui/borrowck/tainted-promoteds.rs @@ -5,7 +5,7 @@ pub fn f() -> u32 { let a = 0; a = &0 * &1 * &2 * &3; - //~^ ERROR: cannot assign twice to immutable variable + //~^ ERROR cannot assign twice to immutable variable a } diff --git a/tests/ui/builtin-superkinds/builtin-superkinds-self-type.rs b/tests/ui/builtin-superkinds/builtin-superkinds-self-type.rs index 05b51e969a0e2..034abf60a226e 100644 --- a/tests/ui/builtin-superkinds/builtin-superkinds-self-type.rs +++ b/tests/ui/builtin-superkinds/builtin-superkinds-self-type.rs @@ -14,5 +14,5 @@ fn main() { let (tx, rx) = channel(); 1193182.foo(tx); assert_eq!(rx.recv(), 1193182); - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs b/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs index 58370bff2200e..7a13a64ed7925 100644 --- a/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs +++ b/tests/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs @@ -1,15 +1,15 @@ //@ only-x86_64 fn efiapi(f: extern "efiapi" fn(usize, ...)) { - //~^ ERROR: using calling conventions other than `C` or `cdecl` for varargs functions is unstable + //~^ ERROR using calling conventions other than `C` or `cdecl` for varargs functions is unstable f(22, 44); } fn sysv(f: extern "sysv64" fn(usize, ...)) { - //~^ ERROR: using calling conventions other than `C` or `cdecl` for varargs functions is unstable + //~^ ERROR using calling conventions other than `C` or `cdecl` for varargs functions is unstable f(22, 44); } fn win(f: extern "win64" fn(usize, ...)) { - //~^ ERROR: using calling conventions other than `C` or `cdecl` for varargs functions is unstable + //~^ ERROR using calling conventions other than `C` or `cdecl` for varargs functions is unstable f(22, 44); } diff --git a/tests/ui/c-variadic/issue-86053-2.rs b/tests/ui/c-variadic/issue-86053-2.rs index c545831f7171a..884411d01680b 100644 --- a/tests/ui/c-variadic/issue-86053-2.rs +++ b/tests/ui/c-variadic/issue-86053-2.rs @@ -6,6 +6,6 @@ trait H {} unsafe extern "C" fn ordering4<'a, F: H<&'static &'a ()>>(_: (), ...) {} -//~^ ERROR: in type `&'static &'a ()`, reference has a longer lifetime than the data it references [E0491] +//~^ ERROR in type `&'static &'a ()`, reference has a longer lifetime than the data it references [E0491] fn main() {} diff --git a/tests/ui/c-variadic/variadic-ffi-1.rs b/tests/ui/c-variadic/variadic-ffi-1.rs index 9dcd55d13e3c7..0bc06c6294a7d 100644 --- a/tests/ui/c-variadic/variadic-ffi-1.rs +++ b/tests/ui/c-variadic/variadic-ffi-1.rs @@ -9,7 +9,7 @@ use minicore::*; extern "stdcall" { fn printf(_: *const u8, ...); - //~^ ERROR: C-variadic function must have a compatible calling convention, + //~^ ERROR C-variadic function must have a compatible calling convention, // like C, cdecl, win64, sysv64 or efiapi } diff --git a/tests/ui/c-variadic/variadic-ffi-2.rs b/tests/ui/c-variadic/variadic-ffi-2.rs index da7bb76fc14bf..0f96594043404 100644 --- a/tests/ui/c-variadic/variadic-ffi-2.rs +++ b/tests/ui/c-variadic/variadic-ffi-2.rs @@ -1,7 +1,7 @@ #![feature(extended_varargs_abi_support)] fn baz(f: extern "Rust" fn(usize, ...)) { - //~^ ERROR: C-variadic function must have a compatible calling convention, + //~^ ERROR C-variadic function must have a compatible calling convention, // like C, cdecl, system, aapcs, win64, sysv64 or efiapi f(22, 44); } diff --git a/tests/ui/c-variadic/variadic-ffi-4.rs b/tests/ui/c-variadic/variadic-ffi-4.rs index 8064037942259..660508dda7a73 100644 --- a/tests/ui/c-variadic/variadic-ffi-4.rs +++ b/tests/ui/c-variadic/variadic-ffi-4.rs @@ -6,33 +6,33 @@ use core::ffi::{VaList, VaListImpl}; pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> { ap - //~^ ERROR: lifetime may not live long enough - //~| ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough + //~| ERROR lifetime may not live long enough } pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaListImpl<'static> { - ap //~ ERROR: lifetime may not live long enough + ap //~ ERROR lifetime may not live long enough } pub unsafe extern "C" fn no_escape2(_: usize, ap: ...) { - let _ = ap.with_copy(|ap| ap); //~ ERROR: lifetime may not live long enough + let _ = ap.with_copy(|ap| ap); //~ ERROR lifetime may not live long enough } pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) { *ap0 = ap1; - //~^ ERROR: lifetime may not live long enough - //~| ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough + //~| ERROR lifetime may not live long enough } pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) { ap0 = &mut ap1; - //~^ ERROR: `ap1` does not live long enough - //~| ERROR: lifetime may not live long enough - //~| ERROR: lifetime may not live long enough + //~^ ERROR `ap1` does not live long enough + //~| ERROR lifetime may not live long enough + //~| ERROR lifetime may not live long enough } pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) { *ap0 = ap1.clone(); - //~^ ERROR: lifetime may not live long enough - //~| ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough + //~| ERROR lifetime may not live long enough } diff --git a/tests/ui/cannot-mutate-captured-non-mut-var.rs b/tests/ui/cannot-mutate-captured-non-mut-var.rs index 952dab25bf9dc..147230ca05e22 100644 --- a/tests/ui/cannot-mutate-captured-non-mut-var.rs +++ b/tests/ui/cannot-mutate-captured-non-mut-var.rs @@ -7,9 +7,9 @@ fn to_fn_once>(f: F) -> F { f } fn main() { let x = 1; to_fn_once(move|| { x = 2; }); - //~^ ERROR: cannot assign to `x`, as it is not declared as mutable + //~^ ERROR cannot assign to `x`, as it is not declared as mutable let s = std::io::stdin(); to_fn_once(move|| { s.read_to_end(&mut Vec::new()); }); - //~^ ERROR: cannot borrow `s` as mutable, as it is not declared as mutable + //~^ ERROR cannot borrow `s` as mutable, as it is not declared as mutable } diff --git a/tests/ui/cast/cast_lit_suffix-issue-138392.fixed b/tests/ui/cast/cast_lit_suffix-issue-138392.fixed index c6fbd09f89c51..6f05f8f5e86e7 100644 --- a/tests/ui/cast/cast_lit_suffix-issue-138392.fixed +++ b/tests/ui/cast/cast_lit_suffix-issue-138392.fixed @@ -1,6 +1,6 @@ //@ run-rustfix #![allow(unused_parens)] fn main() { - let _x: u8 = (4u8); //~ ERROR: mismatched types - let _y: u8 = (4u8); //~ ERROR: mismatched types + let _x: u8 = (4u8); //~ ERROR mismatched types + let _y: u8 = (4u8); //~ ERROR mismatched types } diff --git a/tests/ui/cast/cast_lit_suffix-issue-138392.rs b/tests/ui/cast/cast_lit_suffix-issue-138392.rs index 86dbbbbf12628..c0b4d2f616f95 100644 --- a/tests/ui/cast/cast_lit_suffix-issue-138392.rs +++ b/tests/ui/cast/cast_lit_suffix-issue-138392.rs @@ -1,6 +1,6 @@ //@ run-rustfix #![allow(unused_parens)] fn main() { - let _x: u8 = (4i32); //~ ERROR: mismatched types - let _y: u8 = (4.0f32); //~ ERROR: mismatched types + let _x: u8 = (4i32); //~ ERROR mismatched types + let _y: u8 = (4.0f32); //~ ERROR mismatched types } diff --git a/tests/ui/cast/issue-10991.rs b/tests/ui/cast/issue-10991.rs index c36829fdf5b85..547bef2466935 100644 --- a/tests/ui/cast/issue-10991.rs +++ b/tests/ui/cast/issue-10991.rs @@ -1,4 +1,4 @@ fn main() { let nil = (); - let _t = nil as usize; //~ ERROR: non-primitive cast: `()` as `usize` + let _t = nil as usize; //~ ERROR non-primitive cast: `()` as `usize` } diff --git a/tests/ui/cast/issue-84213.fixed b/tests/ui/cast/issue-84213.fixed index a0dc4a896668d..c2e194d3fc841 100644 --- a/tests/ui/cast/issue-84213.fixed +++ b/tests/ui/cast/issue-84213.fixed @@ -9,8 +9,8 @@ fn main() { let _ = something.field; let _pointer_to_something = &something as *const Something; - //~^ ERROR: non-primitive cast + //~^ ERROR non-primitive cast let _mut_pointer_to_something = &mut something as *mut Something; - //~^ ERROR: non-primitive cast + //~^ ERROR non-primitive cast } diff --git a/tests/ui/cast/issue-84213.rs b/tests/ui/cast/issue-84213.rs index 93b584c6d35a3..8d0f651ddc7c3 100644 --- a/tests/ui/cast/issue-84213.rs +++ b/tests/ui/cast/issue-84213.rs @@ -9,8 +9,8 @@ fn main() { let _ = something.field; let _pointer_to_something = something as *const Something; - //~^ ERROR: non-primitive cast + //~^ ERROR non-primitive cast let _mut_pointer_to_something = something as *mut Something; - //~^ ERROR: non-primitive cast + //~^ ERROR non-primitive cast } diff --git a/tests/ui/cast/issue-85586.rs b/tests/ui/cast/issue-85586.rs index 78816582b57f4..e7ac321b58035 100644 --- a/tests/ui/cast/issue-85586.rs +++ b/tests/ui/cast/issue-85586.rs @@ -6,5 +6,5 @@ fn main() { let a = [1, 2, 3].iter().sum(); let b = (a + 1) as usize; - //~^ ERROR: type annotations needed [E0282] + //~^ ERROR type annotations needed [E0282] } diff --git a/tests/ui/cast/issue-89497.fixed b/tests/ui/cast/issue-89497.fixed index 4229199fa43a1..b3cbbff56ef55 100644 --- a/tests/ui/cast/issue-89497.fixed +++ b/tests/ui/cast/issue-89497.fixed @@ -5,6 +5,6 @@ fn main() { let pointer: usize = &1_i32 as *const i32 as usize; let _reference: &'static i32 = unsafe { &*(pointer as *const i32) }; - //~^ ERROR: non-primitive cast - //~| HELP: consider borrowing the value + //~^ ERROR non-primitive cast + //~| HELP consider borrowing the value } diff --git a/tests/ui/cast/issue-89497.rs b/tests/ui/cast/issue-89497.rs index e934560ddabab..b0235d03d9e05 100644 --- a/tests/ui/cast/issue-89497.rs +++ b/tests/ui/cast/issue-89497.rs @@ -5,6 +5,6 @@ fn main() { let pointer: usize = &1_i32 as *const i32 as usize; let _reference: &'static i32 = unsafe { pointer as *const i32 as &'static i32 }; - //~^ ERROR: non-primitive cast - //~| HELP: consider borrowing the value + //~^ ERROR non-primitive cast + //~| HELP consider borrowing the value } diff --git a/tests/ui/cast/ptr-to-trait-obj-different-args.rs b/tests/ui/cast/ptr-to-trait-obj-different-args.rs index bb103f789f55b..aaef593be2efd 100644 --- a/tests/ui/cast/ptr-to-trait-obj-different-args.rs +++ b/tests/ui/cast/ptr-to-trait-obj-different-args.rs @@ -15,17 +15,17 @@ impl Trait for T {} fn main() { let a: *const dyn A = &(); - let b: *const dyn B = a as _; //~ error: casting `*const dyn A` as `*const dyn B` is invalid + let b: *const dyn B = a as _; //~ error casting `*const dyn A` as `*const dyn B` is invalid let x: *const dyn Trait = &(); - let y: *const dyn Trait = x as _; //~ error: casting `*const dyn Trait` as `*const dyn Trait` is invalid + let y: *const dyn Trait = x as _; //~ error casting `*const dyn Trait` as `*const dyn Trait` is invalid _ = (b, y); } fn generic(x: *const dyn Trait, t: *const dyn Trait) { - let _: *const dyn Trait = x as _; //~ error: casting `*const (dyn Trait + 'static)` as `*const dyn Trait` is invalid - let _: *const dyn Trait = t as _; //~ error: casting `*const (dyn Trait + 'static)` as `*const dyn Trait` is invalid + let _: *const dyn Trait = x as _; //~ error casting `*const (dyn Trait + 'static)` as `*const dyn Trait` is invalid + let _: *const dyn Trait = t as _; //~ error casting `*const (dyn Trait + 'static)` as `*const dyn Trait` is invalid } trait Assocked { @@ -33,5 +33,5 @@ trait Assocked { } fn change_assoc(x: *mut dyn Assocked) -> *mut dyn Assocked { - x as _ //~ error: casting `*mut (dyn Assocked + 'static)` as `*mut (dyn Assocked + 'static)` is invalid + x as _ //~ error casting `*mut (dyn Assocked + 'static)` as `*mut (dyn Assocked + 'static)` is invalid } diff --git a/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.rs b/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.rs index f968dca4fd310..a0e3dbb63650e 100644 --- a/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.rs +++ b/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.rs @@ -22,7 +22,7 @@ struct S { fn m<'a>() { let unsend: *const dyn Cat<'a> = &(); let _send = unsend as *const S>; - //~^ error: lifetime may not live long enough + //~^ error lifetime may not live long enough } fn main() { diff --git a/tests/ui/cast/ptr-to-trait-obj-different-regions-lt-ext.rs b/tests/ui/cast/ptr-to-trait-obj-different-regions-lt-ext.rs index be2b89aab08f2..89a0498a605d2 100644 --- a/tests/ui/cast/ptr-to-trait-obj-different-regions-lt-ext.rs +++ b/tests/ui/cast/ptr-to-trait-obj-different-regions-lt-ext.rs @@ -9,7 +9,7 @@ trait Static<'a> { } fn bad_cast<'a>(x: *const dyn Static<'static>) -> *const dyn Static<'a> { - x as _ //~ error: lifetime may not live long enough + x as _ //~ error lifetime may not live long enough } impl Static<'static> for () { diff --git a/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.rs b/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.rs index f8910c944c61e..3e5427c6ab956 100644 --- a/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.rs +++ b/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.rs @@ -3,21 +3,21 @@ trait Trait<'a> {} fn change_lt<'a, 'b>(x: *mut dyn Trait<'a>) -> *mut dyn Trait<'b> { - x as _ //~ error: lifetime may not live long enough - //~| error: lifetime may not live long enough + x as _ //~ error lifetime may not live long enough + //~| error lifetime may not live long enough } fn change_lt_ab<'a: 'b, 'b>(x: *mut dyn Trait<'a>) -> *mut dyn Trait<'b> { - x as _ //~ error: lifetime may not live long enough + x as _ //~ error lifetime may not live long enough } fn change_lt_ba<'a, 'b: 'a>(x: *mut dyn Trait<'a>) -> *mut dyn Trait<'b> { - x as _ //~ error: lifetime may not live long enough + x as _ //~ error lifetime may not live long enough } fn change_lt_hr<'a>(x: *mut dyn Trait<'a>) -> *mut dyn for<'b> Trait<'b> { - x as _ //~ error: lifetime may not live long enough - //~^ error: mismatched types + x as _ //~ error lifetime may not live long enough + //~^ error mismatched types //~| one type is more general than the other } @@ -28,21 +28,21 @@ trait Assocked { fn change_assoc_0<'a, 'b>( x: *mut dyn Assocked, ) -> *mut dyn Assocked { - x as _ //~ error: lifetime may not live long enough - //~| error: lifetime may not live long enough + x as _ //~ error lifetime may not live long enough + //~| error lifetime may not live long enough } fn change_assoc_1<'a, 'b>( x: *mut dyn Assocked>, ) -> *mut dyn Assocked> { - x as _ //~ error: lifetime may not live long enough - //~| error: lifetime may not live long enough + x as _ //~ error lifetime may not live long enough + //~| error lifetime may not live long enough } // This tests the default borrow check error, without the special casing for return values. fn require_static(_: *const dyn Trait<'static>) {} fn extend_to_static<'a>(ptr: *const dyn Trait<'a>) { - require_static(ptr as _) //~ error: borrowed data escapes outside of function + require_static(ptr as _) //~ error borrowed data escapes outside of function } fn main() {} diff --git a/tests/ui/cast/ptr-to-trait-obj-wrap-upcast.rs b/tests/ui/cast/ptr-to-trait-obj-wrap-upcast.rs index ff2c4cacfb1f7..16286a654a10f 100644 --- a/tests/ui/cast/ptr-to-trait-obj-wrap-upcast.rs +++ b/tests/ui/cast/ptr-to-trait-obj-wrap-upcast.rs @@ -8,7 +8,7 @@ struct Wrapper(T); // and reinterpreting would be confusing/surprising. // See fn cast(ptr: *const dyn Sub) -> *const Wrapper { - ptr as _ //~ error: casting `*const (dyn Sub + 'static)` as `*const Wrapper` is invalid + ptr as _ //~ error casting `*const (dyn Sub + 'static)` as `*const Wrapper` is invalid } fn main() {} diff --git a/tests/ui/cast/unsized-struct-cast.rs b/tests/ui/cast/unsized-struct-cast.rs index 52bb6cedcd6d7..3594f8bd1a265 100644 --- a/tests/ui/cast/unsized-struct-cast.rs +++ b/tests/ui/cast/unsized-struct-cast.rs @@ -2,5 +2,5 @@ pub struct Data([u8]); fn main(){ const _: *const Data = &[] as *const Data; - //~^ ERROR: casting `&[_; 0]` as `*const Data` is invalid + //~^ ERROR casting `&[_; 0]` as `*const Data` is invalid } diff --git a/tests/ui/closures/2229_closure_analysis/arrays-completely-captured.rs b/tests/ui/closures/2229_closure_analysis/arrays-completely-captured.rs index 27b17a56f129f..ed4b070cf3b42 100644 --- a/tests/ui/closures/2229_closure_analysis/arrays-completely-captured.rs +++ b/tests/ui/closures/2229_closure_analysis/arrays-completely-captured.rs @@ -6,17 +6,17 @@ fn main() { let mut m = [1, 2, 3, 4, 5]; let mut c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: m[0] += 10; - //~^ NOTE: Capturing m[] -> Mutable - //~| NOTE: Min Capture m[] -> Mutable + //~^ NOTE Capturing m[] -> Mutable + //~| NOTE Min Capture m[] -> Mutable m[1] += 40; - //~^ NOTE: Capturing m[] -> Mutable + //~^ NOTE Capturing m[] -> Mutable }; c(); diff --git a/tests/ui/closures/2229_closure_analysis/by_value.rs b/tests/ui/closures/2229_closure_analysis/by_value.rs index 2c9202fd61721..c21c53abe333f 100644 --- a/tests/ui/closures/2229_closure_analysis/by_value.rs +++ b/tests/ui/closures/2229_closure_analysis/by_value.rs @@ -16,18 +16,18 @@ fn big_box() { let t = (b, 10); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { //~^ First Pass analysis includes: //~| Min Capture analysis includes: let p = t.0.0; - //~^ NOTE: Capturing t[(0, 0),Deref,(0, 0)] -> ByValue - //~| NOTE: Min Capture t[(0, 0)] -> ByValue + //~^ NOTE Capturing t[(0, 0),Deref,(0, 0)] -> ByValue + //~| NOTE Min Capture t[(0, 0)] -> ByValue println!("{} {:?}", t.1, p); - //~^ NOTE: Capturing t[(1, 0)] -> Immutable - //~| NOTE: Min Capture t[(1, 0)] -> Immutable + //~^ NOTE Capturing t[(1, 0)] -> Immutable + //~| NOTE Min Capture t[(1, 0)] -> Immutable }; c(); diff --git a/tests/ui/closures/2229_closure_analysis/capture-analysis-1.rs b/tests/ui/closures/2229_closure_analysis/capture-analysis-1.rs index 0c42e66a2faf4..1807363139484 100644 --- a/tests/ui/closures/2229_closure_analysis/capture-analysis-1.rs +++ b/tests/ui/closures/2229_closure_analysis/capture-analysis-1.rs @@ -13,22 +13,22 @@ fn main() { let q = Point { x: 10, y: 10 }; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { //~^ First Pass analysis includes: //~| Min Capture analysis includes: println!("{:?}", p); - //~^ NOTE: Capturing p[] -> Immutable - //~| NOTE: Min Capture p[] -> Immutable + //~^ NOTE Capturing p[] -> Immutable + //~| NOTE Min Capture p[] -> Immutable println!("{:?}", p.x); - //~^ NOTE: Capturing p[(0, 0)] -> Immutable + //~^ NOTE Capturing p[(0, 0)] -> Immutable println!("{:?}", q.x); - //~^ NOTE: Capturing q[(0, 0)] -> Immutable + //~^ NOTE Capturing q[(0, 0)] -> Immutable println!("{:?}", q); - //~^ NOTE: Capturing q[] -> Immutable - //~| NOTE: Min Capture q[] -> Immutable + //~^ NOTE Capturing q[] -> Immutable + //~| NOTE Min Capture q[] -> Immutable }; } diff --git a/tests/ui/closures/2229_closure_analysis/capture-analysis-2.rs b/tests/ui/closures/2229_closure_analysis/capture-analysis-2.rs index adb618d1771e7..0a2f8bf6a17c5 100644 --- a/tests/ui/closures/2229_closure_analysis/capture-analysis-2.rs +++ b/tests/ui/closures/2229_closure_analysis/capture-analysis-2.rs @@ -12,18 +12,18 @@ fn main() { let mut p = Point { x: String::new(), y: 10 }; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { //~^ First Pass analysis includes: //~| Min Capture analysis includes: let _x = p.x; - //~^ NOTE: Capturing p[(0, 0)] -> ByValue - //~| NOTE: p[] captured as ByValue here + //~^ NOTE Capturing p[(0, 0)] -> ByValue + //~| NOTE p[] captured as ByValue here println!("{:?}", p); - //~^ NOTE: Capturing p[] -> Immutable - //~| NOTE: Min Capture p[] -> ByValue - //~| NOTE: p[] used here + //~^ NOTE Capturing p[] -> Immutable + //~| NOTE Min Capture p[] -> ByValue + //~| NOTE p[] used here }; } diff --git a/tests/ui/closures/2229_closure_analysis/capture-analysis-3.rs b/tests/ui/closures/2229_closure_analysis/capture-analysis-3.rs index 0a21eaaaa1214..f30d3427bbfc7 100644 --- a/tests/ui/closures/2229_closure_analysis/capture-analysis-3.rs +++ b/tests/ui/closures/2229_closure_analysis/capture-analysis-3.rs @@ -17,18 +17,18 @@ fn main() { let mut a = Parent { b: Child {c: String::new(), d: String::new()} }; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { //~^ First Pass analysis includes: //~| Min Capture analysis includes: let _x = a.b.c; - //~^ NOTE: Capturing a[(0, 0),(0, 0)] -> ByValue - //~| NOTE: a[(0, 0)] captured as ByValue here + //~^ NOTE Capturing a[(0, 0),(0, 0)] -> ByValue + //~| NOTE a[(0, 0)] captured as ByValue here println!("{:?}", a.b); - //~^ NOTE: Capturing a[(0, 0)] -> Immutable - //~| NOTE: Min Capture a[(0, 0)] -> ByValue - //~| NOTE: a[(0, 0)] used here + //~^ NOTE Capturing a[(0, 0)] -> Immutable + //~| NOTE Min Capture a[(0, 0)] -> ByValue + //~| NOTE a[(0, 0)] used here }; } diff --git a/tests/ui/closures/2229_closure_analysis/capture-analysis-4.rs b/tests/ui/closures/2229_closure_analysis/capture-analysis-4.rs index 790dad0710bc8..b0c3db0044867 100644 --- a/tests/ui/closures/2229_closure_analysis/capture-analysis-4.rs +++ b/tests/ui/closures/2229_closure_analysis/capture-analysis-4.rs @@ -17,16 +17,16 @@ fn main() { let mut a = Parent { b: Child {c: String::new(), d: String::new()} }; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { //~^ First Pass analysis includes: //~| Min Capture analysis includes: let _x = a.b; - //~^ NOTE: Capturing a[(0, 0)] -> ByValue - //~| NOTE: Min Capture a[(0, 0)] -> ByValue + //~^ NOTE Capturing a[(0, 0)] -> ByValue + //~| NOTE Min Capture a[(0, 0)] -> ByValue println!("{:?}", a.b.c); - //~^ NOTE: Capturing a[(0, 0),(0, 0)] -> Immutable + //~^ NOTE Capturing a[(0, 0),(0, 0)] -> Immutable }; } diff --git a/tests/ui/closures/2229_closure_analysis/capture-disjoint-field-struct.rs b/tests/ui/closures/2229_closure_analysis/capture-disjoint-field-struct.rs index af12e0b259d9a..afb77b0886d6d 100644 --- a/tests/ui/closures/2229_closure_analysis/capture-disjoint-field-struct.rs +++ b/tests/ui/closures/2229_closure_analysis/capture-disjoint-field-struct.rs @@ -11,15 +11,15 @@ fn main() { let mut p = Point { x: 10, y: 10 }; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { //~^ First Pass analysis includes: //~| Min Capture analysis includes: println!("{}", p.x); - //~^ NOTE: Capturing p[(0, 0)] -> Immutable - //~| NOTE: Min Capture p[(0, 0)] -> Immutable + //~^ NOTE Capturing p[(0, 0)] -> Immutable + //~| NOTE Min Capture p[(0, 0)] -> Immutable }; // `c` should only capture `p.x`, therefore mutating `p.y` is allowed. diff --git a/tests/ui/closures/2229_closure_analysis/capture-disjoint-field-tuple.rs b/tests/ui/closures/2229_closure_analysis/capture-disjoint-field-tuple.rs index ccd260492643e..ac111560efd6a 100644 --- a/tests/ui/closures/2229_closure_analysis/capture-disjoint-field-tuple.rs +++ b/tests/ui/closures/2229_closure_analysis/capture-disjoint-field-tuple.rs @@ -6,15 +6,15 @@ fn main() { let mut t = (10, 10); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { //~^ First Pass analysis includes: //~| Min Capture analysis includes: println!("{}", t.0); - //~^ NOTE: Capturing t[(0, 0)] -> Immutable - //~| NOTE: Min Capture t[(0, 0)] -> Immutable + //~^ NOTE Capturing t[(0, 0)] -> Immutable + //~| NOTE Min Capture t[(0, 0)] -> Immutable }; // `c` only captures t.0, therefore mutating t.1 is allowed. diff --git a/tests/ui/closures/2229_closure_analysis/capture-enums.rs b/tests/ui/closures/2229_closure_analysis/capture-enums.rs index b1e21bd0f8d61..a300db37e8bff 100644 --- a/tests/ui/closures/2229_closure_analysis/capture-enums.rs +++ b/tests/ui/closures/2229_closure_analysis/capture-enums.rs @@ -14,23 +14,23 @@ fn multi_variant_enum() { let meta = Info::Meta("meta".into(), vec); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { //~^ First Pass analysis includes: //~| Min Capture analysis includes: if let Info::Point(_, _, str) = point { - //~^ NOTE: Capturing point[] -> Immutable - //~| NOTE: Capturing point[(2, 0)] -> ByValue - //~| NOTE: Min Capture point[] -> ByValue + //~^ NOTE Capturing point[] -> Immutable + //~| NOTE Capturing point[(2, 0)] -> ByValue + //~| NOTE Min Capture point[] -> ByValue println!("{}", str); } if let Info::Meta(_, v) = meta { - //~^ NOTE: Capturing meta[] -> Immutable - //~| NOTE: Capturing meta[(1, 1)] -> ByValue - //~| NOTE: Min Capture meta[] -> ByValue + //~^ NOTE Capturing meta[] -> Immutable + //~| NOTE Capturing meta[(1, 1)] -> ByValue + //~| NOTE Min Capture meta[] -> ByValue println!("{:?}", v); } }; @@ -46,15 +46,15 @@ fn single_variant_enum() { let point = SingleVariant::Point(10, -10, "1".into()); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { //~^ First Pass analysis includes: //~| Min Capture analysis includes: let SingleVariant::Point(_, _, str) = point; - //~^ NOTE: Capturing point[(2, 0)] -> ByValue - //~| NOTE: Min Capture point[(2, 0)] -> ByValue + //~^ NOTE Capturing point[(2, 0)] -> ByValue + //~| NOTE Min Capture point[(2, 0)] -> ByValue println!("{}", str); }; diff --git a/tests/ui/closures/2229_closure_analysis/deep-multilevel-struct.rs b/tests/ui/closures/2229_closure_analysis/deep-multilevel-struct.rs index 61b707605c2d6..982beed1db226 100644 --- a/tests/ui/closures/2229_closure_analysis/deep-multilevel-struct.rs +++ b/tests/ui/closures/2229_closure_analysis/deep-multilevel-struct.rs @@ -32,20 +32,20 @@ fn main() { }; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: let x = &p.a.p.x; - //~^ NOTE: Capturing p[(0, 0),(0, 0),(0, 0)] -> Immutable + //~^ NOTE Capturing p[(0, 0),(0, 0),(0, 0)] -> Immutable p.b.q.y = 9; - //~^ NOTE: Capturing p[(1, 0),(1, 0),(1, 0)] -> Mutable - //~| NOTE: p[] captured as Mutable here + //~^ NOTE Capturing p[(1, 0),(1, 0),(1, 0)] -> Mutable + //~| NOTE p[] captured as Mutable here println!("{:?}", p); - //~^ NOTE: Capturing p[] -> Immutable - //~| NOTE: Min Capture p[] -> Mutable - //~| NOTE: p[] used here + //~^ NOTE Capturing p[] -> Immutable + //~| NOTE Min Capture p[] -> Mutable + //~| NOTE p[] used here }; } diff --git a/tests/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs b/tests/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs index 6c7eab1eeb7cd..02a8800f82d8a 100644 --- a/tests/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs +++ b/tests/ui/closures/2229_closure_analysis/deep-multilevel-tuple.rs @@ -6,20 +6,20 @@ fn main() { let mut t = (((1,2),(3,4)),((5,6),(7,8))); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: let x = &t.0.0.0; - //~^ NOTE: Capturing t[(0, 0),(0, 0),(0, 0)] -> Immutable + //~^ NOTE Capturing t[(0, 0),(0, 0),(0, 0)] -> Immutable t.1.1.1 = 9; - //~^ NOTE: Capturing t[(1, 0),(1, 0),(1, 0)] -> Mutable - //~| NOTE: t[] captured as Mutable here + //~^ NOTE Capturing t[(1, 0),(1, 0),(1, 0)] -> Mutable + //~| NOTE t[] captured as Mutable here println!("{:?}", t); - //~^ NOTE: Min Capture t[] -> Mutable - //~| NOTE: Capturing t[] -> Immutable - //~| NOTE: t[] used here + //~^ NOTE Min Capture t[] -> Mutable + //~| NOTE Capturing t[] -> Immutable + //~| NOTE t[] used here }; } diff --git a/tests/ui/closures/2229_closure_analysis/destructure_patterns.rs b/tests/ui/closures/2229_closure_analysis/destructure_patterns.rs index 68e8d66762ddf..56f207e86ec6a 100644 --- a/tests/ui/closures/2229_closure_analysis/destructure_patterns.rs +++ b/tests/ui/closures/2229_closure_analysis/destructure_patterns.rs @@ -8,17 +8,17 @@ fn arrays() { let arr: [String; 5] = [format!("A"), format!("B"), format!("C"), format!("D"), format!("E")]; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: let [a, b, .., e] = arr; - //~^ NOTE: Capturing arr[Index] -> ByValue - //~| NOTE: Capturing arr[Index] -> ByValue - //~| NOTE: Capturing arr[Index] -> ByValue - //~| NOTE: Min Capture arr[] -> ByValue + //~^ NOTE Capturing arr[Index] -> ByValue + //~| NOTE Capturing arr[Index] -> ByValue + //~| NOTE Capturing arr[Index] -> ByValue + //~| NOTE Min Capture arr[] -> ByValue assert_eq!(a, "A"); assert_eq!(b, "B"); assert_eq!(e, "E"); @@ -37,17 +37,17 @@ fn structs() { let mut p = Point { x: 10, y: 10, id: String::new() }; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: let Point { x: ref mut x, y: _, id: moved_id } = p; - //~^ NOTE: Capturing p[(0, 0)] -> Mutable - //~| NOTE: Capturing p[(2, 0)] -> ByValue - //~| NOTE: Min Capture p[(0, 0)] -> Mutable - //~| NOTE: Min Capture p[(2, 0)] -> ByValue + //~^ NOTE Capturing p[(0, 0)] -> Mutable + //~| NOTE Capturing p[(2, 0)] -> ByValue + //~| NOTE Min Capture p[(0, 0)] -> Mutable + //~| NOTE Min Capture p[(2, 0)] -> ByValue println!("{}, {}", x, moved_id); }; @@ -58,19 +58,19 @@ fn tuples() { let mut t = (10, String::new(), (String::new(), 42)); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: let (ref mut x, ref ref_str, (moved_s, _)) = t; - //~^ NOTE: Capturing t[(0, 0)] -> Mutable - //~| NOTE: Capturing t[(1, 0)] -> Immutable - //~| NOTE: Capturing t[(2, 0),(0, 0)] -> ByValue - //~| NOTE: Min Capture t[(0, 0)] -> Mutable - //~| NOTE: Min Capture t[(1, 0)] -> Immutable - //~| NOTE: Min Capture t[(2, 0),(0, 0)] -> ByValue + //~^ NOTE Capturing t[(0, 0)] -> Mutable + //~| NOTE Capturing t[(1, 0)] -> Immutable + //~| NOTE Capturing t[(2, 0),(0, 0)] -> ByValue + //~| NOTE Min Capture t[(0, 0)] -> Mutable + //~| NOTE Min Capture t[(1, 0)] -> Immutable + //~| NOTE Min Capture t[(2, 0),(0, 0)] -> ByValue println!("{}, {} {}", x, ref_str, moved_s); }; diff --git a/tests/ui/closures/2229_closure_analysis/diagnostics/arrays.rs b/tests/ui/closures/2229_closure_analysis/diagnostics/arrays.rs index 2d22c9a856f6b..111d492569f05 100644 --- a/tests/ui/closures/2229_closure_analysis/diagnostics/arrays.rs +++ b/tests/ui/closures/2229_closure_analysis/diagnostics/arrays.rs @@ -12,7 +12,7 @@ fn arrays_1() { // c will capture `arr` completely, therefore another index into the // array can't be modified here arr[1] += 10; - //~^ ERROR: cannot use `arr[_]` because it was mutably borrowed + //~^ ERROR cannot use `arr[_]` because it was mutably borrowed c(); } @@ -26,7 +26,7 @@ fn arrays_2() { // c will capture `arr` completely, therefore another index into the // array can't be modified here arr[1] += 10; - //~^ ERROR: cannot assign to `arr[_]` because it is borrowed + //~^ ERROR cannot assign to `arr[_]` because it is borrowed c(); } @@ -40,7 +40,7 @@ fn arrays_3() { // c will capture `arr` completely, therefore another index into the // array can't be modified here arr[1] += 10; - //~^ ERROR: cannot assign to `arr[_]` because it is borrowed + //~^ ERROR cannot assign to `arr[_]` because it is borrowed c(); } @@ -54,7 +54,7 @@ fn arrays_4() { // c will capture `arr` completely, therefore we cannot borrow another index // into the array. println!("{}", arr[3]); - //~^ ERROR: cannot borrow `arr[_]` as immutable because it is also borrowed as mutable + //~^ ERROR cannot borrow `arr[_]` as immutable because it is also borrowed as mutable c(); } @@ -69,7 +69,7 @@ fn arrays_5() { // c will capture `arr` completely, therefore we cannot borrow other indices // into the array. println!("{:#?}", &arr[3..2]); - //~^ ERROR: cannot borrow `arr` as immutable because it is also borrowed as mutable + //~^ ERROR cannot borrow `arr` as immutable because it is also borrowed as mutable c(); } diff --git a/tests/ui/closures/2229_closure_analysis/diagnostics/box.rs b/tests/ui/closures/2229_closure_analysis/diagnostics/box.rs index 746e4cb17094a..27e717d9e84ea 100644 --- a/tests/ui/closures/2229_closure_analysis/diagnostics/box.rs +++ b/tests/ui/closures/2229_closure_analysis/diagnostics/box.rs @@ -19,7 +19,7 @@ fn box_1() { }; e.0.0.m.x = format!("not-x"); - //~^ ERROR: cannot assign to `e.0.0.m.x` because it is borrowed + //~^ ERROR cannot assign to `e.0.0.m.x` because it is borrowed c(); } @@ -36,7 +36,7 @@ fn box_2() { }; println!("{}", e.0.0.m.x); - //~^ ERROR: cannot borrow `e.0.0.m.x` as immutable because it is also borrowed as mutable + //~^ ERROR cannot borrow `e.0.0.m.x` as immutable because it is also borrowed as mutable c(); } @@ -53,7 +53,7 @@ fn box_3() { }; e.0.0.m.x = format!("not-x"); - //~^ ERROR: cannot assign to `e.0.0.m.x` because it is borrowed + //~^ ERROR cannot assign to `e.0.0.m.x` because it is borrowed c(); } diff --git a/tests/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm-borrow.rs b/tests/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm-borrow.rs index 77e3ffdc47dea..d7d92db422596 100644 --- a/tests/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm-borrow.rs +++ b/tests/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm-borrow.rs @@ -11,7 +11,7 @@ fn main() { // `x.0` is mutable but we access `x` via `*z.0.0`, which is an immutable reference and // therefore can't be mutated. let mut c = || { - //~^ ERROR: cannot borrow `*z.0.0` as mutable, as it is behind a `&` reference + //~^ ERROR cannot borrow `*z.0.0` as mutable, as it is behind a `&` reference z.0.0.0 = format!("X1"); }; diff --git a/tests/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.rs b/tests/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.rs index 27a64232629f7..974d49372af51 100644 --- a/tests/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.rs +++ b/tests/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.rs @@ -10,7 +10,7 @@ fn mut_error_struct() { let mut c = || { z.0.0.0 = 20; - //~^ ERROR: cannot assign to `z.0.0.0`, as it is not declared as mutable + //~^ ERROR cannot assign to `z.0.0.0`, as it is not declared as mutable }; c(); @@ -22,7 +22,7 @@ fn mut_error_box() { let mut c = || { bx.0 = 20; - //~^ ERROR: cannot assign to `*bx.0`, as it is not declared as mutable + //~^ ERROR cannot assign to `*bx.0`, as it is not declared as mutable }; c(); diff --git a/tests/ui/closures/2229_closure_analysis/diagnostics/multilevel-path.rs b/tests/ui/closures/2229_closure_analysis/diagnostics/multilevel-path.rs index 1c25449822a26..fc4d44b19631f 100644 --- a/tests/ui/closures/2229_closure_analysis/diagnostics/multilevel-path.rs +++ b/tests/ui/closures/2229_closure_analysis/diagnostics/multilevel-path.rs @@ -21,7 +21,7 @@ fn main() { }; let py = &mut w.p.x; - //~^ ERROR: cannot borrow `w.p.x` as mutable more than once at a time + //~^ ERROR cannot borrow `w.p.x` as mutable more than once at a time c(); *py = 20 diff --git a/tests/ui/closures/2229_closure_analysis/diagnostics/mut_ref.rs b/tests/ui/closures/2229_closure_analysis/diagnostics/mut_ref.rs index 5827eab84cd01..e518050ec1563 100644 --- a/tests/ui/closures/2229_closure_analysis/diagnostics/mut_ref.rs +++ b/tests/ui/closures/2229_closure_analysis/diagnostics/mut_ref.rs @@ -10,7 +10,7 @@ fn imm_mut_ref() { let ref_mref_x = &mref_x; let c = || { - //~^ ERROR: cannot borrow `**ref_mref_x` as mutable, as it is behind a `&` reference + //~^ ERROR cannot borrow `**ref_mref_x` as mutable, as it is behind a `&` reference **ref_mref_x = y; }; @@ -24,7 +24,7 @@ fn mut_imm_ref() { let mref_ref_x = &mut ref_x; let c = || { - //~^ ERROR: cannot borrow `**mref_ref_x` as mutable, as it is behind a `&` reference + //~^ ERROR cannot borrow `**mref_ref_x` as mutable, as it is behind a `&` reference **mref_ref_x = y; }; diff --git a/tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.rs b/tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.rs index fe5106c57af68..11526b57c5c35 100644 --- a/tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.rs +++ b/tests/ui/closures/2229_closure_analysis/diagnostics/repr_packed.rs @@ -19,7 +19,7 @@ fn test_missing_unsafe_warning_on_repr_packed() { let c = || { println!("{}", foo.x); - //~^ ERROR: reference to packed field is unaligned + //~^ ERROR reference to packed field is unaligned let _z = foo.x; }; diff --git a/tests/ui/closures/2229_closure_analysis/diagnostics/simple-struct-min-capture.rs b/tests/ui/closures/2229_closure_analysis/diagnostics/simple-struct-min-capture.rs index 881810e9671a7..d87d22e960289 100644 --- a/tests/ui/closures/2229_closure_analysis/diagnostics/simple-struct-min-capture.rs +++ b/tests/ui/closures/2229_closure_analysis/diagnostics/simple-struct-min-capture.rs @@ -20,6 +20,6 @@ fn main() { println!("{:?}", p); - //~^ ERROR: cannot borrow `p` as immutable because it is also borrowed as mutable + //~^ ERROR cannot borrow `p` as immutable because it is also borrowed as mutable c(); } diff --git a/tests/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.rs b/tests/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.rs index 7467c13b337eb..cd9961eadd90e 100644 --- a/tests/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.rs +++ b/tests/ui/closures/2229_closure_analysis/feature-gate-capture_disjoint_fields.rs @@ -6,14 +6,14 @@ fn main() { let s = format!("s"); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: println!("This uses new capture analyysis to capture s={}", s); - //~^ NOTE: Capturing s[] -> Immutable - //~| NOTE: Min Capture s[] -> Immutable + //~^ NOTE Capturing s[] -> Immutable + //~| NOTE Min Capture s[] -> Immutable }; } diff --git a/tests/ui/closures/2229_closure_analysis/filter-on-struct-member.rs b/tests/ui/closures/2229_closure_analysis/filter-on-struct-member.rs index feef8cabb3994..ef546addf535c 100644 --- a/tests/ui/closures/2229_closure_analysis/filter-on-struct-member.rs +++ b/tests/ui/closures/2229_closure_analysis/filter-on-struct-member.rs @@ -22,10 +22,10 @@ impl Data { self.list.retain( #[rustc_capture_analysis] |v| self.filter.allowed(*v), - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: - //~| NOTE: Capturing self[Deref,(0, 0)] -> Immutable - //~| NOTE: Min Capture self[Deref,(0, 0)] -> Immutable + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: + //~| NOTE Capturing self[Deref,(0, 0)] -> Immutable + //~| NOTE Min Capture self[Deref,(0, 0)] -> Immutable ); } } diff --git a/tests/ui/closures/2229_closure_analysis/issue-118144.rs b/tests/ui/closures/2229_closure_analysis/issue-118144.rs index 5747cc75e98af..55a8c0ebf0fe7 100644 --- a/tests/ui/closures/2229_closure_analysis/issue-118144.rs +++ b/tests/ui/closures/2229_closure_analysis/issue-118144.rs @@ -8,7 +8,7 @@ fn func(func_arg: &mut V) { // a destructuring binding like `let V(x) = ...` // because only `V(x) = ...` triggers the ICE let x; - V(x) = func_arg; //~ ERROR: mismatched types + V(x) = func_arg; //~ ERROR mismatched types func_arg.0 = 0; }; } diff --git a/tests/ui/closures/2229_closure_analysis/issue-87378.rs b/tests/ui/closures/2229_closure_analysis/issue-87378.rs index 9c89a4538bee8..4f372acc57154 100644 --- a/tests/ui/closures/2229_closure_analysis/issue-87378.rs +++ b/tests/ui/closures/2229_closure_analysis/issue-87378.rs @@ -12,15 +12,15 @@ fn main() { let u = Union { value: 42 }; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: unsafe { u.value } - //~^ NOTE: Capturing u[(0, 0)] -> Immutable - //~| NOTE: Min Capture u[] -> Immutable + //~^ NOTE Capturing u[(0, 0)] -> Immutable + //~| NOTE Min Capture u[] -> Immutable }; c(); diff --git a/tests/ui/closures/2229_closure_analysis/issue-88118-2.rs b/tests/ui/closures/2229_closure_analysis/issue-88118-2.rs index 27c1eac88e573..865ec8da34745 100644 --- a/tests/ui/closures/2229_closure_analysis/issue-88118-2.rs +++ b/tests/ui/closures/2229_closure_analysis/issue-88118-2.rs @@ -8,7 +8,7 @@ fn print_error_count(registry: &Registry) { |x: &Registry| { match &x { Registry if let _ = registry.try_find_description() => { } - //~^ WARNING: irrefutable `if let` guard pattern + //~^ WARNING irrefutable `if let` guard pattern _ => {} } }; diff --git a/tests/ui/closures/2229_closure_analysis/issue-88476.rs b/tests/ui/closures/2229_closure_analysis/issue-88476.rs index 45fe73b76e2a7..c8d084025225a 100644 --- a/tests/ui/closures/2229_closure_analysis/issue-88476.rs +++ b/tests/ui/closures/2229_closure_analysis/issue-88476.rs @@ -18,14 +18,14 @@ pub fn test1() { let f = Foo(Rc::new(1)); let x = #[rustc_capture_analysis] move || { - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - //~| ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~| ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: println!("{:?}", f.0); - //~^ NOTE: Capturing f[(0, 0)] -> Immutable - //~| NOTE: Min Capture f[] -> ByValue + //~^ NOTE Capturing f[(0, 0)] -> Immutable + //~| NOTE Min Capture f[] -> ByValue }; x(); @@ -46,14 +46,14 @@ fn test2() { let character = Character { hp: 100, name: format!("A") }; let c = #[rustc_capture_analysis] move || { - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - //~| ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~| ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: println!("{}", character.hp) - //~^ NOTE: Capturing character[(0, 0)] -> Immutable - //~| NOTE: Min Capture character[(0, 0)] -> ByValue + //~^ NOTE Capturing character[(0, 0)] -> Immutable + //~| NOTE Min Capture character[(0, 0)] -> ByValue }; c(); diff --git a/tests/ui/closures/2229_closure_analysis/match/issue-87097.rs b/tests/ui/closures/2229_closure_analysis/match/issue-87097.rs index 3b41665cb4a0b..4769986dfdc67 100644 --- a/tests/ui/closures/2229_closure_analysis/match/issue-87097.rs +++ b/tests/ui/closures/2229_closure_analysis/match/issue-87097.rs @@ -3,7 +3,7 @@ enum Variant { A, - B, //~ WARNING: variant `B` is never constructed + B, //~ WARNING variant `B` is never constructed } struct A { @@ -14,7 +14,7 @@ fn discriminant_is_a_ref() { let here = A { field: Variant::A }; let out_ref = &here.field; - || match out_ref { //~ WARNING: unused closure that must be used + || match out_ref { //~ WARNING unused closure that must be used Variant::A => (), Variant::B => (), }; @@ -23,7 +23,7 @@ fn discriminant_is_a_ref() { fn discriminant_is_a_field() { let here = A { field: Variant::A }; - || match here.field { //~ WARNING: unused closure that must be used + || match here.field { //~ WARNING unused closure that must be used Variant::A => (), Variant::B => (), }; diff --git a/tests/ui/closures/2229_closure_analysis/match/issue-88331.rs b/tests/ui/closures/2229_closure_analysis/match/issue-88331.rs index e3c1aed24cbb3..4ac0f346cdc99 100644 --- a/tests/ui/closures/2229_closure_analysis/match/issue-88331.rs +++ b/tests/ui/closures/2229_closure_analysis/match/issue-88331.rs @@ -9,7 +9,7 @@ impl Opcode { pub fn example1(msg_type: Opcode) -> impl FnMut(&[u8]) { move |i| match msg_type { - //~^ ERROR: non-exhaustive patterns: `Opcode(0_u8)` and `Opcode(2_u8..=u8::MAX)` not covered + //~^ ERROR non-exhaustive patterns: `Opcode(0_u8)` and `Opcode(2_u8..=u8::MAX)` not covered Opcode::OP1 => unimplemented!(), } } @@ -25,7 +25,7 @@ impl Opcode2 { pub fn example2(msg_type: Opcode2) -> impl FnMut(&[u8]) { move |i| match msg_type { - //~^ ERROR: non-exhaustive patterns: `Opcode2(Opcode(0_u8))` and `Opcode2(Opcode(2_u8..=u8::MAX))` not covered + //~^ ERROR non-exhaustive patterns: `Opcode2(Opcode(0_u8))` and `Opcode2(Opcode(2_u8..=u8::MAX))` not covered Opcode2::OP2=> unimplemented!(), } } diff --git a/tests/ui/closures/2229_closure_analysis/match/match-edge-cases_2.rs b/tests/ui/closures/2229_closure_analysis/match/match-edge-cases_2.rs index a3b19708899a0..d23bf3bfabd3b 100644 --- a/tests/ui/closures/2229_closure_analysis/match/match-edge-cases_2.rs +++ b/tests/ui/closures/2229_closure_analysis/match/match-edge-cases_2.rs @@ -30,7 +30,7 @@ fn edge_case_if() { _ => () }}; let mut mut_ts = ts; - //~^ ERROR: cannot move out of `ts` because it is borrowed + //~^ ERROR cannot move out of `ts` because it is borrowed _b(); } diff --git a/tests/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs b/tests/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs index 3225558271812..a71ee4d440ad7 100644 --- a/tests/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs +++ b/tests/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs @@ -24,7 +24,7 @@ fn main() { let _a = || { match l1 { L1::A => (), L1::B => () } }; // (except if the match is already non-exhaustive) let _b = || { match l1 { L1::A => () } }; - //~^ ERROR: non-exhaustive patterns: `L1::B` not covered [E0004] + //~^ ERROR non-exhaustive patterns: `L1::B` not covered [E0004] // l2 should not be captured as it is a non-exhaustive SingleVariant // defined in this crate @@ -35,16 +35,16 @@ fn main() { // E1 is not visibly uninhabited from here let (e1, e2, e3, e4) = bar(); let _d = || { match e1 {} }; - //~^ ERROR: non-exhaustive patterns: type `E1` is non-empty [E0004] + //~^ ERROR non-exhaustive patterns: type `E1` is non-empty [E0004] let _e = || { match e2 { E2::A => (), E2::B => () } }; - //~^ ERROR: non-exhaustive patterns: `_` not covered [E0004] + //~^ ERROR non-exhaustive patterns: `_` not covered [E0004] let _f = || { match e2 { E2::A => (), E2::B => (), _ => () } }; // e3 should be captured as it is a non-exhaustive SingleVariant // defined in another crate let _g = || { match e3 { E3::C => (), _ => () } }; let mut mut_e3 = e3; - //~^ ERROR: cannot move out of `e3` because it is borrowed + //~^ ERROR cannot move out of `e3` because it is borrowed _g(); // e4 should not be captured as it is a SingleVariant diff --git a/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.rs b/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.rs index 377b1ab10c4b2..16942963a63c5 100644 --- a/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.rs +++ b/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.rs @@ -66,7 +66,7 @@ fn test6() { let x: u8; let c1 = || match x { }; //~^ ERROR E0381 - //~| ERROR: non-exhaustive patterns: type `u8` is non-empty + //~| ERROR non-exhaustive patterns: type `u8` is non-empty } fn main() { diff --git a/tests/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.rs b/tests/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.rs index 9c7b70457d98e..6d8cea26ddedf 100644 --- a/tests/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.rs +++ b/tests/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.rs @@ -13,8 +13,8 @@ fn test_1_should_capture() { //~^ First Pass analysis includes: //~| Min Capture analysis includes: match variant { - //~^ NOTE: Capturing variant[] -> Immutable - //~| NOTE: Min Capture variant[] -> Immutable + //~^ NOTE Capturing variant[] -> Immutable + //~| NOTE Min Capture variant[] -> Immutable Some(_) => {} _ => {} } @@ -64,9 +64,9 @@ fn test_6_should_capture_single_variant() { //~^ First Pass analysis includes: //~| Min Capture analysis includes: match variant { - //~^ NOTE: Capturing variant[] -> Immutable - //~| NOTE: Capturing variant[(0, 0)] -> Immutable - //~| NOTE: Min Capture variant[] -> Immutable + //~^ NOTE Capturing variant[] -> Immutable + //~| NOTE Capturing variant[(0, 0)] -> Immutable + //~| NOTE Min Capture variant[] -> Immutable SingleVariant::Points(a) => { println!("{:?}", a); } @@ -131,8 +131,8 @@ fn test_5_should_capture_multi_variant() { //~^ First Pass analysis includes: //~| Min Capture analysis includes: match variant { - //~^ NOTE: Capturing variant[] -> Immutable - //~| NOTE: Min Capture variant[] -> Immutable + //~^ NOTE Capturing variant[] -> Immutable + //~| NOTE Min Capture variant[] -> Immutable MVariant::A => {} _ => {} } @@ -149,8 +149,8 @@ fn test_7_should_capture_slice_len() { //~^ First Pass analysis includes: //~| Min Capture analysis includes: match slice { - //~^ NOTE: Capturing slice[] -> Immutable - //~| NOTE: Min Capture slice[] -> Immutable + //~^ NOTE Capturing slice[] -> Immutable + //~| NOTE Min Capture slice[] -> Immutable [_,_,_] => {}, _ => {} } @@ -161,8 +161,8 @@ fn test_7_should_capture_slice_len() { //~^ First Pass analysis includes: //~| Min Capture analysis includes: match slice { - //~^ NOTE: Capturing slice[] -> Immutable - //~| NOTE: Min Capture slice[] -> Immutable + //~^ NOTE Capturing slice[] -> Immutable + //~| NOTE Min Capture slice[] -> Immutable [] => {}, _ => {} } @@ -173,8 +173,8 @@ fn test_7_should_capture_slice_len() { //~^ First Pass analysis includes: //~| Min Capture analysis includes: match slice { - //~^ NOTE: Capturing slice[] -> Immutable - //~| NOTE: Min Capture slice[] -> Immutable + //~^ NOTE Capturing slice[] -> Immutable + //~| NOTE Min Capture slice[] -> Immutable [_, .. ,_] => {}, _ => {} } diff --git a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed index c1d88cbdf8374..9d9c1a118d24f 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed @@ -1,6 +1,6 @@ //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here use std::thread; @@ -20,12 +20,12 @@ fn test_send_trait() { let mut f = 10; let fptr = SendPointer(&mut f as *mut i32); thread::spawn(move || { let _ = &fptr; unsafe { - //~^ ERROR: changes to closure capture - //~| NOTE: in Rust 2018, this closure implements `Send` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `fptr` to be fully captured + //~^ ERROR changes to closure capture + //~| NOTE in Rust 2018, this closure implements `Send` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `fptr` to be fully captured *fptr.0 = 20; - //~^ NOTE: in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0` + //~^ NOTE in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0` } }).join().unwrap(); } @@ -40,13 +40,13 @@ fn test_sync_trait() { let f = CustomInt(&mut f as *mut i32); let fptr = SyncPointer(f); thread::spawn(move || { let _ = &fptr; unsafe { - //~^ ERROR: changes to closure capture - //~| NOTE: in Rust 2018, this closure implements `Sync` - //~| NOTE: in Rust 2018, this closure implements `Send` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `fptr` to be fully captured + //~^ ERROR changes to closure capture + //~| NOTE in Rust 2018, this closure implements `Sync` + //~| NOTE in Rust 2018, this closure implements `Send` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `fptr` to be fully captured *fptr.0.0 = 20; - //~^ NOTE: in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0.0` + //~^ NOTE in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0.0` } }).join().unwrap(); } @@ -66,12 +66,12 @@ fn test_clone_trait() { let f = U(S(Foo(0)), T(0)); let c = || { let _ = &f; - //~^ ERROR: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements - //~| NOTE: in Rust 2018, this closure implements `Clone` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `f` to be fully captured + //~^ ERROR changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements + //~| NOTE in Rust 2018, this closure implements `Clone` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `f` to be fully captured let f_1 = f.1; - //~^ NOTE: in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.1` + //~^ NOTE in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.1` println!("{:?}", f_1.0); }; @@ -79,7 +79,7 @@ fn test_clone_trait() { c_clone(); } -//~^ NOTE: in Rust 2018, `f` is dropped here, but in Rust 2021, only `f.1` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `f` is dropped here, but in Rust 2021, only `f.1` will be dropped here as part of the closure fn main() { test_send_trait(); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs index 6b452fcdaf111..b377da949467b 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs @@ -1,6 +1,6 @@ //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here use std::thread; @@ -20,12 +20,12 @@ fn test_send_trait() { let mut f = 10; let fptr = SendPointer(&mut f as *mut i32); thread::spawn(move || unsafe { - //~^ ERROR: changes to closure capture - //~| NOTE: in Rust 2018, this closure implements `Send` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `fptr` to be fully captured + //~^ ERROR changes to closure capture + //~| NOTE in Rust 2018, this closure implements `Send` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `fptr` to be fully captured *fptr.0 = 20; - //~^ NOTE: in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0` + //~^ NOTE in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0` }).join().unwrap(); } @@ -40,13 +40,13 @@ fn test_sync_trait() { let f = CustomInt(&mut f as *mut i32); let fptr = SyncPointer(f); thread::spawn(move || unsafe { - //~^ ERROR: changes to closure capture - //~| NOTE: in Rust 2018, this closure implements `Sync` - //~| NOTE: in Rust 2018, this closure implements `Send` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `fptr` to be fully captured + //~^ ERROR changes to closure capture + //~| NOTE in Rust 2018, this closure implements `Sync` + //~| NOTE in Rust 2018, this closure implements `Send` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `fptr` to be fully captured *fptr.0.0 = 20; - //~^ NOTE: in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0.0` + //~^ NOTE in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0.0` }).join().unwrap(); } @@ -65,12 +65,12 @@ impl Clone for U { fn test_clone_trait() { let f = U(S(Foo(0)), T(0)); let c = || { - //~^ ERROR: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements - //~| NOTE: in Rust 2018, this closure implements `Clone` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `f` to be fully captured + //~^ ERROR changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements + //~| NOTE in Rust 2018, this closure implements `Clone` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `f` to be fully captured let f_1 = f.1; - //~^ NOTE: in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.1` + //~^ NOTE in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.1` println!("{:?}", f_1.0); }; @@ -78,7 +78,7 @@ fn test_clone_trait() { c_clone(); } -//~^ NOTE: in Rust 2018, `f` is dropped here, but in Rust 2021, only `f.1` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `f` is dropped here, but in Rust 2021, only `f.1` will be dropped here as part of the closure fn main() { test_send_trait(); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.fixed b/tests/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.fixed index e9e16ce951b24..1ea1cb3385bed 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.fixed @@ -14,7 +14,7 @@ impl Drop for Foo { macro_rules! m { (@ $body:expr) => {{ let f = || $body; - //~^ WARNING: drop order + //~^ WARNING drop order f(); }}; ($body:block) => {{ @@ -26,7 +26,7 @@ fn main() { let a = (Foo(0), Foo(1)); m!({ let _ = &a; - //~^ HELP: add a dummy + //~^ HELP add a dummy let x = a.0; println!("{:?}", x); }); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.rs b/tests/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.rs index 0cb5351f595e0..f03a9774f5ee2 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.rs @@ -14,7 +14,7 @@ impl Drop for Foo { macro_rules! m { (@ $body:expr) => {{ let f = || $body; - //~^ WARNING: drop order + //~^ WARNING drop order f(); }}; ($body:block) => {{ @@ -25,7 +25,7 @@ macro_rules! m { fn main() { let a = (Foo(0), Foo(1)); m!({ - //~^ HELP: add a dummy + //~^ HELP add a dummy let x = a.0; println!("{:?}", x); }); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.fixed b/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.fixed index 2784a60364437..035e7f3825095 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.fixed @@ -1,7 +1,7 @@ //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here #![feature(rustc_attrs)] #![allow(unused)] @@ -38,16 +38,16 @@ fn significant_drop_needs_migration() { let c = || { let _ = &t; - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure // Even if a type implements an insignificant drop, if it's // elements have a significant drop then the overall type is @@ -59,16 +59,16 @@ fn generic_struct_with_significant_drop_needs_migration() { // move is used to force i32 to be copied instead of being a ref let c = move || { let _ = &t; - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.1; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure fn main() { significant_drop_needs_migration(); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.rs b/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.rs index e5de7ba3c6233..a595564a7dd99 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.rs @@ -1,7 +1,7 @@ //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here #![feature(rustc_attrs)] #![allow(unused)] @@ -37,16 +37,16 @@ fn significant_drop_needs_migration() { let t = (SigDrop {}, SigDrop {}); let c = || { - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure // Even if a type implements an insignificant drop, if it's // elements have a significant drop then the overall type is @@ -57,16 +57,16 @@ fn generic_struct_with_significant_drop_needs_migration() { // move is used to force i32 to be copied instead of being a ref let c = move || { - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.1; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure fn main() { significant_drop_needs_migration(); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/issue-78720.rs b/tests/ui/closures/2229_closure_analysis/migrations/issue-78720.rs index 3e72eec4ea8c6..6dd21869c49bb 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/issue-78720.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/issue-78720.rs @@ -5,7 +5,7 @@ fn main() { if let a = "" { - //~^ WARNING: irrefutable `if let` pattern + //~^ WARNING irrefutable `if let` pattern drop(|_: ()| drop(a)); } } diff --git a/tests/ui/closures/2229_closure_analysis/migrations/macro.fixed b/tests/ui/closures/2229_closure_analysis/migrations/macro.fixed index 8946642892ff1..ee759a1383687 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/macro.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/macro.fixed @@ -3,7 +3,7 @@ // See https://github.com/rust-lang/rust/issues/87955 #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here #[derive(Debug)] @@ -17,9 +17,9 @@ impl Drop for Foo { fn main() { let a = (Foo(0), Foo(1)); let _ = || { let _ = &a; dbg!(a.0) }; - //~^ ERROR: drop order - //~| NOTE: will only capture `a.0` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `a` to be fully captured + //~^ ERROR drop order + //~| NOTE will only capture `a.0` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `a` to be fully captured } -//~^ NOTE: dropped here +//~^ NOTE dropped here diff --git a/tests/ui/closures/2229_closure_analysis/migrations/macro.rs b/tests/ui/closures/2229_closure_analysis/migrations/macro.rs index f50b985298d7a..29fea0e3d780b 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/macro.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/macro.rs @@ -3,7 +3,7 @@ // See https://github.com/rust-lang/rust/issues/87955 #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here #[derive(Debug)] @@ -17,9 +17,9 @@ impl Drop for Foo { fn main() { let a = (Foo(0), Foo(1)); let _ = || dbg!(a.0); - //~^ ERROR: drop order - //~| NOTE: will only capture `a.0` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `a` to be fully captured + //~^ ERROR drop order + //~| NOTE will only capture `a.0` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `a` to be fully captured } -//~^ NOTE: dropped here +//~^ NOTE dropped here diff --git a/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.fixed b/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.fixed index b87c398da396d..118a01f1d7cfa 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.fixed @@ -1,6 +1,6 @@ //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here // Test the two possible cases for automated migartion using rustfix // - Closure contains a block i.e. `|| { .. };` @@ -18,28 +18,28 @@ fn closure_contains_block() { let t = (Foo(0), Foo(0)); let c = || { let _ = &t; - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure fn closure_doesnt_contain_block() { let t = (Foo(0), Foo(0)); let c = || { let _ = &t; t.0 }; - //~^ ERROR: drop order - //~| NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure fn main() { closure_contains_block(); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.rs b/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.rs index 5e763b0239ae0..417e2f3051ca0 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.rs @@ -1,6 +1,6 @@ //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here // Test the two possible cases for automated migartion using rustfix // - Closure contains a block i.e. `|| { .. };` @@ -17,28 +17,28 @@ impl Drop for Foo { fn closure_contains_block() { let t = (Foo(0), Foo(0)); let c = || { - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure fn closure_doesnt_contain_block() { let t = (Foo(0), Foo(0)); let c = || t.0; - //~^ ERROR: drop order - //~| NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure fn main() { closure_contains_block(); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed index 3ff73bf4681c0..befe90bf6c27e 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed @@ -2,7 +2,7 @@ //@ needs-unwind #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here #![feature(fn_traits)] #![feature(never_type)] @@ -19,13 +19,13 @@ where let f = panic::AssertUnwindSafe(f); let result = panic::catch_unwind(move || { let _ = &f; - //~^ ERROR: changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures] - //~| NOTE: in Rust 2018, this closure implements `UnwindSafe` - //~| NOTE: in Rust 2018, this closure implements `RefUnwindSafe` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `f` to be fully captured + //~^ ERROR changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures] + //~| NOTE in Rust 2018, this closure implements `UnwindSafe` + //~| NOTE in Rust 2018, this closure implements `RefUnwindSafe` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `f` to be fully captured f.0() - //~^ NOTE: in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.0` + //~^ NOTE in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.0` }); if let Ok(..) = result { panic!("diverging function returned"); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs index 21f1a9515a6a0..c418f6667726f 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs @@ -2,7 +2,7 @@ //@ needs-unwind #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here #![feature(fn_traits)] #![feature(never_type)] @@ -18,13 +18,13 @@ where { let f = panic::AssertUnwindSafe(f); let result = panic::catch_unwind(move || { - //~^ ERROR: changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures] - //~| NOTE: in Rust 2018, this closure implements `UnwindSafe` - //~| NOTE: in Rust 2018, this closure implements `RefUnwindSafe` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `f` to be fully captured + //~^ ERROR changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures] + //~| NOTE in Rust 2018, this closure implements `UnwindSafe` + //~| NOTE in Rust 2018, this closure implements `RefUnwindSafe` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `f` to be fully captured f.0() - //~^ NOTE: in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.0` + //~^ NOTE in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.0` }); if let Ok(..) = result { panic!("diverging function returned"); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed index 8bbd7fab569c8..e52602a7b2399 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed @@ -1,6 +1,6 @@ //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here use std::thread; @@ -36,32 +36,32 @@ fn test_multi_issues() { let f2 = U(S(Foo::from("bar")), T(0)); let c = || { let _ = (&f1, &f2); - //~^ ERROR: changes to closure capture in Rust 2021 - //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `f1`, `f2` to be fully captured + //~^ ERROR changes to closure capture in Rust 2021 + //~| NOTE in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `f1`, `f2` to be fully captured let _f_1 = f1.0; - //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` + //~^ NOTE in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` let _f_2 = f2.1; - //~^ NOTE: in Rust 2018, this closure captures all of `f2`, but in Rust 2021, it will only capture `f2.1` + //~^ NOTE in Rust 2018, this closure captures all of `f2`, but in Rust 2021, it will only capture `f2.1` }; let c_clone = c.clone(); c_clone(); } -//~^ NOTE: in Rust 2018, `f2` is dropped here, but in Rust 2021, only `f2.1` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `f2` is dropped here, but in Rust 2021, only `f2.1` will be dropped here as part of the closure fn test_capturing_all_disjoint_fields_individually() { let f1 = U(S(Foo::from("foo")), T(0)); let c = || { let _ = &f1; - //~^ ERROR: changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures] - //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `f1` to be fully captured + //~^ ERROR changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures] + //~| NOTE in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `f1` to be fully captured let _f_1 = f1.0; - //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` + //~^ NOTE in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` let _f_2 = f1.1; }; @@ -82,15 +82,15 @@ fn test_capturing_several_disjoint_fields_individually_1() { let f1 = U1(S(Foo::from("foo")), T(0), S(Foo::from("bar"))); let c = || { let _ = &f1; - //~^ ERROR: changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures] - //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` - //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `f1` to be fully captured + //~^ ERROR changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures] + //~| NOTE in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` + //~| NOTE in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `f1` to be fully captured let _f_0 = f1.0; - //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` + //~^ NOTE in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` let _f_2 = f1.2; - //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.2` + //~^ NOTE in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.2` }; let c_clone = c.clone(); @@ -102,22 +102,22 @@ fn test_capturing_several_disjoint_fields_individually_2() { let f1 = U1(S(Foo::from("foo")), T(0), S(Foo::from("bar"))); let c = || { let _ = &f1; - //~^ ERROR: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements - //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `f1` to be fully captured + //~^ ERROR changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements + //~| NOTE in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `f1` to be fully captured let _f_0 = f1.0; - //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` + //~^ NOTE in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` let _f_1 = f1.1; - //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.1` + //~^ NOTE in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.1` }; let c_clone = c.clone(); c_clone(); } -//~^ NOTE: in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.1` will be dropped here as part of the closure -//~| NOTE: in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.1` will be dropped here as part of the closure +//~| NOTE in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.0` will be dropped here as part of the closure struct SendPointer(*mut i32); unsafe impl Send for SendPointer {} @@ -135,16 +135,16 @@ fn test_multi_traits_issues() { let mut f2 = 10; let fptr2 = SendPointer(&mut f2 as *mut i32); thread::spawn(move || { let _ = (&fptr1, &fptr2); unsafe { - //~^ ERROR: changes to closure capture in Rust 2021 - //~| NOTE: in Rust 2018, this closure implements `Sync` as `fptr1` implements `Sync` - //~| NOTE: in Rust 2018, this closure implements `Send` as `fptr1` implements `Send` - //~| NOTE: in Rust 2018, this closure implements `Send` as `fptr2` implements `Send` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `fptr1`, `fptr2` to be fully captured + //~^ ERROR changes to closure capture in Rust 2021 + //~| NOTE in Rust 2018, this closure implements `Sync` as `fptr1` implements `Sync` + //~| NOTE in Rust 2018, this closure implements `Send` as `fptr1` implements `Send` + //~| NOTE in Rust 2018, this closure implements `Send` as `fptr2` implements `Send` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `fptr1`, `fptr2` to be fully captured *fptr1.0.0 = 20; - //~^ NOTE: in Rust 2018, this closure captures all of `fptr1`, but in Rust 2021, it will only capture `fptr1.0.0` + //~^ NOTE in Rust 2018, this closure captures all of `fptr1`, but in Rust 2021, it will only capture `fptr1.0.0` *fptr2.0 = 20; - //~^ NOTE: in Rust 2018, this closure captures all of `fptr2`, but in Rust 2021, it will only capture `fptr2.0` + //~^ NOTE in Rust 2018, this closure captures all of `fptr2`, but in Rust 2021, it will only capture `fptr2.0` } }).join().unwrap(); } diff --git a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs index 62fe1581bac04..1d795d6f6b9ba 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs @@ -1,6 +1,6 @@ //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here use std::thread; @@ -35,31 +35,31 @@ fn test_multi_issues() { let f1 = U(S(Foo::from("foo")), T(0)); let f2 = U(S(Foo::from("bar")), T(0)); let c = || { - //~^ ERROR: changes to closure capture in Rust 2021 - //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `f1`, `f2` to be fully captured + //~^ ERROR changes to closure capture in Rust 2021 + //~| NOTE in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `f1`, `f2` to be fully captured let _f_1 = f1.0; - //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` + //~^ NOTE in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` let _f_2 = f2.1; - //~^ NOTE: in Rust 2018, this closure captures all of `f2`, but in Rust 2021, it will only capture `f2.1` + //~^ NOTE in Rust 2018, this closure captures all of `f2`, but in Rust 2021, it will only capture `f2.1` }; let c_clone = c.clone(); c_clone(); } -//~^ NOTE: in Rust 2018, `f2` is dropped here, but in Rust 2021, only `f2.1` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `f2` is dropped here, but in Rust 2021, only `f2.1` will be dropped here as part of the closure fn test_capturing_all_disjoint_fields_individually() { let f1 = U(S(Foo::from("foo")), T(0)); let c = || { - //~^ ERROR: changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures] - //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `f1` to be fully captured + //~^ ERROR changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures] + //~| NOTE in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `f1` to be fully captured let _f_1 = f1.0; - //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` + //~^ NOTE in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` let _f_2 = f1.1; }; @@ -79,15 +79,15 @@ impl Clone for U1 { fn test_capturing_several_disjoint_fields_individually_1() { let f1 = U1(S(Foo::from("foo")), T(0), S(Foo::from("bar"))); let c = || { - //~^ ERROR: changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures] - //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` - //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `f1` to be fully captured + //~^ ERROR changes to closure capture in Rust 2021 will affect which traits the closure implements [rust_2021_incompatible_closure_captures] + //~| NOTE in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` + //~| NOTE in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `f1` to be fully captured let _f_0 = f1.0; - //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` + //~^ NOTE in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` let _f_2 = f1.2; - //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.2` + //~^ NOTE in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.2` }; let c_clone = c.clone(); @@ -98,22 +98,22 @@ fn test_capturing_several_disjoint_fields_individually_1() { fn test_capturing_several_disjoint_fields_individually_2() { let f1 = U1(S(Foo::from("foo")), T(0), S(Foo::from("bar"))); let c = || { - //~^ ERROR: changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements - //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `f1` to be fully captured + //~^ ERROR changes to closure capture in Rust 2021 will affect drop order and which traits the closure implements + //~| NOTE in Rust 2018, this closure implements `Clone` as `f1` implements `Clone` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `f1` to be fully captured let _f_0 = f1.0; - //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` + //~^ NOTE in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0` let _f_1 = f1.1; - //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.1` + //~^ NOTE in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.1` }; let c_clone = c.clone(); c_clone(); } -//~^ NOTE: in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.1` will be dropped here as part of the closure -//~| NOTE: in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.1` will be dropped here as part of the closure +//~| NOTE in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.0` will be dropped here as part of the closure struct SendPointer(*mut i32); unsafe impl Send for SendPointer {} @@ -131,16 +131,16 @@ fn test_multi_traits_issues() { let mut f2 = 10; let fptr2 = SendPointer(&mut f2 as *mut i32); thread::spawn(move || unsafe { - //~^ ERROR: changes to closure capture in Rust 2021 - //~| NOTE: in Rust 2018, this closure implements `Sync` as `fptr1` implements `Sync` - //~| NOTE: in Rust 2018, this closure implements `Send` as `fptr1` implements `Send` - //~| NOTE: in Rust 2018, this closure implements `Send` as `fptr2` implements `Send` - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `fptr1`, `fptr2` to be fully captured + //~^ ERROR changes to closure capture in Rust 2021 + //~| NOTE in Rust 2018, this closure implements `Sync` as `fptr1` implements `Sync` + //~| NOTE in Rust 2018, this closure implements `Send` as `fptr1` implements `Send` + //~| NOTE in Rust 2018, this closure implements `Send` as `fptr2` implements `Send` + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `fptr1`, `fptr2` to be fully captured *fptr1.0.0 = 20; - //~^ NOTE: in Rust 2018, this closure captures all of `fptr1`, but in Rust 2021, it will only capture `fptr1.0.0` + //~^ NOTE in Rust 2018, this closure captures all of `fptr1`, but in Rust 2021, it will only capture `fptr1.0.0` *fptr2.0 = 20; - //~^ NOTE: in Rust 2018, this closure captures all of `fptr2`, but in Rust 2021, it will only capture `fptr2.0` + //~^ NOTE in Rust 2018, this closure captures all of `fptr2`, but in Rust 2021, it will only capture `fptr2.0` }).join().unwrap(); } diff --git a/tests/ui/closures/2229_closure_analysis/migrations/precise.fixed b/tests/ui/closures/2229_closure_analysis/migrations/precise.fixed index 5743f9984be24..c944a54c5df20 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/precise.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/precise.fixed @@ -1,7 +1,7 @@ //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here #[derive(Debug)] struct Foo(i32); @@ -19,17 +19,17 @@ fn test_precise_analysis_drop_paths_not_captured_by_move() { let c = || { let _ = &t; - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` let _t = &t.1; }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure struct S; impl Drop for S { @@ -45,22 +45,22 @@ fn test_precise_analysis_long_path_missing() { let c = || { let _ = &u; - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `u` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `u` to be fully captured let _x = u.0.0; - //~^ NOTE: in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.0.0` + //~^ NOTE in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.0.0` let _x = u.0.1; - //~^ NOTE: in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.0.1` + //~^ NOTE in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.0.1` let _x = u.1.0; - //~^ NOTE: in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.1.0` + //~^ NOTE in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.1.0` }; c(); } -//~^ NOTE: in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.0` will be dropped here as part of the closure -//~| NOTE: in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.1` will be dropped here as part of the closure -//~| NOTE: in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.1.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.0` will be dropped here as part of the closure +//~| NOTE in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.1` will be dropped here as part of the closure +//~| NOTE in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.1.0` will be dropped here as part of the closure fn main() { diff --git a/tests/ui/closures/2229_closure_analysis/migrations/precise.rs b/tests/ui/closures/2229_closure_analysis/migrations/precise.rs index 2ddd2535c7270..d4dad05603901 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/precise.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/precise.rs @@ -1,7 +1,7 @@ //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here #[derive(Debug)] struct Foo(i32); @@ -18,17 +18,17 @@ fn test_precise_analysis_drop_paths_not_captured_by_move() { let t = ConstainsDropField(Foo(10), Foo(20)); let c = || { - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` let _t = &t.1; }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure struct S; impl Drop for S { @@ -43,22 +43,22 @@ fn test_precise_analysis_long_path_missing() { let u = U(T(S, S), T(S, S)); let c = || { - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `u` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `u` to be fully captured let _x = u.0.0; - //~^ NOTE: in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.0.0` + //~^ NOTE in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.0.0` let _x = u.0.1; - //~^ NOTE: in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.0.1` + //~^ NOTE in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.0.1` let _x = u.1.0; - //~^ NOTE: in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.1.0` + //~^ NOTE in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.1.0` }; c(); } -//~^ NOTE: in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.0` will be dropped here as part of the closure -//~| NOTE: in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.1` will be dropped here as part of the closure -//~| NOTE: in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.1.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.0` will be dropped here as part of the closure +//~| NOTE in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.1` will be dropped here as part of the closure +//~| NOTE in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.1.0` will be dropped here as part of the closure fn main() { diff --git a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed index 8aa07cd5442a2..923bf431c8524 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed @@ -1,6 +1,6 @@ //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here // Test cases for types that implement a significant drop (user defined) @@ -24,22 +24,22 @@ fn test1_all_need_migration() { let c = || { let _ = (&t, &t1, &t2); - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t`, `t1`, `t2` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t`, `t1`, `t2` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` let _t1 = t1.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0` + //~^ NOTE in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0` let _t2 = t2.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t2`, but in Rust 2021, it will only capture `t2.0` + //~^ NOTE in Rust 2018, this closure captures all of `t2`, but in Rust 2021, it will only capture `t2.0` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure -//~| NOTE: in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure -//~| NOTE: in Rust 2018, `t2` is dropped here, but in Rust 2021, only `t2.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~| NOTE in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure +//~| NOTE in Rust 2018, `t2` is dropped here, but in Rust 2021, only `t2.0` will be dropped here as part of the closure // String implements drop and therefore should be migrated. // But in this test cases, `t2` is completely captured and when it is dropped won't be affected @@ -50,20 +50,20 @@ fn test2_only_precise_paths_need_migration() { let c = || { let _ = (&t, &t1); - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t`, `t1` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t`, `t1` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` let _t1 = t1.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0` + //~^ NOTE in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0` let _t2 = t2; }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure -//~| NOTE: in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~| NOTE in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure // If a variable would've not been captured by value then it would've not been // dropped with the closure and therefore doesn't need migration. @@ -72,17 +72,17 @@ fn test3_only_by_value_need_migration() { let t1 = (Foo(0), Foo(0)); let c = || { let _ = &t; - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` println!("{:?}", t1.1); }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure // The root variable might not implement drop themselves but some path starting // at the root variable might implement Drop. @@ -93,16 +93,16 @@ fn test4_type_contains_drop_need_migration() { let c = || { let _ = &t; - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure // Test migration analysis in case of Drop + Non Drop aggregates. // Note we need migration here only because the non-copy (because Drop type) is captured, @@ -112,16 +112,16 @@ fn test5_drop_non_drop_aggregate_need_migration() { let c = || { let _ = &t; - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure // Test migration analysis in case of Significant and Insignificant Drop aggregates. fn test6_significant_insignificant_drop_aggregate_need_migration() { @@ -129,16 +129,16 @@ fn test6_significant_insignificant_drop_aggregate_need_migration() { let c = || { let _ = &t; - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.1; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure // Since we are using a move closure here, both `t` and `t1` get moved // even though they are being used by ref inside the closure. @@ -148,18 +148,18 @@ fn test7_move_closures_non_copy_types_might_need_migration() { let c = move || { let _ = (&t1, &t); - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t1`, `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t1`, `t` to be fully captured println!("{:?} {:?}", t1.1, t.1); - //~^ NOTE: in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.1` - //~| NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1` + //~^ NOTE in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.1` + //~| NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure -//~| NOTE: in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.1` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure +//~| NOTE in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.1` will be dropped here as part of the closure fn test8_drop_order_and_blocks() { @@ -169,16 +169,16 @@ fn test8_drop_order_and_blocks() { { let c = || { let _ = &tuple; - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `tuple` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `tuple` to be fully captured tuple.0; - //~^ NOTE: in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0` + //~^ NOTE in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0` }; c(); } - //~^ NOTE: in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure + //~^ NOTE in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure } } @@ -188,16 +188,16 @@ fn test9_drop_order_and_nested_closures() { let b = || { let c = || { let _ = &tuple; - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `tuple` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `tuple` to be fully captured tuple.0; - //~^ NOTE: in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0` + //~^ NOTE in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0` }; c(); }; - //~^ NOTE: in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure + //~^ NOTE in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure b(); } @@ -208,12 +208,12 @@ fn test10_vec_of_significant_drop_type() { let tup = (Foo(0), vec![Foo(3)]); let _c = || { let _ = &tup; tup.0 }; - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `tup` to be fully captured - //~| NOTE: in Rust 2018, this closure captures all of `tup`, but in Rust 2021, it will only capture `tup.0` + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `tup` to be fully captured + //~| NOTE in Rust 2018, this closure captures all of `tup`, but in Rust 2021, it will only capture `tup.0` } -//~^ NOTE: in Rust 2018, `tup` is dropped here, but in Rust 2021, only `tup.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `tup` is dropped here, but in Rust 2021, only `tup.0` will be dropped here as part of the closure fn main() { test1_all_need_migration(); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs index b53461d14df31..d05b379fe496c 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs @@ -1,6 +1,6 @@ //@ run-rustfix #![deny(rust_2021_incompatible_closure_captures)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here // Test cases for types that implement a significant drop (user defined) @@ -23,22 +23,22 @@ fn test1_all_need_migration() { let t2 = (Foo(0), Foo(0)); let c = || { - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t`, `t1`, `t2` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t`, `t1`, `t2` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` let _t1 = t1.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0` + //~^ NOTE in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0` let _t2 = t2.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t2`, but in Rust 2021, it will only capture `t2.0` + //~^ NOTE in Rust 2018, this closure captures all of `t2`, but in Rust 2021, it will only capture `t2.0` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure -//~| NOTE: in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure -//~| NOTE: in Rust 2018, `t2` is dropped here, but in Rust 2021, only `t2.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~| NOTE in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure +//~| NOTE in Rust 2018, `t2` is dropped here, but in Rust 2021, only `t2.0` will be dropped here as part of the closure // String implements drop and therefore should be migrated. // But in this test cases, `t2` is completely captured and when it is dropped won't be affected @@ -48,20 +48,20 @@ fn test2_only_precise_paths_need_migration() { let t2 = (Foo(0), Foo(0)); let c = || { - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t`, `t1` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t`, `t1` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` let _t1 = t1.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0` + //~^ NOTE in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0` let _t2 = t2; }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure -//~| NOTE: in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~| NOTE in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure // If a variable would've not been captured by value then it would've not been // dropped with the closure and therefore doesn't need migration. @@ -69,17 +69,17 @@ fn test3_only_by_value_need_migration() { let t = (Foo(0), Foo(0)); let t1 = (Foo(0), Foo(0)); let c = || { - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` println!("{:?}", t1.1); }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure // The root variable might not implement drop themselves but some path starting // at the root variable might implement Drop. @@ -89,16 +89,16 @@ fn test4_type_contains_drop_need_migration() { let t = ConstainsDropField(Foo(0), Foo(0)); let c = || { - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure // Test migration analysis in case of Drop + Non Drop aggregates. // Note we need migration here only because the non-copy (because Drop type) is captured, @@ -107,32 +107,32 @@ fn test5_drop_non_drop_aggregate_need_migration() { let t = (Foo(0), Foo(0), 0i32); let c = || { - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.0; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure // Test migration analysis in case of Significant and Insignificant Drop aggregates. fn test6_significant_insignificant_drop_aggregate_need_migration() { let t = (Foo(0), String::new()); let c = || { - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t` to be fully captured let _t = t.1; - //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1` + //~^ NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure // Since we are using a move closure here, both `t` and `t1` get moved // even though they are being used by ref inside the closure. @@ -141,18 +141,18 @@ fn test7_move_closures_non_copy_types_might_need_migration() { let t1 = (Foo(0), Foo(0), Foo(0)); let c = move || { - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `t1`, `t` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `t1`, `t` to be fully captured println!("{:?} {:?}", t1.1, t.1); - //~^ NOTE: in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.1` - //~| NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1` + //~^ NOTE in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.1` + //~| NOTE in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1` }; c(); } -//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure -//~| NOTE: in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.1` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure +//~| NOTE in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.1` will be dropped here as part of the closure fn test8_drop_order_and_blocks() { @@ -161,16 +161,16 @@ fn test8_drop_order_and_blocks() { (Foo(0), Foo(1)); { let c = || { - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `tuple` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `tuple` to be fully captured tuple.0; - //~^ NOTE: in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0` + //~^ NOTE in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0` }; c(); } - //~^ NOTE: in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure + //~^ NOTE in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure } } @@ -179,16 +179,16 @@ fn test9_drop_order_and_nested_closures() { (Foo(0), Foo(1)); let b = || { let c = || { - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `tuple` to be fully captured + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `tuple` to be fully captured tuple.0; - //~^ NOTE: in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0` + //~^ NOTE in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0` }; c(); }; - //~^ NOTE: in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure + //~^ NOTE in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure b(); } @@ -199,12 +199,12 @@ fn test10_vec_of_significant_drop_type() { let tup = (Foo(0), vec![Foo(3)]); let _c = || tup.0; - //~^ ERROR: drop order - //~| NOTE: for more information, see - //~| HELP: add a dummy let to cause `tup` to be fully captured - //~| NOTE: in Rust 2018, this closure captures all of `tup`, but in Rust 2021, it will only capture `tup.0` + //~^ ERROR drop order + //~| NOTE for more information, see + //~| HELP add a dummy let to cause `tup` to be fully captured + //~| NOTE in Rust 2018, this closure captures all of `tup`, but in Rust 2021, it will only capture `tup.0` } -//~^ NOTE: in Rust 2018, `tup` is dropped here, but in Rust 2021, only `tup.0` will be dropped here as part of the closure +//~^ NOTE in Rust 2018, `tup` is dropped here, but in Rust 2021, only `tup.0` will be dropped here as part of the closure fn main() { test1_all_need_migration(); diff --git a/tests/ui/closures/2229_closure_analysis/move_closure.rs b/tests/ui/closures/2229_closure_analysis/move_closure.rs index b6690d060118e..5505b9059f833 100644 --- a/tests/ui/closures/2229_closure_analysis/move_closure.rs +++ b/tests/ui/closures/2229_closure_analysis/move_closure.rs @@ -10,15 +10,15 @@ fn simple_move_closure() { let t = T(S("s".into())); let mut c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date move || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: t.0.0 = "new S".into(); - //~^ NOTE: Capturing t[(0, 0),(0, 0)] -> Mutable - //~| NOTE: Min Capture t[(0, 0),(0, 0)] -> ByValue + //~^ NOTE Capturing t[(0, 0),(0, 0)] -> Mutable + //~| NOTE Min Capture t[(0, 0),(0, 0)] -> ByValue }; c(); } @@ -29,15 +29,15 @@ fn simple_ref() { let ref_s = &mut s; let mut c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date move || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: *ref_s += 10; - //~^ NOTE: Capturing ref_s[Deref] -> Mutable - //~| NOTE: Min Capture ref_s[] -> ByValue + //~^ NOTE Capturing ref_s[Deref] -> Mutable + //~| NOTE Min Capture ref_s[] -> ByValue }; c(); } @@ -51,15 +51,15 @@ fn struct_contains_ref_to_another_struct_1() { let t = T(&mut s); let mut c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date move || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: t.0.0 = "new s".into(); - //~^ NOTE: Capturing t[(0, 0),Deref,(0, 0)] -> Mutable - //~| NOTE: Min Capture t[(0, 0)] -> ByValue + //~^ NOTE Capturing t[(0, 0),Deref,(0, 0)] -> Mutable + //~| NOTE Min Capture t[(0, 0)] -> ByValue }; c(); @@ -75,15 +75,15 @@ fn struct_contains_ref_to_another_struct_2() { let t = T(&s); let mut c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date move || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: let _t = t.0.0; - //~^ NOTE: Capturing t[(0, 0),Deref,(0, 0)] -> Immutable - //~| NOTE: Min Capture t[(0, 0)] -> ByValue + //~^ NOTE Capturing t[(0, 0),Deref,(0, 0)] -> Immutable + //~| NOTE Min Capture t[(0, 0)] -> ByValue }; c(); @@ -98,15 +98,15 @@ fn struct_contains_ref_to_another_struct_3() { let t = T(&s); let mut c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date move || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: let _t = t.0.0; - //~^ NOTE: Capturing t[(0, 0),Deref,(0, 0)] -> ByValue - //~| NOTE: Min Capture t[(0, 0)] -> ByValue + //~^ NOTE Capturing t[(0, 0),Deref,(0, 0)] -> ByValue + //~| NOTE Min Capture t[(0, 0)] -> ByValue }; c(); @@ -120,15 +120,15 @@ fn truncate_box_derefs() { // Content within the box is moved within the closure let b = Box::new(S(10)); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date move || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: let _t = b.0; - //~^ NOTE: Capturing b[Deref,(0, 0)] -> Immutable - //~| NOTE: Min Capture b[] -> ByValue + //~^ NOTE Capturing b[Deref,(0, 0)] -> Immutable + //~| NOTE Min Capture b[] -> ByValue }; c(); @@ -137,15 +137,15 @@ fn truncate_box_derefs() { let b = Box::new(S(10)); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date move || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: println!("{}", b.0); - //~^ NOTE: Capturing b[Deref,(0, 0)] -> Immutable - //~| NOTE: Min Capture b[] -> ByValue + //~^ NOTE Capturing b[Deref,(0, 0)] -> Immutable + //~| NOTE Min Capture b[] -> ByValue }; c(); @@ -155,15 +155,15 @@ fn truncate_box_derefs() { let t = (0, b); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date move || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: println!("{}", t.1.0); - //~^ NOTE: Capturing t[(1, 0),Deref,(0, 0)] -> Immutable - //~| NOTE: Min Capture t[(1, 0)] -> ByValue + //~^ NOTE Capturing t[(1, 0),Deref,(0, 0)] -> Immutable + //~| NOTE Min Capture t[(1, 0)] -> ByValue }; } @@ -178,13 +178,13 @@ fn box_mut_1() { let box_p_foo = Box::new(p_foo); let c = #[rustc_capture_analysis] move || box_p_foo.x += 10; - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date //~| First Pass analysis includes: - //~| NOTE: Capturing box_p_foo[Deref,Deref,(0, 0)] -> Mutable + //~| NOTE Capturing box_p_foo[Deref,Deref,(0, 0)] -> Mutable //~| Min Capture analysis includes: - //~| NOTE: Min Capture box_p_foo[] -> ByValue + //~| NOTE Min Capture box_p_foo[] -> ByValue } // Ensure that even in move closures, if the data is not owned by the root variable @@ -196,13 +196,13 @@ fn box_mut_2() { let p_foo = &mut box_foo; let c = #[rustc_capture_analysis] move || p_foo.x += 10; - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date //~| First Pass analysis includes: - //~| NOTE: Capturing p_foo[Deref,Deref,(0, 0)] -> Mutable + //~| NOTE Capturing p_foo[Deref,Deref,(0, 0)] -> Mutable //~| Min Capture analysis includes: - //~| NOTE: Min Capture p_foo[] -> ByValue + //~| NOTE Min Capture p_foo[] -> ByValue } // Test that move closures can take ownership of Copy type @@ -210,13 +210,13 @@ fn returned_closure_owns_copy_type_data() -> impl Fn() -> i32 { let x = 10; let c = #[rustc_capture_analysis] move || x; - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date //~| First Pass analysis includes: - //~| NOTE: Capturing x[] -> Immutable + //~| NOTE Capturing x[] -> Immutable //~| Min Capture analysis includes: - //~| NOTE: Min Capture x[] -> ByValue + //~| NOTE Min Capture x[] -> ByValue c } diff --git a/tests/ui/closures/2229_closure_analysis/multilevel-path-1.rs b/tests/ui/closures/2229_closure_analysis/multilevel-path-1.rs index 501aebe725aad..016bf9a7b051f 100644 --- a/tests/ui/closures/2229_closure_analysis/multilevel-path-1.rs +++ b/tests/ui/closures/2229_closure_analysis/multilevel-path-1.rs @@ -20,15 +20,15 @@ fn main() { // Therefore `w.p` is captured // Note that `wp.x` doesn't start off a variable defined outside the closure. let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: let wp = &w.p; - //~^ NOTE: Capturing w[(0, 0)] -> Immutable - //~| NOTE: Min Capture w[(0, 0)] -> Immutable + //~^ NOTE Capturing w[(0, 0)] -> Immutable + //~| NOTE Min Capture w[(0, 0)] -> Immutable println!("{}", wp.x); }; diff --git a/tests/ui/closures/2229_closure_analysis/multilevel-path-2.rs b/tests/ui/closures/2229_closure_analysis/multilevel-path-2.rs index f73627d14daa2..196a2d9b0aaef 100644 --- a/tests/ui/closures/2229_closure_analysis/multilevel-path-2.rs +++ b/tests/ui/closures/2229_closure_analysis/multilevel-path-2.rs @@ -15,15 +15,15 @@ fn main() { let mut w = Wrapper { p: Point { x: 10, y: 10 } }; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: println!("{}", w.p.x); - //~^ NOTE: Capturing w[(0, 0),(0, 0)] -> Immutable - //~| NOTE: Min Capture w[(0, 0),(0, 0)] -> Immutable + //~^ NOTE Capturing w[(0, 0),(0, 0)] -> Immutable + //~| NOTE Min Capture w[(0, 0),(0, 0)] -> Immutable }; // `c` only captures `w.p.x`, therefore it's safe to mutate `w.p.y`. diff --git a/tests/ui/closures/2229_closure_analysis/nested-closure.rs b/tests/ui/closures/2229_closure_analysis/nested-closure.rs index 54166d068cb1d..e66836ceaab3e 100644 --- a/tests/ui/closures/2229_closure_analysis/nested-closure.rs +++ b/tests/ui/closures/2229_closure_analysis/nested-closure.rs @@ -17,32 +17,32 @@ fn main() { let mut p = Point { x: 5, y: 20 }; let mut c1 = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: println!("{}", p.x); - //~^ NOTE: Capturing p[(0, 0)] -> Immutable - //~| NOTE: Min Capture p[(0, 0)] -> Immutable + //~^ NOTE Capturing p[(0, 0)] -> Immutable + //~| NOTE Min Capture p[(0, 0)] -> Immutable let incr = 10; let mut c2 = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || p.y += incr; - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: - //~| NOTE: Capturing p[(1, 0)] -> Mutable - //~| NOTE: Capturing incr[] -> Immutable - //~| NOTE: Min Capture p[(1, 0)] -> Mutable - //~| NOTE: Min Capture incr[] -> Immutable - //~| NOTE: Capturing p[(1, 0)] -> Mutable - //~| NOTE: Min Capture p[(1, 0)] -> Mutable + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: + //~| NOTE Capturing p[(1, 0)] -> Mutable + //~| NOTE Capturing incr[] -> Immutable + //~| NOTE Min Capture p[(1, 0)] -> Mutable + //~| NOTE Min Capture incr[] -> Immutable + //~| NOTE Capturing p[(1, 0)] -> Mutable + //~| NOTE Min Capture p[(1, 0)] -> Mutable c2(); println!("{}", p.y); - //~^ NOTE: Capturing p[(1, 0)] -> Immutable + //~^ NOTE Capturing p[(1, 0)] -> Immutable }; c1(); diff --git a/tests/ui/closures/2229_closure_analysis/optimization/edge_case.rs b/tests/ui/closures/2229_closure_analysis/optimization/edge_case.rs index 70c20cf5aef84..28cc9c18eb0b9 100644 --- a/tests/ui/closures/2229_closure_analysis/optimization/edge_case.rs +++ b/tests/ui/closures/2229_closure_analysis/optimization/edge_case.rs @@ -18,13 +18,13 @@ struct MyStruct<'a> { fn foo<'a, 'b>(m: &'a MyStruct<'b>) -> impl FnMut() + 'static { let c = #[rustc_capture_analysis] || drop(&m.a.0); - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - //~| ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: - //~| NOTE: Capturing m[Deref,(0, 0),Deref,(0, 0)] -> Immutable - //~| NOTE: Min Capture m[Deref,(0, 0),Deref] -> Immutable + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~| ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: + //~| NOTE Capturing m[Deref,(0, 0),Deref,(0, 0)] -> Immutable + //~| NOTE Min Capture m[Deref,(0, 0),Deref] -> Immutable c } diff --git a/tests/ui/closures/2229_closure_analysis/path-with-array-access.rs b/tests/ui/closures/2229_closure_analysis/path-with-array-access.rs index ed740f3a16773..60062c77c4b0a 100644 --- a/tests/ui/closures/2229_closure_analysis/path-with-array-access.rs +++ b/tests/ui/closures/2229_closure_analysis/path-with-array-access.rs @@ -21,14 +21,14 @@ fn main() { let pent = Pentagon { points: [p1, p2, p3, p4, p5] }; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: println!("{}", pent.points[5].x); - //~^ NOTE: Capturing pent[(0, 0)] -> Immutable - //~| NOTE: Min Capture pent[(0, 0)] -> Immutable + //~^ NOTE Capturing pent[(0, 0)] -> Immutable + //~| NOTE Min Capture pent[(0, 0)] -> Immutable }; } diff --git a/tests/ui/closures/2229_closure_analysis/preserve_field_drop_order.rs b/tests/ui/closures/2229_closure_analysis/preserve_field_drop_order.rs index 159be843edb0b..1a342d5181e09 100644 --- a/tests/ui/closures/2229_closure_analysis/preserve_field_drop_order.rs +++ b/tests/ui/closures/2229_closure_analysis/preserve_field_drop_order.rs @@ -21,24 +21,24 @@ fn test_one() { let b = (HasDrop, HasDrop); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: Min Capture analysis includes: + //~^ ERROR Min Capture analysis includes: //~| ERROR println!("{:?}", a.0); - //~^ NOTE: Min Capture a[(0, 0)] -> Immutable + //~^ NOTE Min Capture a[(0, 0)] -> Immutable //~| NOTE println!("{:?}", a.1); - //~^ NOTE: Min Capture a[(1, 0)] -> Immutable + //~^ NOTE Min Capture a[(1, 0)] -> Immutable //~| NOTE println!("{:?}", b.0); - //~^ NOTE: Min Capture b[(0, 0)] -> Immutable + //~^ NOTE Min Capture b[(0, 0)] -> Immutable //~| NOTE println!("{:?}", b.1); - //~^ NOTE: Min Capture b[(1, 0)] -> Immutable + //~^ NOTE Min Capture b[(1, 0)] -> Immutable //~| NOTE }; } @@ -48,24 +48,24 @@ fn test_two() { let b = (HasDrop, HasDrop); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: Min Capture analysis includes: + //~^ ERROR Min Capture analysis includes: //~| ERROR println!("{:?}", a.1); - //~^ NOTE: Min Capture a[(1, 0)] -> Immutable + //~^ NOTE Min Capture a[(1, 0)] -> Immutable //~| NOTE println!("{:?}", a.0); - //~^ NOTE: Min Capture a[(0, 0)] -> Immutable + //~^ NOTE Min Capture a[(0, 0)] -> Immutable //~| NOTE println!("{:?}", b.1); - //~^ NOTE: Min Capture b[(1, 0)] -> Immutable + //~^ NOTE Min Capture b[(1, 0)] -> Immutable //~| NOTE println!("{:?}", b.0); - //~^ NOTE: Min Capture b[(0, 0)] -> Immutable + //~^ NOTE Min Capture b[(0, 0)] -> Immutable //~| NOTE }; } @@ -75,24 +75,24 @@ fn test_three() { let b = (HasDrop, HasDrop); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: Min Capture analysis includes: + //~^ ERROR Min Capture analysis includes: //~| ERROR println!("{:?}", b.1); - //~^ NOTE: Min Capture b[(1, 0)] -> Immutable + //~^ NOTE Min Capture b[(1, 0)] -> Immutable //~| NOTE println!("{:?}", a.1); - //~^ NOTE: Min Capture a[(1, 0)] -> Immutable + //~^ NOTE Min Capture a[(1, 0)] -> Immutable //~| NOTE println!("{:?}", a.0); - //~^ NOTE: Min Capture a[(0, 0)] -> Immutable + //~^ NOTE Min Capture a[(0, 0)] -> Immutable //~| NOTE println!("{:?}", b.0); - //~^ NOTE: Min Capture b[(0, 0)] -> Immutable + //~^ NOTE Min Capture b[(0, 0)] -> Immutable //~| NOTE }; } diff --git a/tests/ui/closures/2229_closure_analysis/repr_packed.rs b/tests/ui/closures/2229_closure_analysis/repr_packed.rs index 2525af37eaaaa..3f2ff3e61a1f5 100644 --- a/tests/ui/closures/2229_closure_analysis/repr_packed.rs +++ b/tests/ui/closures/2229_closure_analysis/repr_packed.rs @@ -12,17 +12,17 @@ fn test_alignment_not_affected() { let mut foo = Foo { x: 0, y: 0 }; let mut c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: let z1: &u8 = &foo.x; - //~^ NOTE: Capturing foo[] -> Immutable + //~^ NOTE Capturing foo[] -> Immutable let z2: &mut u8 = &mut foo.y; - //~^ NOTE: Capturing foo[] -> Mutable - //~| NOTE: Min Capture foo[] -> Mutable + //~^ NOTE Capturing foo[] -> Mutable + //~| NOTE Min Capture foo[] -> Mutable *z2 = 42; @@ -43,17 +43,17 @@ fn test_alignment_affected() { let mut foo = Foo { x: String::new(), y: 0 }; let mut c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: let z1: &String = &foo.x; - //~^ NOTE: Capturing foo[] -> Immutable + //~^ NOTE Capturing foo[] -> Immutable let z2: &mut u16 = &mut foo.y; - //~^ NOTE: Capturing foo[] -> Mutable - //~| NOTE: Min Capture foo[] -> Mutable + //~^ NOTE Capturing foo[] -> Mutable + //~| NOTE Min Capture foo[] -> Mutable *z2 = 42; @@ -79,19 +79,19 @@ fn test_truncation_when_ref_and_move() { let mut foo = Foo { x: String::new() }; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: println!("{}", foo.x); - //~^ NOTE: Capturing foo[] -> Immutable - //~| NOTE: Min Capture foo[] -> ByValue - //~| NOTE: foo[] used here + //~^ NOTE Capturing foo[] -> Immutable + //~| NOTE Min Capture foo[] -> ByValue + //~| NOTE foo[] used here let _z = foo.x; - //~^ NOTE: Capturing foo[(0, 0)] -> ByValue - //~| NOTE: foo[] captured as ByValue here + //~^ NOTE Capturing foo[(0, 0)] -> ByValue + //~| NOTE foo[] captured as ByValue here }; c(); diff --git a/tests/ui/closures/2229_closure_analysis/simple-struct-min-capture.rs b/tests/ui/closures/2229_closure_analysis/simple-struct-min-capture.rs index 38aa76999fb44..c153b0264d712 100644 --- a/tests/ui/closures/2229_closure_analysis/simple-struct-min-capture.rs +++ b/tests/ui/closures/2229_closure_analysis/simple-struct-min-capture.rs @@ -21,19 +21,19 @@ fn main() { // Requirements met when p is captured via MutBorrow // let mut c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: p.x += 10; - //~^ NOTE: Capturing p[(0, 0)] -> Mutable - //~| NOTE: p[] captured as Mutable here + //~^ NOTE Capturing p[(0, 0)] -> Mutable + //~| NOTE p[] captured as Mutable here println!("{:?}", p); - //~^ NOTE: Capturing p[] -> Immutable - //~| NOTE: Min Capture p[] -> Mutable - //~| NOTE: p[] used here + //~^ NOTE Capturing p[] -> Immutable + //~| NOTE Min Capture p[] -> Mutable + //~| NOTE p[] used here }; c(); diff --git a/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.rs b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.rs index 193ed98daa9d2..05ad24b3642c0 100644 --- a/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.rs +++ b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.rs @@ -4,7 +4,7 @@ fn extend_lifetime<'a, 'b>(x: &mut (&'a str,), y: &'b str) { let mut closure = |input| x.0 = input; - //~^ ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough closure(y); } diff --git a/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.rs b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.rs index 03a208b8c2659..fd7a8cf5acbd5 100644 --- a/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.rs +++ b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.rs @@ -13,7 +13,7 @@ impl<'b> Spooky<'b> { if let Some(owned) = &self.owned { let borrow: &'a &'static u32 = owned; self.borrowed = borrow; - //~^ ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } }; closure(); diff --git a/tests/ui/closures/2229_closure_analysis/unsafe_ptr.rs b/tests/ui/closures/2229_closure_analysis/unsafe_ptr.rs index 667f244f612e8..cf354b6e363d5 100644 --- a/tests/ui/closures/2229_closure_analysis/unsafe_ptr.rs +++ b/tests/ui/closures/2229_closure_analysis/unsafe_ptr.rs @@ -23,15 +23,15 @@ fn unsafe_imm() { let t = T(p); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || unsafe { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: println!("{:?}", (*t.0).s); - //~^ NOTE: Capturing t[(0, 0),Deref,(0, 0)] -> Immutable - //~| NOTE: Min Capture t[(0, 0)] -> Immutable + //~^ NOTE Capturing t[(0, 0),Deref,(0, 0)] -> Immutable + //~| NOTE Min Capture t[(0, 0)] -> Immutable }; c(); @@ -44,15 +44,15 @@ fn unsafe_mut() { let p : *mut S = &mut *my_speed; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: let x = unsafe { &mut (*p).s }; - //~^ NOTE: Capturing p[Deref,(0, 0)] -> Immutable - //~| NOTE: Min Capture p[] -> Immutable + //~^ NOTE Capturing p[Deref,(0, 0)] -> Immutable + //~| NOTE Min Capture p[] -> Immutable *x = "s".into(); }; c(); diff --git a/tests/ui/closures/2229_closure_analysis/wild_patterns.rs b/tests/ui/closures/2229_closure_analysis/wild_patterns.rs index d220cfce9ce44..09b543eedd2e1 100644 --- a/tests/ui/closures/2229_closure_analysis/wild_patterns.rs +++ b/tests/ui/closures/2229_closure_analysis/wild_patterns.rs @@ -20,16 +20,16 @@ fn wild_struct() { let p = Point { x: 10, y: 20 }; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: // FIXME(arora-aman): Change `_x` to `_` let Point { x: _x, y: _ } = p; - //~^ NOTE: Capturing p[(0, 0)] -> Immutable - //~| NOTE: Min Capture p[(0, 0)] -> Immutable + //~^ NOTE Capturing p[(0, 0)] -> Immutable + //~| NOTE Min Capture p[(0, 0)] -> Immutable }; c(); @@ -39,16 +39,16 @@ fn wild_tuple() { let t = (String::new(), 10); let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: // FIXME(arora-aman): Change `_x` to `_` let (_x, _) = t; - //~^ NOTE: Capturing t[(0, 0)] -> ByValue - //~| NOTE: Min Capture t[(0, 0)] -> ByValue + //~^ NOTE Capturing t[(0, 0)] -> ByValue + //~| NOTE Min Capture t[(0, 0)] -> ByValue }; c(); @@ -58,16 +58,16 @@ fn wild_arr() { let arr = [String::new(), String::new()]; let c = #[rustc_capture_analysis] - //~^ ERROR: attributes on expressions are experimental - //~| NOTE: see issue #15701 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR attributes on expressions are experimental + //~| NOTE see issue #15701 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date || { - //~^ ERROR: First Pass analysis includes: - //~| ERROR: Min Capture analysis includes: + //~^ ERROR First Pass analysis includes: + //~| ERROR Min Capture analysis includes: // FIXME(arora-aman): Change `_x` to `_` let [_x, _] = arr; - //~^ NOTE: Capturing arr[Index] -> ByValue - //~| NOTE: Min Capture arr[] -> ByValue + //~^ NOTE Capturing arr[Index] -> ByValue + //~| NOTE Min Capture arr[] -> ByValue }; c(); diff --git a/tests/ui/closures/binder/forbid_ambig_const_infers.rs b/tests/ui/closures/binder/forbid_ambig_const_infers.rs index e9d783711ee3e..16765581a24fa 100644 --- a/tests/ui/closures/binder/forbid_ambig_const_infers.rs +++ b/tests/ui/closures/binder/forbid_ambig_const_infers.rs @@ -4,6 +4,6 @@ struct Foo([u32; N]); fn main() { let c = for<'a> |b: &'a Foo<_>| -> u32 { b.0[0] }; - //~^ ERROR: implicit types in closure signatures are forbidden when `for<...>` is present + //~^ ERROR implicit types in closure signatures are forbidden when `for<...>` is present c(&Foo([1_u32; 1])); } diff --git a/tests/ui/closures/binder/forbid_ambig_type_infers.rs b/tests/ui/closures/binder/forbid_ambig_type_infers.rs index 4e717ef3a179d..a6162e555cf56 100644 --- a/tests/ui/closures/binder/forbid_ambig_type_infers.rs +++ b/tests/ui/closures/binder/forbid_ambig_type_infers.rs @@ -4,6 +4,6 @@ struct Foo(T); fn main() { let c = for<'a> |b: &'a Foo<_>| -> u32 { b.0 }; - //~^ ERROR: implicit types in closure signatures are forbidden when `for<...>` is present + //~^ ERROR implicit types in closure signatures are forbidden when `for<...>` is present c(&Foo(1_u32)); } diff --git a/tests/ui/closures/binder/forbid_const_infer.rs b/tests/ui/closures/binder/forbid_const_infer.rs index f5b8bf188dfee..3105e14cdd789 100644 --- a/tests/ui/closures/binder/forbid_const_infer.rs +++ b/tests/ui/closures/binder/forbid_const_infer.rs @@ -2,6 +2,6 @@ fn main() { let c = for<'a> |b: &'a [u32; _]| -> u32 { b[0] }; - //~^ ERROR: implicit types in closure signatures are forbidden when `for<...>` is present + //~^ ERROR implicit types in closure signatures are forbidden when `for<...>` is present c(&[1_u32; 2]); } diff --git a/tests/ui/closures/binder/implicit-stuff.rs b/tests/ui/closures/binder/implicit-stuff.rs index c976c200b0c8e..e80ce7e862d9e 100644 --- a/tests/ui/closures/binder/implicit-stuff.rs +++ b/tests/ui/closures/binder/implicit-stuff.rs @@ -24,5 +24,5 @@ fn main() { //~| ERROR `'_` cannot be used here let _ = for<'a> |x: &()| -> &'a () { x }; //~ ERROR `&` without an explicit lifetime name cannot be used here let _ = for<'a> |x: &'a ()| -> &() { x }; //~ ERROR `&` without an explicit lifetime name cannot be used here - //~^ ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } diff --git a/tests/ui/closures/closure-array-break-length.rs b/tests/ui/closures/closure-array-break-length.rs index fda590fda022c..31d2658ae1e89 100644 --- a/tests/ui/closures/closure-array-break-length.rs +++ b/tests/ui/closures/closure-array-break-length.rs @@ -1,7 +1,7 @@ fn main() { - |_: [_; continue]| {}; //~ ERROR: `continue` outside of a loop + |_: [_; continue]| {}; //~ ERROR `continue` outside of a loop - while |_: [_; continue]| {} {} //~ ERROR: `continue` outside of a loop + while |_: [_; continue]| {} {} //~ ERROR `continue` outside of a loop - while |_: [_; break]| {} {} //~ ERROR: `break` outside of a loop + while |_: [_; break]| {} {} //~ ERROR `break` outside of a loop } diff --git a/tests/ui/closures/issue-10398.rs b/tests/ui/closures/issue-10398.rs index f76d09cd0b2ae..b018130afebc2 100644 --- a/tests/ui/closures/issue-10398.rs +++ b/tests/ui/closures/issue-10398.rs @@ -3,7 +3,7 @@ fn main() { let f = move|| { let _a = x; drop(x); - //~^ ERROR: use of moved value: `x` + //~^ ERROR use of moved value: `x` }; f(); } diff --git a/tests/ui/closures/issue-11873.rs b/tests/ui/closures/issue-11873.rs index d3bd05caf384e..2b12253d687ff 100644 --- a/tests/ui/closures/issue-11873.rs +++ b/tests/ui/closures/issue-11873.rs @@ -1,7 +1,7 @@ fn main() { let mut v = vec![1]; let mut f = || v.push(2); - let _w = v; //~ ERROR: cannot move out of `v` + let _w = v; //~ ERROR cannot move out of `v` f(); } diff --git a/tests/ui/closures/issue-52437.rs b/tests/ui/closures/issue-52437.rs index 6ac5380a5aa23..d81f883068100 100644 --- a/tests/ui/closures/issue-52437.rs +++ b/tests/ui/closures/issue-52437.rs @@ -1,5 +1,5 @@ fn main() { [(); &(&'static: loop { |x| {}; }) as *const _ as usize] - //~^ ERROR: invalid label name `'static` - //~| ERROR: type annotations needed + //~^ ERROR invalid label name `'static` + //~| ERROR type annotations needed } diff --git a/tests/ui/closures/issue-67123.rs b/tests/ui/closures/issue-67123.rs index 014c530e6d7dc..57ff9317ff65c 100644 --- a/tests/ui/closures/issue-67123.rs +++ b/tests/ui/closures/issue-67123.rs @@ -1,5 +1,5 @@ fn foo(t: T) { - || { t; t; }; //~ ERROR: use of moved value + || { t; t; }; //~ ERROR use of moved value } fn main() {} diff --git a/tests/ui/closures/issue-6801.rs b/tests/ui/closures/issue-6801.rs index cecb08f006fde..89279d4f3f8bc 100644 --- a/tests/ui/closures/issue-6801.rs +++ b/tests/ui/closures/issue-6801.rs @@ -16,6 +16,6 @@ fn main() { let x : Box = Box::new(9); let sq = || { *x * *x }; - twice(x); //~ ERROR: cannot move out of + twice(x); //~ ERROR cannot move out of invoke(sq); } diff --git a/tests/ui/closures/issue-87461.rs b/tests/ui/closures/issue-87461.rs index cc5b10c544d03..a69ad45818b7f 100644 --- a/tests/ui/closures/issue-87461.rs +++ b/tests/ui/closures/issue-87461.rs @@ -8,14 +8,14 @@ async fn func() -> Result { }.await?; Ok(()) - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] } async fn func2() -> Result { Err(42u64)?; Ok(()) - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] } fn main() { @@ -24,6 +24,6 @@ fn main() { return Err(42u64); } Ok(()) - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] }; } diff --git a/tests/ui/coercion/coerce-issue-49593-box-never.rs b/tests/ui/coercion/coerce-issue-49593-box-never.rs index e556959204590..903fb7f4d3053 100644 --- a/tests/ui/coercion/coerce-issue-49593-box-never.rs +++ b/tests/ui/coercion/coerce-issue-49593-box-never.rs @@ -16,13 +16,13 @@ fn foo(x: !) -> Box { // Method resolution will generate new inference vars and relate them. // Thus fallback will not fall back to `!`, but `()` instead. Box::<_ /* ! */>::new(x) - //[nofallback]~^ ERROR trait bound `(): std::error::Error` is not satisfied + //[nofallback]~^ ERROR trait bound `(): std::error:Error` is not satisfied } fn foo_raw_ptr(x: !) -> *mut dyn Error { /* *mut $0 is coerced to *mut Error here */ raw_ptr_box::<_ /* ! */>(x) - //[nofallback]~^ ERROR trait bound `(): std::error::Error` is not satisfied + //[nofallback]~^ ERROR trait bound `(): std::error:Error` is not satisfied } fn no_coercion(d: *mut dyn Error) -> *mut dyn Error { diff --git a/tests/ui/coherence/associated-type2.rs b/tests/ui/coherence/associated-type2.rs index 68e98b62953a6..5693ca81b4d7e 100644 --- a/tests/ui/coherence/associated-type2.rs +++ b/tests/ui/coherence/associated-type2.rs @@ -9,7 +9,7 @@ trait ToUnit { } impl ToUnit for *const T {} -//~^ ERROR: not all trait items implemented +//~^ ERROR not all trait items implemented trait Overlap {} diff --git a/tests/ui/coherence/coherence-negative-outlives-lifetimes.rs b/tests/ui/coherence/coherence-negative-outlives-lifetimes.rs index ae1000c6a47c2..df3f48b3ab243 100644 --- a/tests/ui/coherence/coherence-negative-outlives-lifetimes.rs +++ b/tests/ui/coherence/coherence-negative-outlives-lifetimes.rs @@ -16,6 +16,6 @@ trait MyTrait<'a> {} impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {} impl<'a, T> MyTrait<'a> for &'a T {} -//[stock]~^ ERROR: conflicting implementations of trait `MyTrait<'_>` for type `&_` +//[stock]~^ ERROR conflicting implementations of trait `MyTrait<'_>` for type `&_` fn main() {} diff --git a/tests/ui/coherence/coherence-overlap-negate-not-use-feature-gate.rs b/tests/ui/coherence/coherence-overlap-negate-not-use-feature-gate.rs index a067736f63a24..79c1c50cc19bf 100644 --- a/tests/ui/coherence/coherence-overlap-negate-not-use-feature-gate.rs +++ b/tests/ui/coherence/coherence-overlap-negate-not-use-feature-gate.rs @@ -3,6 +3,6 @@ use std::ops::DerefMut; trait Foo {} impl Foo for T {} impl Foo for &U {} -//~^ ERROR: conflicting implementations of trait `Foo` for type `&_` [E0119] +//~^ ERROR conflicting implementations of trait `Foo` for type `&_` [E0119] fn main() {} diff --git a/tests/ui/coherence/coherence-tuple-conflict.rs b/tests/ui/coherence/coherence-tuple-conflict.rs index 8dd09598c30bf..48ffa03f934b0 100644 --- a/tests/ui/coherence/coherence-tuple-conflict.rs +++ b/tests/ui/coherence/coherence-tuple-conflict.rs @@ -15,7 +15,7 @@ impl MyTrait for (T,T) { impl MyTrait for (A,B) { //~^ ERROR E0119 fn get(&self) -> usize { self.dummy } - //~^ ERROR: no field `dummy` + //~^ ERROR no field `dummy` } fn main() { } diff --git a/tests/ui/coherence/deep-bad-copy-reason.rs b/tests/ui/coherence/deep-bad-copy-reason.rs index f1c2698bad5cc..a5e6ecc29441a 100644 --- a/tests/ui/coherence/deep-bad-copy-reason.rs +++ b/tests/ui/coherence/deep-bad-copy-reason.rs @@ -5,15 +5,15 @@ extern "Rust" { } pub struct ListS { - //~^ NOTE: required because it appears within the type + //~^ NOTE required because it appears within the type len: usize, data: [T; 0], opaque: OpaqueListContents, } pub struct Interned<'a, T>(&'a T); -//~^ NOTE: required by an implicit `Sized` -//~| NOTE: required by the implicit `Sized` +//~^ NOTE required by an implicit `Sized` +//~| NOTE required by the implicit `Sized` impl<'a, T> Clone for Interned<'a, T> { fn clone(&self) -> Self { @@ -26,8 +26,8 @@ impl<'a, T> Copy for Interned<'a, T> {} pub struct List<'tcx, T>(Interned<'tcx, ListS>); //~^ NOTE this field does not implement `Copy` //~| NOTE the `Copy` impl for `Interned<'tcx, ListS>` requires that `OpaqueListContents: Sized` -//~| NOTE: doesn't have a size known at compile-time -//~| ERROR: cannot be known at compilation time +//~| NOTE doesn't have a size known at compile-time +//~| ERROR cannot be known at compilation time impl<'tcx, T> Clone for List<'tcx, T> { fn clone(&self) -> Self { diff --git a/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.rs b/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.rs index e07fa78463c7d..4df4177a67335 100644 --- a/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.rs +++ b/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.rs @@ -6,6 +6,6 @@ trait Trait {} impl Trait for [(); N] {} impl Trait for [(); N] {} -//~^ ERROR: conflicting implementations of trait `Trait` +//~^ ERROR conflicting implementations of trait `Trait` fn main() {} diff --git a/tests/ui/coherence/occurs-check/associated-type.rs b/tests/ui/coherence/occurs-check/associated-type.rs index d56ccc5b3532d..d2cbcddc127ac 100644 --- a/tests/ui/coherence/occurs-check/associated-type.rs +++ b/tests/ui/coherence/occurs-check/associated-type.rs @@ -43,5 +43,5 @@ fn foo, U>(x: T::Assoc) -> T::Assoc { fn main() { foo:: fn(&'a (), ()), for<'a> fn(&'a (), ())>(3usize); - //[next]~^ ERROR: cannot normalize + //[next]~^ ERROR cannot normalize } diff --git a/tests/ui/compare-method/issue-90444.rs b/tests/ui/compare-method/issue-90444.rs index 6c287d9a707de..84ba81ebbd085 100644 --- a/tests/ui/compare-method/issue-90444.rs +++ b/tests/ui/compare-method/issue-90444.rs @@ -1,7 +1,7 @@ pub struct A; impl From for A { fn from(_: fn((), (), &mut ())) -> Self { - //~^ error: method `from` has an incompatible type for trait + //~^ error method `from` has an incompatible type for trait loop {} } } @@ -9,7 +9,7 @@ impl From for A { pub struct B; impl From for B { fn from(_: fn((), (), u64)) -> Self { - //~^ error: method `from` has an incompatible type for trait + //~^ error method `from` has an incompatible type for trait loop {} } } diff --git a/tests/ui/conditional-compilation/cfg-attr-multi-true.rs b/tests/ui/conditional-compilation/cfg-attr-multi-true.rs index 424760c2e663b..b43e9e9b1d83f 100644 --- a/tests/ui/conditional-compilation/cfg-attr-multi-true.rs +++ b/tests/ui/conditional-compilation/cfg-attr-multi-true.rs @@ -9,13 +9,13 @@ #[cfg_attr(all(), deprecated, must_use)] struct MustUseDeprecated {} -impl MustUseDeprecated { //~ warning: use of deprecated - fn new() -> MustUseDeprecated { //~ warning: use of deprecated - MustUseDeprecated {} //~ warning: use of deprecated +impl MustUseDeprecated { //~ warning use of deprecated + fn new() -> MustUseDeprecated { //~ warning use of deprecated + MustUseDeprecated {} //~ warning use of deprecated } } fn main() { - MustUseDeprecated::new(); //~ warning: use of deprecated - //~| warning: unused `MustUseDeprecated` that must be used + MustUseDeprecated::new(); //~ warning use of deprecated + //~| warning unused `MustUseDeprecated` that must be used } diff --git a/tests/ui/conditional-compilation/cfg-attr-parse.rs b/tests/ui/conditional-compilation/cfg-attr-parse.rs index 8ca31c118369c..c59b7b6853752 100644 --- a/tests/ui/conditional-compilation/cfg-attr-parse.rs +++ b/tests/ui/conditional-compilation/cfg-attr-parse.rs @@ -1,11 +1,11 @@ // Parse `cfg_attr` with varying numbers of attributes and trailing commas // Completely empty `cfg_attr` input -#[cfg_attr()] //~ error: malformed `cfg_attr` attribute input +#[cfg_attr()] //~ error malformed `cfg_attr` attribute input struct NoConfigurationPredicate; // Zero attributes, zero trailing comma (comma manatory here) -#[cfg_attr(all())] //~ error: expected `,`, found end of `cfg_attr` +#[cfg_attr(all())] //~ error expected `,`, found end of `cfg_attr` struct A0C0; // Zero attributes, one trailing comma diff --git a/tests/ui/const-generics/adt_const_params/alias_const_param_ty-1.rs b/tests/ui/const-generics/adt_const_params/alias_const_param_ty-1.rs index e90426ec0c762..737758da2baa2 100644 --- a/tests/ui/const-generics/adt_const_params/alias_const_param_ty-1.rs +++ b/tests/ui/const-generics/adt_const_params/alias_const_param_ty-1.rs @@ -1,6 +1,6 @@ //@ check-pass #![feature(adt_const_params, lazy_type_alias)] -//~^ WARN: the feature `lazy_type_alias` is incomplete +//~^ WARN the feature `lazy_type_alias` is incomplete pub type Matrix = [usize; 1]; const EMPTY_MATRIX: Matrix = [0; 1]; diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_bad.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_bad.rs index 35539193a2787..029cd8f375b03 100644 --- a/tests/ui/const-generics/adt_const_params/const_param_ty_bad.rs +++ b/tests/ui/const-generics/adt_const_params/const_param_ty_bad.rs @@ -4,10 +4,10 @@ fn check(_: impl std::marker::UnsizedConstParamTy) {} fn main() { - check(main); //~ error: `fn() {main}` can't be used as a const parameter type - check(|| {}); //~ error: `{closure@$DIR/const_param_ty_bad.rs:8:11: 8:13}` can't be used as a const parameter type - check(main as fn()); //~ error: `fn()` can't be used as a const parameter type - check(&mut ()); //~ error: `&mut ()` can't be used as a const parameter type - check(&mut () as *mut ()); //~ error: `*mut ()` can't be used as a const parameter type - check(&() as *const ()); //~ error: `*const ()` can't be used as a const parameter type + check(main); //~ error `fn() {main}` can't be used as a const parameter type + check(|| {}); //~ error `{closure@$DIR/const_param_ty_bad.rs:8:11: 8:13}` can't be used as a const parameter type + check(main as fn()); //~ error `fn()` can't be used as a const parameter type + check(&mut ()); //~ error `&mut ()` can't be used as a const parameter type + check(&mut () as *mut ()); //~ error `*mut ()` can't be used as a const parameter type + check(&() as *const ()); //~ error `*const ()` can't be used as a const parameter type } diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_bad_empty_array.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_bad_empty_array.rs index 2008a96310a8b..841a38975d407 100644 --- a/tests/ui/const-generics/adt_const_params/const_param_ty_bad_empty_array.rs +++ b/tests/ui/const-generics/adt_const_params/const_param_ty_bad_empty_array.rs @@ -8,5 +8,5 @@ fn check() {} fn main() { check::<[NotParam; 0]>(); - //~^ error: `NotParam` can't be used as a const parameter type + //~^ error `NotParam` can't be used as a const parameter type } diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.rs index 6a553c2e08540..5545186574a96 100644 --- a/tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.rs +++ b/tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.rs @@ -4,9 +4,9 @@ use std::marker::{ConstParamTy_, UnsizedConstParamTy}; fn foo(a: &dyn ConstParamTy_) {} -//~^ ERROR: the trait `ConstParamTy_` +//~^ ERROR the trait `ConstParamTy_` fn bar(a: &dyn UnsizedConstParamTy) {} -//~^ ERROR: the trait `UnsizedConstParamTy` +//~^ ERROR the trait `UnsizedConstParamTy` fn main() {} diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.rs index 7ffdafa33e938..24a38863d3f01 100644 --- a/tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.rs +++ b/tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.rs @@ -7,7 +7,7 @@ struct NotParam; fn check() {} fn main() { - check::<&NotParam>(); //~ error: `NotParam` can't be used as a const parameter type - check::<[NotParam]>(); //~ error: `NotParam` can't be used as a const parameter type - check::<[NotParam; 17]>(); //~ error: `NotParam` can't be used as a const parameter type + check::<&NotParam>(); //~ error `NotParam` can't be used as a const parameter type + check::<[NotParam]>(); //~ error `NotParam` can't be used as a const parameter type + check::<[NotParam; 17]>(); //~ error `NotParam` can't be used as a const parameter type } diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.rs index 8b3d0546010dc..5db4350ec924f 100644 --- a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.rs +++ b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.rs @@ -8,10 +8,10 @@ struct NotParam; struct CantParam(NotParam); impl std::marker::UnsizedConstParamTy for CantParam {} -//~^ error: the trait `ConstParamTy_` cannot be implemented for this type +//~^ error the trait `ConstParamTy_` cannot be implemented for this type #[derive(std::marker::UnsizedConstParamTy, Eq, PartialEq)] -//~^ error: the trait `ConstParamTy_` cannot be implemented for this type +//~^ error the trait `ConstParamTy_` cannot be implemented for this type struct CantParamDerive(NotParam); fn main() {} diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs index 761a6387a24e9..2a717b53bcc44 100644 --- a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs +++ b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs @@ -8,11 +8,11 @@ impl std::marker::UnsizedConstParamTy for ImplementsConstParamTy {} struct CantParam(ImplementsConstParamTy); impl std::marker::UnsizedConstParamTy for CantParam {} -//~^ error: the type `CantParam` does not `#[derive(PartialEq)]` +//~^ error the type `CantParam` does not `#[derive(PartialEq)]` //~| the trait bound `CantParam: Eq` is not satisfied #[derive(std::marker::UnsizedConstParamTy)] -//~^ error: the type `CantParamDerive` does not `#[derive(PartialEq)]` +//~^ error the type `CantParamDerive` does not `#[derive(PartialEq)]` //~| the trait bound `CantParamDerive: Eq` is not satisfied struct CantParamDerive(ImplementsConstParamTy); diff --git a/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-1.rs b/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-1.rs index cea82722a0e60..6da47db6c4980 100644 --- a/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-1.rs +++ b/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-1.rs @@ -4,7 +4,7 @@ // Regression test for #118545 struct Checked; -//~^ ERROR: using function pointers as const generic parameters is forbidden +//~^ ERROR using function pointers as const generic parameters is forbidden fn foo() {} const _: Checked = Checked::; diff --git a/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.rs b/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.rs index 6b87ad86d4bc2..25df38ebccf86 100644 --- a/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.rs +++ b/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.rs @@ -6,14 +6,14 @@ fn function() {} struct Wrapper; -//~^ ERROR: using function pointers as const generic parameters is forbidden +//~^ ERROR using function pointers as const generic parameters is forbidden impl Wrapper<{ bar() }> { - //~^ ERROR: cannot find function `bar` in this scope + //~^ ERROR cannot find function `bar` in this scope fn call() {} } fn main() { Wrapper::::call; - //~^ ERROR: the function or associated item `call` exists for struct `Wrapper`, + //~^ ERROR the function or associated item `call` exists for struct `Wrapper`, } diff --git a/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-1.rs b/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-1.rs index a1ee1c4cdd585..918268240eb3e 100644 --- a/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-1.rs +++ b/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-1.rs @@ -6,6 +6,6 @@ use std::marker::UnsizedConstParamTy; struct Foo; impl UnsizedConstParamTy for &'static Foo {} -//~^ ERROR: the trait `ConstParamTy_` cannot be implemented for this type +//~^ ERROR the trait `ConstParamTy_` cannot be implemented for this type fn main() {} diff --git a/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-2.rs b/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-2.rs index ac1b522f469e1..db253665e9b35 100644 --- a/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-2.rs +++ b/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-2.rs @@ -9,7 +9,7 @@ use std::marker::UnsizedConstParamTy; struct ConstStrU(*const u8, usize); impl UnsizedConstParamTy for &'static ConstStrU {} -//~^ ERROR: the trait `ConstParamTy_` cannot be implemented for this type +//~^ ERROR the trait `ConstParamTy_` cannot be implemented for this type impl ConstStrU { const fn from_bytes(bytes: &'static [u8]) -> Self { diff --git a/tests/ui/const-generics/adt_const_params/suggest_feature_only_when_possible.rs b/tests/ui/const-generics/adt_const_params/suggest_feature_only_when_possible.rs index 33988bc067850..e3568422dd9fd 100644 --- a/tests/ui/const-generics/adt_const_params/suggest_feature_only_when_possible.rs +++ b/tests/ui/const-generics/adt_const_params/suggest_feature_only_when_possible.rs @@ -4,16 +4,16 @@ // Can never be used as const generics. fn uwu_0() {} -//~^ ERROR: forbidden as the type of a const generic -//~| HELP: add `#![feature(adt_const_params)]` -//~| HELP: add `#![feature(adt_const_params)]` -//~| HELP: add `#![feature(adt_const_params)]` -//~| HELP: add `#![feature(unsized_const_params)]` -//~| HELP: add `#![feature(unsized_const_params)]` +//~^ ERROR forbidden as the type of a const generic +//~| HELP add `#![feature(adt_const_params)]` +//~| HELP add `#![feature(adt_const_params)]` +//~| HELP add `#![feature(adt_const_params)]` +//~| HELP add `#![feature(unsized_const_params)]` +//~| HELP add `#![feature(unsized_const_params)]` // Needs the feature but can be used, so suggest adding the feature. fn owo_0() {} -//~^ ERROR: forbidden as the type of a const generic +//~^ ERROR forbidden as the type of a const generic // Can only be used in const generics with changes. struct Meow { @@ -21,23 +21,23 @@ struct Meow { } fn meow_0() {} -//~^ ERROR: forbidden as the type of a const generic +//~^ ERROR forbidden as the type of a const generic fn meow_1() {} -//~^ ERROR: forbidden as the type of a const generic +//~^ ERROR forbidden as the type of a const generic fn meow_2() {} -//~^ ERROR: forbidden as the type of a const generic +//~^ ERROR forbidden as the type of a const generic fn meow_3() {} -//~^ ERROR: forbidden as the type of a const generic +//~^ ERROR forbidden as the type of a const generic // This is suboptimal that it thinks it can be used // but better to suggest the feature to the user. fn meow_4() {} -//~^ ERROR: forbidden as the type of a const generic +//~^ ERROR forbidden as the type of a const generic // Non-local ADT that does not impl `ConstParamTy` fn nya_0() {} -//~^ ERROR: forbidden as the type of a const generic +//~^ ERROR forbidden as the type of a const generic fn nya_1>() {} -//~^ ERROR: forbidden as the type of a const generic +//~^ ERROR forbidden as the type of a const generic fn main() {} diff --git a/tests/ui/const-generics/adt_const_params/trait_objects_as_a_const_generic.rs b/tests/ui/const-generics/adt_const_params/trait_objects_as_a_const_generic.rs index b0934508399d5..85cf212338d06 100644 --- a/tests/ui/const-generics/adt_const_params/trait_objects_as_a_const_generic.rs +++ b/tests/ui/const-generics/adt_const_params/trait_objects_as_a_const_generic.rs @@ -6,7 +6,7 @@ use std::marker::UnsizedConstParamTy; trait Trait {} impl UnsizedConstParamTy for dyn Trait {} -//~^ ERROR: the trait `ConstParamTy` may not be implemented for this type +//~^ ERROR the trait `ConstParamTy` may not be implemented for this type fn foo() {} diff --git a/tests/ui/const-generics/adt_const_params/unsized_field-1.rs b/tests/ui/const-generics/adt_const_params/unsized_field-1.rs index f6e5bd6e355da..8b3d905e10219 100644 --- a/tests/ui/const-generics/adt_const_params/unsized_field-1.rs +++ b/tests/ui/const-generics/adt_const_params/unsized_field-1.rs @@ -6,15 +6,15 @@ extern crate unsized_const_param; use std::marker::ConstParamTy; #[derive(ConstParamTy, Eq, PartialEq)] -//~^ ERROR: the trait `ConstParamTy_` cannot be implemented for this type +//~^ ERROR the trait `ConstParamTy_` cannot be implemented for this type struct A([u8]); #[derive(ConstParamTy, Eq, PartialEq)] -//~^ ERROR: the trait `ConstParamTy_` cannot be implemented for this type +//~^ ERROR the trait `ConstParamTy_` cannot be implemented for this type struct B(&'static [u8]); #[derive(ConstParamTy, Eq, PartialEq)] -//~^ ERROR: the trait `ConstParamTy_` cannot be implemented for this type +//~^ ERROR the trait `ConstParamTy_` cannot be implemented for this type struct C(unsized_const_param::Foo); fn main() {} diff --git a/tests/ui/const-generics/adt_const_params/unsized_field-2.rs b/tests/ui/const-generics/adt_const_params/unsized_field-2.rs index e4a3a481b4e37..9693e1c661983 100644 --- a/tests/ui/const-generics/adt_const_params/unsized_field-2.rs +++ b/tests/ui/const-generics/adt_const_params/unsized_field-2.rs @@ -1,11 +1,11 @@ //@ aux-build:unsized_const_param.rs #![feature(adt_const_params, unsized_const_params)] -//~^ WARN: the feature `unsized_const_params` is incomplete +//~^ WARN the feature `unsized_const_params` is incomplete extern crate unsized_const_param; #[derive(std::marker::ConstParamTy, Eq, PartialEq)] -//~^ ERROR: the trait `ConstParamTy_` cannot be implemented for this type +//~^ ERROR the trait `ConstParamTy_` cannot be implemented for this type struct A(unsized_const_param::GenericNotUnsizedParam<&'static [u8]>); #[derive(std::marker::UnsizedConstParamTy, Eq, PartialEq)] diff --git a/tests/ui/const-generics/assoc_const_as_type_argument.rs b/tests/ui/const-generics/assoc_const_as_type_argument.rs index ffc7f116a94ef..ffcbda1b659ed 100644 --- a/tests/ui/const-generics/assoc_const_as_type_argument.rs +++ b/tests/ui/const-generics/assoc_const_as_type_argument.rs @@ -6,8 +6,8 @@ fn bar() {} fn foo() { bar::<::ASSOC>(); - //~^ ERROR: expected associated type, found associated constant `Trait::ASSOC` - //~| ERROR: unresolved item provided when a constant was expected + //~^ ERROR expected associated type, found associated constant `Trait::ASSOC` + //~| ERROR unresolved item provided when a constant was expected } fn main() {} diff --git a/tests/ui/const-generics/bad-subst-const-kind.rs b/tests/ui/const-generics/bad-subst-const-kind.rs index cc2ff9b8dea07..6795b55f34d0e 100644 --- a/tests/ui/const-generics/bad-subst-const-kind.rs +++ b/tests/ui/const-generics/bad-subst-const-kind.rs @@ -6,11 +6,11 @@ trait Q { } impl Q for [u8; N] { - //~^ ERROR: the constant `N` is not of type `usize` + //~^ ERROR the constant `N` is not of type `usize` const ASSOC: usize = 1; } pub fn test() -> [u8; <[u8; 13] as Q>::ASSOC] { - //~^ ERROR: the constant `13` is not of type `u64` + //~^ ERROR the constant `13` is not of type `u64` todo!() } diff --git a/tests/ui/const-generics/const-param-type-depends-on-type-param.rs b/tests/ui/const-generics/const-param-type-depends-on-type-param.rs index 5503b08930b00..bfe2e2882396b 100644 --- a/tests/ui/const-generics/const-param-type-depends-on-type-param.rs +++ b/tests/ui/const-generics/const-param-type-depends-on-type-param.rs @@ -9,7 +9,7 @@ // We may want to lift this restriction in the future. pub struct Dependent([(); X]); -//~^ ERROR: the type of const parameters must not depend on other generic parameters -//~| ERROR: type parameter `T` is never used +//~^ ERROR the type of const parameters must not depend on other generic parameters +//~| ERROR type parameter `T` is never used fn main() {} diff --git a/tests/ui/const-generics/defaults/generic-expr-default-concrete.rs b/tests/ui/const-generics/defaults/generic-expr-default-concrete.rs index f082bd8d2e9ff..f2d3be09fe140 100644 --- a/tests/ui/const-generics/defaults/generic-expr-default-concrete.rs +++ b/tests/ui/const-generics/defaults/generic-expr-default-concrete.rs @@ -8,7 +8,7 @@ fn no_constraining() -> Foo<10> { pub fn different_than_default() -> Foo<10> { Foo::<10, 12> - //~^ error: mismatched types + //~^ error mismatched types } fn main() {} diff --git a/tests/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs b/tests/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs index 777865d1cb6a1..8ac185c30dbe2 100644 --- a/tests/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs +++ b/tests/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs @@ -10,7 +10,7 @@ where [(); { N + 1 }]:, [(); { N + 2 }]:, { Foo:: - //~^ error: mismatched types + //~^ error mismatched types } fn main() {} diff --git a/tests/ui/const-generics/defaults/generic-expr-default.rs b/tests/ui/const-generics/defaults/generic-expr-default.rs index 8fe43feb78ac8..64089aac36426 100644 --- a/tests/ui/const-generics/defaults/generic-expr-default.rs +++ b/tests/ui/const-generics/defaults/generic-expr-default.rs @@ -3,7 +3,7 @@ pub struct Foo; pub fn needs_evaluatable_bound() -> Foo { - //~^ error: unconstrained generic constant + //~^ error unconstrained generic constant loop {} } pub fn has_evaluatable_bound() -> Foo where [(); N1 + 1]: { @@ -13,7 +13,7 @@ pub fn has_evaluatable_bound() -> Foo where [(); N1 + 1]: { type FooAlias = [(); NP]; fn needs_evaluatable_bound_alias() -> FooAlias { - //~^^ error: unconstrained generic constant + //~^^ error unconstrained generic constant todo!() } fn has_evaluatable_bound_alias() -> FooAlias diff --git a/tests/ui/const-generics/defaults/mismatch.rs b/tests/ui/const-generics/defaults/mismatch.rs index ec131505ed755..08739683a88ef 100644 --- a/tests/ui/const-generics/defaults/mismatch.rs +++ b/tests/ui/const-generics/defaults/mismatch.rs @@ -5,18 +5,18 @@ pub struct Example4; fn main() { let e: Example<13> = (); - //~^ Error: mismatched types + //~^ Error mismatched types //~| expected struct `Example` let e: Example2 = (); - //~^ Error: mismatched types + //~^ Error mismatched types //~| expected struct `Example2` let e: Example3<13, u32> = (); - //~^ Error: mismatched types + //~^ Error mismatched types //~| expected struct `Example3` let e: Example3<7> = (); - //~^ Error: mismatched types + //~^ Error mismatched types //~| expected struct `Example3<7>` let e: Example4<7> = (); - //~^ Error: mismatched types + //~^ Error mismatched types //~| expected struct `Example4<7>` } diff --git a/tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.rs b/tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.rs index 9eb33acbb24d1..13629d479df5e 100644 --- a/tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.rs +++ b/tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.rs @@ -3,7 +3,7 @@ trait Trait { } impl Trait for () { fn foo() {} - //~^ error: associated function `foo` has an incompatible generic parameter for trait + //~^ error associated function `foo` has an incompatible generic parameter for trait } trait Other { @@ -11,7 +11,7 @@ trait Other { } impl Other for () { fn bar() {} - //~^ error: associated function `bar` has an incompatible generic parameter for trait + //~^ error associated function `bar` has an incompatible generic parameter for trait } trait Uwu { @@ -19,7 +19,7 @@ trait Uwu { } impl Uwu for () { fn baz() {} - //~^ error: associated function `baz` has an incompatible generic parameter for trait + //~^ error associated function `baz` has an incompatible generic parameter for trait } trait Aaaaaa { @@ -27,7 +27,7 @@ trait Aaaaaa { } impl Aaaaaa for () { fn bbbb() {} - //~^ error: associated function `bbbb` has an incompatible generic parameter for trait + //~^ error associated function `bbbb` has an incompatible generic parameter for trait } trait Names { @@ -35,7 +35,7 @@ trait Names { } impl Names for () { fn abcd() {} - //~^ error: associated function `abcd` has an incompatible generic parameter for trait + //~^ error associated function `abcd` has an incompatible generic parameter for trait } fn main() {} diff --git a/tests/ui/const-generics/defaults/rp_impl_trait_fail.rs b/tests/ui/const-generics/defaults/rp_impl_trait_fail.rs index ba41bf38a3379..5baea94c09b0d 100644 --- a/tests/ui/const-generics/defaults/rp_impl_trait_fail.rs +++ b/tests/ui/const-generics/defaults/rp_impl_trait_fail.rs @@ -4,7 +4,7 @@ trait Trait {} impl Trait for Uwu {} fn rawr() -> impl Trait { - //~^ error: the trait bound `Uwu<10, 12>: Trait` is not satisfied + //~^ error the trait bound `Uwu<10, 12>: Trait` is not satisfied Uwu::<10, 12> } @@ -14,17 +14,17 @@ impl Traitor for u32 {} impl Traitor<1, 2> for u64 {} fn uwu() -> impl Traitor { - //~^ error: the trait bound `u32: Traitor` is not satisfied + //~^ error the trait bound `u32: Traitor` is not satisfied 1_u32 } fn owo() -> impl Traitor { - //~^ error: the trait bound `u64: Traitor` is not satisfied + //~^ error the trait bound `u64: Traitor` is not satisfied 1_u64 } fn main() { rawr(); - uwu(); //~ ERROR: type annotations needed + uwu(); //~ ERROR type annotations needed owo(); } diff --git a/tests/ui/const-generics/defaults/trait_objects_fail.rs b/tests/ui/const-generics/defaults/trait_objects_fail.rs index 6ab803f990920..4eaa4137967fc 100644 --- a/tests/ui/const-generics/defaults/trait_objects_fail.rs +++ b/tests/ui/const-generics/defaults/trait_objects_fail.rs @@ -24,7 +24,7 @@ fn bar(arg: &dyn Traitor) -> u8 { fn main() { foo(&10_u32); - //~^ error: the trait bound `u32: Trait` is not satisfied + //~^ error the trait bound `u32: Trait` is not satisfied bar(&true); - //~^ error: the trait bound `bool: Traitor<_>` is not satisfied + //~^ error the trait bound `bool: Traitor<_>` is not satisfied } diff --git a/tests/ui/const-generics/defaults/wfness.rs b/tests/ui/const-generics/defaults/wfness.rs index a93f670815a03..1da76792ca547 100644 --- a/tests/ui/const-generics/defaults/wfness.rs +++ b/tests/ui/const-generics/defaults/wfness.rs @@ -1,12 +1,12 @@ struct Ooopsies; -//~^ error: evaluation of constant value failed +//~^ error evaluation of constant value failed trait Trait {} impl Trait<3> for () {} struct WhereClause where (): Trait; -//~^ error: the trait bound `(): Trait<2>` is not satisfied +//~^ error the trait bound `(): Trait<2>` is not satisfied trait Traitor {} struct WhereClauseTooGeneric(T) @@ -16,7 +16,7 @@ where // no error on struct def struct DependentDefaultWfness>(T); fn foo() -> DependentDefaultWfness { - //~^ error: the trait bound `(): Trait<1>` is not satisfied + //~^ error the trait bound `(): Trait<1>` is not satisfied loop {} } diff --git a/tests/ui/const-generics/defaults/wrong-order.rs b/tests/ui/const-generics/defaults/wrong-order.rs index d53d56f41e666..ee944b837b36f 100644 --- a/tests/ui/const-generics/defaults/wrong-order.rs +++ b/tests/ui/const-generics/defaults/wrong-order.rs @@ -4,6 +4,6 @@ struct A { } struct Foo(T); -//~^ error: generic parameters with a default must be trailing +//~^ error generic parameters with a default must be trailing fn main() {} diff --git a/tests/ui/const-generics/dont-evaluate-array-len-on-err-1.rs b/tests/ui/const-generics/dont-evaluate-array-len-on-err-1.rs index 6c4ee1af210ba..134460cab8fc4 100644 --- a/tests/ui/const-generics/dont-evaluate-array-len-on-err-1.rs +++ b/tests/ui/const-generics/dont-evaluate-array-len-on-err-1.rs @@ -13,7 +13,7 @@ trait Foo { [Adt; std::mem::size_of::()]: , { <[Adt; std::mem::size_of::()] as Foo>::bar() - //~^ Error: the trait bound + //~^ Error the trait bound } fn bar() {} diff --git a/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-2.rs b/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-2.rs index bce7ac5708a59..e60dff0023d63 100644 --- a/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-2.rs +++ b/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-2.rs @@ -5,13 +5,13 @@ macro_rules! y { ( $($matcher:tt)*) => { x - //~^ ERROR: cannot find value `x` in this scope + //~^ ERROR cannot find value `x` in this scope }; } const _: A< - //~^ ERROR: free constant item without body - //~| ERROR: cannot find type `A` in this scope + //~^ ERROR free constant item without body + //~| ERROR cannot find type `A` in this scope { y! { test.tou8 } }, diff --git a/tests/ui/const-generics/early/trivial-const-arg-macro-braced-expansion.rs b/tests/ui/const-generics/early/trivial-const-arg-macro-braced-expansion.rs index 33630205369f0..b9e7253614b2a 100644 --- a/tests/ui/const-generics/early/trivial-const-arg-macro-braced-expansion.rs +++ b/tests/ui/const-generics/early/trivial-const-arg-macro-braced-expansion.rs @@ -8,7 +8,7 @@ struct A; fn foo() -> A<{ y!() }> { A::<1> - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } fn main() {} diff --git a/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces-2.rs b/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces-2.rs index 5a9e62561dc99..f7efdefa140e1 100644 --- a/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces-2.rs +++ b/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces-2.rs @@ -1,7 +1,7 @@ macro_rules! y { () => { N - //~^ ERROR: generic parameters may not be used in const operations + //~^ ERROR generic parameters may not be used in const operations }; } diff --git a/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces.rs b/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces.rs index 45c0768dde44a..fd1b5bccb3ec4 100644 --- a/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces.rs +++ b/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces.rs @@ -2,7 +2,7 @@ macro_rules! y { () => { { N } - //~^ ERROR: generic parameters may not be used in const operations + //~^ ERROR generic parameters may not be used in const operations }; } diff --git a/tests/ui/const-generics/early/trivial-const-arg-nested-braces.rs b/tests/ui/const-generics/early/trivial-const-arg-nested-braces.rs index 941ba6bfea785..ab2d9c568c91e 100644 --- a/tests/ui/const-generics/early/trivial-const-arg-nested-braces.rs +++ b/tests/ui/const-generics/early/trivial-const-arg-nested-braces.rs @@ -2,7 +2,7 @@ struct A; #[rustfmt::skip] fn foo() -> A<{ { N } }> { - //~^ ERROR: generic parameters may not be used in const operations + //~^ ERROR generic parameters may not be used in const operations A::<1> } diff --git a/tests/ui/const-generics/ensure_is_evaluatable.rs b/tests/ui/const-generics/ensure_is_evaluatable.rs index 1e8d8c3d3559b..e3f4a0e161d8e 100644 --- a/tests/ui/const-generics/ensure_is_evaluatable.rs +++ b/tests/ui/const-generics/ensure_is_evaluatable.rs @@ -7,7 +7,7 @@ where [(); M + 1]:, { bar() - //~^ ERROR: unconstrained + //~^ ERROR unconstrained } fn bar() -> [(); N] diff --git a/tests/ui/const-generics/failing_goal_with_repeat_expr_anon_const.rs b/tests/ui/const-generics/failing_goal_with_repeat_expr_anon_const.rs index 346ef64a8a6c1..8df584078fcbf 100644 --- a/tests/ui/const-generics/failing_goal_with_repeat_expr_anon_const.rs +++ b/tests/ui/const-generics/failing_goal_with_repeat_expr_anon_const.rs @@ -12,9 +12,9 @@ pub trait T { fn a() { [0u8; std::mem::size_of::()] == Self::P; - //~^ ERROR: can't compare - //~| ERROR: constant expression depends on a generic parameter - //~| ERROR: constant expression depends on a generic parameter + //~^ ERROR can't compare + //~| ERROR constant expression depends on a generic parameter + //~| ERROR constant expression depends on a generic parameter } } diff --git a/tests/ui/const-generics/fn-const-param-call.rs b/tests/ui/const-generics/fn-const-param-call.rs index d536c24023928..0f8bd03989664 100644 --- a/tests/ui/const-generics/fn-const-param-call.rs +++ b/tests/ui/const-generics/fn-const-param-call.rs @@ -10,10 +10,10 @@ fn function() -> u32 { 17 } -struct Wrapper u32>; //~ ERROR: using function pointers as const generic parameters +struct Wrapper u32>; //~ ERROR using function pointers as const generic parameters impl u32> Wrapper { - //~^ ERROR: using function pointers as const generic parameters + //~^ ERROR using function pointers as const generic parameters fn call() -> u32 { F() } diff --git a/tests/ui/const-generics/fn-const-param-infer.rs b/tests/ui/const-generics/fn-const-param-infer.rs index 5f1958df26e05..2bf49bb8a96ee 100644 --- a/tests/ui/const-generics/fn-const-param-infer.rs +++ b/tests/ui/const-generics/fn-const-param-infer.rs @@ -6,7 +6,7 @@ #![cfg_attr(adt_const_params, allow(incomplete_features))] struct Checked bool>; -//~^ ERROR: using function pointers as const generic parameters +//~^ ERROR using function pointers as const generic parameters fn not_one(val: usize) -> bool { val != 1 @@ -30,9 +30,9 @@ fn main() { let _ = Checked::; let _ = Checked::<{ generic_arg:: }>; - let _ = Checked::<{ generic_arg:: }>; //~ ERROR: mismatched types + let _ = Checked::<{ generic_arg:: }>; //~ ERROR mismatched types - let _ = Checked::; //~ ERROR: type annotations needed + let _ = Checked::; //~ ERROR type annotations needed let _ = Checked::<{ generic:: }>; let _: Checked<{ generic:: }> = Checked::<{ generic:: }>; let _: Checked<{ generic:: }> = Checked::<{ generic:: }>; diff --git a/tests/ui/const-generics/fn_with_two_const_inputs.rs b/tests/ui/const-generics/fn_with_two_const_inputs.rs index 0d6246a9f02c3..d47220532c040 100644 --- a/tests/ui/const-generics/fn_with_two_const_inputs.rs +++ b/tests/ui/const-generics/fn_with_two_const_inputs.rs @@ -10,7 +10,7 @@ where [(); both(N + 1, M + 1)]:, { bar() - //~^ ERROR: unconstrained generic constant + //~^ ERROR unconstrained generic constant } fn bar() -> [(); N] diff --git a/tests/ui/const-generics/generic_arg_infer/issue-91614.rs b/tests/ui/const-generics/generic_arg_infer/issue-91614.rs index a386b1e5c2bf5..e510f7660e05a 100644 --- a/tests/ui/const-generics/generic_arg_infer/issue-91614.rs +++ b/tests/ui/const-generics/generic_arg_infer/issue-91614.rs @@ -4,6 +4,6 @@ use std::simd::Mask; fn main() { let y = Mask::<_, _>::splat(false); - //~^ ERROR: type annotations needed + //~^ ERROR type annotations needed //~| ERROR type annotations needed } diff --git a/tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.rs b/tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.rs index 7561ae2febbdf..38fd99f871aa8 100644 --- a/tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.rs +++ b/tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.rs @@ -15,15 +15,15 @@ where // errors are bad but seems to be pre-existing issue #86198 assert_impl::>(); - //~^ Error: mismatched types - //~^^ Error: unconstrained generic constant + //~^ Error mismatched types + //~^^ Error unconstrained generic constant assert_impl::>(); - //~^ Error: mismatched types - //~^^ Error: unconstrained generic constant + //~^ Error mismatched types + //~^^ Error unconstrained generic constant assert_impl::>(); - //~^ Error: mismatched types + //~^ Error mismatched types assert_impl::>(); - //~^ Error: mismatched types + //~^ Error mismatched types } pub fn use_trait_impl_2() where @@ -33,15 +33,15 @@ where // errors are bad but seems to be pre-existing issue #86198 assert_impl::>(); - //~^ Error: mismatched types - //~^^ Error: unconstrained generic constant + //~^ Error mismatched types + //~^^ Error unconstrained generic constant assert_impl::>(); - //~^ Error: mismatched types - //~^^ Error: unconstrained generic constant + //~^ Error mismatched types + //~^^ Error unconstrained generic constant assert_impl::>(); - //~^ Error: mismatched types + //~^ Error mismatched types assert_impl::>(); - //~^ Error: mismatched types + //~^ Error mismatched types } fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/abstract-consts-as-cast-5.rs b/tests/ui/const-generics/generic_const_exprs/abstract-consts-as-cast-5.rs index 916d60c0e0def..81c99acd07081 100644 --- a/tests/ui/const-generics/generic_const_exprs/abstract-consts-as-cast-5.rs +++ b/tests/ui/const-generics/generic_const_exprs/abstract-consts-as-cast-5.rs @@ -3,7 +3,7 @@ fn foo(a: [(); N as usize]) { bar::<{ N as usize as usize }>(); - //~^ error: unconstrained generic constant + //~^ error unconstrained generic constant } fn bar() {} diff --git a/tests/ui/const-generics/generic_const_exprs/adt_wf_hang.rs b/tests/ui/const-generics/generic_const_exprs/adt_wf_hang.rs index 5d538d2679dd8..c0ec5e6621f73 100644 --- a/tests/ui/const-generics/generic_const_exprs/adt_wf_hang.rs +++ b/tests/ui/const-generics/generic_const_exprs/adt_wf_hang.rs @@ -9,6 +9,6 @@ struct U; struct S() where S<{ U }>:; -//~^ ERROR: overflow evaluating the requirement `S<{ U }> well-formed` +//~^ ERROR overflow evaluating the requirement `S<{ U }> well-formed` fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.rs b/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.rs index c8f7553da7982..1682e86eaea08 100644 --- a/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.rs +++ b/tests/ui/const-generics/generic_const_exprs/assoc_const_unification/doesnt_unify_evaluatable.rs @@ -7,7 +7,7 @@ trait Trait { fn foo() where [(); U::ASSOC]:, { bar::<{ T::ASSOC }>(); - //~^ ERROR: unconstrained generic constant + //~^ ERROR unconstrained generic constant } fn bar() {} diff --git a/tests/ui/const-generics/generic_const_exprs/const-block-is-poly.rs b/tests/ui/const-generics/generic_const_exprs/const-block-is-poly.rs index f1305202ad452..27e4e5789791a 100644 --- a/tests/ui/const-generics/generic_const_exprs/const-block-is-poly.rs +++ b/tests/ui/const-generics/generic_const_exprs/const-block-is-poly.rs @@ -3,7 +3,7 @@ fn foo() { let _ = [0u8; const { std::mem::size_of::() }]; - //~^ ERROR: overly complex generic constant + //~^ ERROR overly complex generic constant } fn main() { diff --git a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.rs b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.rs index e575d0dc9b405..41810199df465 100644 --- a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.rs +++ b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.rs @@ -15,12 +15,12 @@ where [(); (L - 1) + 1 + L]:, { foo::<_, L>([(); L + 1 + L]); - //~^ ERROR: mismatched types - //~^^ ERROR: unconstrained generic constant - //~^^^ ERROR: function takes 1 generic argument but 2 generic arguments were supplied - //~^^^^ ERROR: unconstrained generic constant - //~^^^^^ ERROR: unconstrained generic constant `L + 1 + L` - //~^^^^^^ ERROR: unconstrained generic constant `L + 1` + //~^ ERROR mismatched types + //~^^ ERROR unconstrained generic constant + //~^^^ ERROR function takes 1 generic argument but 2 generic arguments were supplied + //~^^^^ ERROR unconstrained generic constant + //~^^^^^ ERROR unconstrained generic constant `L + 1 + L` + //~^^^^^^ ERROR unconstrained generic constant `L + 1` } fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/relate_binop_arg_tys.rs b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/relate_binop_arg_tys.rs index fd52fc3554129..20cde5e4ed4e5 100644 --- a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/relate_binop_arg_tys.rs +++ b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/relate_binop_arg_tys.rs @@ -11,8 +11,8 @@ const fn make_generic(_: usize, a: bool) -> bool { fn foo() -> Bar<{ make_generic(N, true == false) }> { Bar::<{ make_generic(N, 1_u8 == 0_u8) }> - //~^ error: mismatched types - //~| error: unconstrained generic constant + //~^ error mismatched types + //~| error unconstrained generic constant } fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/relate_cast_arg_ty.rs b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/relate_cast_arg_ty.rs index bef9d4b9e996f..0d26cc769e043 100644 --- a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/relate_cast_arg_ty.rs +++ b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/relate_cast_arg_ty.rs @@ -5,8 +5,8 @@ fn foo() -> [(); (true as usize) + N] { [(); (1_u8 as usize) + N] - //~^ error: mismatched types - //~| error: unconstrained generic constant + //~^ error mismatched types + //~| error unconstrained generic constant } fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.rs b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.rs index 6093fc70b1696..5935cde1c2c49 100644 --- a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.rs +++ b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/wf_obligation.rs @@ -15,8 +15,8 @@ where [(); (L - 1) + 1 + L]:, { foo::<_, L>([(); L + 1 + L]); - //~^ ERROR: mismatched types - //~^^ ERROR: unconstrained generic constant + //~^ ERROR mismatched types + //~^^ ERROR unconstrained generic constant } fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/error_in_ty.rs b/tests/ui/const-generics/generic_const_exprs/error_in_ty.rs index 29ad935c0149c..89ba20d6f4c32 100644 --- a/tests/ui/const-generics/generic_const_exprs/error_in_ty.rs +++ b/tests/ui/const-generics/generic_const_exprs/error_in_ty.rs @@ -4,17 +4,17 @@ #![allow(incomplete_features)] pub struct A {} -//~^ ERROR: cannot find value `x` in this scope -//~| ERROR: `[usize; x]` is forbidden as the type of a const generic parameter +//~^ ERROR cannot find value `x` in this scope +//~| ERROR `[usize; x]` is forbidden as the type of a const generic parameter impl A<2> { - //~^ ERROR: mismatched types + //~^ ERROR mismatched types pub const fn B() {} - //~^ ERROR: duplicate definitions + //~^ ERROR duplicate definitions } impl A<2> { - //~^ ERROR: mismatched types + //~^ ERROR mismatched types pub const fn B() {} } diff --git a/tests/ui/const-generics/generic_const_exprs/issue-105257.rs b/tests/ui/const-generics/generic_const_exprs/issue-105257.rs index a107556fd79dd..3f47fdbbbf976 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-105257.rs +++ b/tests/ui/const-generics/generic_const_exprs/issue-105257.rs @@ -3,7 +3,7 @@ trait Trait { fn fnc(&self) {} //~ERROR defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions - //~^ ERROR: mismatched types + //~^ ERROR mismatched types fn foo() }>(&self) {} //~ERROR defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions } diff --git a/tests/ui/const-generics/generic_const_exprs/issue-105608.rs b/tests/ui/const-generics/generic_const_exprs/issue-105608.rs index e28ba3b1adab6..fcb4dbd0876e6 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-105608.rs +++ b/tests/ui/const-generics/generic_const_exprs/issue-105608.rs @@ -11,5 +11,5 @@ impl Combination { pub fn main() { Combination::<0>.and::<_>().and::<_>(); - //~^ ERROR: type annotations needed + //~^ ERROR type annotations needed } diff --git a/tests/ui/const-generics/generic_const_exprs/issue-109141.rs b/tests/ui/const-generics/generic_const_exprs/issue-109141.rs index 5303b24717353..5184b6103a7c4 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-109141.rs +++ b/tests/ui/const-generics/generic_const_exprs/issue-109141.rs @@ -8,6 +8,6 @@ impl EntriesBuffer { } struct EntriesBuffer(Box<[[u8; HashesEntryLEN]; 5]>); -//~^ ERROR: cannot find value `HashesEntryLEN` in this scope +//~^ ERROR cannot find value `HashesEntryLEN` in this scope fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/issue-62504.rs b/tests/ui/const-generics/generic_const_exprs/issue-62504.rs index f021e1036143b..33c11d374f81a 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-62504.rs +++ b/tests/ui/const-generics/generic_const_exprs/issue-62504.rs @@ -24,6 +24,6 @@ impl ArrayHolder { fn main() { let mut array = ArrayHolder::new(); - //~^ ERROR: type annotations needed + //~^ ERROR type annotations needed //~| ERROR type annotations needed } diff --git a/tests/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs b/tests/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs index 2fa9a71fbb33c..c5ce658586949 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs +++ b/tests/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs @@ -14,7 +14,7 @@ trait Foo { [(); std::mem::size_of::()]: , { Self::AssocInstance == [(); std::mem::size_of::()]; - //~^ Error: mismatched types + //~^ Error mismatched types } } diff --git a/tests/ui/const-generics/generic_const_exprs/issue-83765.rs b/tests/ui/const-generics/generic_const_exprs/issue-83765.rs index fac811d1302fa..03b0e5cf7562f 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-83765.rs +++ b/tests/ui/const-generics/generic_const_exprs/issue-83765.rs @@ -28,10 +28,10 @@ impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> TensorSi for BMap<'a, R, T, F, DIM> { fn size(&self) -> [usize; DIM] { - //~^ ERROR: method not compatible with trait [E0308] + //~^ ERROR method not compatible with trait [E0308] self.reference.size() - //~^ ERROR: unconstrained generic constant - //~| ERROR: mismatched types + //~^ ERROR unconstrained generic constant + //~| ERROR mismatched types } } diff --git a/tests/ui/const-generics/generic_const_exprs/issue-85848.rs b/tests/ui/const-generics/generic_const_exprs/issue-85848.rs index 3a7f4c6184cf1..e5f68ddee2895 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-85848.rs +++ b/tests/ui/const-generics/generic_const_exprs/issue-85848.rs @@ -22,9 +22,9 @@ impl Contains() }> for U where T: _Contains {} fn writes_to_path(cap: &C) { writes_to_specific_path(&cap); - //~^ ERROR: the trait bound `(): _Contains<&C>` is not satisfied [E0277] - //~| ERROR: unconstrained generic constant - //~| ERROR: mismatched types [E0308] + //~^ ERROR the trait bound `(): _Contains<&C>` is not satisfied [E0277] + //~| ERROR unconstrained generic constant + //~| ERROR mismatched types [E0308] } fn writes_to_specific_path>(cap: &C) {} diff --git a/tests/ui/const-generics/generic_const_exprs/lit_type_mismatch.rs b/tests/ui/const-generics/generic_const_exprs/lit_type_mismatch.rs index 1ed0965e1bde1..7b7678e3da9b6 100644 --- a/tests/ui/const-generics/generic_const_exprs/lit_type_mismatch.rs +++ b/tests/ui/const-generics/generic_const_exprs/lit_type_mismatch.rs @@ -9,13 +9,13 @@ #![allow(incomplete_features)] struct A(C); -//~^ ERROR: generic parameters with a default must be trailing -//~| ERROR: mismatched types +//~^ ERROR generic parameters with a default must be trailing +//~| ERROR mismatched types struct Cond; struct Thing>(T); -//~^ ERROR: mismatched types +//~^ ERROR mismatched types impl Thing {} diff --git a/tests/ui/const-generics/generic_const_exprs/no_where_clause.rs b/tests/ui/const-generics/generic_const_exprs/no_where_clause.rs index 53230469491d3..fe1a4f7aebcca 100644 --- a/tests/ui/const-generics/generic_const_exprs/no_where_clause.rs +++ b/tests/ui/const-generics/generic_const_exprs/no_where_clause.rs @@ -16,8 +16,8 @@ impl Example { Self { a: [0.; N], b: [0.; complex_maths(N)], - //~^ ERROR: unconstrained generic constant - //~| ERROR: unconstrained generic constant + //~^ ERROR unconstrained generic constant + //~| ERROR unconstrained generic constant } } } diff --git a/tests/ui/const-generics/generic_const_exprs/non_local_anon_const_diagnostics.rs b/tests/ui/const-generics/generic_const_exprs/non_local_anon_const_diagnostics.rs index 12c1df0e337d9..ab148e62e52f2 100644 --- a/tests/ui/const-generics/generic_const_exprs/non_local_anon_const_diagnostics.rs +++ b/tests/ui/const-generics/generic_const_exprs/non_local_anon_const_diagnostics.rs @@ -10,7 +10,7 @@ where [(); M + 1]:, { let _: anon_const_non_local::Foo<2> = anon_const_non_local::foo::(); - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/unresolved_lifetimes_error.rs b/tests/ui/const-generics/generic_const_exprs/unresolved_lifetimes_error.rs index 96aeec77c1300..f4b9d7393ee85 100644 --- a/tests/ui/const-generics/generic_const_exprs/unresolved_lifetimes_error.rs +++ b/tests/ui/const-generics/generic_const_exprs/unresolved_lifetimes_error.rs @@ -3,7 +3,7 @@ fn foo() -> [(); { let a: &'a (); - //~^ ERROR: use of undeclared lifetime name `'a` + //~^ ERROR use of undeclared lifetime name `'a` 10_usize }] { loop {} diff --git a/tests/ui/const-generics/generic_const_parameter_types/bad_inference.rs b/tests/ui/const-generics/generic_const_parameter_types/bad_inference.rs index de2e687e870c4..f42edd676393f 100644 --- a/tests/ui/const-generics/generic_const_parameter_types/bad_inference.rs +++ b/tests/ui/const-generics/generic_const_parameter_types/bad_inference.rs @@ -15,9 +15,9 @@ fn foo() -> [T; N] { fn main() { // Requires inferring `T`/`N` from `12_u8` and `2` respectively. let a = foo::<_, _, { [12_u8; 2] }>(); - //~^ ERROR: anonymous constants with inferred types are not yet supported + //~^ ERROR anonymous constants with inferred types are not yet supported // Requires inferring `T`/`N`/`12_?i`/`_` from `[u8; 2]` let b: [u8; 2] = foo::<_, _, { [12; _] }>(); - //~^ ERROR: anonymous constants with inferred types are not yet supported + //~^ ERROR anonymous constants with inferred types are not yet supported } diff --git a/tests/ui/const-generics/generic_const_parameter_types/forward_declared_type.rs b/tests/ui/const-generics/generic_const_parameter_types/forward_declared_type.rs index 2abf7f44e2030..0bb71e4903138 100644 --- a/tests/ui/const-generics/generic_const_parameter_types/forward_declared_type.rs +++ b/tests/ui/const-generics/generic_const_parameter_types/forward_declared_type.rs @@ -4,8 +4,8 @@ use std::marker::PhantomData; struct UsesConst; -//~^ ERROR: const parameter types cannot reference parameters before they are declared +//~^ ERROR const parameter types cannot reference parameters before they are declared struct UsesType(PhantomData); -//~^ ERROR: const parameter types cannot reference parameters before they are declared +//~^ ERROR const parameter types cannot reference parameters before they are declared fn main() {} diff --git a/tests/ui/const-generics/generic_const_parameter_types/lifetime_dependent_const_param.rs b/tests/ui/const-generics/generic_const_parameter_types/lifetime_dependent_const_param.rs index 6b81ca743aa7c..9a0f2eae8b186 100644 --- a/tests/ui/const-generics/generic_const_parameter_types/lifetime_dependent_const_param.rs +++ b/tests/ui/const-generics/generic_const_parameter_types/lifetime_dependent_const_param.rs @@ -5,15 +5,15 @@ fn foo<'a, const N: &'a u32>() {} fn bar() { foo::<'static, { &1_u32 }>(); - //~^ ERROR: anonymous constants with lifetimes in their type are not yet supported + //~^ ERROR anonymous constants with lifetimes in their type are not yet supported foo::<'_, { &1_u32 }>(); - //~^ ERROR: anonymous constants with lifetimes in their type are not yet supported + //~^ ERROR anonymous constants with lifetimes in their type are not yet supported } fn borrowck<'a, const N: &'static u32, const M: &'a u32>() { foo::<'a, M>(); foo::<'static, M>(); - //~^ ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough foo::<'static, N>(); } diff --git a/tests/ui/const-generics/generic_const_parameter_types/mismatched_args_with_value.rs b/tests/ui/const-generics/generic_const_parameter_types/mismatched_args_with_value.rs index df8a057b335a2..e4cf23f103279 100644 --- a/tests/ui/const-generics/generic_const_parameter_types/mismatched_args_with_value.rs +++ b/tests/ui/const-generics/generic_const_parameter_types/mismatched_args_with_value.rs @@ -8,8 +8,8 @@ fn bar() {} fn main() { foo::<3, { [1; 2] }>(); - //~^ ERROR: mismatched type + //~^ ERROR mismatched type bar::(); - //~^ ERROR: mismatched type + //~^ ERROR mismatched type } diff --git a/tests/ui/const-generics/generic_const_parameter_types/no_const_param_ty_bound.rs b/tests/ui/const-generics/generic_const_parameter_types/no_const_param_ty_bound.rs index 1a5ab46cda19a..25ca518d4a764 100644 --- a/tests/ui/const-generics/generic_const_parameter_types/no_const_param_ty_bound.rs +++ b/tests/ui/const-generics/generic_const_parameter_types/no_const_param_ty_bound.rs @@ -4,6 +4,6 @@ use std::marker::{ConstParamTy_, PhantomData}; struct UsesType(PhantomData); -//~^ ERROR: `[T; N]` can't be used as a const parameter type +//~^ ERROR `[T; N]` can't be used as a const parameter type fn main() {} diff --git a/tests/ui/const-generics/invalid-enum.rs b/tests/ui/const-generics/invalid-enum.rs index fcfad300c44e5..9652611f061de 100644 --- a/tests/ui/const-generics/invalid-enum.rs +++ b/tests/ui/const-generics/invalid-enum.rs @@ -21,17 +21,17 @@ impl Example { pub fn main() { test_1::(); - //~^ ERROR: expected type, found variant - //~| ERROR: unresolved item provided when a constant was expected + //~^ ERROR expected type, found variant + //~| ERROR unresolved item provided when a constant was expected test_2::<_, CompileFlag::A>(0); - //~^ ERROR: expected type, found variant - //~| ERROR: unresolved item provided when a constant was expected + //~^ ERROR expected type, found variant + //~| ERROR unresolved item provided when a constant was expected let _: Example = Example { x: 0 }; - //~^ ERROR: expected type, found variant - //~| ERROR: unresolved item provided when a constant was expected + //~^ ERROR expected type, found variant + //~| ERROR unresolved item provided when a constant was expected let _: Example = Example { x: 0 }; - //~^ ERROR: type provided when a constant was expected + //~^ ERROR type provided when a constant was expected } diff --git a/tests/ui/const-generics/issues/issue-56445-1.rs b/tests/ui/const-generics/issues/issue-56445-1.rs index 681e0e147cfc8..abf20b351566f 100644 --- a/tests/ui/const-generics/issues/issue-56445-1.rs +++ b/tests/ui/const-generics/issues/issue-56445-1.rs @@ -7,6 +7,6 @@ use std::marker::PhantomData; struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>); -//~^ ERROR: the type of const parameters must not depend on other generic parameters +//~^ ERROR the type of const parameters must not depend on other generic parameters impl Bug<'_, ""> {} diff --git a/tests/ui/const-generics/issues/issue-56445-2.rs b/tests/ui/const-generics/issues/issue-56445-2.rs index e078c8487c727..38e0b4d3a2a64 100644 --- a/tests/ui/const-generics/issues/issue-56445-2.rs +++ b/tests/ui/const-generics/issues/issue-56445-2.rs @@ -5,7 +5,7 @@ impl<'a> OnDiskDirEntry<'a> { const LFN_FRAGMENT_LEN: usize = 2; fn lfn_contents(&self) -> [char; Self::LFN_FRAGMENT_LEN] { loop { } } - //~^ ERROR: generic `Self` types are currently not permitted in anonymous constants + //~^ ERROR generic `Self` types are currently not permitted in anonymous constants } fn main() {} diff --git a/tests/ui/const-generics/issues/issue-56445-3.rs b/tests/ui/const-generics/issues/issue-56445-3.rs index c29df14586e21..3f5a38a0c348f 100644 --- a/tests/ui/const-generics/issues/issue-56445-3.rs +++ b/tests/ui/const-generics/issues/issue-56445-3.rs @@ -2,7 +2,7 @@ pub struct Memory<'rom> { rom: &'rom [u8], ram: [u8; Self::SIZE], - //~^ ERROR: generic `Self` types are currently not permitted in anonymous constants + //~^ ERROR generic `Self` types are currently not permitted in anonymous constants } impl<'rom> Memory<'rom> { diff --git a/tests/ui/const-generics/issues/issue-62878.rs b/tests/ui/const-generics/issues/issue-62878.rs index c80b46ddbc440..b524db6e97498 100644 --- a/tests/ui/const-generics/issues/issue-62878.rs +++ b/tests/ui/const-generics/issues/issue-62878.rs @@ -8,5 +8,5 @@ fn foo() {} fn main() { foo::<_, { [1] }>(); - //[min]~^ ERROR: const arguments cannot yet be inferred with `_` + //[min]~^ ERROR const arguments cannot yet be inferred with `_` } diff --git a/tests/ui/const-generics/issues/issue-67945-3.rs b/tests/ui/const-generics/issues/issue-67945-3.rs index d0a3a26dced9d..4995d08145175 100644 --- a/tests/ui/const-generics/issues/issue-67945-3.rs +++ b/tests/ui/const-generics/issues/issue-67945-3.rs @@ -6,10 +6,10 @@ #![cfg_attr(full, feature(generic_const_exprs))] #![cfg_attr(full, allow(incomplete_features))] -struct Bug { //[min]~ ERROR: parameter `S` is never used - A: [(); { //[full]~ ERROR: overly complex generic constant +struct Bug { //[min]~ ERROR parameter `S` is never used + A: [(); { //[full]~ ERROR overly complex generic constant let x: Option = None; - //[min]~^ ERROR: generic parameters may not be used in const operations + //[min]~^ ERROR generic parameters may not be used in const operations 0 }], } diff --git a/tests/ui/const-generics/issues/issue-67945-4.rs b/tests/ui/const-generics/issues/issue-67945-4.rs index da9de87d05393..1dafb0be4ff09 100644 --- a/tests/ui/const-generics/issues/issue-67945-4.rs +++ b/tests/ui/const-generics/issues/issue-67945-4.rs @@ -5,10 +5,10 @@ #![cfg_attr(full, feature(generic_const_exprs))] #![cfg_attr(full, allow(incomplete_features))] -struct Bug { //[min]~ ERROR: parameter `S` is never used - A: [(); { //[full]~ ERROR: overly complex generic constant +struct Bug { //[min]~ ERROR parameter `S` is never used + A: [(); { //[full]~ ERROR overly complex generic constant let x: Option> = None; - //[min]~^ ERROR: generic parameters may not be used in const operations + //[min]~^ ERROR generic parameters may not be used in const operations 0 }], } diff --git a/tests/ui/const-generics/issues/issue-68366.rs b/tests/ui/const-generics/issues/issue-68366.rs index d9d5e21857b13..e6732490974b2 100644 --- a/tests/ui/const-generics/issues/issue-68366.rs +++ b/tests/ui/const-generics/issues/issue-68366.rs @@ -7,7 +7,7 @@ #![cfg_attr(full, allow(incomplete_features))] struct Collatz>; -//~^ ERROR: `Option` is forbidden +//~^ ERROR `Option` is forbidden impl Collatz<{Some(N)}> {} //~^ ERROR the const parameter diff --git a/tests/ui/const-generics/issues/issue-71381.rs b/tests/ui/const-generics/issues/issue-71381.rs index e472ef31fcdd3..227d92ee545d8 100644 --- a/tests/ui/const-generics/issues/issue-71381.rs +++ b/tests/ui/const-generics/issues/issue-71381.rs @@ -12,8 +12,8 @@ unsafe extern "C" fn pass(args: PassArg) { impl Test { pub fn call_me(&self) { - //~^ ERROR: the type of const parameters must not depend on other generic parameters - //[min]~^^ ERROR: using function pointers as const generic parameters is forbidden + //~^ ERROR the type of const parameters must not depend on other generic parameters + //[min]~^^ ERROR using function pointers as const generic parameters is forbidden self.0 = Self::trampiline:: as _ } @@ -21,8 +21,8 @@ impl Test { Args: Sized, const IDX: usize, const FN: unsafe extern "C" fn(Args), - //~^ ERROR: the type of const parameters must not depend on other generic parameters - //[min]~^^ ERROR: using function pointers as const generic parameters is forbidden + //~^ ERROR the type of const parameters must not depend on other generic parameters + //[min]~^^ ERROR using function pointers as const generic parameters is forbidden >( args: Args, ) { diff --git a/tests/ui/const-generics/issues/issue-71382.rs b/tests/ui/const-generics/issues/issue-71382.rs index 8878a4434c46f..784c4fb91a203 100644 --- a/tests/ui/const-generics/issues/issue-71382.rs +++ b/tests/ui/const-generics/issues/issue-71382.rs @@ -14,7 +14,7 @@ impl Test { } fn test(&self) { - //~^ ERROR: using function pointers as const generic parameters is forbidden + //~^ ERROR using function pointers as const generic parameters is forbidden FN(); } } diff --git a/tests/ui/const-generics/issues/issue-71611.rs b/tests/ui/const-generics/issues/issue-71611.rs index c6c1e267171f6..bd339808b2f27 100644 --- a/tests/ui/const-generics/issues/issue-71611.rs +++ b/tests/ui/const-generics/issues/issue-71611.rs @@ -3,8 +3,8 @@ #![cfg_attr(full, allow(incomplete_features))] fn func(outer: A) { - //~^ ERROR: the type of const parameters must not depend on other generic parameters - //[min]~| ERROR: using function pointers as const generic parameters is forbidden + //~^ ERROR the type of const parameters must not depend on other generic parameters + //[min]~| ERROR using function pointers as const generic parameters is forbidden F(outer); } diff --git a/tests/ui/const-generics/issues/issue-72352.rs b/tests/ui/const-generics/issues/issue-72352.rs index 841ae8670042a..ee2ab73510caf 100644 --- a/tests/ui/const-generics/issues/issue-72352.rs +++ b/tests/ui/const-generics/issues/issue-72352.rs @@ -6,7 +6,7 @@ use std::ffi::{c_char, CStr, CString}; unsafe fn unsafely_do_the_thing usize>(ptr: *const c_char) -> usize { - //~^ ERROR: using function pointers as const generic parameters is forbidden + //~^ ERROR using function pointers as const generic parameters is forbidden F(CStr::from_ptr(ptr)) } diff --git a/tests/ui/const-generics/issues/issue-82956.rs b/tests/ui/const-generics/issues/issue-82956.rs index 3539e9b966c86..3bdc70575d5dd 100644 --- a/tests/ui/const-generics/issues/issue-82956.rs +++ b/tests/ui/const-generics/issues/issue-82956.rs @@ -23,7 +23,7 @@ where fn pop(self) -> (Self::Newlen, Self::Output) { let mut iter = IntoIter::new(self); - //~^ ERROR: failed to resolve: use of undeclared type `IntoIter` + //~^ ERROR failed to resolve: use of undeclared type `IntoIter` let end = iter.next_back().unwrap(); let new = [(); N - 1].map(move |()| iter.next().unwrap()); (new, end) diff --git a/tests/ui/const-generics/issues/issue-83765.rs b/tests/ui/const-generics/issues/issue-83765.rs index 0959f771c22ed..c4bd233393f36 100644 --- a/tests/ui/const-generics/issues/issue-83765.rs +++ b/tests/ui/const-generics/issues/issue-83765.rs @@ -80,7 +80,7 @@ impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> TensorSi for BMap<'a, R, T, F, DIM> { fn size(&self) -> [usize; DIM] { - //~^ ERROR: method not compatible with trait + //~^ ERROR method not compatible with trait self.reference.size() } } @@ -90,7 +90,7 @@ impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> Broadcas { type Element = R; fn bget(&self, index: [usize; DIM]) -> Option { - //~^ ERROR: method not compatible with trait + //~^ ERROR method not compatible with trait self.reference.bget(index).map(&self.closure) } } diff --git a/tests/ui/const-generics/issues/issue-84659.fixed b/tests/ui/const-generics/issues/issue-84659.fixed index 85f1adc5c19dc..419161557af16 100644 --- a/tests/ui/const-generics/issues/issue-84659.fixed +++ b/tests/ui/const-generics/issues/issue-84659.fixed @@ -7,7 +7,7 @@ trait Bar {} trait Foo<'a> { const N: usize; type Baz: Bar<{ Self::N }> where [(); { Self::N }]:; - //~^ ERROR: unconstrained generic constant + //~^ ERROR unconstrained generic constant } fn main() {} diff --git a/tests/ui/const-generics/issues/issue-84659.rs b/tests/ui/const-generics/issues/issue-84659.rs index b2ea6320f73bc..75189609bd2a4 100644 --- a/tests/ui/const-generics/issues/issue-84659.rs +++ b/tests/ui/const-generics/issues/issue-84659.rs @@ -7,7 +7,7 @@ trait Bar {} trait Foo<'a> { const N: usize; type Baz: Bar<{ Self::N }>; - //~^ ERROR: unconstrained generic constant + //~^ ERROR unconstrained generic constant } fn main() {} diff --git a/tests/ui/const-generics/issues/issue-86530.rs b/tests/ui/const-generics/issues/issue-86530.rs index b024decd4e11c..67c6419a492e8 100644 --- a/tests/ui/const-generics/issues/issue-86530.rs +++ b/tests/ui/const-generics/issues/issue-86530.rs @@ -14,7 +14,7 @@ where fn unit_literals() { z(" "); - //~^ ERROR: the trait bound `&str: X` is not satisfied + //~^ ERROR the trait bound `&str: X` is not satisfied } fn main() {} diff --git a/tests/ui/const-generics/issues/issue-86820.rs b/tests/ui/const-generics/issues/issue-86820.rs index ae4bd943fd415..b4fe16e9997ab 100644 --- a/tests/ui/const-generics/issues/issue-86820.rs +++ b/tests/ui/const-generics/issues/issue-86820.rs @@ -14,7 +14,7 @@ trait Bits { impl Bits for u8 { fn bit(self) -> bool { - //~^ ERROR: method `bit` has an incompatible generic parameter for trait `Bits` [E0053] + //~^ ERROR method `bit` has an incompatible generic parameter for trait `Bits` [E0053] let i = 1 << I; let mask = u8::from(i); mask & self == mask diff --git a/tests/ui/const-generics/issues/issue-87493.rs b/tests/ui/const-generics/issues/issue-87493.rs index 80472e6bd9c52..e8b619ff77ec5 100644 --- a/tests/ui/const-generics/issues/issue-87493.rs +++ b/tests/ui/const-generics/issues/issue-87493.rs @@ -6,8 +6,8 @@ pub fn foo(_s: S, _t: T) where S: MyTrait, T: MyTrait, - //~^ ERROR: expected one of `,` or `>`, found `==` - //~| ERROR: trait takes 0 generic arguments but 1 generic argument was supplied + //~^ ERROR expected one of `,` or `>`, found `==` + //~| ERROR trait takes 0 generic arguments but 1 generic argument was supplied { } diff --git a/tests/ui/const-generics/issues/issue-90318.rs b/tests/ui/const-generics/issues/issue-90318.rs index cebc1ce214208..b42866850bc3c 100644 --- a/tests/ui/const-generics/issues/issue-90318.rs +++ b/tests/ui/const-generics/issues/issue-90318.rs @@ -13,7 +13,7 @@ fn consume(_val: T) where If<{ TypeId::of::() != TypeId::of::<()>() }>: True, //~^ overly complex generic constant - //~| ERROR: cannot call + //~| ERROR cannot call { } @@ -21,7 +21,7 @@ fn test() where If<{ TypeId::of::() != TypeId::of::<()>() }>: True, //~^ overly complex generic constant - //~| ERROR: cannot call + //~| ERROR cannot call { } diff --git a/tests/ui/const-generics/kind_mismatch.rs b/tests/ui/const-generics/kind_mismatch.rs index ecdc01a5ef901..cd5f2a63607fb 100644 --- a/tests/ui/const-generics/kind_mismatch.rs +++ b/tests/ui/const-generics/kind_mismatch.rs @@ -9,8 +9,8 @@ pub trait ContainsKey {} pub trait SubsetExcept

{} impl ContainsKey for KeyHolder {} -//~^ ERROR: type provided when a constant was expected -//~| ERROR: type provided when a constant was expected +//~^ ERROR type provided when a constant was expected +//~| ERROR type provided when a constant was expected impl> SubsetExcept

for T {} diff --git a/tests/ui/const-generics/lookup-method.rs b/tests/ui/const-generics/lookup-method.rs index 915935c94a55a..cad721c4926eb 100644 --- a/tests/ui/const-generics/lookup-method.rs +++ b/tests/ui/const-generics/lookup-method.rs @@ -15,5 +15,5 @@ impl Builder { fn main() { let b = Builder::; b.cast().build(); - //~^ ERROR: no method named `build` found for struct `Builder` in the current scope + //~^ ERROR no method named `build` found for struct `Builder` in the current scope } diff --git a/tests/ui/const-generics/min_const_generics/const_default_first.rs b/tests/ui/const-generics/min_const_generics/const_default_first.rs index eafafb8a27455..7b587d33a837a 100644 --- a/tests/ui/const-generics/min_const_generics/const_default_first.rs +++ b/tests/ui/const-generics/min_const_generics/const_default_first.rs @@ -2,6 +2,6 @@ #![allow(dead_code)] struct Both { -//~^ ERROR: generic parameters with a default must be +//~^ ERROR generic parameters with a default must be v: T } diff --git a/tests/ui/const-generics/min_const_generics/macro-fail.rs b/tests/ui/const-generics/min_const_generics/macro-fail.rs index 8cfa5293cc28f..0160edf333303 100644 --- a/tests/ui/const-generics/min_const_generics/macro-fail.rs +++ b/tests/ui/const-generics/min_const_generics/macro-fail.rs @@ -12,10 +12,10 @@ trait Marker {} impl Marker for Example {} fn make_marker() -> impl Marker { - //~^ ERROR: type provided when a constant was expected - //~| ERROR: type provided when a constant was expected + //~^ ERROR type provided when a constant was expected + //~| ERROR type provided when a constant was expected Example:: - //~^ ERROR: type provided when a constant was expected + //~^ ERROR type provided when a constant was expected } fn from_marker(_: impl Marker<{ @@ -35,9 +35,9 @@ fn main() { }>; let _fail = Example::; - //~^ ERROR: type provided when a constant + //~^ ERROR type provided when a constant let _fail = Example::; //~^ ERROR unexpected end of macro invocation - //~| ERROR: type provided when a constant was expected + //~| ERROR type provided when a constant was expected } diff --git a/tests/ui/const-generics/mistyped_const_in_pat.rs b/tests/ui/const-generics/mistyped_const_in_pat.rs index 6f1dd52872f65..7a28844a47169 100644 --- a/tests/ui/const-generics/mistyped_const_in_pat.rs +++ b/tests/ui/const-generics/mistyped_const_in_pat.rs @@ -11,7 +11,7 @@ impl Trait for Vec { } impl Trait for Vec {} -//~^ ERROR: conflicting implementations +//~^ ERROR conflicting implementations const BAR: as Trait>::Assoc = 3; diff --git a/tests/ui/const-generics/not_wf_param_in_rpitit.rs b/tests/ui/const-generics/not_wf_param_in_rpitit.rs index cb1e90923e75d..2e922e1f68f0e 100644 --- a/tests/ui/const-generics/not_wf_param_in_rpitit.rs +++ b/tests/ui/const-generics/not_wf_param_in_rpitit.rs @@ -1,8 +1,8 @@ //@ edition:2021 trait Trait { - //~^ ERROR: cannot find value `bar` in this scope - //~| ERROR: cycle detected when computing type of `Trait::N` + //~^ ERROR cannot find value `bar` in this scope + //~| ERROR cycle detected when computing type of `Trait::N` async fn a() {} } diff --git a/tests/ui/const-generics/opaque_types.rs b/tests/ui/const-generics/opaque_types.rs index 788d795199980..e883c9b2ff8d8 100644 --- a/tests/ui/const-generics/opaque_types.rs +++ b/tests/ui/const-generics/opaque_types.rs @@ -4,10 +4,10 @@ type Foo = impl Sized; #[define_opaque(Foo)] fn foo() {} -//~^ ERROR: `Foo` is forbidden as the type of a const generic parameter -//~| ERROR: item does not constrain +//~^ ERROR `Foo` is forbidden as the type of a const generic parameter +//~| ERROR item does not constrain fn main() { foo::<42>(); - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/const-generics/opaque_types2.rs b/tests/ui/const-generics/opaque_types2.rs index 69f813cf84ae9..6a250389dc75b 100644 --- a/tests/ui/const-generics/opaque_types2.rs +++ b/tests/ui/const-generics/opaque_types2.rs @@ -12,7 +12,7 @@ const fn baz() -> Foo { #[define_opaque(Foo)] fn bar() { foo::<{ baz() }>(); - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } fn main() {} diff --git a/tests/ui/const-generics/parent_generics_of_encoding_impl_trait.rs b/tests/ui/const-generics/parent_generics_of_encoding_impl_trait.rs index 3922aa7aa4a1f..c91332ae6e80c 100644 --- a/tests/ui/const-generics/parent_generics_of_encoding_impl_trait.rs +++ b/tests/ui/const-generics/parent_generics_of_encoding_impl_trait.rs @@ -7,5 +7,5 @@ extern crate generics_of_parent_impl_trait; fn main() { // check for `impl Trait<{ const }>` which has a parent of a `DefKind::TyParam` generics_of_parent_impl_trait::foo([()]); - //~^ error: type annotations needed + //~^ error type annotations needed } diff --git a/tests/ui/const-generics/raw-ptr-const-param-deref.rs b/tests/ui/const-generics/raw-ptr-const-param-deref.rs index bf077acd4fae8..e89e4dea89103 100644 --- a/tests/ui/const-generics/raw-ptr-const-param-deref.rs +++ b/tests/ui/const-generics/raw-ptr-const-param-deref.rs @@ -8,10 +8,10 @@ const A: u32 = 3; -struct Const; //~ ERROR: using raw pointers as const generic parameters +struct Const; //~ ERROR using raw pointers as const generic parameters impl Const

{ - //~^ ERROR: using raw pointers as const generic parameters + //~^ ERROR using raw pointers as const generic parameters fn get() -> u32 { unsafe { *P } } diff --git a/tests/ui/const-generics/raw-ptr-const-param.rs b/tests/ui/const-generics/raw-ptr-const-param.rs index 49e48d9905f41..92cc699fdcfcd 100644 --- a/tests/ui/const-generics/raw-ptr-const-param.rs +++ b/tests/ui/const-generics/raw-ptr-const-param.rs @@ -5,10 +5,10 @@ #![cfg_attr(adt_const_params, feature(adt_const_params))] #![cfg_attr(adt_const_params, allow(incomplete_features))] -struct Const; //~ ERROR: using raw pointers as const generic parameters +struct Const; //~ ERROR using raw pointers as const generic parameters fn main() { let _: Const<{ 15 as *const _ }> = Const::<{ 10 as *const _ }>; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let _: Const<{ 10 as *const _ }> = Const::<{ 10 as *const _ }>; } diff --git a/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.rs b/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.rs index def4611f94b72..63fed1bbed2c7 100644 --- a/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.rs +++ b/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.rs @@ -18,9 +18,9 @@ fn bar() {} fn foo() { bar::<{ [1; N] }>(); - //~^ ERROR: generic parameters may not be used in const operations + //~^ ERROR generic parameters may not be used in const operations bar::<{ [1; { N + 1 }] }>(); - //~^ ERROR: generic parameters may not be used in const operations + //~^ ERROR generic parameters may not be used in const operations } fn main() {} diff --git a/tests/ui/const-generics/sneaky-array-repeat-expr.rs b/tests/ui/const-generics/sneaky-array-repeat-expr.rs index cd1607608a6e9..95ea5f50f3bd1 100644 --- a/tests/ui/const-generics/sneaky-array-repeat-expr.rs +++ b/tests/ui/const-generics/sneaky-array-repeat-expr.rs @@ -9,8 +9,8 @@ impl Trait for () { pub const fn foo() where (): Trait { let bar = [(); <()>::Assoc]; - //~^ error: constant expression depends on a generic parameter - //~| error: constant expression depends on a generic parameter + //~^ error constant expression depends on a generic parameter + //~| error constant expression depends on a generic parameter } trait Trait2 { @@ -24,8 +24,8 @@ impl Trait2 for () { pub const fn foo2() where (): Trait2 { let bar2 = [(); <()>::Assoc2]; - //~^ error: constant expression depends on a generic parameter - //~| error: constant expression depends on a generic parameter + //~^ error constant expression depends on a generic parameter + //~| error constant expression depends on a generic parameter } fn main() { diff --git a/tests/ui/const-generics/transmute-fail.rs b/tests/ui/const-generics/transmute-fail.rs index cf9064bd8f4ba..56c5bf8f40e2a 100644 --- a/tests/ui/const-generics/transmute-fail.rs +++ b/tests/ui/const-generics/transmute-fail.rs @@ -14,10 +14,10 @@ fn foo(v: [[u32; H + 1]; W]) -> [[u32; W + 1]; H } fn bar(v: [[u32; H]; W]) -> [[u32; W]; H] { - //~^ ERROR: the constant `W` is not of type `usize` + //~^ ERROR the constant `W` is not of type `usize` unsafe { std::mem::transmute(v) - //~^ ERROR: the constant `W` is not of type `usize` + //~^ ERROR the constant `W` is not of type `usize` } } @@ -43,7 +43,7 @@ fn overflow_more(v: [[[u32; 8888888]; 9999999]; 777777777]) -> [[[u32; 9999999]; fn transpose(v: [[u32; H]; W]) -> [[u32; W]; H] { unsafe { std::mem::transmute(v) - //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types } } @@ -54,14 +54,14 @@ fn ident(v: [[u32; H]; W]) -> [[u32; H]; W] { fn flatten(v: [[u32; H]; W]) -> [u32; W * H] { unsafe { std::mem::transmute(v) - //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types } } fn coagulate(v: [u32; H * W]) -> [[u32; W]; H] { unsafe { std::mem::transmute(v) - //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types } } @@ -70,7 +70,7 @@ fn flatten_3d( ) -> [u32; D * W * H] { unsafe { std::mem::transmute(v) - //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types } } @@ -79,28 +79,28 @@ fn flatten_somewhat( ) -> [[u32; D * W]; H] { unsafe { std::mem::transmute(v) - //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types } } fn known_size(v: [u16; L]) -> [u8; L * 2] { unsafe { std::mem::transmute(v) - //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types } } fn condense_bytes(v: [u8; L * 2]) -> [u16; L] { unsafe { std::mem::transmute(v) - //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types } } fn singleton_each(v: [u8; L]) -> [[u8; 1]; L] { unsafe { std::mem::transmute(v) - //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types } } @@ -109,7 +109,7 @@ fn transpose_with_const( ) -> [[u32; W + W]; 2 * H] { unsafe { std::mem::transmute(v) - //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types } } diff --git a/tests/ui/const-generics/type_not_in_scope.rs b/tests/ui/const-generics/type_not_in_scope.rs index 1eb265d74d1c7..5933701808b3e 100644 --- a/tests/ui/const-generics/type_not_in_scope.rs +++ b/tests/ui/const-generics/type_not_in_scope.rs @@ -5,7 +5,7 @@ impl X { } } fn getn() -> [u8; N] {} -//~^ ERROR: expected type, found built-in attribute `cfg_attr` -//~| ERROR: mismatched types +//~^ ERROR expected type, found built-in attribute `cfg_attr` +//~| ERROR mismatched types fn main() {} diff --git a/tests/ui/const-generics/unify_with_nested_expr.rs b/tests/ui/const-generics/unify_with_nested_expr.rs index 1271e0902a3bd..739e743d9c1bf 100644 --- a/tests/ui/const-generics/unify_with_nested_expr.rs +++ b/tests/ui/const-generics/unify_with_nested_expr.rs @@ -6,7 +6,7 @@ where [(); N + 1 + 1]:, { bar(); - //~^ ERROR: type annotations + //~^ ERROR type annotations } fn bar() diff --git a/tests/ui/const-generics/variant-discrimiant-no-generics.rs b/tests/ui/const-generics/variant-discrimiant-no-generics.rs index 1228b917bb41b..c6477dd8d6b47 100644 --- a/tests/ui/const-generics/variant-discrimiant-no-generics.rs +++ b/tests/ui/const-generics/variant-discrimiant-no-generics.rs @@ -5,25 +5,25 @@ enum Foo { Variant = N, - //~^ ERROR: generic parameters may not be used in enum discriminant values + //~^ ERROR generic parameters may not be used in enum discriminant values } enum Owo { Variant = { N + 1 }, - //~^ ERROR: generic parameters may not be used in enum discriminant values + //~^ ERROR generic parameters may not be used in enum discriminant values } #[repr(isize)] enum Bar { Variant = { std::mem::size_of::() as isize }, - Other(T), //~^ ERROR: generic parameters may not be used in enum discriminant values + Other(T), //~^ ERROR generic parameters may not be used in enum discriminant values } #[repr(isize)] enum UwU<'a> { Variant = { let a: &'a (); - //~^ ERROR: generic parameters may not be used in enum discriminant values + //~^ ERROR generic parameters may not be used in enum discriminant values 10_isize }, Other(&'a ()), diff --git a/tests/ui/const-ptr/forbidden_slices.rs b/tests/ui/const-ptr/forbidden_slices.rs index 001cfd66ad145..32519b01bdc7a 100644 --- a/tests/ui/const-ptr/forbidden_slices.rs +++ b/tests/ui/const-ptr/forbidden_slices.rs @@ -14,24 +14,24 @@ use std::{ // Null is never valid for references pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) }; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) }; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value // Out of bounds pub static S2: &[u32] = unsafe { from_raw_parts(&D0, 2) }; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value // Reading uninitialized data -pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) }; //~ ERROR: it is undefined behavior to use this value +pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) }; //~ ERROR it is undefined behavior to use this value // Reinterpret pointers as integers (UB in CTFE.) -pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) }; //~ ERROR: it is undefined behavior to use this value +pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, size_of::<&u32>()) }; //~ ERROR it is undefined behavior to use this value // Layout mismatch -pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) }; //~ ERROR: it is undefined behavior to use this value +pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) }; //~ ERROR it is undefined behavior to use this value // Reading padding is not ok pub static S7: &[u16] = unsafe { - //~^ ERROR: it is undefined behavior to use this value + //~^ ERROR it is undefined behavior to use this value let ptr = (&D2 as *const Struct as *const u16).add(1); from_raw_parts(ptr, 4) @@ -39,7 +39,7 @@ pub static S7: &[u16] = unsafe { // Unaligned read pub static S8: &[u64] = unsafe { - //~^ ERROR: it is undefined behavior to use this value + //~^ ERROR it is undefined behavior to use this value let ptr = (&D4 as *const [u32; 2] as *const u32).byte_add(1).cast::(); from_raw_parts(ptr, 1) @@ -55,22 +55,22 @@ pub static R2: &[u32] = unsafe { //~^ ERROR could not evaluate static initializer }; pub static R4: &[u8] = unsafe { - //~^ ERROR: it is undefined behavior to use this value + //~^ ERROR it is undefined behavior to use this value let ptr = (&D1) as *const MaybeUninit<&u32> as *const u8; from_ptr_range(ptr..ptr.add(1)) }; pub static R5: &[u8] = unsafe { - //~^ ERROR: it is undefined behavior to use this value + //~^ ERROR it is undefined behavior to use this value let ptr = &D3 as *const &u32; from_ptr_range(ptr.cast()..ptr.add(1).cast()) }; pub static R6: &[bool] = unsafe { - //~^ ERROR: it is undefined behavior to use this value + //~^ ERROR it is undefined behavior to use this value let ptr = &D0 as *const u32 as *const bool; from_ptr_range(ptr..ptr.add(4)) }; pub static R7: &[u16] = unsafe { - //~^ ERROR: it is undefined behavior to use this value + //~^ ERROR it is undefined behavior to use this value let ptr = (&D2 as *const Struct as *const u16).byte_add(1); from_ptr_range(ptr..ptr.add(4)) }; diff --git a/tests/ui/consts/assert-type-intrinsics.rs b/tests/ui/consts/assert-type-intrinsics.rs index 32b5f5c92c52d..bd5142425fb7a 100644 --- a/tests/ui/consts/assert-type-intrinsics.rs +++ b/tests/ui/consts/assert-type-intrinsics.rs @@ -9,14 +9,14 @@ fn main() { const _BAD1: () = unsafe { MaybeUninit::::uninit().assume_init(); - //~^ERROR: evaluation of constant value failed + //~^ERROR evaluation of constant value failed }; const _BAD2: () = { intrinsics::assert_mem_uninitialized_valid::<&'static i32>(); - //~^ERROR: evaluation of constant value failed + //~^ERROR evaluation of constant value failed }; const _BAD3: () = { intrinsics::assert_zero_valid::<&'static i32>(); - //~^ERROR: evaluation of constant value failed + //~^ERROR evaluation of constant value failed }; } diff --git a/tests/ui/consts/const-array-oob-arith.rs b/tests/ui/consts/const-array-oob-arith.rs index 0f6e76768cd15..38181cd358e08 100644 --- a/tests/ui/consts/const-array-oob-arith.rs +++ b/tests/ui/consts/const-array-oob-arith.rs @@ -3,10 +3,10 @@ const IDX: usize = 3; const VAL: i32 = ARR[IDX]; const BONG: [i32; (ARR[0] - 41) as usize] = [5]; const BLUB: [i32; (ARR[0] - 40) as usize] = [5]; -//~^ ERROR: mismatched types +//~^ ERROR mismatched types //~| expected an array const BOO: [i32; (ARR[0] - 41) as usize] = [5, 99]; -//~^ ERROR: mismatched types +//~^ ERROR mismatched types //~| expected an array fn main() { diff --git a/tests/ui/consts/const-array-oob.rs b/tests/ui/consts/const-array-oob.rs index cf3db077e36ee..c5f49a46f788f 100644 --- a/tests/ui/consts/const-array-oob.rs +++ b/tests/ui/consts/const-array-oob.rs @@ -1,6 +1,6 @@ const FOO: [usize; 3] = [1, 2, 3]; const BAR: usize = FOO[5]; -//~^ ERROR: evaluation of constant value failed +//~^ ERROR evaluation of constant value failed const BLUB: [u32; FOO[4]] = [5, 6]; //~^ ERROR evaluation of constant value failed [E0080] diff --git a/tests/ui/consts/const-eval/const_panic-normalize-tabs-115498.rs b/tests/ui/consts/const-eval/const_panic-normalize-tabs-115498.rs index 0bf2f0e6669d7..904e86522074d 100644 --- a/tests/ui/consts/const-eval/const_panic-normalize-tabs-115498.rs +++ b/tests/ui/consts/const-eval/const_panic-normalize-tabs-115498.rs @@ -2,4 +2,4 @@ struct Bug([u8; panic!{"\t"}]); //~^ ERROR evaluation of constant value failed -//~| NOTE: in this expansion of panic! +//~| NOTE in this expansion of panic! diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs b/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs index c1a544031c2a5..e8545b2f8eaae 100644 --- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs +++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs @@ -2,7 +2,7 @@ #![feature(const_heap)] use std::intrinsics; -const FOO: i32 = foo(); //~ error: evaluation of constant value failed +const FOO: i32 = foo(); //~ error evaluation of constant value failed const fn foo() -> i32 { unsafe { let _ = intrinsics::const_allocate(4, 3) as *mut i32; //~ inside `foo` diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_uninit.rs b/tests/ui/consts/const-eval/heap/alloc_intrinsic_uninit.rs index c283a5fae7de6..223618aa27b29 100644 --- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_uninit.rs +++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_uninit.rs @@ -5,5 +5,5 @@ use std::intrinsics; const BAR: &i32 = unsafe { &*(intrinsics::const_allocate(4, 4) as *mut i32) }; -//~^ error: it is undefined behavior to use this value +//~^ error it is undefined behavior to use this value fn main() {} diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs b/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs index 26cb69e458b61..dbe0ed146378c 100644 --- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs +++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs @@ -6,6 +6,6 @@ use std::intrinsics; const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32 }; -//~^ error: mutable pointer in final value of constant +//~^ error mutable pointer in final value of constant fn main() {} diff --git a/tests/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.rs b/tests/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.rs index 509c872f6095d..532580e7cdf47 100644 --- a/tests/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.rs +++ b/tests/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.rs @@ -9,7 +9,7 @@ use std::intrinsics; const _X: &'static u8 = unsafe { - //~^ error: it is undefined behavior to use this value + //~^ error it is undefined behavior to use this value let ptr = intrinsics::const_allocate(4, 4); intrinsics::const_deallocate(ptr, 4, 4); &*ptr @@ -20,7 +20,7 @@ const _Y: u8 = unsafe { let reference = &*ptr; intrinsics::const_deallocate(ptr, 4, 4); *reference - //~^ error: evaluation of constant value failed + //~^ error evaluation of constant value failed }; fn main() {} diff --git a/tests/ui/consts/const-eval/heap/dealloc_intrinsic_duplicate.rs b/tests/ui/consts/const-eval/heap/dealloc_intrinsic_duplicate.rs index 4010b476990dc..607d50c94e204 100644 --- a/tests/ui/consts/const-eval/heap/dealloc_intrinsic_duplicate.rs +++ b/tests/ui/consts/const-eval/heap/dealloc_intrinsic_duplicate.rs @@ -7,7 +7,7 @@ const _X: () = unsafe { let ptr = intrinsics::const_allocate(4, 4); intrinsics::const_deallocate(ptr, 4, 4); intrinsics::const_deallocate(ptr, 4, 4); - //~^ error: evaluation of constant value failed + //~^ error evaluation of constant value failed }; fn main() {} diff --git a/tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.rs b/tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.rs index 031d70fdc8897..cf6974907740e 100644 --- a/tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.rs +++ b/tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.rs @@ -6,24 +6,24 @@ use std::intrinsics; const _X: () = unsafe { let ptr = intrinsics::const_allocate(4, 4); intrinsics::const_deallocate(ptr, 4, 2); - //~^ error: evaluation of constant value failed + //~^ error evaluation of constant value failed }; const _Y: () = unsafe { let ptr = intrinsics::const_allocate(4, 4); intrinsics::const_deallocate(ptr, 2, 4); - //~^ error: evaluation of constant value failed + //~^ error evaluation of constant value failed }; const _Z: () = unsafe { let ptr = intrinsics::const_allocate(4, 4); intrinsics::const_deallocate(ptr, 3, 4); - //~^ error: evaluation of constant value failed + //~^ error evaluation of constant value failed }; const _W: () = unsafe { let ptr = intrinsics::const_allocate(4, 4); intrinsics::const_deallocate(ptr, 4, 3); - //~^ error: evaluation of constant value failed + //~^ error evaluation of constant value failed }; fn main() {} diff --git a/tests/ui/consts/const-eval/issue-52475.rs b/tests/ui/consts/const-eval/issue-52475.rs index ee26d280018b4..c75d3ea9c3456 100644 --- a/tests/ui/consts/const-eval/issue-52475.rs +++ b/tests/ui/consts/const-eval/issue-52475.rs @@ -3,7 +3,7 @@ fn main() { let mut x = &0; let mut n = 0; while n < 5 { - //~^ ERROR: constant evaluation is taking a long time + //~^ ERROR constant evaluation is taking a long time n = (n + 1) % 5; x = &0; // Materialize a new AllocId } diff --git a/tests/ui/consts/const-eval/issue-85155.rs b/tests/ui/consts/const-eval/issue-85155.rs index cb5b3a08375d0..3abea25af750f 100644 --- a/tests/ui/consts/const-eval/issue-85155.rs +++ b/tests/ui/consts/const-eval/issue-85155.rs @@ -20,5 +20,5 @@ fn main() { //~^ NOTE the above error was encountered while instantiating } -//~? ERROR evaluation of `post_monomorphization_error::ValidateConstImm::<2, 0, 1>::VALID` failed +//~? ERROR evaluation of `post_monomorphization_error:ValidateConstImm::<2, 0, 1>::VALID` failed //~? NOTE erroneous constant encountered diff --git a/tests/ui/consts/const-eval/issue-91827-extern-types-field-offset.rs b/tests/ui/consts/const-eval/issue-91827-extern-types-field-offset.rs index c6960fa7259db..a83b58412e399 100644 --- a/tests/ui/consts/const-eval/issue-91827-extern-types-field-offset.rs +++ b/tests/ui/consts/const-eval/issue-91827-extern-types-field-offset.rs @@ -36,7 +36,7 @@ const OFFSET: () = unsafe { // This needs to compute the field offset, but we don't know the type's alignment, so this // fails. let field = &x.a; - //~^ ERROR: evaluation of constant value failed + //~^ ERROR evaluation of constant value failed //~| does not have a known offset }; diff --git a/tests/ui/consts/const-eval/nonnull_as_ref_ub.rs b/tests/ui/consts/const-eval/nonnull_as_ref_ub.rs index 19ab5239986c7..d092a817c446d 100644 --- a/tests/ui/consts/const-eval/nonnull_as_ref_ub.rs +++ b/tests/ui/consts/const-eval/nonnull_as_ref_ub.rs @@ -1,6 +1,6 @@ use std::ptr::NonNull; const NON_NULL: NonNull = unsafe { NonNull::dangling() }; -const _: () = assert!(42 == *unsafe { NON_NULL.as_ref() }); //~ERROR: evaluation of constant value failed +const _: () = assert!(42 == *unsafe { NON_NULL.as_ref() }); //~ERROR evaluation of constant value failed fn main() {} diff --git a/tests/ui/consts/const-eval/raw-bytes.rs b/tests/ui/consts/const-eval/raw-bytes.rs index 9187de5636202..161b95f970907 100644 --- a/tests/ui/consts/const-eval/raw-bytes.rs +++ b/tests/ui/consts/const-eval/raw-bytes.rs @@ -148,7 +148,7 @@ const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit:: const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit:: { uninit: () }]) }; //~^ ERROR it is undefined behavior to use this value const MYSTR_NO_INIT_ISSUE83182: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) }; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value // # slice const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) }; @@ -208,34 +208,34 @@ const _: &[!] = unsafe { &*(1_usize as *const [!; 42]) }; //~ ERROR undefined be // Reading uninitialized data pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) }; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value // Reinterpret pointers as integers (UB in CTFE.) pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, mem::size_of::<&u32>()) }; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value // Layout mismatch pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) }; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value // Reading padding is not ok pub static S7: &[u16] = unsafe { - //~^ ERROR: it is undefined behavior to use this value + //~^ ERROR it is undefined behavior to use this value let ptr = (&D2 as *const Struct as *const u16).add(1); from_raw_parts(ptr, 4) }; pub static R4: &[u8] = unsafe { - //~^ ERROR: it is undefined behavior to use this value + //~^ ERROR it is undefined behavior to use this value let ptr = (&D1) as *const mem::MaybeUninit<&u32> as *const u8; from_ptr_range(ptr..ptr.add(1)) }; pub static R5: &[u8] = unsafe { - //~^ ERROR: it is undefined behavior to use this value + //~^ ERROR it is undefined behavior to use this value let ptr = &D3 as *const &u32; from_ptr_range(ptr.cast()..ptr.add(1).cast()) }; pub static R6: &[bool] = unsafe { - //~^ ERROR: it is undefined behavior to use this value + //~^ ERROR it is undefined behavior to use this value let ptr = &D0 as *const u32 as *const bool; from_ptr_range(ptr..ptr.add(4)) }; diff --git a/tests/ui/consts/const-eval/raw-pointer-ub.rs b/tests/ui/consts/const-eval/raw-pointer-ub.rs index 478e93a910e0c..0c0bcc70971fc 100644 --- a/tests/ui/consts/const-eval/raw-pointer-ub.rs +++ b/tests/ui/consts/const-eval/raw-pointer-ub.rs @@ -1,15 +1,15 @@ const MISALIGNED_LOAD: () = unsafe { let mem = [0u32; 8]; let ptr = mem.as_ptr().byte_add(1); - let _val = *ptr; //~ERROR: evaluation of constant value failed - //~^NOTE: based on pointer with alignment 1, but alignment 4 is required + let _val = *ptr; //~ERROR evaluation of constant value failed + //~^NOTE based on pointer with alignment 1, but alignment 4 is required }; const MISALIGNED_STORE: () = unsafe { let mut mem = [0u32; 8]; let ptr = mem.as_mut_ptr().byte_add(1); - *ptr = 0; //~ERROR: evaluation of constant value failed - //~^NOTE: based on pointer with alignment 1, but alignment 4 is required + *ptr = 0; //~ERROR evaluation of constant value failed + //~^NOTE based on pointer with alignment 1, but alignment 4 is required }; const MISALIGNED_COPY: () = unsafe { @@ -31,15 +31,15 @@ const MISALIGNED_FIELD: () = unsafe { let mem = [0f32; 8]; let ptr = mem.as_ptr().cast::(); // Accessing an f32 field but we still require the alignment of the pointer type. - let _val = (*ptr).0; //~ERROR: evaluation of constant value failed - //~^NOTE: based on pointer with alignment 4, but alignment 16 is required + let _val = (*ptr).0; //~ERROR evaluation of constant value failed + //~^NOTE based on pointer with alignment 4, but alignment 16 is required }; const OOB: () = unsafe { let mem = [0u32; 1]; let ptr = mem.as_ptr().cast::(); - let _val = *ptr; //~ERROR: evaluation of constant value failed - //~^NOTE: expected a pointer to 8 bytes of memory + let _val = *ptr; //~ERROR evaluation of constant value failed + //~^NOTE expected a pointer to 8 bytes of memory }; fn main() {} diff --git a/tests/ui/consts/const-eval/ub-invalid-values.rs b/tests/ui/consts/const-eval/ub-invalid-values.rs index c0b68d7619a07..02987214b7133 100644 --- a/tests/ui/consts/const-eval/ub-invalid-values.rs +++ b/tests/ui/consts/const-eval/ub-invalid-values.rs @@ -5,7 +5,7 @@ const fn bool_cast(ptr: *const bool) { unsafe { const _: () = { let v = 3_u8; - bool_cast(&v as *const u8 as *const bool); //~ ERROR: evaluation of constant value failed + bool_cast(&v as *const u8 as *const bool); //~ ERROR evaluation of constant value failed //~^ NOTE interpreting an invalid 8-bit value as a bool }; diff --git a/tests/ui/consts/const-eval/ub-write-through-immutable.rs b/tests/ui/consts/const-eval/ub-write-through-immutable.rs index d3ae2d8188486..82fc48b8999c2 100644 --- a/tests/ui/consts/const-eval/ub-write-through-immutable.rs +++ b/tests/ui/consts/const-eval/ub-write-through-immutable.rs @@ -7,14 +7,14 @@ use std::cell::UnsafeCell; const WRITE_AFTER_CAST: () = unsafe { let mut x = 0; let ptr = &x as *const i32 as *mut i32; - *ptr = 0; //~ERROR: evaluation of constant value failed + *ptr = 0; //~ERROR evaluation of constant value failed //~| immutable }; const WRITE_AFTER_TRANSMUTE: () = unsafe { let mut x = 0; let ptr: *mut i32 = mem::transmute(&x); - *ptr = 0; //~ERROR: evaluation of constant value failed + *ptr = 0; //~ERROR evaluation of constant value failed //~| immutable }; diff --git a/tests/ui/consts/const-eval/validation-ice-extern-type-field.rs b/tests/ui/consts/const-eval/validation-ice-extern-type-field.rs index 8a32b170c40a4..93520f6a56a7e 100644 --- a/tests/ui/consts/const-eval/validation-ice-extern-type-field.rs +++ b/tests/ui/consts/const-eval/validation-ice-extern-type-field.rs @@ -10,6 +10,6 @@ struct ThinDst { } const C1: &ThinDst = unsafe { std::mem::transmute(b"d".as_ptr()) }; -//~^ERROR: evaluation of constant value failed +//~^ERROR evaluation of constant value failed fn main() {} diff --git a/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs b/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs index 0b475087d550a..30827278fcc1e 100644 --- a/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs +++ b/tests/ui/consts/const-extern-fn/const-extern-fn-call-extern-fn.rs @@ -5,7 +5,7 @@ extern "C" { const extern "C" fn bar() { unsafe { regular_in_block(); - //~^ ERROR: cannot call non-const function + //~^ ERROR cannot call non-const function } } @@ -14,7 +14,7 @@ extern "C" fn regular() {} const extern "C" fn foo() { unsafe { regular(); - //~^ ERROR: cannot call non-const function + //~^ ERROR cannot call non-const function } } diff --git a/tests/ui/consts/const-mut-refs/issue-76510.rs b/tests/ui/consts/const-mut-refs/issue-76510.rs index 6ebbd4e50f6df..960160c91b9bc 100644 --- a/tests/ui/consts/const-mut-refs/issue-76510.rs +++ b/tests/ui/consts/const-mut-refs/issue-76510.rs @@ -1,7 +1,7 @@ use std::mem::{transmute, ManuallyDrop}; const S: &'static mut str = &mut " hello "; -//~^ ERROR: mutable references are not allowed in the final value of constants +//~^ ERROR mutable references are not allowed in the final value of constants const fn trigger() -> [(); unsafe { let s = transmute::<(*const u8, usize), &ManuallyDrop>((S.as_ptr(), 3)); diff --git a/tests/ui/consts/const-promoted-opaque.rs b/tests/ui/consts/const-promoted-opaque.rs index 188dacd100343..9f264004b93bf 100644 --- a/tests/ui/consts/const-promoted-opaque.rs +++ b/tests/ui/consts/const-promoted-opaque.rs @@ -30,13 +30,13 @@ const FOO: Foo = foo(); const BAR: () = { let _: &'static _ = &FOO; - //[string,atomic,unit]~^ ERROR: destructor of `Foo` cannot be evaluated at compile-time + //[string,atomic,unit]~^ ERROR destructor of `Foo` cannot be evaluated at compile-time }; const BAZ: &Foo = &FOO; -//[atomic]~^ ERROR: constants cannot refer to interior mutable data +//[atomic]~^ ERROR constants cannot refer to interior mutable data fn main() { let _: &'static _ = &FOO; - //[string,atomic,unit]~^ ERROR: temporary value dropped while borrowed + //[string,atomic,unit]~^ ERROR temporary value dropped while borrowed } diff --git a/tests/ui/consts/const-unsized.rs b/tests/ui/consts/const-unsized.rs index e8af3323cebfe..a77658f123b26 100644 --- a/tests/ui/consts/const-unsized.rs +++ b/tests/ui/consts/const-unsized.rs @@ -18,6 +18,6 @@ static STATIC_BAR: str = *"bar"; fn main() { println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR); - //~^ ERROR: cannot move a value of type `str` - //~| ERROR: cannot move a value of type `dyn Debug + Sync` + //~^ ERROR cannot move a value of type `str` + //~| ERROR cannot move a value of type `dyn Debug + Sync` } diff --git a/tests/ui/consts/const-unstable-intrinsic.rs b/tests/ui/consts/const-unstable-intrinsic.rs index 890a30c73c8aa..f6193c5218920 100644 --- a/tests/ui/consts/const-unstable-intrinsic.rs +++ b/tests/ui/consts/const-unstable-intrinsic.rs @@ -15,16 +15,16 @@ const fn const_main() { let x = 42; unsafe { unstable_intrinsic::size_of_val(&x); - //~^ERROR: unstable library feature `unstable` - //~|ERROR: not yet stable as a const intrinsic + //~^ERROR unstable library feature `unstable` + //~|ERROR not yet stable as a const intrinsic unstable_intrinsic::min_align_of_val(&x); - //~^ERROR: unstable library feature `unstable` - //~|ERROR: not yet stable as a const intrinsic + //~^ERROR unstable library feature `unstable` + //~|ERROR not yet stable as a const intrinsic size_of_val(&x); - //~^ERROR: cannot use `#[feature(local)]` + //~^ERROR cannot use `#[feature(local)]` min_align_of_val(&x); - //~^ERROR: cannot use `#[feature(local)]` + //~^ERROR cannot use `#[feature(local)]` } } diff --git a/tests/ui/consts/const-unwrap.rs b/tests/ui/consts/const-unwrap.rs index d48078a0834c5..96a485acd8ff1 100644 --- a/tests/ui/consts/const-unwrap.rs +++ b/tests/ui/consts/const-unwrap.rs @@ -4,12 +4,12 @@ const FOO: i32 = Some(42i32).unwrap(); const BAR: i32 = Option::::None.unwrap(); -//~^ ERROR: evaluation of constant value failed -//~| NOTE: called `Option::unwrap()` on a `None` value +//~^ ERROR evaluation of constant value failed +//~| NOTE called `Option::unwrap()` on a `None` value const BAZ: i32 = Option::::None.expect("absolutely not!"); -//~^ ERROR: evaluation of constant value failed -//~| NOTE: absolutely not! +//~^ ERROR evaluation of constant value failed +//~| NOTE absolutely not! fn main() { println!("{}", FOO); diff --git a/tests/ui/consts/const_in_pattern/arrays-and-slices.rs b/tests/ui/consts/const_in_pattern/arrays-and-slices.rs index bb38490206b2c..f7edbecf01134 100644 --- a/tests/ui/consts/const_in_pattern/arrays-and-slices.rs +++ b/tests/ui/consts/const_in_pattern/arrays-and-slices.rs @@ -16,26 +16,26 @@ fn type_mismatches() { // patterns check slices' length appropriately when matching on slices. match BSTR_UNSIZED { BSTR_SIZED => {} - //~^ ERROR: mismatched types + //~^ ERROR mismatched types _ => {} } match STRUCT_UNSIZED { STRUCT_SIZED => {} - //~^ ERROR: mismatched types + //~^ ERROR mismatched types _ => {} } // Test that slice consts can't be used where an array pattern is expected. match BSTR_UNSIZED { BSTR_SIZED => {} - //~^ ERROR: mismatched types + //~^ ERROR mismatched types _ => {} } // If the types matched here, this would still error, since unsized structs aren't permitted in // constant patterns. See the `invalid_patterns` test below. match STRUCT_UNSIZED { STRUCT_SIZED => {} - //~^ ERROR: mismatched types + //~^ ERROR mismatched types _ => {} } } @@ -45,7 +45,7 @@ fn invalid_patterns() { // See `tests/ui/consts/issue-87046.rs` for an example with `str`. match STRUCT_UNSIZED { STRUCT_UNSIZED => {} - //~^ ERROR: cannot use unsized non-slice type `SomeStruct<[u8]>` in constant patterns + //~^ ERROR cannot use unsized non-slice type `SomeStruct<[u8]>` in constant patterns _ => {} } } diff --git a/tests/ui/consts/const_in_pattern/issue-34784-match-on-non-int-raw-ptr.rs b/tests/ui/consts/const_in_pattern/issue-34784-match-on-non-int-raw-ptr.rs index e7c6101a3e062..25b1a001cddf3 100644 --- a/tests/ui/consts/const_in_pattern/issue-34784-match-on-non-int-raw-ptr.rs +++ b/tests/ui/consts/const_in_pattern/issue-34784-match-on-non-int-raw-ptr.rs @@ -6,14 +6,14 @@ const C_INNER: (*const u8, u8) = (C, 0); fn foo(x: *const u8) { match x { - C => {} //~ERROR: behave unpredictably + C => {} //~ERROR behave unpredictably _ => {} } } fn foo2(x: *const u8) { match (x, 1) { - C_INNER => {} //~ERROR: behave unpredictably + C_INNER => {} //~ERROR behave unpredictably _ => {} } } @@ -24,12 +24,12 @@ const STR: *const str = "abcd"; fn main() { match D { - D => {} //~ERROR: behave unpredictably + D => {} //~ERROR behave unpredictably _ => {} } match STR { - STR => {} //~ERROR: behave unpredictably + STR => {} //~ERROR behave unpredictably _ => {} } } diff --git a/tests/ui/consts/const_refs_to_static_fail_invalid.rs b/tests/ui/consts/const_refs_to_static_fail_invalid.rs index 3383a208345da..6d670a65deb69 100644 --- a/tests/ui/consts/const_refs_to_static_fail_invalid.rs +++ b/tests/ui/consts/const_refs_to_static_fail_invalid.rs @@ -6,7 +6,7 @@ fn invalid() { static S: i8 = 10; const C: &bool = unsafe { std::mem::transmute(&S) }; - //~^ERROR: undefined behavior + //~^ERROR undefined behavior //~| expected a boolean // This must be rejected here (or earlier), since it's not a valid `&bool`. @@ -22,7 +22,7 @@ fn extern_() { } const C: &i8 = unsafe { &S }; - //~^ERROR: undefined behavior + //~^ERROR undefined behavior //~| `extern` static // This must be rejected here (or earlier), since the pattern cannot be read. @@ -36,7 +36,7 @@ fn mutable() { static mut S_MUT: i32 = 0; const C: &i32 = unsafe { &S_MUT }; - //~^ERROR: undefined behavior + //~^ERROR undefined behavior //~| encountered reference to mutable memory // This *must not build*, the constant we are matching against diff --git a/tests/ui/consts/control-flow/loop.rs b/tests/ui/consts/control-flow/loop.rs index b02c31c4c25b5..e44b5f0f18af7 100644 --- a/tests/ui/consts/control-flow/loop.rs +++ b/tests/ui/consts/control-flow/loop.rs @@ -51,14 +51,14 @@ const _: i32 = { let mut x = 0; for i in 0..4 { - //~^ ERROR: cannot use `for` - //~| ERROR: cannot use `for` + //~^ ERROR cannot use `for` + //~| ERROR cannot use `for` x += i; } for i in 0..4 { - //~^ ERROR: cannot use `for` - //~| ERROR: cannot use `for` + //~^ ERROR cannot use `for` + //~| ERROR cannot use `for` x += i; } diff --git a/tests/ui/consts/control-flow/try.rs b/tests/ui/consts/control-flow/try.rs index 67083e1a39b5d..1b47e59ccf1db 100644 --- a/tests/ui/consts/control-flow/try.rs +++ b/tests/ui/consts/control-flow/try.rs @@ -4,8 +4,8 @@ const fn opt() -> Option { let x = Some(2); x?; - //~^ ERROR: `?` is not allowed - //~| ERROR: `?` is not allowed + //~^ ERROR `?` is not allowed + //~| ERROR `?` is not allowed None } diff --git a/tests/ui/consts/dangling-zst-ice-issue-126393.rs b/tests/ui/consts/dangling-zst-ice-issue-126393.rs index 4beee913a978a..a3d5ef0f6e912 100644 --- a/tests/ui/consts/dangling-zst-ice-issue-126393.rs +++ b/tests/ui/consts/dangling-zst-ice-issue-126393.rs @@ -5,7 +5,7 @@ pub struct Wrapper; pub static MAGIC_FFI_REF: &'static Wrapper = unsafe { -//~^ERROR: it is undefined behavior to use this value +//~^ERROR it is undefined behavior to use this value std::mem::transmute(&{ let y = 42; y diff --git a/tests/ui/consts/effect_param.rs b/tests/ui/consts/effect_param.rs index bfe0a519037db..c39a38b5d2f47 100644 --- a/tests/ui/consts/effect_param.rs +++ b/tests/ui/consts/effect_param.rs @@ -2,14 +2,14 @@ fn main() { i8::checked_sub::(42, 43); - //~^ ERROR: method takes 0 generic arguments but 1 generic argument was supplied + //~^ ERROR method takes 0 generic arguments but 1 generic argument was supplied i8::checked_sub::(42, 43); - //~^ ERROR: method takes 0 generic arguments but 1 generic argument was supplied + //~^ ERROR method takes 0 generic arguments but 1 generic argument was supplied } const FOO: () = { i8::checked_sub::(42, 43); - //~^ ERROR: method takes 0 generic arguments but 1 generic argument was supplied + //~^ ERROR method takes 0 generic arguments but 1 generic argument was supplied i8::checked_sub::(42, 43); - //~^ ERROR: method takes 0 generic arguments but 1 generic argument was supplied + //~^ ERROR method takes 0 generic arguments but 1 generic argument was supplied }; diff --git a/tests/ui/consts/escaping-bound-var.rs b/tests/ui/consts/escaping-bound-var.rs index a538d607d6ca5..f181bd49bfab8 100644 --- a/tests/ui/consts/escaping-bound-var.rs +++ b/tests/ui/consts/escaping-bound-var.rs @@ -3,7 +3,7 @@ fn test<'a>( _: &'a (), -) -> [(); { //~ ERROR: mismatched types +) -> [(); { //~ ERROR mismatched types let x: &'a (); //~^ ERROR cannot capture late-bound lifetime in constant 1 diff --git a/tests/ui/consts/extra-const-ub/detect-extra-ub.rs b/tests/ui/consts/extra-const-ub/detect-extra-ub.rs index d2b157e03e7cb..7e962ab3a5b5b 100644 --- a/tests/ui/consts/extra-const-ub/detect-extra-ub.rs +++ b/tests/ui/consts/extra-const-ub/detect-extra-ub.rs @@ -27,32 +27,32 @@ enum UninhDiscriminant { const INVALID_BOOL: () = unsafe { let _x: bool = transmute(3u8); - //[with_flag]~^ ERROR: evaluation of constant value failed + //[with_flag]~^ ERROR evaluation of constant value failed //[with_flag]~| invalid value }; const INVALID_PTR_IN_INT: () = unsafe { let _x: usize = transmute(&3u8); - //[with_flag]~^ ERROR: evaluation of constant value failed + //[with_flag]~^ ERROR evaluation of constant value failed //[with_flag]~| invalid value }; const INVALID_PTR_IN_ENUM: () = unsafe { let _x: PtrSizedEnum = transmute(&3u8); - //[with_flag]~^ ERROR: evaluation of constant value failed + //[with_flag]~^ ERROR evaluation of constant value failed //[with_flag]~| invalid value }; const INVALID_SLICE_TO_USIZE_TRANSMUTE: () = unsafe { let x: &[u8] = &[0; 32]; let _x: (usize, usize) = transmute(x); - //[with_flag]~^ ERROR: evaluation of constant value failed + //[with_flag]~^ ERROR evaluation of constant value failed //[with_flag]~| invalid value }; const UNALIGNED_PTR: () = unsafe { let _x: &u32 = transmute(&[0u8; 4]); - //[with_flag]~^ ERROR: evaluation of constant value failed + //[with_flag]~^ ERROR evaluation of constant value failed //[with_flag]~| invalid value }; @@ -60,7 +60,7 @@ const UNINHABITED_VARIANT: () = unsafe { let data = [1u8]; // Not using transmute, we want to hit the ImmTy code path. let v = *addr_of!(data).cast::(); - //[with_flag]~^ ERROR: evaluation of constant value failed + //[with_flag]~^ ERROR evaluation of constant value failed //[with_flag]~| invalid value }; @@ -80,7 +80,7 @@ const PARTIAL_POINTER: () = unsafe { let mem = Packed { pad1: 0, ptr: &0u8 as *const u8, pad2: [0; 7] }; let mem = Align { p: mem, align: 0 }; let _val = *(&mem as *const Align as *const [*const u8; 2]); - //[with_flag]~^ ERROR: evaluation of constant value failed + //[with_flag]~^ ERROR evaluation of constant value failed //[with_flag]~| invalid value }; @@ -95,7 +95,7 @@ const VALID_ARRAY: [Option; 0] = { let e = [None; 0]; e }; const OVERSIZED_REF: () = { unsafe { let slice: *const [u8] = transmute((1usize, usize::MAX)); let _val = &*slice; - //[with_flag]~^ ERROR: evaluation of constant value failed + //[with_flag]~^ ERROR evaluation of constant value failed //[with_flag]~| slice is bigger than largest supported object } }; diff --git a/tests/ui/consts/issue-104609.rs b/tests/ui/consts/issue-104609.rs index 9ee83b409c16f..7d3f31226850a 100644 --- a/tests/ui/consts/issue-104609.rs +++ b/tests/ui/consts/issue-104609.rs @@ -1,11 +1,11 @@ fn foo() { oops; - //~^ ERROR: cannot find value `oops` in this scope + //~^ ERROR cannot find value `oops` in this scope } unsafe fn bar() { std::mem::transmute::<_, *mut _>(1_u8); - //~^ ERROR: type annotations needed + //~^ ERROR type annotations needed } fn main() {} diff --git a/tests/ui/consts/issue-104768.rs b/tests/ui/consts/issue-104768.rs index 52a8070be4e41..98f6636e9744d 100644 --- a/tests/ui/consts/issue-104768.rs +++ b/tests/ui/consts/issue-104768.rs @@ -1,5 +1,5 @@ const A: &_ = 0_u32; -//~^ ERROR: the placeholder `_` is not allowed within types on item signatures for constants -//~| ERROR: mismatched types +//~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants +//~| ERROR mismatched types fn main() {} diff --git a/tests/ui/consts/issue-17458.rs b/tests/ui/consts/issue-17458.rs index 44125a1c3df8d..98fcdb70c2b67 100644 --- a/tests/ui/consts/issue-17458.rs +++ b/tests/ui/consts/issue-17458.rs @@ -1,5 +1,5 @@ static X: usize = unsafe { core::ptr::null::() as usize }; -//~^ ERROR: pointers cannot be cast to integers during const eval +//~^ ERROR pointers cannot be cast to integers during const eval fn main() { assert_eq!(X, 0); diff --git a/tests/ui/consts/issue-17718-const-bad-values.rs b/tests/ui/consts/issue-17718-const-bad-values.rs index c4de7b61f07d7..655413585b412 100644 --- a/tests/ui/consts/issue-17718-const-bad-values.rs +++ b/tests/ui/consts/issue-17718-const-bad-values.rs @@ -4,11 +4,11 @@ #![allow(static_mut_refs)] const C1: &'static mut [usize] = &mut []; -//~^ ERROR: mutable references are not allowed +//~^ ERROR mutable references are not allowed static mut S: i32 = 3; const C2: &'static mut i32 = unsafe { &mut S }; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value //~| reference to mutable memory fn main() {} diff --git a/tests/ui/consts/issue-17718-const-borrow.rs b/tests/ui/consts/issue-17718-const-borrow.rs index 89316dbd5c41a..e62622c97807a 100644 --- a/tests/ui/consts/issue-17718-const-borrow.rs +++ b/tests/ui/consts/issue-17718-const-borrow.rs @@ -2,13 +2,13 @@ use std::cell::UnsafeCell; const A: UnsafeCell = UnsafeCell::new(1); const B: &'static UnsafeCell = &A; -//~^ ERROR: cannot refer to interior mutable +//~^ ERROR cannot refer to interior mutable struct C { a: UnsafeCell } const D: C = C { a: UnsafeCell::new(1) }; const E: &'static UnsafeCell = &D.a; -//~^ ERROR: cannot refer to interior mutable +//~^ ERROR cannot refer to interior mutable const F: &'static C = &D; -//~^ ERROR: cannot refer to interior mutable +//~^ ERROR cannot refer to interior mutable fn main() {} diff --git a/tests/ui/consts/issue-17718-constants-not-static.rs b/tests/ui/consts/issue-17718-constants-not-static.rs index 2e6aff1618bfb..ca328eda46778 100644 --- a/tests/ui/consts/issue-17718-constants-not-static.rs +++ b/tests/ui/consts/issue-17718-constants-not-static.rs @@ -3,7 +3,7 @@ fn id(x: T) -> T { x } const FOO: usize = 3; fn foo() -> &'static usize { &id(FOO) } -//~^ ERROR: cannot return reference to temporary value +//~^ ERROR cannot return reference to temporary value fn main() { } diff --git a/tests/ui/consts/issue-32829-2.rs b/tests/ui/consts/issue-32829-2.rs index c7ad0979293d7..3154dbe383f81 100644 --- a/tests/ui/consts/issue-32829-2.rs +++ b/tests/ui/consts/issue-32829-2.rs @@ -8,7 +8,7 @@ const bad : u32 = { const bad_two : u32 = { { invalid(); - //~^ ERROR: cannot call non-const function `invalid` + //~^ ERROR cannot call non-const function `invalid` 0 } }; @@ -30,7 +30,7 @@ static bad_four : u32 = { static bad_five : u32 = { { invalid(); - //~^ ERROR: cannot call non-const function `invalid` + //~^ ERROR cannot call non-const function `invalid` 0 } }; @@ -52,7 +52,7 @@ static mut bad_seven : u32 = { static mut bad_eight : u32 = { { invalid(); - //~^ ERROR: cannot call non-const function `invalid` + //~^ ERROR cannot call non-const function `invalid` 0 } }; diff --git a/tests/ui/consts/issue-63952.rs b/tests/ui/consts/issue-63952.rs index aee06f8eb0428..13fe9098e9368 100644 --- a/tests/ui/consts/issue-63952.rs +++ b/tests/ui/consts/issue-63952.rs @@ -14,7 +14,7 @@ union SliceTransmute { } // bad slice: length too big to even exist anywhere -const SLICE_WAY_TOO_LONG: &[u8] = unsafe { //~ ERROR: it is undefined behavior to use this value +const SLICE_WAY_TOO_LONG: &[u8] = unsafe { //~ ERROR it is undefined behavior to use this value SliceTransmute { repr: SliceRepr { ptr: &42, diff --git a/tests/ui/consts/issue-64506.rs b/tests/ui/consts/issue-64506.rs index 096d29cbe499c..f04cda0279ebf 100644 --- a/tests/ui/consts/issue-64506.rs +++ b/tests/ui/consts/issue-64506.rs @@ -14,7 +14,7 @@ const FOO: () = { b: (), } let x = unsafe { Foo { b: () }.a }; - //~^ ERROR: evaluation of constant value failed + //~^ ERROR evaluation of constant value failed let x = &x.inner; }; diff --git a/tests/ui/consts/issue-64662.rs b/tests/ui/consts/issue-64662.rs index e3a8c85830f73..cff3952f36291 100644 --- a/tests/ui/consts/issue-64662.rs +++ b/tests/ui/consts/issue-64662.rs @@ -1,6 +1,6 @@ enum Foo { - A = foo(), //~ ERROR: type annotations needed - B = foo(), //~ ERROR: type annotations needed + A = foo(), //~ ERROR type annotations needed + B = foo(), //~ ERROR type annotations needed } const fn foo() -> isize { diff --git a/tests/ui/consts/issue-66693-panic-in-array-len.rs b/tests/ui/consts/issue-66693-panic-in-array-len.rs index fc0dcd7a44daa..4a3259e338d7b 100644 --- a/tests/ui/consts/issue-66693-panic-in-array-len.rs +++ b/tests/ui/consts/issue-66693-panic-in-array-len.rs @@ -4,11 +4,11 @@ fn main() { let _ = [0i32; panic!(2f32)]; - //~^ ERROR: argument to `panic!()` in a const context must have type `&str` + //~^ ERROR argument to `panic!()` in a const context must have type `&str` // ensure that conforming panics are handled correctly let _ = [false; panic!()]; - //~^ ERROR: evaluation of constant value failed + //~^ ERROR evaluation of constant value failed // typechecking halts before getting to this one let _ = ['a', panic!("panic in array len")]; diff --git a/tests/ui/consts/issue-66693.rs b/tests/ui/consts/issue-66693.rs index 416bd8ec72aef..31ae843bf5fa3 100644 --- a/tests/ui/consts/issue-66693.rs +++ b/tests/ui/consts/issue-66693.rs @@ -2,19 +2,19 @@ // non-`&str` argument. const _: () = panic!(1); -//~^ ERROR: argument to `panic!()` in a const context must have type `&str` +//~^ ERROR argument to `panic!()` in a const context must have type `&str` static _FOO: () = panic!(true); -//~^ ERROR: argument to `panic!()` in a const context must have type `&str` +//~^ ERROR argument to `panic!()` in a const context must have type `&str` const fn _foo() { panic!(&1); - //~^ ERROR: argument to `panic!()` in a const context must have type `&str` + //~^ ERROR argument to `panic!()` in a const context must have type `&str` } // ensure that conforming panics don't cause an error beyond the failure to const eval const _: () = panic!(); -//~^ ERROR: evaluation of constant value failed +//~^ ERROR evaluation of constant value failed static _BAR: () = panic!("panic in static"); //~^ ERROR could not evaluate static initializer diff --git a/tests/ui/consts/issue-87046.rs b/tests/ui/consts/issue-87046.rs index 4b8f9f5364136..568c70fa0efa5 100644 --- a/tests/ui/consts/issue-87046.rs +++ b/tests/ui/consts/issue-87046.rs @@ -26,7 +26,7 @@ impl Username { pub fn is_root(&self) -> bool { match self { ROOT_USER => true, - //~^ ERROR: cannot use unsized non-slice type `Username` in constant patterns + //~^ ERROR cannot use unsized non-slice type `Username` in constant patterns _ => false, } } diff --git a/tests/ui/consts/issue-90870.rs b/tests/ui/consts/issue-90870.rs index b62769a33f8e2..f7da10d2a5a44 100644 --- a/tests/ui/consts/issue-90870.rs +++ b/tests/ui/consts/issue-90870.rs @@ -4,21 +4,21 @@ const fn f(a: &u8, b: &u8) -> bool { a == b - //~^ ERROR: cannot call non-const operator in constant functions [E0015] - //~| HELP: consider dereferencing here + //~^ ERROR cannot call non-const operator in constant functions [E0015] + //~| HELP consider dereferencing here } const fn g(a: &&&&i64, b: &&&&i64) -> bool { a == b - //~^ ERROR: cannot call non-const operator in constant functions [E0015] - //~| HELP: consider dereferencing here + //~^ ERROR cannot call non-const operator in constant functions [E0015] + //~| HELP consider dereferencing here } const fn h(mut a: &[u8], mut b: &[u8]) -> bool { while let ([l, at @ ..], [r, bt @ ..]) = (a, b) { if l == r { - //~^ ERROR: cannot call non-const operator in constant functions [E0015] - //~| HELP: consider dereferencing here + //~^ ERROR cannot call non-const operator in constant functions [E0015] + //~| HELP consider dereferencing here a = at; b = bt; } else { diff --git a/tests/ui/consts/issue-91434.rs b/tests/ui/consts/issue-91434.rs index 001dc708f8932..451b5f0fae016 100644 --- a/tests/ui/consts/issue-91434.rs +++ b/tests/ui/consts/issue-91434.rs @@ -1,5 +1,5 @@ fn main() { [9; [[9E; h]]]; - //~^ ERROR: expected at least one digit in exponent - //~| ERROR: cannot find value `h` in this scope [E0425] + //~^ ERROR expected at least one digit in exponent + //~| ERROR cannot find value `h` in this scope [E0425] } diff --git a/tests/ui/consts/issue-91560.fixed b/tests/ui/consts/issue-91560.fixed index b975e6ee958d5..a9dc9deb525df 100644 --- a/tests/ui/consts/issue-91560.fixed +++ b/tests/ui/consts/issue-91560.fixed @@ -6,16 +6,16 @@ fn foo() { const length: usize = 2; - //~^ HELP: consider using `const` + //~^ HELP consider using `const` let arr = [0; length]; - //~^ ERROR: attempt to use a non-constant value in a constant [E0435] + //~^ ERROR attempt to use a non-constant value in a constant [E0435] } fn bar() { const length: usize = 2; - //~^ HELP: consider using `const` + //~^ HELP consider using `const` let arr = [0; length]; - //~^ ERROR: attempt to use a non-constant value in a constant [E0435] + //~^ ERROR attempt to use a non-constant value in a constant [E0435] } fn main() {} diff --git a/tests/ui/consts/issue-91560.rs b/tests/ui/consts/issue-91560.rs index 5e7e1cbe1e5ac..ec307ddb72e58 100644 --- a/tests/ui/consts/issue-91560.rs +++ b/tests/ui/consts/issue-91560.rs @@ -6,16 +6,16 @@ fn foo() { let mut length: usize = 2; - //~^ HELP: consider using `const` + //~^ HELP consider using `const` let arr = [0; length]; - //~^ ERROR: attempt to use a non-constant value in a constant [E0435] + //~^ ERROR attempt to use a non-constant value in a constant [E0435] } fn bar() { let length: usize = 2; - //~^ HELP: consider using `const` + //~^ HELP consider using `const` let arr = [0; length]; - //~^ ERROR: attempt to use a non-constant value in a constant [E0435] + //~^ ERROR attempt to use a non-constant value in a constant [E0435] } fn main() {} diff --git a/tests/ui/consts/issue-94675.rs b/tests/ui/consts/issue-94675.rs index 87c8b04452bac..7c3e942f4b9f2 100644 --- a/tests/ui/consts/issue-94675.rs +++ b/tests/ui/consts/issue-94675.rs @@ -7,7 +7,7 @@ struct Foo<'a> { impl<'a> Foo<'a> { const fn spam(&mut self, baz: &mut Vec) { self.bar[0] = baz.len(); - //~^ ERROR: cannot call + //~^ ERROR cannot call } } diff --git a/tests/ui/consts/min_const_fn/recursive_const_stab_unmarked_crate_imports.rs b/tests/ui/consts/min_const_fn/recursive_const_stab_unmarked_crate_imports.rs index 06ce406fd8994..b9853dcb94777 100644 --- a/tests/ui/consts/min_const_fn/recursive_const_stab_unmarked_crate_imports.rs +++ b/tests/ui/consts/min_const_fn/recursive_const_stab_unmarked_crate_imports.rs @@ -13,9 +13,9 @@ const fn stable_fn() { unstable_if_unmarked_const_fn_crate::expose_on_stable(); // This one is not. unstable_if_unmarked_const_fn_crate::not_stably_const(); - //~^ERROR: cannot use `#[feature(rustc_private)]` + //~^ERROR cannot use `#[feature(rustc_private)]` unmarked_const_fn_crate::just_a_fn(); - //~^ERROR: cannot be (indirectly) exposed to stable + //~^ERROR cannot be (indirectly) exposed to stable } fn main() {} diff --git a/tests/ui/consts/min_const_fn/recursive_const_stab_unstable_if_unmarked.rs b/tests/ui/consts/min_const_fn/recursive_const_stab_unstable_if_unmarked.rs index 429fa060521f5..57c13678acd03 100644 --- a/tests/ui/consts/min_const_fn/recursive_const_stab_unstable_if_unmarked.rs +++ b/tests/ui/consts/min_const_fn/recursive_const_stab_unstable_if_unmarked.rs @@ -13,10 +13,10 @@ pub const fn not_stably_const() { pub const fn expose_on_stable() { // Calling `not_stably_const` here is *not* okay. not_stably_const(); - //~^ERROR: cannot use `#[feature(rustc_private)]` + //~^ERROR cannot use `#[feature(rustc_private)]` // Also directly using const-unstable things is not okay. let _x = async { 15 }; - //~^ERROR: cannot use `#[feature(const_async_blocks)]` + //~^ERROR cannot use `#[feature(const_async_blocks)]` } fn main() { diff --git a/tests/ui/consts/miri_unleashed/mutable_references.rs b/tests/ui/consts/miri_unleashed/mutable_references.rs index e7fc5699236ee..07cc858a39c69 100644 --- a/tests/ui/consts/miri_unleashed/mutable_references.rs +++ b/tests/ui/consts/miri_unleashed/mutable_references.rs @@ -24,11 +24,11 @@ static BOO: &mut Foo<()> = &mut Foo(()); //~^ ERROR encountered mutable pointer in final value of static const BLUNT: &mut i32 = &mut 42; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value //~| pointing to read-only memory const SUBTLE: &mut i32 = unsafe { - //~^ ERROR: it is undefined behavior to use this value + //~^ ERROR it is undefined behavior to use this value //~| constructing invalid value: encountered reference to mutable memory in `const` static mut STATIC: i32 = 0; &mut STATIC @@ -59,31 +59,31 @@ unsafe impl Sync for Synced {} // Make sure we also catch this behind a type-erased `dyn Trait` reference. const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value //~| `UnsafeCell` in read-only memory // # Check for mutable references to read-only memory static READONLY: i32 = 0; static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) }; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value //~| pointing to read-only memory // # Check for consts pointing to mutable memory static mut MUTABLE: i32 = 42; -const POINTS_TO_MUTABLE: &i32 = unsafe { &MUTABLE }; //~ERROR: undefined behavior +const POINTS_TO_MUTABLE: &i32 = unsafe { &MUTABLE }; //~ERROR undefined behavior //~| encountered reference to mutable memory static mut MUTABLE_REF: &mut i32 = &mut 42; const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF }; -//~^ ERROR: evaluation of constant value failed +//~^ ERROR evaluation of constant value failed //~| accesses mutable global memory const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _; -//~^ ERROR: mutable pointer in final value +//~^ ERROR mutable pointer in final value const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _; -//~^ ERROR: mutable pointer in final value +//~^ ERROR mutable pointer in final value // This does *not* error since it uses a shared reference, and we have to ignore // those. See . diff --git a/tests/ui/consts/missing_assoc_const_type2.rs b/tests/ui/consts/missing_assoc_const_type2.rs index baf236700a396..31038effb637c 100644 --- a/tests/ui/consts/missing_assoc_const_type2.rs +++ b/tests/ui/consts/missing_assoc_const_type2.rs @@ -10,7 +10,7 @@ trait Range { struct TwoDigits; impl Range for TwoDigits { const FIRST: = 10; - //~^ ERROR: missing type + //~^ ERROR missing type const LAST: u8 = 99; } diff --git a/tests/ui/consts/nested_erroneous_ctfe.rs b/tests/ui/consts/nested_erroneous_ctfe.rs index 1ec271401fb4c..f51c062ba5679 100644 --- a/tests/ui/consts/nested_erroneous_ctfe.rs +++ b/tests/ui/consts/nested_erroneous_ctfe.rs @@ -1,4 +1,4 @@ fn main() { [9; || [9; []]]; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/consts/no-ice-from-static-in-const-issue-52060.rs b/tests/ui/consts/no-ice-from-static-in-const-issue-52060.rs index e0f9e462d32e8..3f42c0d21c6d2 100644 --- a/tests/ui/consts/no-ice-from-static-in-const-issue-52060.rs +++ b/tests/ui/consts/no-ice-from-static-in-const-issue-52060.rs @@ -3,7 +3,7 @@ static mut A: &'static [u32] = &[1]; static B: [u32; 1] = [0; unsafe { A.len() }]; -//~^ ERROR: evaluation of constant value failed +//~^ ERROR evaluation of constant value failed //~| mutable global memory fn main() {} diff --git a/tests/ui/consts/overflowing-consts.rs b/tests/ui/consts/overflowing-consts.rs index 5ff205ce58e66..4ac8f2f4891ba 100644 --- a/tests/ui/consts/overflowing-consts.rs +++ b/tests/ui/consts/overflowing-consts.rs @@ -16,273 +16,273 @@ const BITS: usize = 32; const BITS: usize = 64; // Shift left -const _NI8_SHL: i8 = 1i8 << 8; //~ ERROR: evaluation of constant value failed -const _NI8_SHL_P: &i8 = &(1i8 << 8); //~ ERROR: evaluation of constant value failed +const _NI8_SHL: i8 = 1i8 << 8; //~ ERROR evaluation of constant value failed +const _NI8_SHL_P: &i8 = &(1i8 << 8); //~ ERROR evaluation of constant value failed -const _NI16_SHL: i16 = 1i16 << 16; //~ ERROR: evaluation of constant value failed -const _NI16_SHL_P: &i16 = &(1i16 << 16); //~ ERROR: evaluation of constant value failed +const _NI16_SHL: i16 = 1i16 << 16; //~ ERROR evaluation of constant value failed +const _NI16_SHL_P: &i16 = &(1i16 << 16); //~ ERROR evaluation of constant value failed -const _NI32_SHL: i32 = 1i32 << 32; //~ ERROR: evaluation of constant value failed -const _NI32_SHL_P: &i32 = &(1i32 << 32); //~ ERROR: evaluation of constant value failed +const _NI32_SHL: i32 = 1i32 << 32; //~ ERROR evaluation of constant value failed +const _NI32_SHL_P: &i32 = &(1i32 << 32); //~ ERROR evaluation of constant value failed -const _NI64_SHL: i64 = 1i64 << 64; //~ ERROR: evaluation of constant value failed -const _NI64_SHL_P: &i64 = &(1i64 << 64); //~ ERROR: evaluation of constant value failed +const _NI64_SHL: i64 = 1i64 << 64; //~ ERROR evaluation of constant value failed +const _NI64_SHL_P: &i64 = &(1i64 << 64); //~ ERROR evaluation of constant value failed -const _NI128_SHL: i128 = 1i128 << 128; //~ ERROR: evaluation of constant value failed -const _NI128_SHL_P: &i128 = &(1i128 << 128); //~ ERROR: evaluation of constant value failed +const _NI128_SHL: i128 = 1i128 << 128; //~ ERROR evaluation of constant value failed +const _NI128_SHL_P: &i128 = &(1i128 << 128); //~ ERROR evaluation of constant value failed -const _NU8_SHL: u8 = 1u8 << 8; //~ ERROR: evaluation of constant value failed -const _NU8_SHL_P: &u8 = &(1u8 << 8); //~ ERROR: evaluation of constant value failed +const _NU8_SHL: u8 = 1u8 << 8; //~ ERROR evaluation of constant value failed +const _NU8_SHL_P: &u8 = &(1u8 << 8); //~ ERROR evaluation of constant value failed -const _NU16_SHL: u16 = 1u16 << 16; //~ ERROR: evaluation of constant value failed -const _NU16_SHL_P: &u16 = &(1u16 << 16); //~ ERROR: evaluation of constant value failed +const _NU16_SHL: u16 = 1u16 << 16; //~ ERROR evaluation of constant value failed +const _NU16_SHL_P: &u16 = &(1u16 << 16); //~ ERROR evaluation of constant value failed -const _NU32_SHL: u32 = 1u32 << 32; //~ ERROR: evaluation of constant value failed -const _NU32_SHL_P: &u32 = &(1u32 << 32); //~ ERROR: evaluation of constant value failed +const _NU32_SHL: u32 = 1u32 << 32; //~ ERROR evaluation of constant value failed +const _NU32_SHL_P: &u32 = &(1u32 << 32); //~ ERROR evaluation of constant value failed -const _NU64_SHL: u64 = 1u64 << 64; //~ ERROR: evaluation of constant value failed -const _NU64_SHL_P: &u64 = &(1u64 << 64); //~ ERROR: evaluation of constant value failed +const _NU64_SHL: u64 = 1u64 << 64; //~ ERROR evaluation of constant value failed +const _NU64_SHL_P: &u64 = &(1u64 << 64); //~ ERROR evaluation of constant value failed -const _NU128_SHL: u128 = 1u128 << 128; //~ ERROR: evaluation of constant value failed -const _NU128_SHL_P: &u128 = &(1u128 << 128); //~ ERROR: evaluation of constant value failed +const _NU128_SHL: u128 = 1u128 << 128; //~ ERROR evaluation of constant value failed +const _NU128_SHL_P: &u128 = &(1u128 << 128); //~ ERROR evaluation of constant value failed -const _NISIZE_SHL: isize = 1isize << BITS; //~ ERROR: evaluation of constant value failed -const _NISIZE_SHL_P: &isize = &(1isize << BITS); //~ ERROR: evaluation of constant value failed +const _NISIZE_SHL: isize = 1isize << BITS; //~ ERROR evaluation of constant value failed +const _NISIZE_SHL_P: &isize = &(1isize << BITS); //~ ERROR evaluation of constant value failed -const _NUSIZE_SHL: usize = 1usize << BITS; //~ ERROR: evaluation of constant value failed -const _NUSIZE_SHL_P: &usize = &(1usize << BITS); //~ ERROR: evaluation of constant value failed +const _NUSIZE_SHL: usize = 1usize << BITS; //~ ERROR evaluation of constant value failed +const _NUSIZE_SHL_P: &usize = &(1usize << BITS); //~ ERROR evaluation of constant value failed // Shift right -const _NI8_SHR: i8 = 1i8 >> 8; //~ ERROR: evaluation of constant value failed -const _NI8_SHR_P: &i8 = &(1i8 >> 8); //~ ERROR: evaluation of constant value failed +const _NI8_SHR: i8 = 1i8 >> 8; //~ ERROR evaluation of constant value failed +const _NI8_SHR_P: &i8 = &(1i8 >> 8); //~ ERROR evaluation of constant value failed -const _NI16_SHR: i16 = 1i16 >> 16; //~ ERROR: evaluation of constant value failed -const _NI16_SHR_P: &i16 = &(1i16 >> 16); //~ ERROR: evaluation of constant value failed +const _NI16_SHR: i16 = 1i16 >> 16; //~ ERROR evaluation of constant value failed +const _NI16_SHR_P: &i16 = &(1i16 >> 16); //~ ERROR evaluation of constant value failed -const _NI32_SHR: i32 = 1i32 >> 32; //~ ERROR: evaluation of constant value failed -const _NI32_SHR_P: &i32 = &(1i32 >> 32); //~ ERROR: evaluation of constant value failed +const _NI32_SHR: i32 = 1i32 >> 32; //~ ERROR evaluation of constant value failed +const _NI32_SHR_P: &i32 = &(1i32 >> 32); //~ ERROR evaluation of constant value failed -const _NI64_SHR: i64 = 1i64 >> 64; //~ ERROR: evaluation of constant value failed -const _NI64_SHR_P: &i64 = &(1i64 >> 64); //~ ERROR: evaluation of constant value failed +const _NI64_SHR: i64 = 1i64 >> 64; //~ ERROR evaluation of constant value failed +const _NI64_SHR_P: &i64 = &(1i64 >> 64); //~ ERROR evaluation of constant value failed -const _NI128_SHR: i128 = 1i128 >> 128; //~ ERROR: evaluation of constant value failed -const _NI128_SHR_P: &i128 = &(1i128 >> 128); //~ ERROR: evaluation of constant value failed +const _NI128_SHR: i128 = 1i128 >> 128; //~ ERROR evaluation of constant value failed +const _NI128_SHR_P: &i128 = &(1i128 >> 128); //~ ERROR evaluation of constant value failed -const _NU8_SHR: u8 = 1u8 >> 8; //~ ERROR: evaluation of constant value failed -const _NU8_SHR_P: &u8 = &(1u8 >> 8); //~ ERROR: evaluation of constant value failed +const _NU8_SHR: u8 = 1u8 >> 8; //~ ERROR evaluation of constant value failed +const _NU8_SHR_P: &u8 = &(1u8 >> 8); //~ ERROR evaluation of constant value failed -const _NU16_SHR: u16 = 1u16 >> 16; //~ ERROR: evaluation of constant value failed -const _NU16_SHR_P: &u16 = &(1u16 >> 16); //~ ERROR: evaluation of constant value failed +const _NU16_SHR: u16 = 1u16 >> 16; //~ ERROR evaluation of constant value failed +const _NU16_SHR_P: &u16 = &(1u16 >> 16); //~ ERROR evaluation of constant value failed -const _NU32_SHR: u32 = 1u32 >> 32; //~ ERROR: evaluation of constant value failed -const _NU32_SHR_P: &u32 = &(1u32 >> 32); //~ ERROR: evaluation of constant value failed +const _NU32_SHR: u32 = 1u32 >> 32; //~ ERROR evaluation of constant value failed +const _NU32_SHR_P: &u32 = &(1u32 >> 32); //~ ERROR evaluation of constant value failed -const _NU64_SHR: u64 = 1u64 >> 64; //~ ERROR: evaluation of constant value failed -const _NU64_SHR_P: &u64 = &(1u64 >> 64); //~ ERROR: evaluation of constant value failed +const _NU64_SHR: u64 = 1u64 >> 64; //~ ERROR evaluation of constant value failed +const _NU64_SHR_P: &u64 = &(1u64 >> 64); //~ ERROR evaluation of constant value failed -const _NU128_SHR: u128 = 1u128 >> 128; //~ ERROR: evaluation of constant value failed -const _NU128_SHR_P: &u128 = &(1u128 >> 128); //~ ERROR: evaluation of constant value failed +const _NU128_SHR: u128 = 1u128 >> 128; //~ ERROR evaluation of constant value failed +const _NU128_SHR_P: &u128 = &(1u128 >> 128); //~ ERROR evaluation of constant value failed -const _NISIZE_SHR: isize = 1isize >> BITS; //~ ERROR: evaluation of constant value failed -const _NISIZE_SHR_P: &isize = &(1isize >> BITS); //~ ERROR: evaluation of constant value failed +const _NISIZE_SHR: isize = 1isize >> BITS; //~ ERROR evaluation of constant value failed +const _NISIZE_SHR_P: &isize = &(1isize >> BITS); //~ ERROR evaluation of constant value failed -const _NUSIZE_SHR: usize = 1usize >> BITS; //~ ERROR: evaluation of constant value failed -const _NUSIZE_SHR_P: &usize = &(1usize >> BITS); //~ ERROR: evaluation of constant value failed +const _NUSIZE_SHR: usize = 1usize >> BITS; //~ ERROR evaluation of constant value failed +const _NUSIZE_SHR_P: &usize = &(1usize >> BITS); //~ ERROR evaluation of constant value failed // Addition -const _NI8_ADD: i8 = 1i8 + i8::MAX; //~ ERROR: evaluation of constant value failed -const _NI8_ADD_P: &i8 = &(1i8 + i8::MAX); //~ ERROR: evaluation of constant value failed +const _NI8_ADD: i8 = 1i8 + i8::MAX; //~ ERROR evaluation of constant value failed +const _NI8_ADD_P: &i8 = &(1i8 + i8::MAX); //~ ERROR evaluation of constant value failed -const _NI16_ADD: i16 = 1i16 + i16::MAX; //~ ERROR: evaluation of constant value failed -const _NI16_ADD_P: &i16 = &(1i16 + i16::MAX); //~ ERROR: evaluation of constant value failed +const _NI16_ADD: i16 = 1i16 + i16::MAX; //~ ERROR evaluation of constant value failed +const _NI16_ADD_P: &i16 = &(1i16 + i16::MAX); //~ ERROR evaluation of constant value failed -const _NI32_ADD: i32 = 1i32 + i32::MAX; //~ ERROR: evaluation of constant value failed -const _NI32_ADD_P: &i32 = &(1i32 + i32::MAX); //~ ERROR: evaluation of constant value failed +const _NI32_ADD: i32 = 1i32 + i32::MAX; //~ ERROR evaluation of constant value failed +const _NI32_ADD_P: &i32 = &(1i32 + i32::MAX); //~ ERROR evaluation of constant value failed -const _NI64_ADD: i64 = 1i64 + i64::MAX; //~ ERROR: evaluation of constant value failed -const _NI64_ADD_P: &i64 = &(1i64 + i64::MAX); //~ ERROR: evaluation of constant value failed +const _NI64_ADD: i64 = 1i64 + i64::MAX; //~ ERROR evaluation of constant value failed +const _NI64_ADD_P: &i64 = &(1i64 + i64::MAX); //~ ERROR evaluation of constant value failed -const _NI128_ADD: i128 = 1i128 + i128::MAX; //~ ERROR: evaluation of constant value failed -const _NI128_ADD_P: &i128 = &(1i128 + i128::MAX); //~ ERROR: evaluation of constant value failed +const _NI128_ADD: i128 = 1i128 + i128::MAX; //~ ERROR evaluation of constant value failed +const _NI128_ADD_P: &i128 = &(1i128 + i128::MAX); //~ ERROR evaluation of constant value failed -const _NU8_ADD: u8 = 1u8 + u8::MAX; //~ ERROR: evaluation of constant value failed -const _NU8_ADD_P: &u8 = &(1u8 + u8::MAX); //~ ERROR: evaluation of constant value failed +const _NU8_ADD: u8 = 1u8 + u8::MAX; //~ ERROR evaluation of constant value failed +const _NU8_ADD_P: &u8 = &(1u8 + u8::MAX); //~ ERROR evaluation of constant value failed -const _NU16_ADD: u16 = 1u16 + u16::MAX; //~ ERROR: evaluation of constant value failed -const _NU16_ADD_P: &u16 = &(1u16 + u16::MAX); //~ ERROR: evaluation of constant value failed +const _NU16_ADD: u16 = 1u16 + u16::MAX; //~ ERROR evaluation of constant value failed +const _NU16_ADD_P: &u16 = &(1u16 + u16::MAX); //~ ERROR evaluation of constant value failed -const _NU32_ADD: u32 = 1u32 + u32::MAX; //~ ERROR: evaluation of constant value failed -const _NU32_ADD_P: &u32 = &(1u32 + u32::MAX); //~ ERROR: evaluation of constant value failed +const _NU32_ADD: u32 = 1u32 + u32::MAX; //~ ERROR evaluation of constant value failed +const _NU32_ADD_P: &u32 = &(1u32 + u32::MAX); //~ ERROR evaluation of constant value failed -const _NU64_ADD: u64 = 1u64 + u64::MAX; //~ ERROR: evaluation of constant value failed -const _NU64_ADD_P: &u64 = &(1u64 + u64::MAX); //~ ERROR: evaluation of constant value failed +const _NU64_ADD: u64 = 1u64 + u64::MAX; //~ ERROR evaluation of constant value failed +const _NU64_ADD_P: &u64 = &(1u64 + u64::MAX); //~ ERROR evaluation of constant value failed -const _NU128_ADD: u128 = 1u128 + u128::MAX; //~ ERROR: evaluation of constant value failed -const _NU128_ADD_P: &u128 = &(1u128 + u128::MAX); //~ ERROR: evaluation of constant value failed +const _NU128_ADD: u128 = 1u128 + u128::MAX; //~ ERROR evaluation of constant value failed +const _NU128_ADD_P: &u128 = &(1u128 + u128::MAX); //~ ERROR evaluation of constant value failed -const _NISIZE_ADD: isize = 1isize + isize::MAX; //~ ERROR: evaluation of constant value failed -const _NISIZE_ADD_P: &isize = &(1isize + isize::MAX); //~ ERROR: evaluation of constant value failed +const _NISIZE_ADD: isize = 1isize + isize::MAX; //~ ERROR evaluation of constant value failed +const _NISIZE_ADD_P: &isize = &(1isize + isize::MAX); //~ ERROR evaluation of constant value failed -const _NUSIZE_ADD: usize = 1usize + usize::MAX; //~ ERROR: evaluation of constant value failed -const _NUSIZE_ADD_P: &usize = &(1usize + usize::MAX); //~ ERROR: evaluation of constant value failed +const _NUSIZE_ADD: usize = 1usize + usize::MAX; //~ ERROR evaluation of constant value failed +const _NUSIZE_ADD_P: &usize = &(1usize + usize::MAX); //~ ERROR evaluation of constant value failed // Subtraction -const _NI8_SUB: i8 = -5i8 - i8::MAX; //~ ERROR: evaluation of constant value failed -const _NI8_SUB_P: &i8 = &(-5i8 - i8::MAX); //~ ERROR: evaluation of constant value failed +const _NI8_SUB: i8 = -5i8 - i8::MAX; //~ ERROR evaluation of constant value failed +const _NI8_SUB_P: &i8 = &(-5i8 - i8::MAX); //~ ERROR evaluation of constant value failed -const _NI16_SUB: i16 = -5i16 - i16::MAX; //~ ERROR: evaluation of constant value failed -const _NI16_SUB_P: &i16 = &(-5i16 - i16::MAX); //~ ERROR: evaluation of constant value failed +const _NI16_SUB: i16 = -5i16 - i16::MAX; //~ ERROR evaluation of constant value failed +const _NI16_SUB_P: &i16 = &(-5i16 - i16::MAX); //~ ERROR evaluation of constant value failed -const _NI32_SUB: i32 = -5i32 - i32::MAX; //~ ERROR: evaluation of constant value failed -const _NI32_SUB_P: &i32 = &(-5i32 - i32::MAX); //~ ERROR: evaluation of constant value failed +const _NI32_SUB: i32 = -5i32 - i32::MAX; //~ ERROR evaluation of constant value failed +const _NI32_SUB_P: &i32 = &(-5i32 - i32::MAX); //~ ERROR evaluation of constant value failed -const _NI64_SUB: i64 = -5i64 - i64::MAX; //~ ERROR: evaluation of constant value failed -const _NI64_SUB_P: &i64 = &(-5i64 - i64::MAX); //~ ERROR: evaluation of constant value failed +const _NI64_SUB: i64 = -5i64 - i64::MAX; //~ ERROR evaluation of constant value failed +const _NI64_SUB_P: &i64 = &(-5i64 - i64::MAX); //~ ERROR evaluation of constant value failed -const _NI128_SUB: i128 = -5i128 - i128::MAX; //~ ERROR: evaluation of constant value failed -const _NI128_SUB_P: &i128 = &(-5i128 - i128::MAX); //~ ERROR: evaluation of constant value failed +const _NI128_SUB: i128 = -5i128 - i128::MAX; //~ ERROR evaluation of constant value failed +const _NI128_SUB_P: &i128 = &(-5i128 - i128::MAX); //~ ERROR evaluation of constant value failed -const _NU8_SUB: u8 = 1u8 - 5; //~ ERROR: evaluation of constant value failed -const _NU8_SUB_P: &u8 = &(1u8 - 5); //~ ERROR: evaluation of constant value failed +const _NU8_SUB: u8 = 1u8 - 5; //~ ERROR evaluation of constant value failed +const _NU8_SUB_P: &u8 = &(1u8 - 5); //~ ERROR evaluation of constant value failed -const _NU16_SUB: u16 = 1u16 - 5; //~ ERROR: evaluation of constant value failed -const _NU16_SUB_P: &u16 = &(1u16 - 5); //~ ERROR: evaluation of constant value failed +const _NU16_SUB: u16 = 1u16 - 5; //~ ERROR evaluation of constant value failed +const _NU16_SUB_P: &u16 = &(1u16 - 5); //~ ERROR evaluation of constant value failed -const _NU32_SUB: u32 = 1u32 - 5; //~ ERROR: evaluation of constant value failed -const _NU32_SUB_P: &u32 = &(1u32 - 5); //~ ERROR: evaluation of constant value failed +const _NU32_SUB: u32 = 1u32 - 5; //~ ERROR evaluation of constant value failed +const _NU32_SUB_P: &u32 = &(1u32 - 5); //~ ERROR evaluation of constant value failed -const _NU64_SUB: u64 = 1u64 - 5; //~ ERROR: evaluation of constant value failed -const _NU64_SUB_P: &u64 = &(1u64 - 5); //~ ERROR: evaluation of constant value failed +const _NU64_SUB: u64 = 1u64 - 5; //~ ERROR evaluation of constant value failed +const _NU64_SUB_P: &u64 = &(1u64 - 5); //~ ERROR evaluation of constant value failed -const _NU128_SUB: u128 = 1u128 - 5; //~ ERROR: evaluation of constant value failed -const _NU128_SUB_P: &u128 = &(1u128 - 5); //~ ERROR: evaluation of constant value failed +const _NU128_SUB: u128 = 1u128 - 5; //~ ERROR evaluation of constant value failed +const _NU128_SUB_P: &u128 = &(1u128 - 5); //~ ERROR evaluation of constant value failed -const _NISIZE_SUB: isize = -5isize - isize::MAX; //~ ERROR: evaluation of constant value failed -const _NISIZE_SUB_P: &isize = &(-5isize - isize::MAX); //~ ERROR: evaluation of constant value failed +const _NISIZE_SUB: isize = -5isize - isize::MAX; //~ ERROR evaluation of constant value failed +const _NISIZE_SUB_P: &isize = &(-5isize - isize::MAX); //~ ERROR evaluation of constant value failed -const _NUSIZE_SUB: usize = 1usize - 5 ; //~ ERROR: evaluation of constant value failed -const _NUSIZE_SUB_P: &usize = &(1usize - 5 ); //~ ERROR: evaluation of constant value failed +const _NUSIZE_SUB: usize = 1usize - 5 ; //~ ERROR evaluation of constant value failed +const _NUSIZE_SUB_P: &usize = &(1usize - 5 ); //~ ERROR evaluation of constant value failed // Multiplication -const _NI8_MUL: i8 = i8::MAX * 5; //~ ERROR: evaluation of constant value failed -const _NI8_MUL_P: &i8 = &(i8::MAX * 5); //~ ERROR: evaluation of constant value failed +const _NI8_MUL: i8 = i8::MAX * 5; //~ ERROR evaluation of constant value failed +const _NI8_MUL_P: &i8 = &(i8::MAX * 5); //~ ERROR evaluation of constant value failed -const _NI16_MUL: i16 = i16::MAX * 5; //~ ERROR: evaluation of constant value failed -const _NI16_MUL_P: &i16 = &(i16::MAX * 5); //~ ERROR: evaluation of constant value failed +const _NI16_MUL: i16 = i16::MAX * 5; //~ ERROR evaluation of constant value failed +const _NI16_MUL_P: &i16 = &(i16::MAX * 5); //~ ERROR evaluation of constant value failed -const _NI32_MUL: i32 = i32::MAX * 5; //~ ERROR: evaluation of constant value failed -const _NI32_MUL_P: &i32 = &(i32::MAX * 5); //~ ERROR: evaluation of constant value failed +const _NI32_MUL: i32 = i32::MAX * 5; //~ ERROR evaluation of constant value failed +const _NI32_MUL_P: &i32 = &(i32::MAX * 5); //~ ERROR evaluation of constant value failed -const _NI64_MUL: i64 = i64::MAX * 5; //~ ERROR: evaluation of constant value failed -const _NI64_MUL_P: &i64 = &(i64::MAX * 5); //~ ERROR: evaluation of constant value failed +const _NI64_MUL: i64 = i64::MAX * 5; //~ ERROR evaluation of constant value failed +const _NI64_MUL_P: &i64 = &(i64::MAX * 5); //~ ERROR evaluation of constant value failed -const _NI128_MUL: i128 = i128::MAX * 5; //~ ERROR: evaluation of constant value failed -const _NI128_MUL_P: &i128 = &(i128::MAX * 5); //~ ERROR: evaluation of constant value failed +const _NI128_MUL: i128 = i128::MAX * 5; //~ ERROR evaluation of constant value failed +const _NI128_MUL_P: &i128 = &(i128::MAX * 5); //~ ERROR evaluation of constant value failed -const _NU8_MUL: u8 = u8::MAX * 5; //~ ERROR: evaluation of constant value failed -const _NU8_MUL_P: &u8 = &(u8::MAX * 5); //~ ERROR: evaluation of constant value failed +const _NU8_MUL: u8 = u8::MAX * 5; //~ ERROR evaluation of constant value failed +const _NU8_MUL_P: &u8 = &(u8::MAX * 5); //~ ERROR evaluation of constant value failed -const _NU16_MUL: u16 = u16::MAX * 5; //~ ERROR: evaluation of constant value failed -const _NU16_MUL_P: &u16 = &(u16::MAX * 5); //~ ERROR: evaluation of constant value failed +const _NU16_MUL: u16 = u16::MAX * 5; //~ ERROR evaluation of constant value failed +const _NU16_MUL_P: &u16 = &(u16::MAX * 5); //~ ERROR evaluation of constant value failed -const _NU32_MUL: u32 = u32::MAX * 5; //~ ERROR: evaluation of constant value failed -const _NU32_MUL_P: &u32 = &(u32::MAX * 5); //~ ERROR: evaluation of constant value failed +const _NU32_MUL: u32 = u32::MAX * 5; //~ ERROR evaluation of constant value failed +const _NU32_MUL_P: &u32 = &(u32::MAX * 5); //~ ERROR evaluation of constant value failed -const _NU64_MUL: u64 = u64::MAX * 5; //~ ERROR: evaluation of constant value failed -const _NU64_MUL_P: &u64 = &(u64::MAX * 5); //~ ERROR: evaluation of constant value failed +const _NU64_MUL: u64 = u64::MAX * 5; //~ ERROR evaluation of constant value failed +const _NU64_MUL_P: &u64 = &(u64::MAX * 5); //~ ERROR evaluation of constant value failed -const _NU128_MUL: u128 = u128::MAX * 5; //~ ERROR: evaluation of constant value failed -const _NU128_MUL_P: &u128 = &(u128::MAX * 5); //~ ERROR: evaluation of constant value failed +const _NU128_MUL: u128 = u128::MAX * 5; //~ ERROR evaluation of constant value failed +const _NU128_MUL_P: &u128 = &(u128::MAX * 5); //~ ERROR evaluation of constant value failed -const _NISIZE_MUL: isize = isize::MAX * 5; //~ ERROR: evaluation of constant value failed -const _NISIZE_MUL_P: &isize = &(isize::MAX * 5); //~ ERROR: evaluation of constant value failed +const _NISIZE_MUL: isize = isize::MAX * 5; //~ ERROR evaluation of constant value failed +const _NISIZE_MUL_P: &isize = &(isize::MAX * 5); //~ ERROR evaluation of constant value failed -const _NUSIZE_MUL: usize = usize::MAX * 5; //~ ERROR: evaluation of constant value failed -const _NUSIZE_MUL_P: &usize = &(usize::MAX * 5); //~ ERROR: evaluation of constant value failed +const _NUSIZE_MUL: usize = usize::MAX * 5; //~ ERROR evaluation of constant value failed +const _NUSIZE_MUL_P: &usize = &(usize::MAX * 5); //~ ERROR evaluation of constant value failed // Division -const _NI8_DIV: i8 = 1i8 / 0; //~ ERROR: evaluation of constant value failed -const _NI8_DIV_P: &i8 = &(1i8 / 0); //~ ERROR: evaluation of constant value failed +const _NI8_DIV: i8 = 1i8 / 0; //~ ERROR evaluation of constant value failed +const _NI8_DIV_P: &i8 = &(1i8 / 0); //~ ERROR evaluation of constant value failed -const _NI16_DIV: i16 = 1i16 / 0; //~ ERROR: evaluation of constant value failed -const _NI16_DIV_P: &i16 = &(1i16 / 0); //~ ERROR: evaluation of constant value failed +const _NI16_DIV: i16 = 1i16 / 0; //~ ERROR evaluation of constant value failed +const _NI16_DIV_P: &i16 = &(1i16 / 0); //~ ERROR evaluation of constant value failed -const _NI32_DIV: i32 = 1i32 / 0; //~ ERROR: evaluation of constant value failed -const _NI32_DIV_P: &i32 = &(1i32 / 0); //~ ERROR: evaluation of constant value failed +const _NI32_DIV: i32 = 1i32 / 0; //~ ERROR evaluation of constant value failed +const _NI32_DIV_P: &i32 = &(1i32 / 0); //~ ERROR evaluation of constant value failed -const _NI64_DIV: i64 = 1i64 / 0; //~ ERROR: evaluation of constant value failed -const _NI64_DIV_P: &i64 = &(1i64 / 0); //~ ERROR: evaluation of constant value failed +const _NI64_DIV: i64 = 1i64 / 0; //~ ERROR evaluation of constant value failed +const _NI64_DIV_P: &i64 = &(1i64 / 0); //~ ERROR evaluation of constant value failed -const _NI128_DIV: i128 = 1i128 / 0; //~ ERROR: evaluation of constant value failed -const _NI128_DIV_P: &i128 = &(1i128 / 0); //~ ERROR: evaluation of constant value failed +const _NI128_DIV: i128 = 1i128 / 0; //~ ERROR evaluation of constant value failed +const _NI128_DIV_P: &i128 = &(1i128 / 0); //~ ERROR evaluation of constant value failed -const _NU8_DIV: u8 = 1u8 / 0; //~ ERROR: evaluation of constant value failed -const _NU8_DIV_P: &u8 = &(1u8 / 0); //~ ERROR: evaluation of constant value failed +const _NU8_DIV: u8 = 1u8 / 0; //~ ERROR evaluation of constant value failed +const _NU8_DIV_P: &u8 = &(1u8 / 0); //~ ERROR evaluation of constant value failed -const _NU16_DIV: u16 = 1u16 / 0; //~ ERROR: evaluation of constant value failed -const _NU16_DIV_P: &u16 = &(1u16 / 0); //~ ERROR: evaluation of constant value failed +const _NU16_DIV: u16 = 1u16 / 0; //~ ERROR evaluation of constant value failed +const _NU16_DIV_P: &u16 = &(1u16 / 0); //~ ERROR evaluation of constant value failed -const _NU32_DIV: u32 = 1u32 / 0; //~ ERROR: evaluation of constant value failed -const _NU32_DIV_P: &u32 = &(1u32 / 0); //~ ERROR: evaluation of constant value failed +const _NU32_DIV: u32 = 1u32 / 0; //~ ERROR evaluation of constant value failed +const _NU32_DIV_P: &u32 = &(1u32 / 0); //~ ERROR evaluation of constant value failed -const _NU64_DIV: u64 = 1u64 / 0; //~ ERROR: evaluation of constant value failed -const _NU64_DIV_P: &u64 = &(1u64 / 0); //~ ERROR: evaluation of constant value failed +const _NU64_DIV: u64 = 1u64 / 0; //~ ERROR evaluation of constant value failed +const _NU64_DIV_P: &u64 = &(1u64 / 0); //~ ERROR evaluation of constant value failed -const _NU128_DIV: u128 = 1u128 / 0; //~ ERROR: evaluation of constant value failed -const _NU128_DIV_P: &u128 = &(1u128 / 0); //~ ERROR: evaluation of constant value failed +const _NU128_DIV: u128 = 1u128 / 0; //~ ERROR evaluation of constant value failed +const _NU128_DIV_P: &u128 = &(1u128 / 0); //~ ERROR evaluation of constant value failed -const _NISIZE_DIV: isize = 1isize / 0; //~ ERROR: evaluation of constant value failed -const _NISIZE_DIV_P: &isize = &(1isize / 0); //~ ERROR: evaluation of constant value failed +const _NISIZE_DIV: isize = 1isize / 0; //~ ERROR evaluation of constant value failed +const _NISIZE_DIV_P: &isize = &(1isize / 0); //~ ERROR evaluation of constant value failed -const _NUSIZE_DIV: usize = 1usize / 0; //~ ERROR: evaluation of constant value failed -const _NUSIZE_DIV_P: &usize = &(1usize / 0); //~ ERROR: evaluation of constant value failed +const _NUSIZE_DIV: usize = 1usize / 0; //~ ERROR evaluation of constant value failed +const _NUSIZE_DIV_P: &usize = &(1usize / 0); //~ ERROR evaluation of constant value failed // Modulus -const _NI8_MOD: i8 = 1i8 % 0; //~ ERROR: evaluation of constant value failed -const _NI8_MOD_P: &i8 = &(1i8 % 0); //~ ERROR: evaluation of constant value failed +const _NI8_MOD: i8 = 1i8 % 0; //~ ERROR evaluation of constant value failed +const _NI8_MOD_P: &i8 = &(1i8 % 0); //~ ERROR evaluation of constant value failed -const _NI16_MOD: i16 = 1i16 % 0; //~ ERROR: evaluation of constant value failed -const _NI16_MOD_P: &i16 = &(1i16 % 0); //~ ERROR: evaluation of constant value failed +const _NI16_MOD: i16 = 1i16 % 0; //~ ERROR evaluation of constant value failed +const _NI16_MOD_P: &i16 = &(1i16 % 0); //~ ERROR evaluation of constant value failed -const _NI32_MOD: i32 = 1i32 % 0; //~ ERROR: evaluation of constant value failed -const _NI32_MOD_P: &i32 = &(1i32 % 0); //~ ERROR: evaluation of constant value failed +const _NI32_MOD: i32 = 1i32 % 0; //~ ERROR evaluation of constant value failed +const _NI32_MOD_P: &i32 = &(1i32 % 0); //~ ERROR evaluation of constant value failed -const _NI64_MOD: i64 = 1i64 % 0; //~ ERROR: evaluation of constant value failed -const _NI64_MOD_P: &i64 = &(1i64 % 0); //~ ERROR: evaluation of constant value failed +const _NI64_MOD: i64 = 1i64 % 0; //~ ERROR evaluation of constant value failed +const _NI64_MOD_P: &i64 = &(1i64 % 0); //~ ERROR evaluation of constant value failed -const _NI128_MOD: i128 = 1i128 % 0; //~ ERROR: evaluation of constant value failed -const _NI128_MOD_P: &i128 = &(1i128 % 0); //~ ERROR: evaluation of constant value failed +const _NI128_MOD: i128 = 1i128 % 0; //~ ERROR evaluation of constant value failed +const _NI128_MOD_P: &i128 = &(1i128 % 0); //~ ERROR evaluation of constant value failed -const _NU8_MOD: u8 = 1u8 % 0; //~ ERROR: evaluation of constant value failed -const _NU8_MOD_P: &u8 = &(1u8 % 0); //~ ERROR: evaluation of constant value failed +const _NU8_MOD: u8 = 1u8 % 0; //~ ERROR evaluation of constant value failed +const _NU8_MOD_P: &u8 = &(1u8 % 0); //~ ERROR evaluation of constant value failed -const _NU16_MOD: u16 = 1u16 % 0; //~ ERROR: evaluation of constant value failed -const _NU16_MOD_P: &u16 = &(1u16 % 0); //~ ERROR: evaluation of constant value failed +const _NU16_MOD: u16 = 1u16 % 0; //~ ERROR evaluation of constant value failed +const _NU16_MOD_P: &u16 = &(1u16 % 0); //~ ERROR evaluation of constant value failed -const _NU32_MOD: u32 = 1u32 % 0; //~ ERROR: evaluation of constant value failed -const _NU32_MOD_P: &u32 = &(1u32 % 0); //~ ERROR: evaluation of constant value failed +const _NU32_MOD: u32 = 1u32 % 0; //~ ERROR evaluation of constant value failed +const _NU32_MOD_P: &u32 = &(1u32 % 0); //~ ERROR evaluation of constant value failed -const _NU64_MOD: u64 = 1u64 % 0; //~ ERROR: evaluation of constant value failed -const _NU64_MOD_P: &u64 = &(1u64 % 0); //~ ERROR: evaluation of constant value failed +const _NU64_MOD: u64 = 1u64 % 0; //~ ERROR evaluation of constant value failed +const _NU64_MOD_P: &u64 = &(1u64 % 0); //~ ERROR evaluation of constant value failed -const _NU128_MOD: u128 = 1u128 % 0; //~ ERROR: evaluation of constant value failed -const _NU128_MOD_P: &u128 = &(1u128 % 0); //~ ERROR: evaluation of constant value failed +const _NU128_MOD: u128 = 1u128 % 0; //~ ERROR evaluation of constant value failed +const _NU128_MOD_P: &u128 = &(1u128 % 0); //~ ERROR evaluation of constant value failed -const _NISIZE_MOD: isize = 1isize % 0; //~ ERROR: evaluation of constant value failed -const _NISIZE_MOD_P: &isize = &(1isize % 0); //~ ERROR: evaluation of constant value failed +const _NISIZE_MOD: isize = 1isize % 0; //~ ERROR evaluation of constant value failed +const _NISIZE_MOD_P: &isize = &(1isize % 0); //~ ERROR evaluation of constant value failed -const _NUSIZE_MOD: usize = 1usize % 0; //~ ERROR: evaluation of constant value failed -const _NUSIZE_MOD_P: &usize = &(1usize % 0); //~ ERROR: evaluation of constant value failed +const _NUSIZE_MOD: usize = 1usize % 0; //~ ERROR evaluation of constant value failed +const _NUSIZE_MOD_P: &usize = &(1usize % 0); //~ ERROR evaluation of constant value failed // Out of bounds access -const _NI32_OOB: i32 = [1, 2, 3][4]; //~ ERROR: evaluation of constant value failed -const _NI32_OOB_P: &i32 = &([1, 2, 3][4]); //~ ERROR: evaluation of constant value failed +const _NI32_OOB: i32 = [1, 2, 3][4]; //~ ERROR evaluation of constant value failed +const _NI32_OOB_P: &i32 = &([1, 2, 3][4]); //~ ERROR evaluation of constant value failed pub fn main() {} diff --git a/tests/ui/consts/precise-drop-allow-const-fn-unstable.rs b/tests/ui/consts/precise-drop-allow-const-fn-unstable.rs index 56155e519dca4..ddac8a4bf1e60 100644 --- a/tests/ui/consts/precise-drop-allow-const-fn-unstable.rs +++ b/tests/ui/consts/precise-drop-allow-const-fn-unstable.rs @@ -9,7 +9,7 @@ #[rustc_const_stable(feature = "rust_test", since = "1.0.0")] #[cfg_attr(allow, rustc_allow_const_fn_unstable(const_precise_live_drops))] pub const fn unwrap(this: Option) -> T { -//[not_allow]~^ ERROR: cannot be evaluated +//[not_allow]~^ ERROR cannot be evaluated match this { Some(x) => x, None => panic!(), diff --git a/tests/ui/consts/promoted-type-error-issue-133968.rs b/tests/ui/consts/promoted-type-error-issue-133968.rs index 52c0d48ab5bc1..5e97ca93ef59d 100644 --- a/tests/ui/consts/promoted-type-error-issue-133968.rs +++ b/tests/ui/consts/promoted-type-error-issue-133968.rs @@ -1,7 +1,7 @@ struct B { x: &'static T, } -static STR: &'static [u8] = "a b"; //~ERROR: mismatched types +static STR: &'static [u8] = "a b"; //~ERROR mismatched types static C: &B<[u8]> = &B { x: STR }; fn main() {} diff --git a/tests/ui/consts/promoted_const_call.rs b/tests/ui/consts/promoted_const_call.rs index 79cb2ea2a02a0..3579a2fa7ba5d 100644 --- a/tests/ui/consts/promoted_const_call.rs +++ b/tests/ui/consts/promoted_const_call.rs @@ -6,15 +6,15 @@ impl const Drop for Panic { fn drop(&mut self) { panic!(); } } pub const fn id(x: T) -> T { x } pub const C: () = { let _: &'static _ = &id(&Panic); - //~^ ERROR: temporary value dropped while borrowed - //~| ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed + //~| ERROR temporary value dropped while borrowed }; fn main() { let _: &'static _ = &id(&Panic); - //~^ ERROR: temporary value dropped while borrowed - //~| ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed + //~| ERROR temporary value dropped while borrowed let _: &'static _ = &&(Panic, 0).1; - //~^ ERROR: temporary value dropped while borrowed - //~| ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed + //~| ERROR temporary value dropped while borrowed } diff --git a/tests/ui/consts/promoted_const_call2.rs b/tests/ui/consts/promoted_const_call2.rs index f332cd18cea37..2b66170f9a636 100644 --- a/tests/ui/consts/promoted_const_call2.rs +++ b/tests/ui/consts/promoted_const_call2.rs @@ -2,13 +2,13 @@ pub const fn id(x: T) -> T { x } pub const C: () = { let _: &'static _ = &id(&String::new()); - //~^ ERROR: temporary value dropped while borrowed - //~| ERROR: temporary value dropped while borrowed - //~| ERROR: destructor of `String` cannot be evaluated at compile-time + //~^ ERROR temporary value dropped while borrowed + //~| ERROR temporary value dropped while borrowed + //~| ERROR destructor of `String` cannot be evaluated at compile-time }; fn main() { let _: &'static _ = &id(&String::new()); - //~^ ERROR: temporary value dropped while borrowed - //~| ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed + //~| ERROR temporary value dropped while borrowed } diff --git a/tests/ui/consts/promoted_const_call3.rs b/tests/ui/consts/promoted_const_call3.rs index dc05a3b584424..81ef743ddcf36 100644 --- a/tests/ui/consts/promoted_const_call3.rs +++ b/tests/ui/consts/promoted_const_call3.rs @@ -1,27 +1,27 @@ pub const fn id(x: T) -> T { x } pub const C: () = { let _: &'static _ = &String::new(); - //~^ ERROR: destructor of `String` cannot be evaluated at compile-time + //~^ ERROR destructor of `String` cannot be evaluated at compile-time }; pub const _: () = { let _: &'static _ = &id(&String::new()); - //~^ ERROR: destructor of `String` cannot be evaluated at compile-time + //~^ ERROR destructor of `String` cannot be evaluated at compile-time }; pub const _: () = { let _: &'static _ = &std::mem::ManuallyDrop::new(String::new()); - //~^ ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed }; fn main() { let _: &'static _ = &String::new(); - //~^ ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed let _: &'static _ = &id(&String::new()); - //~^ ERROR: temporary value dropped while borrowed - //~| ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed + //~| ERROR temporary value dropped while borrowed let _: &'static _ = &std::mem::ManuallyDrop::new(String::new()); - //~^ ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed } diff --git a/tests/ui/consts/promoted_const_call5.rs b/tests/ui/consts/promoted_const_call5.rs index 41b3988949e65..997c2ebffd702 100644 --- a/tests/ui/consts/promoted_const_call5.rs +++ b/tests/ui/consts/promoted_const_call5.rs @@ -29,14 +29,14 @@ const C: () = { const _: () = { let _: &'static _ = &new_manually_drop(new_string()); - //~^ ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed }; fn main() { let _: &'static _ = &id(&new_string()); - //~^ ERROR: temporary value dropped while borrowed - //~| ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed + //~| ERROR temporary value dropped while borrowed let _: &'static _ = &new_manually_drop(new_string()); - //~^ ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed } diff --git a/tests/ui/consts/promoted_running_out_of_memory_issue-130687.rs b/tests/ui/consts/promoted_running_out_of_memory_issue-130687.rs index 75765596fa172..1402e611468dd 100644 --- a/tests/ui/consts/promoted_running_out_of_memory_issue-130687.rs +++ b/tests/ui/consts/promoted_running_out_of_memory_issue-130687.rs @@ -11,7 +11,7 @@ pub struct Data([u8; (1 << 47) - 1]); const _: &'static Data = &Data([0; (1 << 47) - 1]); -//~^ERROR: evaluation of constant value failed +//~^ERROR evaluation of constant value failed //~| tried to allocate more memory than available to compiler fn main() {} diff --git a/tests/ui/consts/promoted_size_overflow.rs b/tests/ui/consts/promoted_size_overflow.rs index 3d606905e782c..ffa1f849ed0fd 100644 --- a/tests/ui/consts/promoted_size_overflow.rs +++ b/tests/ui/consts/promoted_size_overflow.rs @@ -1,7 +1,7 @@ //@ only-64bit pub struct Data([u8; usize::MAX >> 2]); const _: &'static [Data] = &[]; -//~^ERROR: evaluation of constant value failed +//~^ERROR evaluation of constant value failed //~| too big for the target architecture fn main() {} diff --git a/tests/ui/consts/recursive-block.rs b/tests/ui/consts/recursive-block.rs index a3dcaa4283669..db66c1d00fecd 100644 --- a/tests/ui/consts/recursive-block.rs +++ b/tests/ui/consts/recursive-block.rs @@ -1,5 +1,5 @@ const fn foo() { - const { foo::<&T>() } //~ ERROR: queries overflow the depth limit! + const { foo::<&T>() } //~ ERROR queries overflow the depth limit! } fn main () { diff --git a/tests/ui/consts/recursive-const-in-impl.rs b/tests/ui/consts/recursive-const-in-impl.rs index 93f7201f921f2..6031450b78cf4 100644 --- a/tests/ui/consts/recursive-const-in-impl.rs +++ b/tests/ui/consts/recursive-const-in-impl.rs @@ -8,5 +8,5 @@ impl Thing { } fn main() { - println!("{}", Thing::::X); //~ ERROR: queries overflow the depth limit! + println!("{}", Thing::::X); //~ ERROR queries overflow the depth limit! } diff --git a/tests/ui/consts/refs-to-cell-in-final.rs b/tests/ui/consts/refs-to-cell-in-final.rs index 844b140cff2b5..4917f286a788f 100644 --- a/tests/ui/consts/refs-to-cell-in-final.rs +++ b/tests/ui/consts/refs-to-cell-in-final.rs @@ -11,9 +11,9 @@ unsafe impl Sync for SyncPtr {} // The resulting constant would pass all validation checks, so it is crucial that this gets rejected // by static const checks! static RAW_SYNC_S: SyncPtr> = SyncPtr { x: &Cell::new(42) }; -//~^ ERROR: cannot refer to interior mutable data +//~^ ERROR cannot refer to interior mutable data const RAW_SYNC_C: SyncPtr> = SyncPtr { x: &Cell::new(42) }; -//~^ ERROR: cannot refer to interior mutable data +//~^ ERROR cannot refer to interior mutable data // This one does not get promoted because of `Drop`, and then enters interesting codepaths because // as a value it has no interior mutability, but as a type it does. See @@ -39,7 +39,7 @@ const NONE_EXPLICIT_PROMOTED: &'static Option> = { // Not okay, since we are borrowing something with interior mutability. const INTERIOR_MUT_VARIANT: &Option> = &{ - //~^ERROR: cannot refer to interior mutable data + //~^ERROR cannot refer to interior mutable data let mut x = None; assert!(x.is_none()); x = Some(UnsafeCell::new(false)); diff --git a/tests/ui/consts/slice-index-overflow-issue-130284.rs b/tests/ui/consts/slice-index-overflow-issue-130284.rs index 299009082563a..3a257a3ea6745 100644 --- a/tests/ui/consts/slice-index-overflow-issue-130284.rs +++ b/tests/ui/consts/slice-index-overflow-issue-130284.rs @@ -5,7 +5,7 @@ const C: () = { unsafe { // This used to ICE, but it should just report UB. let _ice = (*fat)[usize::MAX - 1]; - //~^ERROR: constant value failed + //~^ERROR constant value failed //~| overflow } }; diff --git a/tests/ui/consts/slice_elem_ty_mismatch_in_unsizing_cast.rs b/tests/ui/consts/slice_elem_ty_mismatch_in_unsizing_cast.rs index d821b6a0117e6..9fd5694a3772a 100644 --- a/tests/ui/consts/slice_elem_ty_mismatch_in_unsizing_cast.rs +++ b/tests/ui/consts/slice_elem_ty_mismatch_in_unsizing_cast.rs @@ -1,4 +1,4 @@ const FOO: &str = unsafe { &*(1_usize as *const [i64; 0] as *const [u8] as *const str) }; -//~^ ERROR: cannot cast +//~^ ERROR cannot cast fn main() {} diff --git a/tests/ui/coroutine/async_gen_fn.rs b/tests/ui/coroutine/async_gen_fn.rs index b9adeec3f4027..648edf1215314 100644 --- a/tests/ui/coroutine/async_gen_fn.rs +++ b/tests/ui/coroutine/async_gen_fn.rs @@ -2,8 +2,8 @@ //@[e2024] edition: 2024 async gen fn foo() {} -//[none]~^ ERROR: `async fn` is not permitted in Rust 2015 -//[none]~| ERROR: expected one of `extern`, `fn`, `safe`, or `unsafe`, found `gen` -//[e2024]~^^^ ERROR: gen blocks are experimental +//[none]~^ ERROR `async fn` is not permitted in Rust 2015 +//[none]~| ERROR expected one of `extern`, `fn`, `safe`, or `unsafe`, found `gen` +//[e2024]~^^^ ERROR gen blocks are experimental fn main() {} diff --git a/tests/ui/coroutine/borrowing.rs b/tests/ui/coroutine/borrowing.rs index a6628766c1bad..bb3af856f55f3 100644 --- a/tests/ui/coroutine/borrowing.rs +++ b/tests/ui/coroutine/borrowing.rs @@ -7,14 +7,14 @@ fn main() { let _b = { let a = 3; Pin::new(&mut #[coroutine] || yield &a).resume(()) - //~^ ERROR: `a` does not live long enough + //~^ ERROR `a` does not live long enough }; let _b = { let a = 3; #[coroutine] || { yield &a - //~^ ERROR: `a` does not live long enough + //~^ ERROR `a` does not live long enough } }; } diff --git a/tests/ui/coroutine/gen_block.rs b/tests/ui/coroutine/gen_block.rs index e3734dd4cdf05..dfc496311e441 100644 --- a/tests/ui/coroutine/gen_block.rs +++ b/tests/ui/coroutine/gen_block.rs @@ -5,13 +5,13 @@ fn main() { let x = gen {}; - //[none]~^ ERROR: cannot find - //[e2024]~^^ ERROR: type annotations needed + //[none]~^ ERROR cannot find + //[e2024]~^^ ERROR type annotations needed let y = gen { yield 42 }; - //[none]~^ ERROR: found reserved keyword `yield` - //[none]~| ERROR: cannot find + //[none]~^ ERROR found reserved keyword `yield` + //[none]~| ERROR cannot find gen {}; - //[none]~^ ERROR: cannot find + //[none]~^ ERROR cannot find let _ = || yield true; //[none]~ ERROR yield syntax is experimental //[none]~^ ERROR yield syntax is experimental diff --git a/tests/ui/coroutine/gen_block_is_coro.rs b/tests/ui/coroutine/gen_block_is_coro.rs index bccc3e86ee463..0b8cdd604c22c 100644 --- a/tests/ui/coroutine/gen_block_is_coro.rs +++ b/tests/ui/coroutine/gen_block_is_coro.rs @@ -4,15 +4,15 @@ use std::ops::Coroutine; -fn foo() -> impl Coroutine { //~ ERROR: Coroutine` is not satisfied +fn foo() -> impl Coroutine { //~ ERROR Coroutine` is not satisfied gen { yield 42 } } -fn bar() -> impl Coroutine { //~ ERROR: Coroutine` is not satisfied +fn bar() -> impl Coroutine { //~ ERROR Coroutine` is not satisfied gen { yield 42 } } -fn baz() -> impl Coroutine { //~ ERROR: Coroutine` is not satisfied +fn baz() -> impl Coroutine { //~ ERROR Coroutine` is not satisfied gen { yield 42 } } diff --git a/tests/ui/coroutine/gen_block_move.fixed b/tests/ui/coroutine/gen_block_move.fixed index e58c9b3f9fe32..56bca2a56b510 100644 --- a/tests/ui/coroutine/gen_block_move.fixed +++ b/tests/ui/coroutine/gen_block_move.fixed @@ -4,7 +4,7 @@ fn moved() -> impl Iterator { let mut x = "foo".to_string(); - gen move { //~ ERROR: gen block may outlive the current function + gen move { //~ ERROR gen block may outlive the current function yield 42; if x == "foo" { return } x.clear(); diff --git a/tests/ui/coroutine/gen_block_move.rs b/tests/ui/coroutine/gen_block_move.rs index e249404a0a168..3544e826f1079 100644 --- a/tests/ui/coroutine/gen_block_move.rs +++ b/tests/ui/coroutine/gen_block_move.rs @@ -4,7 +4,7 @@ fn moved() -> impl Iterator { let mut x = "foo".to_string(); - gen { //~ ERROR: gen block may outlive the current function + gen { //~ ERROR gen block may outlive the current function yield 42; if x == "foo" { return } x.clear(); diff --git a/tests/ui/coroutine/gen_block_panic.rs b/tests/ui/coroutine/gen_block_panic.rs index b6362d5046a3b..e1c835502f94a 100644 --- a/tests/ui/coroutine/gen_block_panic.rs +++ b/tests/ui/coroutine/gen_block_panic.rs @@ -7,7 +7,7 @@ fn main() { let mut iter = gen { yield 42; panic!("foo"); - yield 69; //~ WARN: unreachable statement + yield 69; //~ WARN unreachable statement }; assert_eq!(iter.next(), Some(42)); let mut tmp = std::panic::AssertUnwindSafe(&mut iter); diff --git a/tests/ui/coroutine/gen_fn.rs b/tests/ui/coroutine/gen_fn.rs index 2f50d5db9acf6..55ac155630e79 100644 --- a/tests/ui/coroutine/gen_fn.rs +++ b/tests/ui/coroutine/gen_fn.rs @@ -2,7 +2,7 @@ //@[e2024] edition: 2024 gen fn foo() {} -//[none]~^ ERROR: expected one of `#`, `async`, `const`, `default`, `extern`, `fn`, `pub`, `safe`, `unsafe`, or `use`, found `gen` -//[e2024]~^^ ERROR: gen blocks are experimental +//[none]~^ ERROR expected one of `#`, `async`, `const`, `default`, `extern`, `fn`, `pub`, `safe`, `unsafe`, or `use`, found `gen` +//[e2024]~^^ ERROR gen blocks are experimental fn main() {} diff --git a/tests/ui/coroutine/invalid_attr_usage.rs b/tests/ui/coroutine/invalid_attr_usage.rs index 995a3aa3100fc..5546c4804cefd 100644 --- a/tests/ui/coroutine/invalid_attr_usage.rs +++ b/tests/ui/coroutine/invalid_attr_usage.rs @@ -3,9 +3,9 @@ #![feature(coroutines)] #[coroutine] -//~^ ERROR: attribute should be applied to closures +//~^ ERROR attribute should be applied to closures struct Foo; #[coroutine] -//~^ ERROR: attribute should be applied to closures +//~^ ERROR attribute should be applied to closures fn main() {} diff --git a/tests/ui/coroutine/issue-64620-yield-array-element.rs b/tests/ui/coroutine/issue-64620-yield-array-element.rs index 0d898d014e80b..c978d8788c9c9 100644 --- a/tests/ui/coroutine/issue-64620-yield-array-element.rs +++ b/tests/ui/coroutine/issue-64620-yield-array-element.rs @@ -3,8 +3,8 @@ #![feature(coroutines)] pub fn crash(arr: [usize; 1]) { - yield arr[0]; //~ ERROR: yield expression outside of coroutine literal - //~^ ERROR: `yield` can only be used in + yield arr[0]; //~ ERROR yield expression outside of coroutine literal + //~^ ERROR `yield` can only be used in } fn main() {} diff --git a/tests/ui/coroutine/issue-88653.rs b/tests/ui/coroutine/issue-88653.rs index b5936c7960de4..f700be53016ff 100644 --- a/tests/ui/coroutine/issue-88653.rs +++ b/tests/ui/coroutine/issue-88653.rs @@ -6,15 +6,15 @@ use std::ops::Coroutine; fn foo(bar: bool) -> impl Coroutine<(bool,)> { - //~^ ERROR: type mismatch in coroutine arguments [E0631] - //~| NOTE: expected due to this - //~| NOTE: expected coroutine signature `fn((bool,)) -> _` - //~| NOTE: in this expansion of desugaring of `impl Trait` - //~| NOTE: in this expansion of desugaring of `impl Trait` + //~^ ERROR type mismatch in coroutine arguments [E0631] + //~| NOTE expected due to this + //~| NOTE expected coroutine signature `fn((bool,)) -> _` + //~| NOTE in this expansion of desugaring of `impl Trait` + //~| NOTE in this expansion of desugaring of `impl Trait` #[coroutine] |bar| { - //~^ NOTE: found signature defined here - //~| NOTE: return type was inferred to be + //~^ NOTE found signature defined here + //~| NOTE return type was inferred to be if bar { yield bar; } diff --git a/tests/ui/coroutine/issue-91477.rs b/tests/ui/coroutine/issue-91477.rs index c215fd7948f33..4720c6a67486b 100644 --- a/tests/ui/coroutine/issue-91477.rs +++ b/tests/ui/coroutine/issue-91477.rs @@ -2,7 +2,7 @@ fn foo() -> impl Sized { yield 1; //~ ERROR E0627 - //~^ ERROR: `yield` can only be used in + //~^ ERROR `yield` can only be used in } fn main() {} diff --git a/tests/ui/coroutine/not-send-sync.rs b/tests/ui/coroutine/not-send-sync.rs index a46dcd14e8825..4bc5b6e111676 100644 --- a/tests/ui/coroutine/not-send-sync.rs +++ b/tests/ui/coroutine/not-send-sync.rs @@ -12,14 +12,14 @@ fn main() { fn assert_send(_: T) {} assert_sync(#[coroutine] || { - //~^ ERROR: coroutine cannot be shared between threads safely + //~^ ERROR coroutine cannot be shared between threads safely let a = NotSync; yield; drop(a); }); assert_send(#[coroutine] || { - //~^ ERROR: coroutine cannot be sent between threads safely + //~^ ERROR coroutine cannot be sent between threads safely let a = NotSend; yield; drop(a); diff --git a/tests/ui/coroutine/print/coroutine-print-verbose-2.rs b/tests/ui/coroutine/print/coroutine-print-verbose-2.rs index ef7199cafdde0..b7e4156ad0660 100644 --- a/tests/ui/coroutine/print/coroutine-print-verbose-2.rs +++ b/tests/ui/coroutine/print/coroutine-print-verbose-2.rs @@ -15,14 +15,14 @@ fn main() { fn assert_send(_: T) {} assert_sync(#[coroutine] || { - //~^ ERROR: coroutine cannot be shared between threads safely + //~^ ERROR coroutine cannot be shared between threads safely let a = NotSync; yield; drop(a); }); assert_send(#[coroutine] || { - //~^ ERROR: coroutine cannot be sent between threads safely + //~^ ERROR coroutine cannot be sent between threads safely let a = NotSend; yield; drop(a); diff --git a/tests/ui/coroutine/self_referential_gen_block.rs b/tests/ui/coroutine/self_referential_gen_block.rs index 322cbf4f18a9d..9bdb48eb16c21 100644 --- a/tests/ui/coroutine/self_referential_gen_block.rs +++ b/tests/ui/coroutine/self_referential_gen_block.rs @@ -6,7 +6,7 @@ fn main() { let mut x = { let mut x = gen { let y = 42; - let z = &y; //~ ERROR: borrow may still be in use when `gen` block yields + let z = &y; //~ ERROR borrow may still be in use when `gen` block yields yield 43; panic!("{z}"); }; diff --git a/tests/ui/coroutine/too-many-parameters.rs b/tests/ui/coroutine/too-many-parameters.rs index 3baaf0623479d..68909927938a0 100644 --- a/tests/ui/coroutine/too-many-parameters.rs +++ b/tests/ui/coroutine/too-many-parameters.rs @@ -3,7 +3,7 @@ fn main() { #[coroutine] |(), ()| { - //~^ error: too many parameters for a coroutine + //~^ error too many parameters for a coroutine yield; }; } diff --git a/tests/ui/coroutine/type-mismatch-error.rs b/tests/ui/coroutine/type-mismatch-error.rs index ee4e27c20da18..919a440c75b7e 100644 --- a/tests/ui/coroutine/type-mismatch-error.rs +++ b/tests/ui/coroutine/type-mismatch-error.rs @@ -15,7 +15,7 @@ fn main() { yield (); } else { a - //~^ error: `if` and `else` have incompatible types + //~^ error `if` and `else` have incompatible types } }, 0u8, diff --git a/tests/ui/crate-name-mismatch.rs b/tests/ui/crate-name-mismatch.rs index 7651e0f97ebe3..0b79fcb72feb6 100644 --- a/tests/ui/crate-name-mismatch.rs +++ b/tests/ui/crate-name-mismatch.rs @@ -1,6 +1,6 @@ //@ compile-flags: --crate-name foo #![crate_name = "bar"] -//~^ ERROR: `--crate-name` and `#[crate_name]` are required to match, but `foo` != `bar` +//~^ ERROR `--crate-name` and `#[crate_name]` are required to match, but `foo` != `bar` fn main() {} diff --git a/tests/ui/cross-crate/private-by-default.rs b/tests/ui/cross-crate/private-by-default.rs index 3a5d813134436..5cd67025e2cab 100644 --- a/tests/ui/cross-crate/private-by-default.rs +++ b/tests/ui/cross-crate/private-by-default.rs @@ -21,25 +21,25 @@ fn main() { // private items at the top should be inaccessible static_priv_by_default::j; - //~^ ERROR: static `j` is private + //~^ ERROR static `j` is private static_priv_by_default::k; - //~^ ERROR: function `k` is private + //~^ ERROR function `k` is private static_priv_by_default::l; - //~^ ERROR: struct `l` is private + //~^ ERROR struct `l` is private foo::(); - //~^ ERROR: enum `m` is private + //~^ ERROR enum `m` is private foo::(); - //~^ ERROR: type alias `n` is private + //~^ ERROR type alias `n` is private // public items in a private mod should be inaccessible static_priv_by_default::foo::a; - //~^ ERROR: module `foo` is private + //~^ ERROR module `foo` is private static_priv_by_default::foo::b; - //~^ ERROR: module `foo` is private + //~^ ERROR module `foo` is private static_priv_by_default::foo::c; - //~^ ERROR: module `foo` is private + //~^ ERROR module `foo` is private foo::(); - //~^ ERROR: module `foo` is private + //~^ ERROR module `foo` is private foo::(); - //~^ ERROR: module `foo` is private + //~^ ERROR module `foo` is private } diff --git a/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.rs b/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.rs index 0a7ec5ab5c1be..781995a4c3b48 100644 --- a/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.rs +++ b/tests/ui/delegation/correct_body_owner_parent_found_in_diagnostics.rs @@ -7,7 +7,7 @@ pub struct InvariantRef<'a, T: ?Sized>(&'a T, PhantomData<&'a mut &'a T>); impl<'a> InvariantRef<'a, ()> { pub const NEW: Self = InvariantRef::new(&()); - //~^ ERROR: no function or associated item named `new` found + //~^ ERROR no function or associated item named `new` found } trait Trait { @@ -20,15 +20,15 @@ struct Z(u8); impl Trait for Z { reuse ::{foo, bar, meh} { &const { InvariantRef::<'a>::NEW } } - //~^ ERROR: use of undeclared lifetime name `'a` - //~| ERROR: use of undeclared lifetime name `'a` - //~| ERROR: use of undeclared lifetime name `'a` - //~| ERROR: the trait bound `u8: Trait` is not satisfied - //~| ERROR: the trait bound `u8: Trait` is not satisfied - //~| ERROR: the trait bound `u8: Trait` is not satisfied - //~| ERROR: mismatched types - //~| ERROR: mismatched types - //~| ERROR: mismatched types + //~^ ERROR use of undeclared lifetime name `'a` + //~| ERROR use of undeclared lifetime name `'a` + //~| ERROR use of undeclared lifetime name `'a` + //~| ERROR the trait bound `u8: Trait` is not satisfied + //~| ERROR the trait bound `u8: Trait` is not satisfied + //~| ERROR the trait bound `u8: Trait` is not satisfied + //~| ERROR mismatched types + //~| ERROR mismatched types + //~| ERROR mismatched types } fn main() { } diff --git a/tests/ui/deprecation/deprecated_no_stack_check.rs b/tests/ui/deprecation/deprecated_no_stack_check.rs index 8e1f5bbf045a5..804d717b7dc94 100644 --- a/tests/ui/deprecation/deprecated_no_stack_check.rs +++ b/tests/ui/deprecation/deprecated_no_stack_check.rs @@ -1,6 +1,6 @@ #![deny(warnings)] #![feature(no_stack_check)] -//~^ ERROR: feature has been removed [E0557] +//~^ ERROR feature has been removed [E0557] fn main() { } diff --git a/tests/ui/deref-non-pointer.rs b/tests/ui/deref-non-pointer.rs index 82ab355e697b2..945948b278a48 100644 --- a/tests/ui/deref-non-pointer.rs +++ b/tests/ui/deref-non-pointer.rs @@ -1,5 +1,5 @@ fn main() { - match *1 { //~ ERROR: cannot be dereferenced + match *1 { //~ ERROR cannot be dereferenced _ => { panic!(); } } } diff --git a/tests/ui/derives/clone-debug-dead-code.rs b/tests/ui/derives/clone-debug-dead-code.rs index ab49260c01bab..e95f0da7d0860 100644 --- a/tests/ui/derives/clone-debug-dead-code.rs +++ b/tests/ui/derives/clone-debug-dead-code.rs @@ -4,22 +4,22 @@ #![forbid(dead_code)] struct A { f: () } -//~^ ERROR: field `f` is never read +//~^ ERROR field `f` is never read #[derive(Clone)] struct B { f: () } -//~^ ERROR: field `f` is never read +//~^ ERROR field `f` is never read #[derive(Debug)] struct C { f: () } -//~^ ERROR: field `f` is never read +//~^ ERROR field `f` is never read #[derive(Debug,Clone)] struct D { f: () } -//~^ ERROR: field `f` is never read +//~^ ERROR field `f` is never read struct E { f: () } -//~^ ERROR: field `f` is never read +//~^ ERROR field `f` is never read // Custom impl, still doesn't read f impl Clone for E { fn clone(&self) -> Self { diff --git a/tests/ui/derives/deriving-non-type.rs b/tests/ui/derives/deriving-non-type.rs index 9afffa9008590..3f79bd12a2516 100644 --- a/tests/ui/derives/deriving-non-type.rs +++ b/tests/ui/derives/deriving-non-type.rs @@ -2,29 +2,29 @@ struct S; -#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s +#[derive(PartialEq)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s trait T { } -#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s +#[derive(PartialEq)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s impl S { } -#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s +#[derive(PartialEq)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s impl T for S { } -#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s +#[derive(PartialEq)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s static s: usize = 0; -#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s +#[derive(PartialEq)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s const c: usize = 0; -#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s +#[derive(PartialEq)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s mod m { } -#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s +#[derive(PartialEq)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s extern "C" { } -#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s +#[derive(PartialEq)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s type A = usize; -#[derive(PartialEq)] //~ ERROR: `derive` may only be applied to `struct`s, `enum`s and `union`s +#[derive(PartialEq)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s fn main() { } diff --git a/tests/ui/derives/deriving-with-repr-packed-move-errors.rs b/tests/ui/derives/deriving-with-repr-packed-move-errors.rs index ffeb02d78b848..553e5bbd14528 100644 --- a/tests/ui/derives/deriving-with-repr-packed-move-errors.rs +++ b/tests/ui/derives/deriving-with-repr-packed-move-errors.rs @@ -11,21 +11,21 @@ use std::cmp::Ordering; #[repr(packed)] #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)] struct StructA(String); -//~^ ERROR: cannot move out of `self` which is behind a shared reference -//~| ERROR: cannot move out of `self` which is behind a shared reference -//~| ERROR: cannot move out of `other` which is behind a shared reference -//~| ERROR: cannot move out of `self` which is behind a shared reference -//~| ERROR: cannot move out of `other` which is behind a shared reference -//~| ERROR: cannot move out of `self` which is behind a shared reference -//~| ERROR: cannot move out of `other` which is behind a shared reference -//~| ERROR: cannot move out of `self` which is behind a shared reference -//~| ERROR: cannot move out of `self` which is behind a shared reference +//~^ ERROR cannot move out of `self` which is behind a shared reference +//~| ERROR cannot move out of `self` which is behind a shared reference +//~| ERROR cannot move out of `other` which is behind a shared reference +//~| ERROR cannot move out of `self` which is behind a shared reference +//~| ERROR cannot move out of `other` which is behind a shared reference +//~| ERROR cannot move out of `self` which is behind a shared reference +//~| ERROR cannot move out of `other` which is behind a shared reference +//~| ERROR cannot move out of `self` which is behind a shared reference +//~| ERROR cannot move out of `self` which is behind a shared reference // Unrelated impl: additinal diagnostic should NOT be emitted impl StructA { fn fmt(&self) -> String { - self.0 //~ ERROR: cannot move out of `self` which is behind a shared reference + self.0 //~ ERROR cannot move out of `self` which is behind a shared reference } } @@ -35,7 +35,7 @@ struct StructB(String); impl Debug for StructB { fn fmt(&self, f: &mut Formatter) -> Result { - let x = &{ self.0 }; //~ ERROR: cannot move out of `self` which is behind a shared reference + let x = &{ self.0 }; //~ ERROR cannot move out of `self` which is behind a shared reference write!(f, "{}", x) } } @@ -43,16 +43,16 @@ impl Debug for StructB { impl PartialEq for StructB { fn eq(&self, other: &StructB) -> bool { ({ self.0 }) == ({ other.0 }) - //~^ ERROR: cannot move out of `self` which is behind a shared reference - //~| ERROR: cannot move out of `other` which is behind a shared reference + //~^ ERROR cannot move out of `self` which is behind a shared reference + //~| ERROR cannot move out of `other` which is behind a shared reference } } impl PartialOrd for StructB { fn partial_cmp(&self, other: &StructB) -> Option { PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 }) - //~^ ERROR: cannot move out of `self` which is behind a shared reference - //~| ERROR: cannot move out of `other` which is behind a shared reference + //~^ ERROR cannot move out of `self` which is behind a shared reference + //~| ERROR cannot move out of `other` which is behind a shared reference } } @@ -65,7 +65,7 @@ struct StructD(String); impl Debug for StructD { fn fmt(&self, f: &mut Formatter) -> Result { - let x = &{ self.0 }; //~ ERROR: cannot move out of `self` which is behind a shared reference + let x = &{ self.0 }; //~ ERROR cannot move out of `self` which is behind a shared reference write!(f, "{}", x) } } @@ -73,23 +73,23 @@ impl Debug for StructD { impl PartialEq for StructD { fn eq(&self, other: &StructD) -> bool { ({ self.0 }) == ({ other.0 }) - //~^ ERROR: cannot move out of `self` which is behind a shared reference - //~| ERROR: cannot move out of `other` which is behind a shared reference + //~^ ERROR cannot move out of `self` which is behind a shared reference + //~| ERROR cannot move out of `other` which is behind a shared reference } } impl PartialOrd for StructD { fn partial_cmp(&self, other: &StructD) -> Option { PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 }) - //~^ ERROR: cannot move out of `self` which is behind a shared reference - //~| ERROR: cannot move out of `other` which is behind a shared reference + //~^ ERROR cannot move out of `self` which is behind a shared reference + //~| ERROR cannot move out of `other` which is behind a shared reference } } // Packed + derives but the move is outside of a derive // expansion: additinal diagnostic should NOT be emitted fn func(arg: &StructA) -> String { - arg.0 //~ ERROR: cannot move out of `arg` which is behind a shared reference + arg.0 //~ ERROR cannot move out of `arg` which is behind a shared reference } fn main(){ diff --git a/tests/ui/deriving/deriving-coerce-pointee-neg.rs b/tests/ui/deriving/deriving-coerce-pointee-neg.rs index 2713366945e9a..e1772a5ca5775 100644 --- a/tests/ui/deriving/deriving-coerce-pointee-neg.rs +++ b/tests/ui/deriving/deriving-coerce-pointee-neg.rs @@ -7,32 +7,32 @@ extern crate malicious_macro; use std::marker::CoercePointee; #[derive(CoercePointee)] -//~^ ERROR: `CoercePointee` can only be derived on `struct`s with `#[repr(transparent)]` +//~^ ERROR `CoercePointee` can only be derived on `struct`s with `#[repr(transparent)]` enum NotStruct<'a, T: ?Sized> { Variant(&'a T), } #[derive(CoercePointee)] -//~^ ERROR: `CoercePointee` can only be derived on `struct`s with at least one field +//~^ ERROR `CoercePointee` can only be derived on `struct`s with at least one field #[repr(transparent)] struct NoField<'a, #[pointee] T: ?Sized> {} -//~^ ERROR: lifetime parameter `'a` is never used -//~| ERROR: type parameter `T` is never used +//~^ ERROR lifetime parameter `'a` is never used +//~| ERROR type parameter `T` is never used #[derive(CoercePointee)] -//~^ ERROR: `CoercePointee` can only be derived on `struct`s with at least one field +//~^ ERROR `CoercePointee` can only be derived on `struct`s with at least one field #[repr(transparent)] struct NoFieldUnit<'a, #[pointee] T: ?Sized>(); -//~^ ERROR: lifetime parameter `'a` is never used -//~| ERROR: type parameter `T` is never used +//~^ ERROR lifetime parameter `'a` is never used +//~| ERROR type parameter `T` is never used #[derive(CoercePointee)] -//~^ ERROR: `CoercePointee` can only be derived on `struct`s that are generic over at least one type +//~^ ERROR `CoercePointee` can only be derived on `struct`s that are generic over at least one type #[repr(transparent)] struct NoGeneric<'a>(&'a u8); #[derive(CoercePointee)] -//~^ ERROR: exactly one generic type parameter must be marked as `#[pointee]` to derive `CoercePointee` traits +//~^ ERROR exactly one generic type parameter must be marked as `#[pointee]` to derive `CoercePointee` traits #[repr(transparent)] struct AmbiguousPointee<'a, T1: ?Sized, T2: ?Sized> { a: (&'a T1, &'a T2), @@ -41,18 +41,18 @@ struct AmbiguousPointee<'a, T1: ?Sized, T2: ?Sized> { #[derive(CoercePointee)] #[repr(transparent)] struct TooManyPointees<'a, #[pointee] A: ?Sized, #[pointee] B: ?Sized>((&'a A, &'a B)); -//~^ ERROR: only one type parameter can be marked as `#[pointee]` when deriving `CoercePointee` traits +//~^ ERROR only one type parameter can be marked as `#[pointee]` when deriving `CoercePointee` traits #[derive(CoercePointee)] struct NotTransparent<'a, #[pointee] T: ?Sized> { - //~^ ERROR: `derive(CoercePointee)` is only applicable to `struct` with `repr(transparent)` layout + //~^ ERROR `derive(CoercePointee)` is only applicable to `struct` with `repr(transparent)` layout ptr: &'a T, } #[derive(CoercePointee)] #[repr(transparent)] struct NoMaybeSized<'a, #[pointee] T> { - //~^ ERROR: `derive(CoercePointee)` requires `T` to be marked `?Sized` + //~^ ERROR `derive(CoercePointee)` requires `T` to be marked `?Sized` ptr: &'a T, } @@ -60,7 +60,7 @@ struct NoMaybeSized<'a, #[pointee] T> { #[repr(transparent)] struct PointeeOnField<'a, #[pointee] T: ?Sized> { #[pointee] - //~^ ERROR: the `#[pointee]` attribute may only be used on generic parameters + //~^ ERROR the `#[pointee]` attribute may only be used on generic parameters ptr: &'a T, } @@ -70,7 +70,7 @@ struct PointeeInTypeConstBlock< 'a, T: ?Sized = [u32; const { struct UhOh<#[pointee] T>(T); - //~^ ERROR: the `#[pointee]` attribute may only be used on generic parameters + //~^ ERROR the `#[pointee]` attribute may only be used on generic parameters 10 }], > { @@ -84,7 +84,7 @@ struct PointeeInConstConstBlock< T: ?Sized, const V: u32 = { struct UhOh<#[pointee] T>(T); - //~^ ERROR: the `#[pointee]` attribute may only be used on generic parameters + //~^ ERROR the `#[pointee]` attribute may only be used on generic parameters 10 }, > { @@ -99,7 +99,7 @@ struct PointeeInAnotherTypeConstBlock<'a, #[pointee] T: ?Sized> { T, { struct UhOh<#[pointee] T>(T); - //~^ ERROR: the `#[pointee]` attribute may only be used on generic parameters + //~^ ERROR the `#[pointee]` attribute may only be used on generic parameters 0 }, >, @@ -138,7 +138,7 @@ struct GlobalCoreSized<'a, #[pointee] T: ?::core::marker::Sized> { #[malicious_macro::norepr] #[repr(transparent)] struct TryToWipeRepr<'a, #[pointee] T: ?Sized> { - //~^ ERROR: `derive(CoercePointee)` is only applicable to `struct` with `repr(transparent)` layout [E0802] + //~^ ERROR `derive(CoercePointee)` is only applicable to `struct` with `repr(transparent)` layout [E0802] ptr: &'a T, } diff --git a/tests/ui/diagnostic_namespace/do_not_recommend/type_mismatch.rs b/tests/ui/diagnostic_namespace/do_not_recommend/type_mismatch.rs index b5bd14745cda3..aa190c280fb1a 100644 --- a/tests/ui/diagnostic_namespace/do_not_recommend/type_mismatch.rs +++ b/tests/ui/diagnostic_namespace/do_not_recommend/type_mismatch.rs @@ -22,5 +22,5 @@ fn verify() {} pub fn main() { verify::(); - //~^ERROR: Very important message! [E0277] + //~^ERROR Very important message! [E0277] } diff --git a/tests/ui/did_you_mean/issue-103909.rs b/tests/ui/did_you_mean/issue-103909.rs index 20b67cd102d70..da82db561ee58 100644 --- a/tests/ui/did_you_mean/issue-103909.rs +++ b/tests/ui/did_you_mean/issue-103909.rs @@ -3,7 +3,7 @@ use std::fs::File; fn main() { if Err(err) = File::open("hello.txt") { - //~^ ERROR: cannot find value `err` in this scope - //~| ERROR: mismatched types + //~^ ERROR cannot find value `err` in this scope + //~| ERROR mismatched types } } diff --git a/tests/ui/did_you_mean/issue-105225-named-args.rs b/tests/ui/did_you_mean/issue-105225-named-args.rs index 38e817765769f..8eeb8126eff63 100644 --- a/tests/ui/did_you_mean/issue-105225-named-args.rs +++ b/tests/ui/did_you_mean/issue-105225-named-args.rs @@ -3,8 +3,8 @@ fn main() { let y = "y"; println!("{x}", x, x = y); - //~^ ERROR: redundant argument + //~^ ERROR redundant argument println!("{x}", x = y, x = y); - //~^ ERROR: duplicate argument named `x` + //~^ ERROR duplicate argument named `x` } diff --git a/tests/ui/did_you_mean/issue-105225.fixed b/tests/ui/did_you_mean/issue-105225.fixed index 54bd254c8e40b..e5e6f91755b35 100644 --- a/tests/ui/did_you_mean/issue-105225.fixed +++ b/tests/ui/did_you_mean/issue-105225.fixed @@ -5,17 +5,17 @@ fn main() { let y = "y"; println!("{x}", ); - //~^ ERROR: redundant argument + //~^ ERROR redundant argument println!("{x} {}", x, ); - //~^ ERROR: redundant argument + //~^ ERROR redundant argument println!("{} {x}", x, ); - //~^ ERROR: redundant argument + //~^ ERROR redundant argument println!("{x} {y}", ); - //~^ ERROR: redundant arguments + //~^ ERROR redundant arguments println!("{} {} {x} {y} {}", x, x, x, ); - //~^ ERROR: redundant arguments + //~^ ERROR redundant arguments } diff --git a/tests/ui/did_you_mean/issue-105225.rs b/tests/ui/did_you_mean/issue-105225.rs index c0a04b456ac3c..b404ca8318494 100644 --- a/tests/ui/did_you_mean/issue-105225.rs +++ b/tests/ui/did_you_mean/issue-105225.rs @@ -5,17 +5,17 @@ fn main() { let y = "y"; println!("{x}", x); - //~^ ERROR: redundant argument + //~^ ERROR redundant argument println!("{x} {}", x, x); - //~^ ERROR: redundant argument + //~^ ERROR redundant argument println!("{} {x}", x, x); - //~^ ERROR: redundant argument + //~^ ERROR redundant argument println!("{x} {y}", x, y); - //~^ ERROR: redundant arguments + //~^ ERROR redundant arguments println!("{} {} {x} {y} {}", x, x, x, y, y); - //~^ ERROR: redundant arguments + //~^ ERROR redundant arguments } diff --git a/tests/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.rs b/tests/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.rs index 1749137d4384e..f90783d46b883 100644 --- a/tests/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.rs +++ b/tests/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.rs @@ -22,5 +22,5 @@ fn main() { let f1 = Bar; f1.foo(1usize); - //~^ error: the trait bound `Bar: Foo` is not satisfied + //~^ error the trait bound `Bar: Foo` is not satisfied } diff --git a/tests/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs b/tests/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs index e898b224ed14b..e0970619cb12d 100644 --- a/tests/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs +++ b/tests/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.rs @@ -26,5 +26,5 @@ fn main() { let f1 = Bar; f1.foo(1usize); - //~^ error: the trait bound `Bar: Foo` is not satisfied + //~^ error the trait bound `Bar: Foo` is not satisfied } diff --git a/tests/ui/drop/if-let-rescope-borrowck-suggestions.rs b/tests/ui/drop/if-let-rescope-borrowck-suggestions.rs index a3583c48c39b7..7a9f37bd69707 100644 --- a/tests/ui/drop/if-let-rescope-borrowck-suggestions.rs +++ b/tests/ui/drop/if-let-rescope-borrowck-suggestions.rs @@ -19,12 +19,12 @@ fn do_something(_: &T) {} fn main() { do_something(if let Some(value) = Droppy.get_ref() { value } else { &0 }); - //~^ ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed do_something(if let Some(value) = Droppy.get_ref() { - //~^ ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed value } else if let Some(value) = Droppy.get_ref() { - //~^ ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed value } else { &0 diff --git a/tests/ui/drop/lint-if-let-rescope-gated.rs b/tests/ui/drop/lint-if-let-rescope-gated.rs index f5538a37eef85..e28db3bc08964 100644 --- a/tests/ui/drop/lint-if-let-rescope-gated.rs +++ b/tests/ui/drop/lint-if-let-rescope-gated.rs @@ -24,10 +24,10 @@ impl Droppy { fn main() { if let Some(_value) = Droppy.get() { - //[edition2021]~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //[edition2021]~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 - //[edition2021]~| WARN: this changes meaning in Rust 2024 + //[edition2021]~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //[edition2021]~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 + //[edition2021]~| WARN this changes meaning in Rust 2024 } else { - //[edition2021]~^ HELP: the value is now dropped here in Edition 2024 + //[edition2021]~^ HELP the value is now dropped here in Edition 2024 } } diff --git a/tests/ui/drop/lint-if-let-rescope.fixed b/tests/ui/drop/lint-if-let-rescope.fixed index 79858e6f225aa..09e60621702c5 100644 --- a/tests/ui/drop/lint-if-let-rescope.fixed +++ b/tests/ui/drop/lint-if-let-rescope.fixed @@ -25,41 +25,41 @@ fn main() { } match droppy().get() { Some(_value) => { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 // do something } _ => { - //~^ HELP: the value is now dropped here in Edition 2024 + //~^ HELP the value is now dropped here in Edition 2024 // do something else }} match droppy().get() { Some(_value) => { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 // do something } _ => { match droppy().get() { Some(_value) => { - //~^ HELP: the value is now dropped here in Edition 2024 + //~^ HELP the value is now dropped here in Edition 2024 // do something else } _ => {}}}} - //~^ HELP: the value is now dropped here in Edition 2024 + //~^ HELP the value is now dropped here in Edition 2024 if droppy().get().is_some() { // Should not lint } else { match droppy().get() { Some(_value) => { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 } _ => if droppy().get().is_none() { - //~^ HELP: the value is now dropped here in Edition 2024 + //~^ HELP the value is now dropped here in Edition 2024 }}} if let Some(1) = { match Droppy.get() { Some(_value) => { Some(1) } _ => { None }} } { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: the value is now dropped here in Edition 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP the value is now dropped here in Edition 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 } if let () = { if let Some(_value) = Droppy.get() {} } { @@ -70,16 +70,16 @@ fn main() { #[rustfmt::skip] if (match droppy().get() { Some(_value) => { true } _ => { false }}) { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: the value is now dropped here in Edition 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP the value is now dropped here in Edition 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 // do something } else if (((match droppy().get() { Some(_value) => { true } _ => { false }}))) { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: the value is now dropped here in Edition 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP the value is now dropped here in Edition 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 } while let Some(_value) = droppy().get() { @@ -88,17 +88,17 @@ fn main() { } while (match droppy().get() { Some(_value) => { false } _ => { true }}) { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: the value is now dropped here in Edition 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP the value is now dropped here in Edition 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 } match Some((droppy(), ()).1) { Some(_value) => {} _ => {}} - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: the value is now dropped here in Edition 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP the value is now dropped here in Edition 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 // We want to keep the `if let`s below as direct descendents of match arms, // so the formatting is suppressed. diff --git a/tests/ui/drop/lint-if-let-rescope.rs b/tests/ui/drop/lint-if-let-rescope.rs index 9d873c65426f6..770b6c84cb175 100644 --- a/tests/ui/drop/lint-if-let-rescope.rs +++ b/tests/ui/drop/lint-if-let-rescope.rs @@ -25,41 +25,41 @@ fn main() { } if let Some(_value) = droppy().get() { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 // do something } else { - //~^ HELP: the value is now dropped here in Edition 2024 + //~^ HELP the value is now dropped here in Edition 2024 // do something else } if let Some(_value) = droppy().get() { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 // do something } else if let Some(_value) = droppy().get() { - //~^ HELP: the value is now dropped here in Edition 2024 + //~^ HELP the value is now dropped here in Edition 2024 // do something else } - //~^ HELP: the value is now dropped here in Edition 2024 + //~^ HELP the value is now dropped here in Edition 2024 if droppy().get().is_some() { // Should not lint } else if let Some(_value) = droppy().get() { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 } else if droppy().get().is_none() { - //~^ HELP: the value is now dropped here in Edition 2024 + //~^ HELP the value is now dropped here in Edition 2024 } if let Some(1) = { if let Some(_value) = Droppy.get() { Some(1) } else { None } } { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: the value is now dropped here in Edition 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP the value is now dropped here in Edition 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 } if let () = { if let Some(_value) = Droppy.get() {} } { @@ -70,16 +70,16 @@ fn main() { #[rustfmt::skip] if (if let Some(_value) = droppy().get() { true } else { false }) { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: the value is now dropped here in Edition 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP the value is now dropped here in Edition 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 // do something } else if (((if let Some(_value) = droppy().get() { true } else { false }))) { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: the value is now dropped here in Edition 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP the value is now dropped here in Edition 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 } while let Some(_value) = droppy().get() { @@ -88,17 +88,17 @@ fn main() { } while (if let Some(_value) = droppy().get() { false } else { true }) { - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: the value is now dropped here in Edition 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP the value is now dropped here in Edition 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 } if let Some(_value) = Some((droppy(), ()).1) {} else {} - //~^ ERROR: `if let` assigns a shorter lifetime since Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| HELP: the value is now dropped here in Edition 2024 - //~| HELP: a `match` with a single arm can preserve the drop order up to Edition 2021 + //~^ ERROR `if let` assigns a shorter lifetime since Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| HELP the value is now dropped here in Edition 2024 + //~| HELP a `match` with a single arm can preserve the drop order up to Edition 2021 // We want to keep the `if let`s below as direct descendents of match arms, // so the formatting is suppressed. diff --git a/tests/ui/drop/lint-tail-expr-drop-order-borrowck.rs b/tests/ui/drop/lint-tail-expr-drop-order-borrowck.rs index 6f64d83f8a0c3..3e055546337f0 100644 --- a/tests/ui/drop/lint-tail-expr-drop-order-borrowck.rs +++ b/tests/ui/drop/lint-tail-expr-drop-order-borrowck.rs @@ -3,25 +3,25 @@ // due to implementation of RFC 3606 //@ edition: 2021 -#![deny(tail_expr_drop_order)] //~ NOTE: the lint level is defined here +#![deny(tail_expr_drop_order)] //~ NOTE the lint level is defined here fn should_lint_with_potential_borrowck_err() { let _ = { String::new().as_str() }.len(); - //~^ ERROR: relative drop order changing - //~| WARN: this changes meaning in Rust 2024 - //~| NOTE: this temporary value will be dropped at the end of the block + //~^ ERROR relative drop order changing + //~| WARN this changes meaning in Rust 2024 + //~| NOTE this temporary value will be dropped at the end of the block //~| borrow later used by call - //~| NOTE: for more information, see + //~| NOTE for more information, see } fn should_lint_with_unsafe_block() { fn f(_: usize) {} f(unsafe { String::new().as_str() }.len()); - //~^ ERROR: relative drop order changing - //~| WARN: this changes meaning in Rust 2024 - //~| NOTE: this temporary value will be dropped at the end of the block + //~^ ERROR relative drop order changing + //~| WARN this changes meaning in Rust 2024 + //~| NOTE this temporary value will be dropped at the end of the block //~| borrow later used by call - //~| NOTE: for more information, see + //~| NOTE for more information, see } #[rustfmt::skip] @@ -29,11 +29,11 @@ fn should_lint_with_big_block() { fn f(_: T) {} f({ &mut || 0 - //~^ ERROR: relative drop order changing - //~| WARN: this changes meaning in Rust 2024 - //~| NOTE: this temporary value will be dropped at the end of the block + //~^ ERROR relative drop order changing + //~| WARN this changes meaning in Rust 2024 + //~| NOTE this temporary value will be dropped at the end of the block //~| borrow later used here - //~| NOTE: for more information, see + //~| NOTE for more information, see }) } @@ -41,11 +41,11 @@ fn another_temp_that_is_copy_in_arg() { fn f() {} fn g(_: &()) {} g({ &f() }); - //~^ ERROR: relative drop order changing - //~| WARN: this changes meaning in Rust 2024 - //~| NOTE: this temporary value will be dropped at the end of the block + //~^ ERROR relative drop order changing + //~| WARN this changes meaning in Rust 2024 + //~| NOTE this temporary value will be dropped at the end of the block //~| borrow later used by call - //~| NOTE: for more information, see + //~| NOTE for more information, see } fn main() {} diff --git a/tests/ui/drop/lint-tail-expr-drop-order.rs b/tests/ui/drop/lint-tail-expr-drop-order.rs index 55a2d1d3b7543..9b6c11941ad3a 100644 --- a/tests/ui/drop/lint-tail-expr-drop-order.rs +++ b/tests/ui/drop/lint-tail-expr-drop-order.rs @@ -3,22 +3,22 @@ // due to implementation of RFC 3606 //@ edition: 2021 -#![deny(tail_expr_drop_order)] //~ NOTE: the lint level is defined here +#![deny(tail_expr_drop_order)] //~ NOTE the lint level is defined here #![allow(dropping_copy_types)] struct LoudDropper; impl Drop for LoudDropper { - //~^ NOTE: `#1` invokes this custom destructor - //~| NOTE: `x` invokes this custom destructor - //~| NOTE: `#1` invokes this custom destructor - //~| NOTE: `x` invokes this custom destructor - //~| NOTE: `#1` invokes this custom destructor - //~| NOTE: `x` invokes this custom destructor - //~| NOTE: `#1` invokes this custom destructor - //~| NOTE: `x` invokes this custom destructor - //~| NOTE: `#1` invokes this custom destructor - //~| NOTE: `_x` invokes this custom destructor - //~| NOTE: `#1` invokes this custom destructor + //~^ NOTE `#1` invokes this custom destructor + //~| NOTE `x` invokes this custom destructor + //~| NOTE `#1` invokes this custom destructor + //~| NOTE `x` invokes this custom destructor + //~| NOTE `#1` invokes this custom destructor + //~| NOTE `x` invokes this custom destructor + //~| NOTE `#1` invokes this custom destructor + //~| NOTE `x` invokes this custom destructor + //~| NOTE `#1` invokes this custom destructor + //~| NOTE `_x` invokes this custom destructor + //~| NOTE `#1` invokes this custom destructor fn drop(&mut self) { // This destructor should be considered significant because it is a custom destructor // and we will assume that the destructor can generate side effects arbitrarily so that @@ -34,18 +34,18 @@ impl LoudDropper { fn should_lint() -> i32 { let x = LoudDropper; - //~^ NOTE: `x` calls a custom destructor - //~| NOTE: `x` will be dropped later as of Edition 2024 + //~^ NOTE `x` calls a custom destructor + //~| NOTE `x` will be dropped later as of Edition 2024 // Should lint x.get() + LoudDropper.get() - //~^ ERROR: relative drop order changing in Rust 2024 - //~| NOTE: this value will be stored in a temporary; let us call it `#1` - //~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects - //~| NOTE: for more information, see + //~^ ERROR relative drop order changing in Rust 2024 + //~| NOTE this value will be stored in a temporary; let us call it `#1` + //~| NOTE up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| NOTE most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects + //~| NOTE for more information, see } -//~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement +//~^ NOTE now the temporary value is dropped here, before the local variables in the block or statement fn should_not_lint_closure() -> impl FnOnce() -> i32 { let x = LoudDropper; @@ -59,18 +59,18 @@ fn should_not_lint_closure() -> impl FnOnce() -> i32 { fn should_lint_in_nested_items() { fn should_lint_me() -> i32 { let x = LoudDropper; - //~^ NOTE: `x` calls a custom destructor - //~| NOTE: `x` will be dropped later as of Edition 2024 + //~^ NOTE `x` calls a custom destructor + //~| NOTE `x` will be dropped later as of Edition 2024 // Should lint x.get() + LoudDropper.get() - //~^ ERROR: relative drop order changing in Rust 2024 - //~| NOTE: this value will be stored in a temporary; let us call it `#1` - //~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects - //~| NOTE: for more information, see + //~^ ERROR relative drop order changing in Rust 2024 + //~| NOTE this value will be stored in a temporary; let us call it `#1` + //~| NOTE up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| NOTE most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects + //~| NOTE for more information, see } - //~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement + //~^ NOTE now the temporary value is dropped here, before the local variables in the block or statement } fn should_not_lint_params(x: LoudDropper) -> i32 { @@ -87,17 +87,17 @@ fn should_not_lint() -> i32 { fn should_lint_in_nested_block() -> i32 { let x = LoudDropper; - //~^ NOTE: `x` calls a custom destructor - //~| NOTE: `x` will be dropped later as of Edition 2024 + //~^ NOTE `x` calls a custom destructor + //~| NOTE `x` will be dropped later as of Edition 2024 { LoudDropper.get() } - //~^ ERROR: relative drop order changing in Rust 2024 - //~| NOTE: this value will be stored in a temporary; let us call it `#1` - //~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects - //~| NOTE: for more information, see + //~^ ERROR relative drop order changing in Rust 2024 + //~| NOTE this value will be stored in a temporary; let us call it `#1` + //~| NOTE up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| NOTE most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects + //~| NOTE for more information, see } -//~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement +//~^ NOTE now the temporary value is dropped here, before the local variables in the block or statement fn should_not_lint_in_match_arm() -> i32 { let x = LoudDropper; @@ -140,48 +140,48 @@ fn should_lint_into_async_body() -> i32 { } let future = f(); - //~^ NOTE: `future` calls a custom destructor - //~| NOTE: `future` will be dropped later as of Edition 2024 + //~^ NOTE `future` calls a custom destructor + //~| NOTE `future` will be dropped later as of Edition 2024 LoudDropper.get() - //~^ ERROR: relative drop order changing in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| NOTE: this value will be stored in a temporary; let us call it `#1` - //~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 - //~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects - //~| NOTE: for more information, see + //~^ ERROR relative drop order changing in Rust 2024 + //~| WARN this changes meaning in Rust 2024 + //~| NOTE this value will be stored in a temporary; let us call it `#1` + //~| NOTE up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 + //~| NOTE most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects + //~| NOTE for more information, see } -//~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement +//~^ NOTE now the temporary value is dropped here, before the local variables in the block or statement fn should_lint_generics() -> &'static str { fn extract(_: &T) -> &'static str { todo!() } let x = T::default(); - //~^ NOTE: `x` calls a custom destructor - //~| NOTE: `x` will be dropped later as of Edition 2024 + //~^ NOTE `x` calls a custom destructor + //~| NOTE `x` will be dropped later as of Edition 2024 extract(&T::default()) - //~^ ERROR: relative drop order changing in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| NOTE: this value will be stored in a temporary; let us call it `#1` - //~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 - //~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects - //~| NOTE: for more information, see + //~^ ERROR relative drop order changing in Rust 2024 + //~| WARN this changes meaning in Rust 2024 + //~| NOTE this value will be stored in a temporary; let us call it `#1` + //~| NOTE up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 + //~| NOTE most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects + //~| NOTE for more information, see } -//~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement +//~^ NOTE now the temporary value is dropped here, before the local variables in the block or statement fn should_lint_adt() -> i32 { let x: Result = Ok(LoudDropper); - //~^ NOTE: `x` calls a custom destructor - //~| NOTE: `x` will be dropped later as of Edition 2024 + //~^ NOTE `x` calls a custom destructor + //~| NOTE `x` will be dropped later as of Edition 2024 LoudDropper.get() - //~^ ERROR: relative drop order changing in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| NOTE: this value will be stored in a temporary; let us call it `#1` - //~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 - //~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects - //~| NOTE: for more information, see + //~^ ERROR relative drop order changing in Rust 2024 + //~| WARN this changes meaning in Rust 2024 + //~| NOTE this value will be stored in a temporary; let us call it `#1` + //~| NOTE up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 + //~| NOTE most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects + //~| NOTE for more information, see } -//~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement +//~^ NOTE now the temporary value is dropped here, before the local variables in the block or statement fn should_not_lint_insign_dtor() -> i32 { let x = String::new(); @@ -191,7 +191,7 @@ fn should_not_lint_insign_dtor() -> i32 { fn should_lint_with_dtor_span() -> i32 { struct LoudDropper3; impl Drop for LoudDropper3 { - //~^ NOTE: `#1` invokes this custom destructor + //~^ NOTE `#1` invokes this custom destructor fn drop(&mut self) { println!("loud drop"); } @@ -203,7 +203,7 @@ fn should_lint_with_dtor_span() -> i32 { } struct LoudDropper2; impl Drop for LoudDropper2 { - //~^ NOTE: `x` invokes this custom destructor + //~^ NOTE `x` invokes this custom destructor fn drop(&mut self) { println!("loud drop"); } @@ -215,36 +215,36 @@ fn should_lint_with_dtor_span() -> i32 { } let x = LoudDropper2; - //~^ NOTE: `x` calls a custom destructor - //~| NOTE: `x` will be dropped later as of Edition 2024 + //~^ NOTE `x` calls a custom destructor + //~| NOTE `x` will be dropped later as of Edition 2024 LoudDropper3.get() - //~^ ERROR: relative drop order changing in Rust 2024 - //~| NOTE: this value will be stored in a temporary; let us call it `#1` - //~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects - //~| NOTE: for more information, see + //~^ ERROR relative drop order changing in Rust 2024 + //~| NOTE this value will be stored in a temporary; let us call it `#1` + //~| NOTE up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| NOTE most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects + //~| NOTE for more information, see } -//~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement +//~^ NOTE now the temporary value is dropped here, before the local variables in the block or statement fn should_lint_with_transient_drops() { drop(( { LoudDropper.get() - //~^ ERROR: relative drop order changing in Rust 2024 - //~| NOTE: this value will be stored in a temporary; let us call it `#1` - //~| NOTE: up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 - //~| WARN: this changes meaning in Rust 2024 - //~| NOTE: most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects - //~| NOTE: for more information, see + //~^ ERROR relative drop order changing in Rust 2024 + //~| NOTE this value will be stored in a temporary; let us call it `#1` + //~| NOTE up until Edition 2021 `#1` is dropped last but will be dropped earlier in Edition 2024 + //~| WARN this changes meaning in Rust 2024 + //~| NOTE most of the time, changing drop order is harmless; inspect the `impl Drop`s for side effects + //~| NOTE for more information, see }, { let _x = LoudDropper; - //~^ NOTE: `_x` calls a custom destructor - //~| NOTE: `_x` will be dropped later as of Edition 2024 + //~^ NOTE `_x` calls a custom destructor + //~| NOTE `_x` will be dropped later as of Edition 2024 }, )); - //~^ NOTE: now the temporary value is dropped here, before the local variables in the block or statement + //~^ NOTE now the temporary value is dropped here, before the local variables in the block or statement } fn main() {} diff --git a/tests/ui/drop/nonsense-drop-impl-issue-139278.rs b/tests/ui/drop/nonsense-drop-impl-issue-139278.rs index 86f4e4d86072a..9b763d22e6d93 100644 --- a/tests/ui/drop/nonsense-drop-impl-issue-139278.rs +++ b/tests/ui/drop/nonsense-drop-impl-issue-139278.rs @@ -1,8 +1,8 @@ //@ check-fail struct Foo; -impl Drop for Foo { //~ ERROR: not all trait items implemented - const SPLOK: u32 = 0; //~ ERROR: not a member of trait +impl Drop for Foo { //~ ERROR not all trait items implemented + const SPLOK: u32 = 0; //~ ERROR not a member of trait } const X: Foo = Foo; diff --git a/tests/ui/drop/tail-expr-drop-order-negative.rs b/tests/ui/drop/tail-expr-drop-order-negative.rs index 3b20691f8eaa0..662e6c0c893e1 100644 --- a/tests/ui/drop/tail-expr-drop-order-negative.rs +++ b/tests/ui/drop/tail-expr-drop-order-negative.rs @@ -6,7 +6,7 @@ fn why_would_you_do_this() -> bool { let mut x = None; // Make a temporary `RefCell` and put a `Ref` that borrows it in `x`. x.replace(std::cell::RefCell::new(123).borrow()).is_some() - //[edition2024]~^ ERROR: temporary value dropped while borrowed + //[edition2024]~^ ERROR temporary value dropped while borrowed } fn main() { diff --git a/tests/ui/dropck/constrained_by_assoc_type_equality_and_self_ty.rs b/tests/ui/dropck/constrained_by_assoc_type_equality_and_self_ty.rs index 3a85b86cb1fdd..6dd39e9f059e4 100644 --- a/tests/ui/dropck/constrained_by_assoc_type_equality_and_self_ty.rs +++ b/tests/ui/dropck/constrained_by_assoc_type_equality_and_self_ty.rs @@ -5,7 +5,7 @@ trait Trait { struct Foo(T, U); impl, U: ?Sized> Drop for Foo { - //~^ ERROR: `Drop` impl requires `::Assoc == U` + //~^ ERROR `Drop` impl requires `::Assoc == U` fn drop(&mut self) {} } diff --git a/tests/ui/dropck/dropck-union.rs b/tests/ui/dropck/dropck-union.rs index 5a9965db5ed47..ec7abdad6fcc2 100644 --- a/tests/ui/dropck/dropck-union.rs +++ b/tests/ui/dropck/dropck-union.rs @@ -34,5 +34,5 @@ impl<'a> Drop for C<'a> { fn main() { let v : Wrap = Wrap::new(C(Cell::new(None))); - v.0.set(Some(&v)); //~ ERROR: `v` does not live long enough + v.0.set(Some(&v)); //~ ERROR `v` does not live long enough } diff --git a/tests/ui/dropck/relate_lt_in_type_outlives_bound.rs b/tests/ui/dropck/relate_lt_in_type_outlives_bound.rs index 42530d317308a..8f24335d10cd7 100644 --- a/tests/ui/dropck/relate_lt_in_type_outlives_bound.rs +++ b/tests/ui/dropck/relate_lt_in_type_outlives_bound.rs @@ -5,7 +5,7 @@ where impl<'a, T> Drop for Wrapper<'a, T> where T: 'static, - //~^ error: `Drop` impl requires `T: 'static` but the struct it is implemented for does not + //~^ error `Drop` impl requires `T: 'static` but the struct it is implemented for does not { fn drop(&mut self) {} } diff --git a/tests/ui/dropck/unconstrained_const_param_on_drop.rs b/tests/ui/dropck/unconstrained_const_param_on_drop.rs index de77fa55fb280..18a9ae34b837b 100644 --- a/tests/ui/dropck/unconstrained_const_param_on_drop.rs +++ b/tests/ui/dropck/unconstrained_const_param_on_drop.rs @@ -1,7 +1,7 @@ struct Foo {} impl Drop for Foo {} -//~^ ERROR: `Drop` impl requires `the constant `_` has type `usize`` -//~| ERROR: the const parameter `UNUSED` is not constrained by the impl trait, self type, or predicates +//~^ ERROR `Drop` impl requires `the constant `_` has type `usize`` +//~| ERROR the const parameter `UNUSED` is not constrained by the impl trait, self type, or predicates fn main() {} diff --git a/tests/ui/dyn-compatibility/assoc_type_bounds.rs b/tests/ui/dyn-compatibility/assoc_type_bounds.rs index 6e2076a482247..ce73a6c7643b5 100644 --- a/tests/ui/dyn-compatibility/assoc_type_bounds.rs +++ b/tests/ui/dyn-compatibility/assoc_type_bounds.rs @@ -7,7 +7,7 @@ trait Foo { trait Cake {} impl Cake for () {} -fn foo(_: &dyn Foo<()>) {} //~ ERROR: the value of the associated type `Bar` in `Foo<()>` must be specified -fn bar(_: &dyn Foo) {} //~ ERROR: the value of the associated type `Bar` in `Foo` must be specified +fn foo(_: &dyn Foo<()>) {} //~ ERROR the value of the associated type `Bar` in `Foo<()>` must be specified +fn bar(_: &dyn Foo) {} //~ ERROR the value of the associated type `Bar` in `Foo` must be specified fn main() {} diff --git a/tests/ui/dyn-compatibility/assoc_type_bounds2.rs b/tests/ui/dyn-compatibility/assoc_type_bounds2.rs index 2b35016d774ce..eeb2eeaa8c71c 100644 --- a/tests/ui/dyn-compatibility/assoc_type_bounds2.rs +++ b/tests/ui/dyn-compatibility/assoc_type_bounds2.rs @@ -7,7 +7,7 @@ trait Foo { trait Cake {} impl Cake for () {} -fn foo(_: &dyn Foo<()>) {} //~ ERROR: the value of the associated type `Bar` in `Foo<()>` must be specified -fn bar(_: &dyn Foo) {} //~ ERROR: the value of the associated type `Bar` in `Foo` must be specified +fn foo(_: &dyn Foo<()>) {} //~ ERROR the value of the associated type `Bar` in `Foo<()>` must be specified +fn bar(_: &dyn Foo) {} //~ ERROR the value of the associated type `Bar` in `Foo` must be specified fn main() {} diff --git a/tests/ui/dyn-compatibility/assoc_type_bounds_sized_unnecessary.rs b/tests/ui/dyn-compatibility/assoc_type_bounds_sized_unnecessary.rs index e9216da59272d..0f14df7fdf6f5 100644 --- a/tests/ui/dyn-compatibility/assoc_type_bounds_sized_unnecessary.rs +++ b/tests/ui/dyn-compatibility/assoc_type_bounds_sized_unnecessary.rs @@ -7,7 +7,7 @@ trait Foo { } fn foo(_: &dyn Foo) {} -//~^ WARN: unnecessary associated type bound for dyn-incompatible associated type +//~^ WARN unnecessary associated type bound for dyn-incompatible associated type #[allow(unused_associated_type_bounds)] fn bar(_: &dyn Foo) {} diff --git a/tests/ui/dyn-compatibility/assoc_type_bounds_sized_used.rs b/tests/ui/dyn-compatibility/assoc_type_bounds_sized_used.rs index d59fc1712ea7e..1643a34cd9709 100644 --- a/tests/ui/dyn-compatibility/assoc_type_bounds_sized_used.rs +++ b/tests/ui/dyn-compatibility/assoc_type_bounds_sized_used.rs @@ -9,8 +9,8 @@ trait Bop { fn bop() { let _ = ::Bar::default(); - //~^ ERROR: trait bounds were not satisfied - //~| ERROR: the size for values of type `T` cannot be known at compilation time + //~^ ERROR trait bounds were not satisfied + //~| ERROR the size for values of type `T` cannot be known at compilation time } fn main() { diff --git a/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.rs b/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.rs index 312e0d666f1a9..cdafec5b249a9 100644 --- a/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.rs +++ b/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.rs @@ -10,6 +10,6 @@ fn id(f: Copy) -> usize { //[old]~| WARN trait objects without an explicit `dyn` are deprecated //[old]~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! f() - //[old]~^ ERROR: expected function, found `(dyn Copy + 'static)` + //[old]~^ ERROR expected function, found `(dyn Copy + 'static)` } fn main() {} diff --git a/tests/ui/dyn-compatibility/mentions-Self-in-super-predicates.rs b/tests/ui/dyn-compatibility/mentions-Self-in-super-predicates.rs index 2ab0c6c8f5dab..230a008bc73db 100644 --- a/tests/ui/dyn-compatibility/mentions-Self-in-super-predicates.rs +++ b/tests/ui/dyn-compatibility/mentions-Self-in-super-predicates.rs @@ -36,9 +36,9 @@ impl <'x> Expr for SExpr<'x> { fn main() { let a: Box = Box::new(SExpr::new()); - //~^ ERROR: `Expr` is not dyn compatible + //~^ ERROR `Expr` is not dyn compatible let b: Box = Box::new(SExpr::new()); - //~^ ERROR: `Expr` is not dyn compatible + //~^ ERROR `Expr` is not dyn compatible // assert_eq!(a , b); } diff --git a/tests/ui/dyn-compatibility/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs b/tests/ui/dyn-compatibility/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs index 7bc2af463cb9f..ef7f38ae36bfd 100644 --- a/tests/ui/dyn-compatibility/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs +++ b/tests/ui/dyn-compatibility/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs @@ -6,133 +6,133 @@ struct IceCream; impl IceCream { fn foo(_: &Trait) {} - //~^ ERROR: expected a type, found a trait + //~^ ERROR expected a type, found a trait fn bar(self, _: &'a Trait) {} - //~^ ERROR: expected a type, found a trait - //~| ERROR: use of undeclared lifetime name + //~^ ERROR expected a type, found a trait + //~| ERROR use of undeclared lifetime name fn alice<'a>(&self, _: &Trait) {} - //~^ ERROR: expected a type, found a trait + //~^ ERROR expected a type, found a trait fn bob<'a>(_: &'a Trait) {} - //~^ ERROR: expected a type, found a trait + //~^ ERROR expected a type, found a trait fn cat() -> &Trait { - //~^ ERROR: missing lifetime specifier - //~| ERROR: expected a type, found a trait + //~^ ERROR missing lifetime specifier + //~| ERROR expected a type, found a trait &Type } fn dog<'a>() -> &Trait { - //~^ ERROR: missing lifetime specifier - //~| ERROR: expected a type, found a trait + //~^ ERROR missing lifetime specifier + //~| ERROR expected a type, found a trait &Type } fn kitten() -> &'a Trait { - //~^ ERROR: use of undeclared lifetime name - //~| ERROR: expected a type, found a trait + //~^ ERROR use of undeclared lifetime name + //~| ERROR expected a type, found a trait &Type } fn puppy<'a>() -> &'a Trait { - //~^ ERROR: expected a type, found a trait + //~^ ERROR expected a type, found a trait &Type } fn parrot() -> &mut Trait { - //~^ ERROR: missing lifetime specifier - //~| ERROR: expected a type, found a trait + //~^ ERROR missing lifetime specifier + //~| ERROR expected a type, found a trait &mut Type } } trait Sing { fn foo(_: &Trait); - //~^ ERROR: expected a type, found a trait + //~^ ERROR expected a type, found a trait fn bar(_: &'a Trait); - //~^ ERROR: expected a type, found a trait - //~| ERROR: use of undeclared lifetime name + //~^ ERROR expected a type, found a trait + //~| ERROR use of undeclared lifetime name fn alice<'a>(_: &Trait); - //~^ ERROR: expected a type, found a trait + //~^ ERROR expected a type, found a trait fn bob<'a>(_: &'a Trait); - //~^ ERROR: expected a type, found a trait + //~^ ERROR expected a type, found a trait fn cat() -> &Trait; - //~^ ERROR: missing lifetime specifier - //~| ERROR: expected a type, found a trait + //~^ ERROR missing lifetime specifier + //~| ERROR expected a type, found a trait fn dog<'a>() -> &Trait { - //~^ ERROR: missing lifetime specifier - //~| ERROR: expected a type, found a trait + //~^ ERROR missing lifetime specifier + //~| ERROR expected a type, found a trait &Type } fn kitten() -> &'a Trait { - //~^ ERROR: use of undeclared lifetime name - //~| ERROR: expected a type, found a trait + //~^ ERROR use of undeclared lifetime name + //~| ERROR expected a type, found a trait &Type } fn puppy<'a>() -> &'a Trait { - //~^ ERROR: expected a type, found a trait + //~^ ERROR expected a type, found a trait &Type } fn parrot() -> &mut Trait { - //~^ ERROR: missing lifetime specifier - //~| ERROR: expected a type, found a trait + //~^ ERROR missing lifetime specifier + //~| ERROR expected a type, found a trait &mut Type } } fn foo(_: &Trait) {} -//~^ ERROR: expected a type, found a trait +//~^ ERROR expected a type, found a trait fn bar(_: &'a Trait) {} -//~^ ERROR: expected a type, found a trait -//~| ERROR: use of undeclared lifetime name +//~^ ERROR expected a type, found a trait +//~| ERROR use of undeclared lifetime name fn alice<'a>(_: &Trait) {} -//~^ ERROR: expected a type, found a trait +//~^ ERROR expected a type, found a trait fn bob<'a>(_: &'a Trait) {} -//~^ ERROR: expected a type, found a trait +//~^ ERROR expected a type, found a trait struct Type; impl Trait for Type {} fn cat() -> &Trait { -//~^ ERROR: missing lifetime specifier -//~| ERROR: expected a type, found a trait +//~^ ERROR missing lifetime specifier +//~| ERROR expected a type, found a trait &Type } fn dog<'a>() -> &Trait { -//~^ ERROR: missing lifetime specifier -//~| ERROR: expected a type, found a trait +//~^ ERROR missing lifetime specifier +//~| ERROR expected a type, found a trait &Type } fn kitten() -> &'a Trait { -//~^ ERROR: use of undeclared lifetime name -//~| ERROR: expected a type, found a trait +//~^ ERROR use of undeclared lifetime name +//~| ERROR expected a type, found a trait &Type } fn puppy<'a>() -> &'a Trait { -//~^ ERROR: expected a type, found a trait +//~^ ERROR expected a type, found a trait &Type } fn parrot() -> &mut Trait { - //~^ ERROR: missing lifetime specifier - //~| ERROR: expected a type, found a trait + //~^ ERROR missing lifetime specifier + //~| ERROR expected a type, found a trait &mut Type } diff --git a/tests/ui/dyn-keyword/issue-5153.rs b/tests/ui/dyn-keyword/issue-5153.rs index 5bf0579030ad0..f21cac89bddfa 100644 --- a/tests/ui/dyn-keyword/issue-5153.rs +++ b/tests/ui/dyn-keyword/issue-5153.rs @@ -8,5 +8,5 @@ impl Foo for isize { fn main() { (&5isize as &dyn Foo).foo(); - //~^ ERROR: no method named `foo` found for reference `&dyn Foo` in the current scope + //~^ ERROR no method named `foo` found for reference `&dyn Foo` in the current scope } diff --git a/tests/ui/dyn-star/pointer-like-impl-rules.rs b/tests/ui/dyn-star/pointer-like-impl-rules.rs index c234e86e09a84..74f8e7e9d127c 100644 --- a/tests/ui/dyn-star/pointer-like-impl-rules.rs +++ b/tests/ui/dyn-star/pointer-like-impl-rules.rs @@ -7,8 +7,8 @@ use std::marker::PointerLike; struct NotReprTransparent; impl PointerLike for NotReprTransparent {} -//~^ ERROR: implementation must be applied to type that -//~| NOTE: the struct `NotReprTransparent` is not `repr(transparent)` +//~^ ERROR implementation must be applied to type that +//~| NOTE the struct `NotReprTransparent` is not `repr(transparent)` #[repr(transparent)] struct FieldIsPl(usize); @@ -21,14 +21,14 @@ impl PointerLike for FieldIsPlAndHasOtherField {} #[repr(transparent)] struct FieldIsNotPl(u8); impl PointerLike for FieldIsNotPl {} -//~^ ERROR: implementation must be applied to type that -//~| NOTE: the field `0` of struct `FieldIsNotPl` does not implement `PointerLike` +//~^ ERROR implementation must be applied to type that +//~| NOTE the field `0` of struct `FieldIsNotPl` does not implement `PointerLike` #[repr(transparent)] struct GenericFieldIsNotPl(T); impl PointerLike for GenericFieldIsNotPl {} -//~^ ERROR: implementation must be applied to type that -//~| NOTE: the field `0` of struct `GenericFieldIsNotPl` does not implement `PointerLike` +//~^ ERROR implementation must be applied to type that +//~| NOTE the field `0` of struct `GenericFieldIsNotPl` does not implement `PointerLike` #[repr(transparent)] struct GenericFieldIsPl(T); @@ -37,20 +37,20 @@ impl PointerLike for GenericFieldIsPl {} #[repr(transparent)] struct IsZeroSized(()); impl PointerLike for IsZeroSized {} -//~^ ERROR: implementation must be applied to type that -//~| NOTE: the struct `IsZeroSized` is `repr(transparent)`, but does not have a non-trivial field +//~^ ERROR implementation must be applied to type that +//~| NOTE the struct `IsZeroSized` is `repr(transparent)`, but does not have a non-trivial field trait SomeTrait {} impl PointerLike for dyn SomeTrait {} -//~^ ERROR: implementation must be applied to type that -//~| NOTE: types of dynamic or unknown size +//~^ ERROR implementation must be applied to type that +//~| NOTE types of dynamic or unknown size extern "C" { type ExternType; } impl PointerLike for ExternType {} -//~^ ERROR: implementation must be applied to type that -//~| NOTE: types of dynamic or unknown size +//~^ ERROR implementation must be applied to type that +//~| NOTE types of dynamic or unknown size struct LocalSizedType(&'static str); struct LocalUnsizedType(str); @@ -58,20 +58,20 @@ struct LocalUnsizedType(str); // This is not a special error but a normal coherence error, // which should still happen. impl PointerLike for &LocalSizedType {} -//~^ ERROR: conflicting implementations of trait `PointerLike` -//~| NOTE: conflicting implementation in crate `core` +//~^ ERROR conflicting implementations of trait `PointerLike` +//~| NOTE conflicting implementation in crate `core` impl PointerLike for &LocalUnsizedType {} -//~^ ERROR: implementation must be applied to type that -//~| NOTE: references to dynamically-sized types are too large to be `PointerLike` +//~^ ERROR implementation must be applied to type that +//~| NOTE references to dynamically-sized types are too large to be `PointerLike` impl PointerLike for Box {} -//~^ ERROR: conflicting implementations of trait `PointerLike` -//~| NOTE: conflicting implementation in crate `alloc` +//~^ ERROR conflicting implementations of trait `PointerLike` +//~| NOTE conflicting implementation in crate `alloc` impl PointerLike for Box {} -//~^ ERROR: implementation must be applied to type that -//~| NOTE: boxes of dynamically-sized types are too large to be `PointerLike` +//~^ ERROR implementation must be applied to type that +//~| NOTE boxes of dynamically-sized types are too large to be `PointerLike` fn expects_pointer_like(x: impl PointerLike) {} diff --git a/tests/ui/editions/edition-raw-pointer-method-2015.rs b/tests/ui/editions/edition-raw-pointer-method-2015.rs index b85e70465aba6..70cac324d5535 100644 --- a/tests/ui/editions/edition-raw-pointer-method-2015.rs +++ b/tests/ui/editions/edition-raw-pointer-method-2015.rs @@ -7,6 +7,6 @@ fn main() { let x = 0; let y = &x as *const _; let _ = y.is_null(); - //~^ error: type annotations needed [tyvar_behind_raw_pointer] - //~^^ warning: this is accepted in the current edition + //~^ error type annotations needed [tyvar_behind_raw_pointer] + //~^^ warning this is accepted in the current edition } diff --git a/tests/ui/editions/edition-raw-pointer-method-2018.rs b/tests/ui/editions/edition-raw-pointer-method-2018.rs index ad47553d5b7a2..ebf4cf7da1bf7 100644 --- a/tests/ui/editions/edition-raw-pointer-method-2018.rs +++ b/tests/ui/editions/edition-raw-pointer-method-2018.rs @@ -6,6 +6,6 @@ fn main() { let x = 0; let y = &x as *const _; - //~^ error: type annotations needed + //~^ error type annotations needed let _ = y.is_null(); } diff --git a/tests/ui/editions/never-type-fallback-breaking.e2021.fixed b/tests/ui/editions/never-type-fallback-breaking.e2021.fixed index 11ec273fc4bf9..66d550f813200 100644 --- a/tests/ui/editions/never-type-fallback-breaking.e2021.fixed +++ b/tests/ui/editions/never-type-fallback-breaking.e2021.fixed @@ -20,7 +20,7 @@ fn m() { //[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! let x: () = match true { true => Default::default(), - //[e2024]~^ error: the trait bound `!: Default` is not satisfied + //[e2024]~^ error the trait bound `!: Default` is not satisfied false => panic!("..."), }; @@ -35,7 +35,7 @@ fn q() -> Option<()> { } deserialize::<()>()?; - //[e2024]~^ error: the trait bound `!: Default` is not satisfied + //[e2024]~^ error the trait bound `!: Default` is not satisfied None } @@ -48,7 +48,7 @@ fn meow() -> Result<(), ()> { //[e2021]~^ this function depends on never type fallback being `()` //[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! help::<(), _>(1)?; - //[e2024]~^ error: the trait bound `(): From` is not satisfied + //[e2024]~^ error the trait bound `(): From` is not satisfied Ok(()) } @@ -60,7 +60,7 @@ pub fn fallback_return() -> Result<(), ()> { //[e2021]~^ this function depends on never type fallback being `()` //[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! takes_apit::<()>(|| Default::default())?; - //[e2024]~^ error: the trait bound `!: Default` is not satisfied + //[e2024]~^ error the trait bound `!: Default` is not satisfied Ok(()) } @@ -74,6 +74,6 @@ fn fully_apit() -> Result<(), ()> { //[e2021]~^ this function depends on never type fallback being `()` //[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! takes_apit2(mk::<()>()?); - //[e2024]~^ error: the trait bound `!: Default` is not satisfied + //[e2024]~^ error the trait bound `!: Default` is not satisfied Ok(()) } diff --git a/tests/ui/editions/never-type-fallback-breaking.rs b/tests/ui/editions/never-type-fallback-breaking.rs index daafc526eff41..b912a7466b480 100644 --- a/tests/ui/editions/never-type-fallback-breaking.rs +++ b/tests/ui/editions/never-type-fallback-breaking.rs @@ -20,7 +20,7 @@ fn m() { //[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! let x = match true { true => Default::default(), - //[e2024]~^ error: the trait bound `!: Default` is not satisfied + //[e2024]~^ error the trait bound `!: Default` is not satisfied false => panic!("..."), }; @@ -35,7 +35,7 @@ fn q() -> Option<()> { } deserialize()?; - //[e2024]~^ error: the trait bound `!: Default` is not satisfied + //[e2024]~^ error the trait bound `!: Default` is not satisfied None } @@ -48,7 +48,7 @@ fn meow() -> Result<(), ()> { //[e2021]~^ this function depends on never type fallback being `()` //[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! help(1)?; - //[e2024]~^ error: the trait bound `(): From` is not satisfied + //[e2024]~^ error the trait bound `(): From` is not satisfied Ok(()) } @@ -60,7 +60,7 @@ pub fn fallback_return() -> Result<(), ()> { //[e2021]~^ this function depends on never type fallback being `()` //[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! takes_apit(|| Default::default())?; - //[e2024]~^ error: the trait bound `!: Default` is not satisfied + //[e2024]~^ error the trait bound `!: Default` is not satisfied Ok(()) } @@ -74,6 +74,6 @@ fn fully_apit() -> Result<(), ()> { //[e2021]~^ this function depends on never type fallback being `()` //[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! takes_apit2(mk()?); - //[e2024]~^ error: the trait bound `!: Default` is not satisfied + //[e2024]~^ error the trait bound `!: Default` is not satisfied Ok(()) } diff --git a/tests/ui/empty/empty-linkname.rs b/tests/ui/empty/empty-linkname.rs index 7113d913cd0fa..ae2d6106b6c90 100644 --- a/tests/ui/empty/empty-linkname.rs +++ b/tests/ui/empty/empty-linkname.rs @@ -1,4 +1,4 @@ -#[link(name = "")] //~ ERROR: link name must not be empty +#[link(name = "")] //~ ERROR link name must not be empty extern "C" {} fn main() {} diff --git a/tests/ui/entry-point/auxiliary/bad_main_functions.rs b/tests/ui/entry-point/auxiliary/bad_main_functions.rs index 4649be99e6f27..1ccd629901285 100644 --- a/tests/ui/entry-point/auxiliary/bad_main_functions.rs +++ b/tests/ui/entry-point/auxiliary/bad_main_functions.rs @@ -1,2 +1,2 @@ pub fn boilerplate(x: u8) {} -//~^ ERROR: `main` function has wrong type [E0580] +//~^ ERROR `main` function has wrong type [E0580] diff --git a/tests/ui/env-macro/env-arg-2-not-string-literal.rs b/tests/ui/env-macro/env-arg-2-not-string-literal.rs index 66dced478f9fb..70b7403ead922 100644 --- a/tests/ui/env-macro/env-arg-2-not-string-literal.rs +++ b/tests/ui/env-macro/env-arg-2-not-string-literal.rs @@ -1 +1 @@ -fn main() { env!("one", 10); } //~ ERROR: expected string literal +fn main() { env!("one", 10); } //~ ERROR expected string literal diff --git a/tests/ui/env-macro/env-no-args.rs b/tests/ui/env-macro/env-no-args.rs index 2ff6d242b27c9..a01eb63912164 100644 --- a/tests/ui/env-macro/env-no-args.rs +++ b/tests/ui/env-macro/env-no-args.rs @@ -1 +1 @@ -fn main() { env!(); } //~ ERROR: `env!()` takes 1 or 2 arguments +fn main() { env!(); } //~ ERROR `env!()` takes 1 or 2 arguments diff --git a/tests/ui/env-macro/env-not-defined-custom.rs b/tests/ui/env-macro/env-not-defined-custom.rs index 30b72783f5ccc..8cc12b4250532 100644 --- a/tests/ui/env-macro/env-not-defined-custom.rs +++ b/tests/ui/env-macro/env-not-defined-custom.rs @@ -1 +1 @@ -fn main() { env!("__HOPEFULLY_NOT_DEFINED__", "my error message"); } //~ ERROR: my error message +fn main() { env!("__HOPEFULLY_NOT_DEFINED__", "my error message"); } //~ ERROR my error message diff --git a/tests/ui/env-macro/env-not-defined-default.rs b/tests/ui/env-macro/env-not-defined-default.rs index 1fb046c78f2a0..d511bb7d47b55 100644 --- a/tests/ui/env-macro/env-not-defined-default.rs +++ b/tests/ui/env-macro/env-not-defined-default.rs @@ -1,4 +1,4 @@ fn main() { env!("CARGO__HOPEFULLY_NOT_DEFINED__"); - //~^ ERROR: environment variable `CARGO__HOPEFULLY_NOT_DEFINED__` not defined + //~^ ERROR environment variable `CARGO__HOPEFULLY_NOT_DEFINED__` not defined } diff --git a/tests/ui/env-macro/env-not-string-literal.rs b/tests/ui/env-macro/env-not-string-literal.rs index 3eaa0b5daaf6f..8085bc4f560c1 100644 --- a/tests/ui/env-macro/env-not-string-literal.rs +++ b/tests/ui/env-macro/env-not-string-literal.rs @@ -1 +1 @@ -fn main() { env!(10, "two"); } //~ ERROR: expected string literal +fn main() { env!(10, "two"); } //~ ERROR expected string literal diff --git a/tests/ui/env-macro/env-too-many-args.rs b/tests/ui/env-macro/env-too-many-args.rs index ffad1c51303fc..ef7e102f19494 100644 --- a/tests/ui/env-macro/env-too-many-args.rs +++ b/tests/ui/env-macro/env-too-many-args.rs @@ -1 +1 @@ -fn main() { env!("one", "two", "three"); } //~ ERROR: `env!()` takes 1 or 2 arguments +fn main() { env!("one", "two", "three"); } //~ ERROR `env!()` takes 1 or 2 arguments diff --git a/tests/ui/env-macro/option_env-no-args.rs b/tests/ui/env-macro/option_env-no-args.rs index bc5f77bc62e5b..e8a9d79884463 100644 --- a/tests/ui/env-macro/option_env-no-args.rs +++ b/tests/ui/env-macro/option_env-no-args.rs @@ -1 +1 @@ -fn main() { option_env!(); } //~ ERROR: option_env! takes 1 argument +fn main() { option_env!(); } //~ ERROR option_env! takes 1 argument diff --git a/tests/ui/env-macro/option_env-not-string-literal.rs b/tests/ui/env-macro/option_env-not-string-literal.rs index 27c3a8e83db56..a26d780cbb9cb 100644 --- a/tests/ui/env-macro/option_env-not-string-literal.rs +++ b/tests/ui/env-macro/option_env-not-string-literal.rs @@ -1 +1 @@ -fn main() { option_env!(10); } //~ ERROR: argument must be a string literal +fn main() { option_env!(10); } //~ ERROR argument must be a string literal diff --git a/tests/ui/env-macro/option_env-too-many-args.rs b/tests/ui/env-macro/option_env-too-many-args.rs index ecc8b61ac8589..3480439bdfa46 100644 --- a/tests/ui/env-macro/option_env-too-many-args.rs +++ b/tests/ui/env-macro/option_env-too-many-args.rs @@ -1 +1 @@ -fn main() { option_env!("one", "two"); } //~ ERROR: option_env! takes 1 argument +fn main() { option_env!("one", "two"); } //~ ERROR option_env! takes 1 argument diff --git a/tests/ui/ergonomic-clones/dotuse/parse.rs b/tests/ui/ergonomic-clones/dotuse/parse.rs index 37ef5c37029cf..9b15c28f690d6 100644 --- a/tests/ui/ergonomic-clones/dotuse/parse.rs +++ b/tests/ui/ergonomic-clones/dotuse/parse.rs @@ -3,37 +3,37 @@ fn parse1() { 1.use!; - //~^ ERROR: expected one of `.`, `;`, `?`, `}`, or an operator, found `!` + //~^ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `!` } fn parse2() { 1.use!(2); - //~^ ERROR: expected one of `.`, `;`, `?`, `}`, or an operator, found `!` + //~^ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `!` } fn parse3() { 1.use 2; - //~^ ERROR: expected one of `.`, `;`, `?`, `}`, or an operator, found `2` + //~^ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `2` } fn parse4() { 1.use? 2; - //~^ ERROR: expected one of `.`, `;`, `?`, `}`, or an operator, found `2` + //~^ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `2` } fn parse5() { 1.use(); - //~^ ERROR: incorrect use of `use` + //~^ ERROR incorrect use of `use` } fn parse6() { 1.use(2); - //~^ ERROR: expected function, found `{integer}` [E0618] + //~^ ERROR expected function, found `{integer}` [E0618] } fn parse7() { 1.use { 2 }; - //~^ ERROR: expected one of `.`, `;`, `?`, `}`, or an operator, found `{` + //~^ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{` } fn main() {} diff --git a/tests/ui/error-codes/E0084.rs b/tests/ui/error-codes/E0084.rs index a550e04129a33..20236c98c1440 100644 --- a/tests/ui/error-codes/E0084.rs +++ b/tests/ui/error-codes/E0084.rs @@ -1,4 +1,4 @@ -#[repr(i32)] //~ ERROR: E0084 +#[repr(i32)] //~ ERROR E0084 enum Foo {} fn main() { diff --git a/tests/ui/error-codes/E0152-duplicate-lang-items.rs b/tests/ui/error-codes/E0152-duplicate-lang-items.rs index 089810b1ad249..1dd36b82920ca 100644 --- a/tests/ui/error-codes/E0152-duplicate-lang-items.rs +++ b/tests/ui/error-codes/E0152-duplicate-lang-items.rs @@ -13,7 +13,7 @@ use core::panic::PanicInfo; #[lang = "panic_impl"] fn panic_impl(info: &PanicInfo) -> ! { - //~^ ERROR: found duplicate lang item `panic_impl` + //~^ ERROR found duplicate lang item `panic_impl` loop {} } diff --git a/tests/ui/error-codes/E0517.rs b/tests/ui/error-codes/E0517.rs index 1dcaa2d741f6f..c053795027cb3 100644 --- a/tests/ui/error-codes/E0517.rs +++ b/tests/ui/error-codes/E0517.rs @@ -1,13 +1,13 @@ -#[repr(C)] //~ ERROR: E0517 +#[repr(C)] //~ ERROR E0517 type Foo = u8; -#[repr(packed)] //~ ERROR: E0517 +#[repr(packed)] //~ ERROR E0517 enum Foo2 {Bar, Baz} -#[repr(u8)] //~ ERROR: E0517 +#[repr(u8)] //~ ERROR E0517 struct Foo3 {bar: bool, baz: bool} -#[repr(C)] //~ ERROR: E0517 +#[repr(C)] //~ ERROR E0517 impl Foo3 { } diff --git a/tests/ui/error-codes/E0518.rs b/tests/ui/error-codes/E0518.rs index 9c99702ada81f..846d521e2d964 100644 --- a/tests/ui/error-codes/E0518.rs +++ b/tests/ui/error-codes/E0518.rs @@ -1,7 +1,7 @@ -#[inline(always)] //~ ERROR: E0518 +#[inline(always)] //~ ERROR E0518 struct Foo; -#[inline(never)] //~ ERROR: E0518 +#[inline(never)] //~ ERROR E0518 impl Foo { } diff --git a/tests/ui/error-codes/E0637.rs b/tests/ui/error-codes/E0637.rs index 382ce3ed01f34..d3cc05ef09f45 100644 --- a/tests/ui/error-codes/E0637.rs +++ b/tests/ui/error-codes/E0637.rs @@ -1,6 +1,6 @@ fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str { - //~^ ERROR: `'_` cannot be used here [E0637] - //~| ERROR: missing lifetime specifier + //~^ ERROR `'_` cannot be used here [E0637] + //~| ERROR missing lifetime specifier if str1.len() > str2.len() { str1 } else { @@ -10,7 +10,7 @@ fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str { fn and_without_explicit_lifetime() where - T: Into<&u32>, //~ ERROR: `&` without an explicit lifetime name cannot be used here [E0637] + T: Into<&u32>, //~ ERROR `&` without an explicit lifetime name cannot be used here [E0637] { } diff --git a/tests/ui/explicit-tail-calls/become-operator.fixed b/tests/ui/explicit-tail-calls/become-operator.fixed index 24baef42d69a3..b90c7fb4f5a71 100644 --- a/tests/ui/explicit-tail-calls/become-operator.fixed +++ b/tests/ui/explicit-tail-calls/become-operator.fixed @@ -8,34 +8,34 @@ use std::ops::{Not, Add, BitXorAssign}; // built-ins and overloaded operators are handled differently fn f(a: u64, b: u64) -> u64 { - return a + b; //~ error: `become` does not support operators + return a + b; //~ error `become` does not support operators } fn g(a: String, b: &str) -> String { - become (a).add(b); //~ error: `become` does not support operators + become (a).add(b); //~ error `become` does not support operators } fn h(x: u64) -> u64 { - return !x; //~ error: `become` does not support operators + return !x; //~ error `become` does not support operators } fn i_do_not_know_any_more_letters(x: Wrapping) -> Wrapping { - become (x).not(); //~ error: `become` does not support operators + become (x).not(); //~ error `become` does not support operators } fn builtin_index(x: &[u8], i: usize) -> u8 { - return x[i] //~ error: `become` does not support operators + return x[i] //~ error `become` does not support operators } // FIXME(explicit_tail_calls): overloaded index is represented like `[&]*x.index(i)`, // and so need additional handling fn a(a: &mut u8, _: u8) { - return *a ^= 1; //~ error: `become` does not support operators + return *a ^= 1; //~ error `become` does not support operators } fn b(b: &mut Wrapping, _: u8) { - become (*b).bitxor_assign(1); //~ error: `become` does not support operators + become (*b).bitxor_assign(1); //~ error `become` does not support operators } diff --git a/tests/ui/explicit-tail-calls/become-operator.rs b/tests/ui/explicit-tail-calls/become-operator.rs index e547e979b6485..52e0683e403c2 100644 --- a/tests/ui/explicit-tail-calls/become-operator.rs +++ b/tests/ui/explicit-tail-calls/become-operator.rs @@ -8,34 +8,34 @@ use std::ops::{Not, Add, BitXorAssign}; // built-ins and overloaded operators are handled differently fn f(a: u64, b: u64) -> u64 { - become a + b; //~ error: `become` does not support operators + become a + b; //~ error `become` does not support operators } fn g(a: String, b: &str) -> String { - become a + b; //~ error: `become` does not support operators + become a + b; //~ error `become` does not support operators } fn h(x: u64) -> u64 { - become !x; //~ error: `become` does not support operators + become !x; //~ error `become` does not support operators } fn i_do_not_know_any_more_letters(x: Wrapping) -> Wrapping { - become !x; //~ error: `become` does not support operators + become !x; //~ error `become` does not support operators } fn builtin_index(x: &[u8], i: usize) -> u8 { - become x[i] //~ error: `become` does not support operators + become x[i] //~ error `become` does not support operators } // FIXME(explicit_tail_calls): overloaded index is represented like `[&]*x.index(i)`, // and so need additional handling fn a(a: &mut u8, _: u8) { - become *a ^= 1; //~ error: `become` does not support operators + become *a ^= 1; //~ error `become` does not support operators } fn b(b: &mut Wrapping, _: u8) { - become *b ^= 1; //~ error: `become` does not support operators + become *b ^= 1; //~ error `become` does not support operators } diff --git a/tests/ui/explicit-tail-calls/become-outside.rs b/tests/ui/explicit-tail-calls/become-outside.rs index 29738bb9a299f..c5ed9f3731fec 100644 --- a/tests/ui/explicit-tail-calls/become-outside.rs +++ b/tests/ui/explicit-tail-calls/become-outside.rs @@ -4,11 +4,11 @@ #[cfg(constant)] const _: () = { - become f(); //[constant]~ error: become statement outside of function body + become f(); //[constant]~ error become statement outside of function body }; #[cfg(array)] -struct Bad([(); become f()]); //[array]~ error: become statement outside of function body +struct Bad([(); become f()]); //[array]~ error become statement outside of function body fn f() {} diff --git a/tests/ui/explicit-tail-calls/become-uncallable.fixed b/tests/ui/explicit-tail-calls/become-uncallable.fixed index b77c46ea43549..ea008366d3443 100644 --- a/tests/ui/explicit-tail-calls/become-uncallable.fixed +++ b/tests/ui/explicit-tail-calls/become-uncallable.fixed @@ -4,15 +4,15 @@ #![allow(unused)] fn f() -> u64 { - return 1; //~ error: `become` requires a function call + return 1; //~ error `become` requires a function call } fn g() { - return { h() }; //~ error: `become` requires a function call + return { h() }; //~ error `become` requires a function call } fn h() { - return *&g(); //~ error: `become` requires a function call + return *&g(); //~ error `become` requires a function call } fn main() {} diff --git a/tests/ui/explicit-tail-calls/become-uncallable.rs b/tests/ui/explicit-tail-calls/become-uncallable.rs index a73b9258aaabb..1aa2d15a25c95 100644 --- a/tests/ui/explicit-tail-calls/become-uncallable.rs +++ b/tests/ui/explicit-tail-calls/become-uncallable.rs @@ -4,15 +4,15 @@ #![allow(unused)] fn f() -> u64 { - become 1; //~ error: `become` requires a function call + become 1; //~ error `become` requires a function call } fn g() { - become { h() }; //~ error: `become` requires a function call + become { h() }; //~ error `become` requires a function call } fn h() { - become *&g(); //~ error: `become` requires a function call + become *&g(); //~ error `become` requires a function call } fn main() {} diff --git a/tests/ui/explicit-tail-calls/caller_is_track_caller.rs b/tests/ui/explicit-tail-calls/caller_is_track_caller.rs index 4e5f3f12f8399..b9ad1228083cd 100644 --- a/tests/ui/explicit-tail-calls/caller_is_track_caller.rs +++ b/tests/ui/explicit-tail-calls/caller_is_track_caller.rs @@ -3,14 +3,14 @@ #[track_caller] fn a() { - become b(); //~ error: a function marked with `#[track_caller]` cannot perform a tail-call + become b(); //~ error a function marked with `#[track_caller]` cannot perform a tail-call } fn b() {} #[track_caller] fn c() { - become a(); //~ error: a function marked with `#[track_caller]` cannot perform a tail-call + become a(); //~ error a function marked with `#[track_caller]` cannot perform a tail-call } fn main() {} diff --git a/tests/ui/explicit-tail-calls/closure.fixed b/tests/ui/explicit-tail-calls/closure.fixed index 4af71c5d4cc95..eacf7f34b38fd 100644 --- a/tests/ui/explicit-tail-calls/closure.fixed +++ b/tests/ui/explicit-tail-calls/closure.fixed @@ -4,23 +4,23 @@ fn a() { become ((|| ()) as fn() -> _)(); - //~^ ERROR: tail calling closures directly is not allowed + //~^ ERROR tail calling closures directly is not allowed } fn aa((): ()) { become ((|()| ()) as fn(_) -> _)(()); - //~^ ERROR: tail calling closures directly is not allowed + //~^ ERROR tail calling closures directly is not allowed } fn aaa((): (), _: i32) { become ((|(), _| ()) as fn(_, _) -> _)((), 1); - //~^ ERROR: tail calling closures directly is not allowed + //~^ ERROR tail calling closures directly is not allowed } fn v((): (), ((), ()): ((), ())) -> (((), ()), ()) { let f = |(), ((), ())| (((), ()), ()); become (f as fn(_, _) -> _)((), ((), ())); - //~^ ERROR: tail calling closures directly is not allowed + //~^ ERROR tail calling closures directly is not allowed } fn main() { diff --git a/tests/ui/explicit-tail-calls/closure.rs b/tests/ui/explicit-tail-calls/closure.rs index 79a1b5296b0ae..024f2af985f9a 100644 --- a/tests/ui/explicit-tail-calls/closure.rs +++ b/tests/ui/explicit-tail-calls/closure.rs @@ -4,23 +4,23 @@ fn a() { become (|| ())(); - //~^ ERROR: tail calling closures directly is not allowed + //~^ ERROR tail calling closures directly is not allowed } fn aa((): ()) { become (|()| ())(()); - //~^ ERROR: tail calling closures directly is not allowed + //~^ ERROR tail calling closures directly is not allowed } fn aaa((): (), _: i32) { become (|(), _| ())((), 1); - //~^ ERROR: tail calling closures directly is not allowed + //~^ ERROR tail calling closures directly is not allowed } fn v((): (), ((), ()): ((), ())) -> (((), ()), ()) { let f = |(), ((), ())| (((), ()), ()); become f((), ((), ())); - //~^ ERROR: tail calling closures directly is not allowed + //~^ ERROR tail calling closures directly is not allowed } fn main() { diff --git a/tests/ui/explicit-tail-calls/constck.rs b/tests/ui/explicit-tail-calls/constck.rs index 4179fe8caf362..cfa28778f4bbf 100644 --- a/tests/ui/explicit-tail-calls/constck.rs +++ b/tests/ui/explicit-tail-calls/constck.rs @@ -4,14 +4,14 @@ const fn f() { if false { become not_const(); - //~^ error: cannot call non-const function `not_const` in constant functions + //~^ error cannot call non-const function `not_const` in constant functions } } const fn g((): ()) { if false { become yes_const(not_const()); - //~^ error: cannot call non-const function `not_const` in constant functions + //~^ error cannot call non-const function `not_const` in constant functions } } diff --git a/tests/ui/explicit-tail-calls/ctfe-arg-bad-borrow.rs b/tests/ui/explicit-tail-calls/ctfe-arg-bad-borrow.rs index 0a61c90bd00a7..988618ffaba40 100644 --- a/tests/ui/explicit-tail-calls/ctfe-arg-bad-borrow.rs +++ b/tests/ui/explicit-tail-calls/ctfe-arg-bad-borrow.rs @@ -6,7 +6,7 @@ pub const fn test(_: &Type) { let local = Type; become takes_borrow(&local); - //~^ error: `local` does not live long enough + //~^ error `local` does not live long enough } struct Type; diff --git a/tests/ui/explicit-tail-calls/ctfe-id-unlimited.rs b/tests/ui/explicit-tail-calls/ctfe-id-unlimited.rs index 9e89f4066bb70..08d6f701d9fd6 100644 --- a/tests/ui/explicit-tail-calls/ctfe-id-unlimited.rs +++ b/tests/ui/explicit-tail-calls/ctfe-id-unlimited.rs @@ -25,7 +25,7 @@ const fn rec_id(n: u32) -> u32 { const ORIGINAL: u32 = 12345; // Original number, but with identity function applied // (this is the same, but requires execution of the recursion) -const ID_ED: u32 = rec_id(ORIGINAL); //[return]~ error: evaluation of constant value failed +const ID_ED: u32 = rec_id(ORIGINAL); //[return]~ error evaluation of constant value failed // Assert to make absolutely sure the computation actually happens const ASSERT: () = assert!(ORIGINAL == ID_ED); diff --git a/tests/ui/explicit-tail-calls/in-closure.rs b/tests/ui/explicit-tail-calls/in-closure.rs index b23ff5a1e05b4..41773278d517e 100644 --- a/tests/ui/explicit-tail-calls/in-closure.rs +++ b/tests/ui/explicit-tail-calls/in-closure.rs @@ -2,7 +2,7 @@ #![feature(explicit_tail_calls)] fn main() { - || become f(); //~ error: `become` is not allowed in closures + || become f(); //~ error `become` is not allowed in closures } fn f() {} diff --git a/tests/ui/explicit-tail-calls/return-mismatches.rs b/tests/ui/explicit-tail-calls/return-mismatches.rs index e48766b89b00c..3a65fd0eb519b 100644 --- a/tests/ui/explicit-tail-calls/return-mismatches.rs +++ b/tests/ui/explicit-tail-calls/return-mismatches.rs @@ -2,7 +2,7 @@ #![feature(explicit_tail_calls)] fn _f0<'a>() -> &'static [u8] { - become _g0(); //~ error: mismatched types + become _g0(); //~ error mismatched types } fn _g0() -> &'static [u8; 1] { @@ -10,7 +10,7 @@ fn _g0() -> &'static [u8; 1] { } fn _f1() { - become _g1(); //~ error: mismatched types + become _g1(); //~ error mismatched types } fn _g1() -> ! { @@ -18,7 +18,7 @@ fn _g1() -> ! { } fn _f2() -> u32 { - become _g2(); //~ error: mismatched types + become _g2(); //~ error mismatched types } fn _g2() -> u16 { diff --git a/tests/ui/explicit-tail-calls/signature-mismatch.rs b/tests/ui/explicit-tail-calls/signature-mismatch.rs index a32ac9d8bfee3..59471c44f46c8 100644 --- a/tests/ui/explicit-tail-calls/signature-mismatch.rs +++ b/tests/ui/explicit-tail-calls/signature-mismatch.rs @@ -3,28 +3,28 @@ #![feature(c_variadic)] fn _f0((): ()) { - become _g0(); //~ error: mismatched signatures + become _g0(); //~ error mismatched signatures } fn _g0() {} fn _f1() { - become _g1(()); //~ error: mismatched signatures + become _g1(()); //~ error mismatched signatures } fn _g1((): ()) {} extern "C" fn _f2() { - become _g2(); //~ error: mismatched function ABIs + become _g2(); //~ error mismatched function ABIs } fn _g2() {} fn _f3() { - become _g3(); //~ error: mismatched function ABIs + become _g3(); //~ error mismatched function ABIs } extern "C" fn _g3() {} diff --git a/tests/ui/explicit-tail-calls/unsafeck.rs b/tests/ui/explicit-tail-calls/unsafeck.rs index f8a8140cedc33..6d1a9df05ecff 100644 --- a/tests/ui/explicit-tail-calls/unsafeck.rs +++ b/tests/ui/explicit-tail-calls/unsafeck.rs @@ -3,7 +3,7 @@ const fn f() { become dangerous(); - //~^ error: call to unsafe function `dangerous` is unsafe and requires unsafe function or block + //~^ error call to unsafe function `dangerous` is unsafe and requires unsafe function or block } const unsafe fn dangerous() {} diff --git a/tests/ui/expr/if/if-let-arm-types.rs b/tests/ui/expr/if/if-let-arm-types.rs index 1e8260a017da2..4e980c72b6025 100644 --- a/tests/ui/expr/if/if-let-arm-types.rs +++ b/tests/ui/expr/if/if-let-arm-types.rs @@ -6,6 +6,6 @@ fn main() { } else { 1 }; - //~^^ ERROR: `if` and `else` have incompatible types + //~^^ ERROR `if` and `else` have incompatible types //~| NOTE expected `()`, found integer } diff --git a/tests/ui/expr/if/if-no-match-bindings.rs b/tests/ui/expr/if/if-no-match-bindings.rs index d36a436397b46..d9d67f338540c 100644 --- a/tests/ui/expr/if/if-no-match-bindings.rs +++ b/tests/ui/expr/if/if-no-match-bindings.rs @@ -6,7 +6,7 @@ fn b_ref<'a>() -> &'a bool { &true } fn b_mut_ref<'a>() -> &'a mut bool { &mut true } -//~^ ERROR: cannot return reference to temporary +//~^ ERROR cannot return reference to temporary fn main() { // This is OK: diff --git a/tests/ui/expr/malformed_closure/missing_braces_around_block.fixed b/tests/ui/expr/malformed_closure/missing_braces_around_block.fixed index fcc55f28f012a..d61c611d9e793 100644 --- a/tests/ui/expr/malformed_closure/missing_braces_around_block.fixed +++ b/tests/ui/expr/malformed_closure/missing_braces_around_block.fixed @@ -14,7 +14,7 @@ fn main() { // Closure with multiple expressions delimited by semicolon. let num = 5; (1..num).reduce(|a, b| { - //~^ ERROR: closure bodies that contain statements must be surrounded by braces + //~^ ERROR closure bodies that contain statements must be surrounded by braces println!("{}", a); a * b }).unwrap(); @@ -22,5 +22,5 @@ fn main() { // Closure with a single expression ended by a semicolon. let mut v = vec![1, 2, 3]; v.iter_mut().for_each(|x| {*x = *x+1;}); - //~^ ERROR: closure bodies that contain statements must be surrounded by braces + //~^ ERROR closure bodies that contain statements must be surrounded by braces } diff --git a/tests/ui/expr/malformed_closure/missing_braces_around_block.rs b/tests/ui/expr/malformed_closure/missing_braces_around_block.rs index 97639d01f7462..f50a53f9bdf9e 100644 --- a/tests/ui/expr/malformed_closure/missing_braces_around_block.rs +++ b/tests/ui/expr/malformed_closure/missing_braces_around_block.rs @@ -14,7 +14,7 @@ fn main() { // Closure with multiple expressions delimited by semicolon. let num = 5; (1..num).reduce(|a, b| - //~^ ERROR: closure bodies that contain statements must be surrounded by braces + //~^ ERROR closure bodies that contain statements must be surrounded by braces println!("{}", a); a * b ).unwrap(); @@ -22,5 +22,5 @@ fn main() { // Closure with a single expression ended by a semicolon. let mut v = vec![1, 2, 3]; v.iter_mut().for_each(|x|*x = *x+1;); - //~^ ERROR: closure bodies that contain statements must be surrounded by braces + //~^ ERROR closure bodies that contain statements must be surrounded by braces } diff --git a/tests/ui/expr/malformed_closure/ruby_style_closure.rs b/tests/ui/expr/malformed_closure/ruby_style_closure.rs index fdec072b8a864..2c62fff58a030 100644 --- a/tests/ui/expr/malformed_closure/ruby_style_closure.rs +++ b/tests/ui/expr/malformed_closure/ruby_style_closure.rs @@ -10,6 +10,6 @@ fn main() { let p = Some(45).and_then({ |x| println!("doubling {}", x); Some(x * 2) - //~^ ERROR: cannot find value `x` in this scope + //~^ ERROR cannot find value `x` in this scope }); } diff --git a/tests/ui/extern/extern-main-fn.rs b/tests/ui/extern/extern-main-fn.rs index bb1468a70fb1e..e89a5a601c7e0 100644 --- a/tests/ui/extern/extern-main-fn.rs +++ b/tests/ui/extern/extern-main-fn.rs @@ -1 +1 @@ -extern "C" fn main() {} //~ ERROR: `main` function has wrong type [E0580] +extern "C" fn main() {} //~ ERROR `main` function has wrong type [E0580] diff --git a/tests/ui/extern/fictional-abi.rs b/tests/ui/extern/fictional-abi.rs index 60b24f8856efc..3c19c2e3ee8c5 100644 --- a/tests/ui/extern/fictional-abi.rs +++ b/tests/ui/extern/fictional-abi.rs @@ -1,3 +1,3 @@ #![crate_type = "lib"] -pub extern "fictional" fn lol() {} //~ ERROR: invalid ABI +pub extern "fictional" fn lol() {} //~ ERROR invalid ABI diff --git a/tests/ui/extern/issue-116203.rs b/tests/ui/extern/issue-116203.rs index f821284164495..473531005ad54 100644 --- a/tests/ui/extern/issue-116203.rs +++ b/tests/ui/extern/issue-116203.rs @@ -1,8 +1,8 @@ extern "C" { thread_local! { static FOO: u32 = 0; - //~^ error: extern items cannot be `const` - //~| error: incorrect `static` inside `extern` block + //~^ error extern items cannot be `const` + //~| error incorrect `static` inside `extern` block } } @@ -14,8 +14,8 @@ macro_rules! hello { extern "C" { hello! { yes } - //~^ error: extern items cannot be `const` - //~| error: incorrect `static` inside `extern` block + //~^ error extern items cannot be `const` + //~| error incorrect `static` inside `extern` block } fn main() {} diff --git a/tests/ui/extern/issue-36122-accessing-externed-dst.rs b/tests/ui/extern/issue-36122-accessing-externed-dst.rs index 9fb7780e3d769..68872bb4a1d76 100644 --- a/tests/ui/extern/issue-36122-accessing-externed-dst.rs +++ b/tests/ui/extern/issue-36122-accessing-externed-dst.rs @@ -1,7 +1,7 @@ fn main() { extern "C" { - static symbol: [usize]; //~ ERROR: the size for values of type + static symbol: [usize]; //~ ERROR the size for values of type } println!("{}", symbol[0]); - //~^ ERROR: extern static is unsafe + //~^ ERROR extern static is unsafe } diff --git a/tests/ui/extern/issue-80074.rs b/tests/ui/extern/issue-80074.rs index ba7b55a450f51..b3966efda664a 100644 --- a/tests/ui/extern/issue-80074.rs +++ b/tests/ui/extern/issue-80074.rs @@ -7,14 +7,14 @@ extern crate issue_80074; #[macro_use(m)] extern crate issue_80074_2; -//~^^ ERROR: imported macro not found +//~^^ ERROR imported macro not found fn main() { foo!(); - //~^ WARN: macro `foo` is private - //~| WARN: it will become a hard error in a future release! + //~^ WARN macro `foo` is private + //~| WARN it will become a hard error in a future release! bar!(); - //~^ ERROR: cannot find macro `bar` in this scope + //~^ ERROR cannot find macro `bar` in this scope m!(); - //~^ ERROR: cannot find macro `m` in this scope + //~^ ERROR cannot find macro `m` in this scope } diff --git a/tests/ui/extern/issue-95829.rs b/tests/ui/extern/issue-95829.rs index 493d53d2532f2..51515bccc0662 100644 --- a/tests/ui/extern/issue-95829.rs +++ b/tests/ui/extern/issue-95829.rs @@ -1,8 +1,8 @@ //@ edition:2018 extern "C" { - async fn L() { //~ ERROR: incorrect function inside `extern` block - //~^ ERROR: functions in `extern` blocks cannot have `async` qualifier + async fn L() { //~ ERROR incorrect function inside `extern` block + //~^ ERROR functions in `extern` blocks cannot have `async` qualifier async fn M() {} } } diff --git a/tests/ui/feature-gates/feature-gate-abi_unadjusted.rs b/tests/ui/feature-gates/feature-gate-abi_unadjusted.rs index 1dc6adc0e1495..7c1a43b0a3451 100644 --- a/tests/ui/feature-gates/feature-gate-abi_unadjusted.rs +++ b/tests/ui/feature-gates/feature-gate-abi_unadjusted.rs @@ -1,5 +1,5 @@ extern "unadjusted" fn foo() { -//~^ ERROR: "unadjusted" ABI is an implementation detail and perma-unstable +//~^ ERROR "unadjusted" ABI is an implementation detail and perma-unstable } fn main() { diff --git a/tests/ui/feature-gates/feature-gate-allocator_internals.rs b/tests/ui/feature-gates/feature-gate-allocator_internals.rs index a17d17da60713..864e072e5af00 100644 --- a/tests/ui/feature-gates/feature-gate-allocator_internals.rs +++ b/tests/ui/feature-gates/feature-gate-allocator_internals.rs @@ -1,3 +1,3 @@ -#![default_lib_allocator] //~ ERROR: attribute is an experimental feature +#![default_lib_allocator] //~ ERROR attribute is an experimental feature fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-cfg-version.rs b/tests/ui/feature-gates/feature-gate-cfg-version.rs index e35784a68d101..b9f2ba3b072be 100644 --- a/tests/ui/feature-gates/feature-gate-cfg-version.rs +++ b/tests/ui/feature-gates/feature-gate-cfg-version.rs @@ -1,7 +1,7 @@ -#[cfg(version(42))] //~ ERROR: expected a version literal +#[cfg(version(42))] //~ ERROR expected a version literal //~^ ERROR `cfg(version)` is experimental and subject to change fn foo() {} -#[cfg(version(1.20))] //~ ERROR: expected a version literal +#[cfg(version(1.20))] //~ ERROR expected a version literal //~^ ERROR `cfg(version)` is experimental and subject to change fn foo() -> bool { true } #[cfg(version("1.44"))] @@ -11,34 +11,34 @@ fn foo() -> bool { true } //~^ ERROR `cfg(version)` is experimental and subject to change fn foo() -> bool { false } -#[cfg(version("1.43", "1.44", "1.45"))] //~ ERROR: expected single version literal +#[cfg(version("1.43", "1.44", "1.45"))] //~ ERROR expected single version literal //~^ ERROR `cfg(version)` is experimental and subject to change fn bar() -> bool { false } -#[cfg(version(false))] //~ ERROR: expected a version literal +#[cfg(version(false))] //~ ERROR expected a version literal //~^ ERROR `cfg(version)` is experimental and subject to change fn bar() -> bool { false } -#[cfg(version("foo"))] //~ WARNING: unknown version literal format +#[cfg(version("foo"))] //~ WARNING unknown version literal format //~^ ERROR `cfg(version)` is experimental and subject to change fn bar() -> bool { false } -#[cfg(version("999"))] //~ WARNING: unknown version literal format +#[cfg(version("999"))] //~ WARNING unknown version literal format //~^ ERROR `cfg(version)` is experimental and subject to change fn bar() -> bool { false } -#[cfg(version("-1"))] //~ WARNING: unknown version literal format +#[cfg(version("-1"))] //~ WARNING unknown version literal format //~^ ERROR `cfg(version)` is experimental and subject to change fn bar() -> bool { false } -#[cfg(version("65536"))] //~ WARNING: unknown version literal format +#[cfg(version("65536"))] //~ WARNING unknown version literal format //~^ ERROR `cfg(version)` is experimental and subject to change fn bar() -> bool { false } -#[cfg(version("0"))] //~ WARNING: unknown version literal format +#[cfg(version("0"))] //~ WARNING unknown version literal format //~^ ERROR `cfg(version)` is experimental and subject to change fn bar() -> bool { true } #[cfg(version("1.0"))] //~^ ERROR `cfg(version)` is experimental and subject to change fn bar() -> bool { true } -#[cfg(version("1.65536.2"))] //~ WARNING: unknown version literal format +#[cfg(version("1.65536.2"))] //~ WARNING unknown version literal format //~^ ERROR `cfg(version)` is experimental and subject to change fn bar() -> bool { false } -#[cfg(version("1.20.0-stable"))] //~ WARNING: unknown version literal format +#[cfg(version("1.20.0-stable"))] //~ WARNING unknown version literal format //~^ ERROR `cfg(version)` is experimental and subject to change fn bar() {} diff --git a/tests/ui/feature-gates/feature-gate-deprecated_safe.rs b/tests/ui/feature-gates/feature-gate-deprecated_safe.rs index d5f4a4705b972..b6b67a42fe20b 100644 --- a/tests/ui/feature-gates/feature-gate-deprecated_safe.rs +++ b/tests/ui/feature-gates/feature-gate-deprecated_safe.rs @@ -1,7 +1,7 @@ -#[deprecated_safe(since = "TBD", note = "...")] //~ ERROR: the `#[deprecated_safe]` attribute is an experimental feature +#[deprecated_safe(since = "TBD", note = "...")] //~ ERROR the `#[deprecated_safe]` attribute is an experimental feature unsafe fn deprecated_safe_fn() {} -#[deprecated_safe(since = "TBD", note = "...")] //~ ERROR: the `#[deprecated_safe]` attribute is an experimental feature +#[deprecated_safe(since = "TBD", note = "...")] //~ ERROR the `#[deprecated_safe]` attribute is an experimental feature unsafe trait DeprecatedSafeTrait {} fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-doc_cfg.rs b/tests/ui/feature-gates/feature-gate-doc_cfg.rs index b12b8a1057182..64f04697077ac 100644 --- a/tests/ui/feature-gates/feature-gate-doc_cfg.rs +++ b/tests/ui/feature-gates/feature-gate-doc_cfg.rs @@ -1,2 +1,2 @@ -#[doc(cfg(unix))] //~ ERROR: `#[doc(cfg)]` is experimental +#[doc(cfg(unix))] //~ ERROR `#[doc(cfg)]` is experimental fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-doc_masked.rs b/tests/ui/feature-gates/feature-gate-doc_masked.rs index bde3af6b594c2..cdca8aa33c134 100644 --- a/tests/ui/feature-gates/feature-gate-doc_masked.rs +++ b/tests/ui/feature-gates/feature-gate-doc_masked.rs @@ -1,4 +1,4 @@ -#[doc(masked)] //~ ERROR: `#[doc(masked)]` is experimental +#[doc(masked)] //~ ERROR `#[doc(masked)]` is experimental extern crate std as realstd; fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-doc_notable_trait.rs b/tests/ui/feature-gates/feature-gate-doc_notable_trait.rs index 7f3392eadadb3..728a7b0b707d0 100644 --- a/tests/ui/feature-gates/feature-gate-doc_notable_trait.rs +++ b/tests/ui/feature-gates/feature-gate-doc_notable_trait.rs @@ -1,4 +1,4 @@ -#[doc(notable_trait)] //~ ERROR: `#[doc(notable_trait)]` is experimental +#[doc(notable_trait)] //~ ERROR `#[doc(notable_trait)]` is experimental trait SomeTrait {} fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-explicit_tail_calls.rs b/tests/ui/feature-gates/feature-gate-explicit_tail_calls.rs index 856a7f393289a..ae02d62b2ceab 100644 --- a/tests/ui/feature-gates/feature-gate-explicit_tail_calls.rs +++ b/tests/ui/feature-gates/feature-gate-explicit_tail_calls.rs @@ -1,9 +1,9 @@ pub fn you() -> T { - become bottom(); //~ error: `become` expression is experimental + become bottom(); //~ error `become` expression is experimental } pub fn bottom() -> T { - become you(); //~ error: `become` expression is experimental + become you(); //~ error `become` expression is experimental } fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-gen_blocks.rs b/tests/ui/feature-gates/feature-gate-gen_blocks.rs index 01fd922b0e999..d620408a30a13 100644 --- a/tests/ui/feature-gates/feature-gate-gen_blocks.rs +++ b/tests/ui/feature-gates/feature-gate-gen_blocks.rs @@ -3,16 +3,16 @@ fn test_gen() { gen {}; - //[none]~^ ERROR: cannot find struct, variant or union type `gen` - //[e2024]~^^ ERROR: gen blocks are experimental - //[e2024]~| ERROR: type annotations needed + //[none]~^ ERROR cannot find struct, variant or union type `gen` + //[e2024]~^^ ERROR gen blocks are experimental + //[e2024]~| ERROR type annotations needed } fn test_async_gen() { async gen {}; //[none]~^ ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `gen` - //[e2024]~^^ ERROR: gen blocks are experimental - //[e2024]~| ERROR: type annotations needed + //[e2024]~^^ ERROR gen blocks are experimental + //[e2024]~| ERROR type annotations needed } fn main() {} @@ -20,9 +20,9 @@ fn main() {} #[cfg(FALSE)] fn foo() { gen {}; - //[e2024]~^ ERROR: gen blocks are experimental + //[e2024]~^ ERROR gen blocks are experimental async gen {}; - //[e2024]~^ ERROR: gen blocks are experimental + //[e2024]~^ ERROR gen blocks are experimental //[none]~^^ ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `gen` } diff --git a/tests/ui/feature-gates/feature-gate-generic-const-parameter-types.rs b/tests/ui/feature-gates/feature-gate-generic-const-parameter-types.rs index cc374ea3eb2e5..e0127de7c7707 100644 --- a/tests/ui/feature-gates/feature-gate-generic-const-parameter-types.rs +++ b/tests/ui/feature-gates/feature-gate-generic-const-parameter-types.rs @@ -5,7 +5,7 @@ #![cfg_attr(feature, expect(incomplete_features))] struct MyADT; -//[normal]~^ ERROR: the type of const parameters must not depend on other generic parameters -//[normal]~| ERROR: `[u8; LEN]` is forbidden as the type of a const generic parameter +//[normal]~^ ERROR the type of const parameters must not depend on other generic parameters +//[normal]~| ERROR `[u8; LEN]` is forbidden as the type of a const generic parameter fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-generic_arg_infer.rs b/tests/ui/feature-gates/feature-gate-generic_arg_infer.rs index 147978b0557a6..4b0b8b7603179 100644 --- a/tests/ui/feature-gates/feature-gate-generic_arg_infer.rs +++ b/tests/ui/feature-gates/feature-gate-generic_arg_infer.rs @@ -9,13 +9,13 @@ fn foo(_: [u8; N]) -> [u8; N] { fn bar() { let _x: [u8; 3] = [0; _]; - //[normal]~^ ERROR: using `_` for array lengths is unstable + //[normal]~^ ERROR using `_` for array lengths is unstable let _y: [u8; _] = [0; 3]; - //[normal]~^ ERROR: using `_` for array lengths is unstable + //[normal]~^ ERROR using `_` for array lengths is unstable } fn main() { let _x = foo::<_>([1, 2]); - //[normal]~^ ERROR: const arguments cannot yet be inferred with `_` + //[normal]~^ ERROR const arguments cannot yet be inferred with `_` bar(); } diff --git a/tests/ui/feature-gates/feature-gate-guard-patterns.rs b/tests/ui/feature-gates/feature-gate-guard-patterns.rs index 52ed89e668b1f..18eafaf246dec 100644 --- a/tests/ui/feature-gates/feature-gate-guard-patterns.rs +++ b/tests/ui/feature-gates/feature-gate-guard-patterns.rs @@ -16,28 +16,28 @@ fn other_guards_dont() { match 0 { (0 if guard(0)) | 1 => {}, - //~^ ERROR: guard patterns are experimental + //~^ ERROR guard patterns are experimental _ => {}, } let ((x if guard(x)) | x) = 0; - //~^ ERROR: guard patterns are experimental - //~| ERROR: cannot find value `x` + //~^ ERROR guard patterns are experimental + //~| ERROR cannot find value `x` if let (x if guard(x)) = 0 {} - //~^ ERROR: guard patterns are experimental + //~^ ERROR guard patterns are experimental while let (x if guard(x)) = 0 {} - //~^ ERROR: guard patterns are experimental + //~^ ERROR guard patterns are experimental #[cfg(FALSE)] while let (x if guard(x)) = 0 {} - //~^ ERROR: guard patterns are experimental + //~^ ERROR guard patterns are experimental } fn even_as_function_parameters(((x if guard(x), _) | (_, x)): (i32, i32)) {} -//~^ ERROR: guard patterns are experimental -//~| ERROR: cannot find value `x` +//~^ ERROR guard patterns are experimental +//~| ERROR cannot find value `x` fn guard(x: T) -> bool { unimplemented!() diff --git a/tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.rs b/tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.rs index f9b5176d78ac7..8b140873364b3 100644 --- a/tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.rs +++ b/tests/ui/feature-gates/feature-gate-impl_trait_in_assoc_type.rs @@ -4,24 +4,24 @@ trait Foo { impl Foo for () { type Bar = impl std::fmt::Debug; - //~^ ERROR: `impl Trait` in associated types is unstable - //~| ERROR: unconstrained opaque type + //~^ ERROR `impl Trait` in associated types is unstable + //~| ERROR unconstrained opaque type } struct Mop; impl Mop { type Bop = impl std::fmt::Debug; - //~^ ERROR: `impl Trait` in associated types is unstable - //~| ERROR: inherent associated types are unstable - //~| ERROR: unconstrained opaque type + //~^ ERROR `impl Trait` in associated types is unstable + //~| ERROR inherent associated types are unstable + //~| ERROR unconstrained opaque type } fn funky(_: [(); { impl Foo for fn() { type Bar = impl Sized; - //~^ ERROR: `impl Trait` in associated types is unstable - //~| ERROR: unconstrained opaque type + //~^ ERROR `impl Trait` in associated types is unstable + //~| ERROR unconstrained opaque type } 0 }]) {} diff --git a/tests/ui/feature-gates/feature-gate-keylocker_x86.rs b/tests/ui/feature-gates/feature-gate-keylocker_x86.rs index cef80ad41a892..239812e4dcfe2 100644 --- a/tests/ui/feature-gates/feature-gate-keylocker_x86.rs +++ b/tests/ui/feature-gates/feature-gate-keylocker_x86.rs @@ -1,6 +1,6 @@ //@ only-x86_64 #[target_feature(enable = "kl")] -//~^ ERROR: currently unstable +//~^ ERROR currently unstable unsafe fn foo() {} fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-link_cfg.rs b/tests/ui/feature-gates/feature-gate-link_cfg.rs index d30ee3bcfdb14..ba103f1a7b7e6 100644 --- a/tests/ui/feature-gates/feature-gate-link_cfg.rs +++ b/tests/ui/feature-gates/feature-gate-link_cfg.rs @@ -1,5 +1,5 @@ #[link(name = "foo", cfg(foo))] -//~^ ERROR: is unstable +//~^ ERROR is unstable extern "C" {} fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-linkage.rs b/tests/ui/feature-gates/feature-gate-linkage.rs index 505f31ec6388d..8dc98fe4bb748 100644 --- a/tests/ui/feature-gates/feature-gate-linkage.rs +++ b/tests/ui/feature-gates/feature-gate-linkage.rs @@ -1,6 +1,6 @@ extern "C" { #[linkage = "extern_weak"] static foo: *mut isize; - //~^ ERROR: the `linkage` attribute is experimental and not portable + //~^ ERROR the `linkage` attribute is experimental and not portable } fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-movrs_target_feature.rs b/tests/ui/feature-gates/feature-gate-movrs_target_feature.rs index 738cab5a06d69..eca04305410da 100644 --- a/tests/ui/feature-gates/feature-gate-movrs_target_feature.rs +++ b/tests/ui/feature-gates/feature-gate-movrs_target_feature.rs @@ -1,6 +1,6 @@ //@ only-x86_64 #[target_feature(enable = "movrs")] -//~^ ERROR: currently unstable +//~^ ERROR currently unstable unsafe fn foo() {} fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-naked_functions.rs b/tests/ui/feature-gates/feature-gate-naked_functions.rs index abb55b9a557a9..e742450995a7f 100644 --- a/tests/ui/feature-gates/feature-gate-naked_functions.rs +++ b/tests/ui/feature-gates/feature-gate-naked_functions.rs @@ -8,7 +8,7 @@ use std::arch::naked_asm; extern "C" fn naked() { naked_asm!("") //~^ ERROR use of unstable library feature `naked_functions` - //~| ERROR: requires unsafe + //~| ERROR requires unsafe } #[naked] @@ -16,7 +16,7 @@ extern "C" fn naked() { extern "C" fn naked_2() -> isize { naked_asm!("") //~^ ERROR use of unstable library feature `naked_functions` - //~| ERROR: requires unsafe + //~| ERROR requires unsafe } fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-naked_functions_target_feature.rs b/tests/ui/feature-gates/feature-gate-naked_functions_target_feature.rs index 0d3af4c5fe0a4..32e056cccec09 100644 --- a/tests/ui/feature-gates/feature-gate-naked_functions_target_feature.rs +++ b/tests/ui/feature-gates/feature-gate-naked_functions_target_feature.rs @@ -7,7 +7,7 @@ use std::arch::naked_asm; #[naked] #[target_feature(enable = "avx2")] -//~^ ERROR: `#[target_feature(/* ... */)]` is currently unstable on `#[naked]` functions +//~^ ERROR `#[target_feature(/* ... */)]` is currently unstable on `#[naked]` functions extern "C" fn naked() { unsafe { naked_asm!("") } } diff --git a/tests/ui/feature-gates/feature-gate-native_link_modifiers_as_needed.rs b/tests/ui/feature-gates/feature-gate-native_link_modifiers_as_needed.rs index c5859eec8db51..620e46f53035c 100644 --- a/tests/ui/feature-gates/feature-gate-native_link_modifiers_as_needed.rs +++ b/tests/ui/feature-gates/feature-gate-native_link_modifiers_as_needed.rs @@ -3,7 +3,7 @@ #[cfg(in_attr)] #[link(name = "foo", kind = "dylib", modifiers = "+as-needed")] -//[in_attr]~^ ERROR: linking modifier `as-needed` is unstable +//[in_attr]~^ ERROR linking modifier `as-needed` is unstable extern "C" {} fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-patchable-function-entry.rs b/tests/ui/feature-gates/feature-gate-patchable-function-entry.rs index b9642c7bfd4a6..488a8f7a6b0e1 100644 --- a/tests/ui/feature-gates/feature-gate-patchable-function-entry.rs +++ b/tests/ui/feature-gates/feature-gate-patchable-function-entry.rs @@ -1,3 +1,3 @@ #[patchable_function_entry(prefix_nops = 1, entry_nops = 1)] -//~^ ERROR: the `#[patchable_function_entry]` attribute is an experimental feature +//~^ ERROR the `#[patchable_function_entry]` attribute is an experimental feature fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-pattern-complexity-limit.rs b/tests/ui/feature-gates/feature-gate-pattern-complexity-limit.rs index d1f6f4755f08a..873bb9b89edec 100644 --- a/tests/ui/feature-gates/feature-gate-pattern-complexity-limit.rs +++ b/tests/ui/feature-gates/feature-gate-pattern-complexity-limit.rs @@ -1,6 +1,6 @@ // check that `pattern_complexity_limit` is feature-gated #![pattern_complexity_limit = "42"] -//~^ ERROR: the `#[pattern_complexity_limit]` attribute is just used for rustc unit tests +//~^ ERROR the `#[pattern_complexity_limit]` attribute is just used for rustc unit tests fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-raw-dylib-elf.rs b/tests/ui/feature-gates/feature-gate-raw-dylib-elf.rs index ec49e53d9b447..dbe71a7eb95e7 100644 --- a/tests/ui/feature-gates/feature-gate-raw-dylib-elf.rs +++ b/tests/ui/feature-gates/feature-gate-raw-dylib-elf.rs @@ -1,7 +1,7 @@ //@ only-elf //@ needs-dynamic-linking -#[link(name = "meow", kind = "raw-dylib")] //~ ERROR: link kind `raw-dylib` is unstable on ELF platforms +#[link(name = "meow", kind = "raw-dylib")] //~ ERROR link kind `raw-dylib` is unstable on ELF platforms unsafe extern "C" { safe fn meowmeow(); } diff --git a/tests/ui/feature-gates/feature-gate-repr-simd.rs b/tests/ui/feature-gates/feature-gate-repr-simd.rs index 091dc479ef3d4..c972bb172f6ad 100644 --- a/tests/ui/feature-gates/feature-gate-repr-simd.rs +++ b/tests/ui/feature-gates/feature-gate-repr-simd.rs @@ -1,17 +1,17 @@ -#[repr(simd)] //~ ERROR: SIMD types are experimental +#[repr(simd)] //~ ERROR SIMD types are experimental struct Foo([u64; 2]); #[repr(C)] //~ ERROR conflicting representation hints //~^ WARN this was previously accepted -#[repr(simd)] //~ ERROR: SIMD types are experimental +#[repr(simd)] //~ ERROR SIMD types are experimental struct Bar([u64; 2]); -#[repr(simd)] //~ ERROR: SIMD types are experimental -//~^ ERROR: attribute should be applied to a struct +#[repr(simd)] //~ ERROR SIMD types are experimental +//~^ ERROR attribute should be applied to a struct union U {f: u32} -#[repr(simd)] //~ ERROR: SIMD types are experimental -//~^ error: attribute should be applied to a struct +#[repr(simd)] //~ ERROR SIMD types are experimental +//~^ error attribute should be applied to a struct enum E { X } fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-rustdoc_internals.rs b/tests/ui/feature-gates/feature-gate-rustdoc_internals.rs index 57d6b59128703..d190a0b81249c 100644 --- a/tests/ui/feature-gates/feature-gate-rustdoc_internals.rs +++ b/tests/ui/feature-gates/feature-gate-rustdoc_internals.rs @@ -1,13 +1,13 @@ -#[doc(keyword = "match")] //~ ERROR: `#[doc(keyword)]` is meant for internal use only +#[doc(keyword = "match")] //~ ERROR `#[doc(keyword)]` is meant for internal use only /// wonderful mod foo {} trait Mine {} -#[doc(fake_variadic)] //~ ERROR: `#[doc(fake_variadic)]` is meant for internal use only +#[doc(fake_variadic)] //~ ERROR `#[doc(fake_variadic)]` is meant for internal use only impl Mine for (T,) {} -#[doc(search_unbox)] //~ ERROR: `#[doc(search_unbox)]` is meant for internal use only +#[doc(search_unbox)] //~ ERROR `#[doc(search_unbox)]` is meant for internal use only struct Wrap (T); fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-sha512_sm_x86.rs b/tests/ui/feature-gates/feature-gate-sha512_sm_x86.rs index 176a40ecf5370..ef987597ad525 100644 --- a/tests/ui/feature-gates/feature-gate-sha512_sm_x86.rs +++ b/tests/ui/feature-gates/feature-gate-sha512_sm_x86.rs @@ -1,6 +1,6 @@ //@ only-x86_64 #[target_feature(enable = "sha512")] -//~^ ERROR: currently unstable +//~^ ERROR currently unstable unsafe fn foo() {} fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-shorter_tail_lifetimes.rs b/tests/ui/feature-gates/feature-gate-shorter_tail_lifetimes.rs index 5292c44bb2d40..96f7ed8599918 100644 --- a/tests/ui/feature-gates/feature-gate-shorter_tail_lifetimes.rs +++ b/tests/ui/feature-gates/feature-gate-shorter_tail_lifetimes.rs @@ -1,6 +1,6 @@ fn f() -> usize { let c = std::cell::RefCell::new(".."); - c.borrow().len() //~ ERROR: `c` does not live long enough + c.borrow().len() //~ ERROR `c` does not live long enough } fn main() { diff --git a/tests/ui/feature-gates/feature-gate-trace_macros.rs b/tests/ui/feature-gates/feature-gate-trace_macros.rs index 07159b7b54264..1ad7f30db5165 100644 --- a/tests/ui/feature-gates/feature-gate-trace_macros.rs +++ b/tests/ui/feature-gates/feature-gate-trace_macros.rs @@ -1,3 +1,3 @@ fn main() { - trace_macros!(true); //~ ERROR: `trace_macros` is not stable + trace_macros!(true); //~ ERROR `trace_macros` is not stable } diff --git a/tests/ui/feature-gates/feature-gate-unsized-const-params.rs b/tests/ui/feature-gates/feature-gate-unsized-const-params.rs index d088d382377cf..8152089074d7d 100644 --- a/tests/ui/feature-gates/feature-gate-unsized-const-params.rs +++ b/tests/ui/feature-gates/feature-gate-unsized-const-params.rs @@ -1,6 +1,6 @@ struct Foo; -//~^ ERROR: `[u8]` is forbidden as the type of a const generic parameter -//~| HELP: add `#![feature(adt_const_params)]` to the crate -//~| HELP: add `#![feature(unsized_const_params)]` to the crate +//~^ ERROR `[u8]` is forbidden as the type of a const generic parameter +//~| HELP add `#![feature(adt_const_params)]` to the crate +//~| HELP add `#![feature(unsized_const_params)]` to the crate fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-x86_amx_intrinsics.rs b/tests/ui/feature-gates/feature-gate-x86_amx_intrinsics.rs index ecbfc0bce5c56..5c79c172ce63a 100644 --- a/tests/ui/feature-gates/feature-gate-x86_amx_intrinsics.rs +++ b/tests/ui/feature-gates/feature-gate-x86_amx_intrinsics.rs @@ -1,6 +1,6 @@ //@ only-x86_64 #[target_feature(enable = "amx-tile")] -//~^ ERROR: currently unstable +//~^ ERROR currently unstable unsafe fn foo() {} fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-xop_target_feature.rs b/tests/ui/feature-gates/feature-gate-xop_target_feature.rs index 3032a6fbb4755..ffa543bb1f6c8 100644 --- a/tests/ui/feature-gates/feature-gate-xop_target_feature.rs +++ b/tests/ui/feature-gates/feature-gate-xop_target_feature.rs @@ -1,6 +1,6 @@ //@ only-x86_64 #[target_feature(enable = "xop")] -//~^ ERROR: currently unstable +//~^ ERROR currently unstable unsafe fn foo() {} fn main() {} diff --git a/tests/ui/feature-gates/feature-gated-feature-in-macro-arg.rs b/tests/ui/feature-gates/feature-gated-feature-in-macro-arg.rs index 2328798d74c32..be71f27f1474d 100644 --- a/tests/ui/feature-gates/feature-gated-feature-in-macro-arg.rs +++ b/tests/ui/feature-gates/feature-gated-feature-in-macro-arg.rs @@ -8,7 +8,7 @@ fn main() { extern "rust-intrinsic" { //~ ERROR "rust-intrinsic" ABI is an implementation detail fn atomic_fence(); } - atomic_fence(); //~ ERROR: is unsafe + atomic_fence(); //~ ERROR is unsafe 42 }); } diff --git a/tests/ui/feature-gates/gated-bad-feature.rs b/tests/ui/feature-gates/gated-bad-feature.rs index 51f2db5556e2b..0f61589e8e6c8 100644 --- a/tests/ui/feature-gates/gated-bad-feature.rs +++ b/tests/ui/feature-gates/gated-bad-feature.rs @@ -5,6 +5,6 @@ //~| ERROR unknown feature `foo_bar_baz` #![feature] //~ ERROR malformed `feature` attribute #![feature = "foo"] //~ ERROR malformed `feature` attribute -#![feature(test_removed_feature)] //~ ERROR: feature has been removed +#![feature(test_removed_feature)] //~ ERROR feature has been removed fn main() {} diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs index 02a56c7e6aa6c..55948f0c42d7f 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs @@ -1,6 +1,6 @@ -//~ NOTE: not an `extern crate` item -//~^ NOTE: not a free function, impl method or static -//~^^ NOTE: not a function or closure +//~ NOTE not an `extern crate` item +//~^ NOTE not a free function, impl method or static +//~^^ NOTE not a function or closure // This is testing whether various builtin attributes signals an // error or warning when put in "weird" places. // @@ -10,23 +10,23 @@ #![macro_export] -//~^ ERROR: `macro_export` attribute cannot be used at crate level -#![rustc_main] //~ ERROR: the `#[rustc_main]` attribute is used internally to specify -//~^ ERROR: `rustc_main` attribute cannot be used at crate level -//~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +//~^ ERROR `macro_export` attribute cannot be used at crate level +#![rustc_main] //~ ERROR the `#[rustc_main]` attribute is used internally to specify +//~^ ERROR `rustc_main` attribute cannot be used at crate level +//~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date #![repr()] -//~^ ERROR: `repr` attribute cannot be used at crate level +//~^ ERROR `repr` attribute cannot be used at crate level #![path = "3800"] -//~^ ERROR: `path` attribute cannot be used at crate level +//~^ ERROR `path` attribute cannot be used at crate level #![automatically_derived] -//~^ ERROR: `automatically_derived` attribute cannot be used at crate level +//~^ ERROR `automatically_derived` attribute cannot be used at crate level #![no_mangle] #![no_link] -//~^ ERROR: attribute should be applied to an `extern crate` item +//~^ ERROR attribute should be applied to an `extern crate` item #![export_name = "2200"] -//~^ ERROR: attribute should be applied to a free function, impl method or static +//~^ ERROR attribute should be applied to a free function, impl method or static #![inline] -//~^ ERROR: attribute should be applied to function or closure +//~^ ERROR attribute should be applied to function or closure #[inline] //~^ ERROR attribute should be applied to function or closure mod inline { @@ -121,49 +121,49 @@ mod export_name { } #[repr(C)] -//~^ ERROR: attribute should be applied to a struct, enum, or union +//~^ ERROR attribute should be applied to a struct, enum, or union mod repr { //~^ NOTE not a struct, enum, or union mod inner { #![repr(C)] } - //~^ ERROR: attribute should be applied to a struct, enum, or union + //~^ ERROR attribute should be applied to a struct, enum, or union //~| NOTE not a struct, enum, or union #[repr(C)] fn f() { } - //~^ ERROR: attribute should be applied to a struct, enum, or union + //~^ ERROR attribute should be applied to a struct, enum, or union //~| NOTE not a struct, enum, or union struct S; #[repr(C)] type T = S; - //~^ ERROR: attribute should be applied to a struct, enum, or union + //~^ ERROR attribute should be applied to a struct, enum, or union //~| NOTE not a struct, enum, or union #[repr(C)] impl S { } - //~^ ERROR: attribute should be applied to a struct, enum, or union + //~^ ERROR attribute should be applied to a struct, enum, or union //~| NOTE not a struct, enum, or union } #[repr(Rust)] -//~^ ERROR: attribute should be applied to a struct, enum, or union +//~^ ERROR attribute should be applied to a struct, enum, or union mod repr_rust { //~^ NOTE not a struct, enum, or union mod inner { #![repr(Rust)] } - //~^ ERROR: attribute should be applied to a struct, enum, or union + //~^ ERROR attribute should be applied to a struct, enum, or union //~| NOTE not a struct, enum, or union #[repr(Rust)] fn f() { } - //~^ ERROR: attribute should be applied to a struct, enum, or union + //~^ ERROR attribute should be applied to a struct, enum, or union //~| NOTE not a struct, enum, or union struct S; #[repr(Rust)] type T = S; - //~^ ERROR: attribute should be applied to a struct, enum, or union + //~^ ERROR attribute should be applied to a struct, enum, or union //~| NOTE not a struct, enum, or union #[repr(Rust)] impl S { } - //~^ ERROR: attribute should be applied to a struct, enum, or union + //~^ ERROR attribute should be applied to a struct, enum, or union //~| NOTE not a struct, enum, or union } diff --git a/tests/ui/feature-gates/soft-syntax-gates-with-errors.rs b/tests/ui/feature-gates/soft-syntax-gates-with-errors.rs index 2aa2ed34020cf..8aef375b83625 100644 --- a/tests/ui/feature-gates/soft-syntax-gates-with-errors.rs +++ b/tests/ui/feature-gates/soft-syntax-gates-with-errors.rs @@ -3,7 +3,7 @@ // If macro syntax is stabilized, replace with a different unstable syntax. macro a() {} -//~^ ERROR: `macro` is experimental +//~^ ERROR `macro` is experimental #[cfg(FALSE)] macro b() {} @@ -14,7 +14,7 @@ macro_rules! identity { identity! { macro c() {} - //~^ ERROR: `macro` is experimental + //~^ ERROR `macro` is experimental } #[cfg(FALSE)] diff --git a/tests/ui/feature-gates/soft-syntax-gates-without-errors.rs b/tests/ui/feature-gates/soft-syntax-gates-without-errors.rs index 056c8fb04f45d..a7d1038ea8d07 100644 --- a/tests/ui/feature-gates/soft-syntax-gates-without-errors.rs +++ b/tests/ui/feature-gates/soft-syntax-gates-without-errors.rs @@ -4,8 +4,8 @@ #[cfg(FALSE)] macro b() {} -//~^ WARN: `macro` is experimental -//~| WARN: unstable syntax +//~^ WARN `macro` is experimental +//~| WARN unstable syntax macro_rules! identity { ($($x:tt)*) => ($($x)*); @@ -19,8 +19,8 @@ identity! { identity! { #[cfg(FALSE)] macro e() {} - //~^ WARN: `macro` is experimental - //~| WARN: unstable syntax + //~^ WARN `macro` is experimental + //~| WARN unstable syntax } fn main() {} diff --git a/tests/ui/fmt/format-args-argument-span.rs b/tests/ui/fmt/format-args-argument-span.rs index c7acb08f84b6c..660567e82638f 100644 --- a/tests/ui/fmt/format-args-argument-span.rs +++ b/tests/ui/fmt/format-args-argument-span.rs @@ -11,12 +11,12 @@ impl std::fmt::Display for DisplayOnly { fn main() { let x = Some(1); println!("{x:?} {x} {x:?}"); - //~^ ERROR: `Option<{integer}>` doesn't implement `std::fmt::Display` + //~^ ERROR `Option<{integer}>` doesn't implement `std::fmt::Display` println!("{x:?} {x} {x:?}", x = Some(1)); - //~^ ERROR: `Option<{integer}>` doesn't implement `std::fmt::Display` + //~^ ERROR `Option<{integer}>` doesn't implement `std::fmt::Display` let x = DisplayOnly; println!("{x} {x:?} {x}"); - //~^ ERROR: `DisplayOnly` doesn't implement `Debug` + //~^ ERROR `DisplayOnly` doesn't implement `Debug` println!("{x} {x:?} {x}", x = DisplayOnly); - //~^ ERROR: `DisplayOnly` doesn't implement `Debug` + //~^ ERROR `DisplayOnly` doesn't implement `Debug` } diff --git a/tests/ui/fmt/format-args-capture-issue-93378.rs b/tests/ui/fmt/format-args-capture-issue-93378.rs index 9d722a0287a5c..dcbeb30b919af 100644 --- a/tests/ui/fmt/format-args-capture-issue-93378.rs +++ b/tests/ui/fmt/format-args-capture-issue-93378.rs @@ -3,9 +3,9 @@ fn main() { let b = "b"; println!("{a} {b} {} {} {c} {}", c = "c"); - //~^ ERROR: 3 positional arguments in format string, but there is 1 argument + //~^ ERROR 3 positional arguments in format string, but there is 1 argument let n = 1; println!("{a:.n$} {b:.*}"); - //~^ ERROR: 1 positional argument in format string, but no arguments were given + //~^ ERROR 1 positional argument in format string, but no arguments were given } diff --git a/tests/ui/fmt/format-args-capture-issue-94010.rs b/tests/ui/fmt/format-args-capture-issue-94010.rs index bd03e9c93ae2a..9a4851d4d1383 100644 --- a/tests/ui/fmt/format-args-capture-issue-94010.rs +++ b/tests/ui/fmt/format-args-capture-issue-94010.rs @@ -1,7 +1,7 @@ fn main() { const FOO: i32 = 123; println!("{foo:X}"); - //~^ ERROR: cannot find value `foo` in this scope + //~^ ERROR cannot find value `foo` in this scope println!("{:.foo$}", 0); - //~^ ERROR: cannot find value `foo` in this scope + //~^ ERROR cannot find value `foo` in this scope } diff --git a/tests/ui/fmt/format-args-capture-macro-hygiene.rs b/tests/ui/fmt/format-args-capture-macro-hygiene.rs index 21e445624a5f9..7a418219bed97 100644 --- a/tests/ui/fmt/format-args-capture-macro-hygiene.rs +++ b/tests/ui/fmt/format-args-capture-macro-hygiene.rs @@ -4,7 +4,7 @@ extern crate format_string_proc_macro; macro_rules! def_site { - () => { "{foo}" } //~ ERROR: there is no argument named `foo` + () => { "{foo}" } //~ ERROR there is no argument named `foo` } macro_rules! call_site { @@ -12,11 +12,11 @@ macro_rules! call_site { } fn main() { - format!(concat!("{foo}")); //~ ERROR: there is no argument named `foo` - format!(concat!("{ba", "r} {}"), 1); //~ ERROR: there is no argument named `bar` + format!(concat!("{foo}")); //~ ERROR there is no argument named `foo` + format!(concat!("{ba", "r} {}"), 1); //~ ERROR there is no argument named `bar` format!(def_site!()); - format!(call_site!("{foo}")); //~ ERROR: there is no argument named `foo` + format!(call_site!("{foo}")); //~ ERROR there is no argument named `foo` - format!(foo_with_input_span!("")); //~ ERROR: there is no argument named `foo` + format!(foo_with_input_span!("")); //~ ERROR there is no argument named `foo` } diff --git a/tests/ui/fmt/format-args-capture-missing-variables.rs b/tests/ui/fmt/format-args-capture-missing-variables.rs index 46fc083cb7301..1c8c3e9c08f67 100644 --- a/tests/ui/fmt/format-args-capture-missing-variables.rs +++ b/tests/ui/fmt/format-args-capture-missing-variables.rs @@ -1,9 +1,9 @@ fn main() { format!("{} {foo} {} {bar} {}", 1, 2, 3); - //~^ ERROR: cannot find value `foo` in this scope - //~^^ ERROR: cannot find value `bar` in this scope + //~^ ERROR cannot find value `foo` in this scope + //~^^ ERROR cannot find value `bar` in this scope - format!("{foo}"); //~ ERROR: cannot find value `foo` in this scope + format!("{foo}"); //~ ERROR cannot find value `foo` in this scope format!("{valuea} {valueb}", valuea=5, valuec=7); //~^ ERROR cannot find value `valueb` in this scope @@ -14,7 +14,7 @@ fn main() { {foo} "##); - //~^^^ ERROR: cannot find value `foo` in this scope + //~^^^ ERROR cannot find value `foo` in this scope - panic!("{foo} {bar}", bar=1); //~ ERROR: cannot find value `foo` in this scope + panic!("{foo} {bar}", bar=1); //~ ERROR cannot find value `foo` in this scope } diff --git a/tests/ui/fmt/format-expanded-string.rs b/tests/ui/fmt/format-expanded-string.rs index 1466dabd7f707..ac404763af79e 100644 --- a/tests/ui/fmt/format-expanded-string.rs +++ b/tests/ui/fmt/format-expanded-string.rs @@ -17,8 +17,8 @@ extern crate format_string_proc_macro; fn main() { format!(concat!("abc}")); - //~^ ERROR: invalid format string: unmatched `}` found + //~^ ERROR invalid format string: unmatched `}` found format!(err_with_input_span!("")); - //~^ ERROR: invalid format string: unmatched `}` found + //~^ ERROR invalid format string: unmatched `}` found } diff --git a/tests/ui/fmt/ifmt-bad-arg.rs b/tests/ui/fmt/ifmt-bad-arg.rs index e39ffb8fe1b36..17e139fd2c469 100644 --- a/tests/ui/fmt/ifmt-bad-arg.rs +++ b/tests/ui/fmt/ifmt-bad-arg.rs @@ -4,41 +4,41 @@ fn main() { // bad number of arguments, see #44954 (originally #15780) format!("{}"); - //~^ ERROR: 1 positional argument in format string, but no arguments were given + //~^ ERROR 1 positional argument in format string, but no arguments were given format!("{1}", 1); - //~^ ERROR: invalid reference to positional argument 1 (there is 1 argument) - //~^^ ERROR: argument never used + //~^ ERROR invalid reference to positional argument 1 (there is 1 argument) + //~^^ ERROR argument never used format!("{} {}"); - //~^ ERROR: 2 positional arguments in format string, but no arguments were given + //~^ ERROR 2 positional arguments in format string, but no arguments were given format!("{0} {1}", 1); - //~^ ERROR: invalid reference to positional argument 1 (there is 1 argument) + //~^ ERROR invalid reference to positional argument 1 (there is 1 argument) format!("{0} {1} {2}", 1, 2); - //~^ ERROR: invalid reference to positional argument 2 (there are 2 arguments) + //~^ ERROR invalid reference to positional argument 2 (there are 2 arguments) format!("{} {value} {} {}", 1, value=2); - //~^ ERROR: 3 positional arguments in format string, but there are 2 arguments + //~^ ERROR 3 positional arguments in format string, but there are 2 arguments format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2); - //~^ ERROR: 6 positional arguments in format string, but there are 3 arguments + //~^ ERROR 6 positional arguments in format string, but there are 3 arguments format!("{} {foo} {} {bar} {}", 1, 2, 3); - //~^ ERROR: cannot find value `foo` in this scope - //~^^ ERROR: cannot find value `bar` in this scope + //~^ ERROR cannot find value `foo` in this scope + //~^^ ERROR cannot find value `bar` in this scope - format!("{foo}"); //~ ERROR: cannot find value `foo` in this scope - format!("", 1, 2); //~ ERROR: multiple unused formatting arguments - format!("{}", 1, 2); //~ ERROR: argument never used - format!("{1}", 1, 2); //~ ERROR: argument never used - format!("{}", 1, foo=2); //~ ERROR: named argument never used - format!("{foo}", 1, foo=2); //~ ERROR: argument never used - format!("", foo=2); //~ ERROR: named argument never used - format!("{} {}", 1, 2, foo=1, bar=2); //~ ERROR: multiple unused formatting arguments + format!("{foo}"); //~ ERROR cannot find value `foo` in this scope + format!("", 1, 2); //~ ERROR multiple unused formatting arguments + format!("{}", 1, 2); //~ ERROR argument never used + format!("{1}", 1, 2); //~ ERROR argument never used + format!("{}", 1, foo=2); //~ ERROR named argument never used + format!("{foo}", 1, foo=2); //~ ERROR argument never used + format!("", foo=2); //~ ERROR named argument never used + format!("{} {}", 1, 2, foo=1, bar=2); //~ ERROR multiple unused formatting arguments - format!("{foo}", foo=1, foo=2); //~ ERROR: duplicate argument - format!("{foo} {} {}", foo=1, 2); //~ ERROR: positional arguments cannot follow + format!("{foo}", foo=1, foo=2); //~ ERROR duplicate argument + format!("{foo} {} {}", foo=1, 2); //~ ERROR positional arguments cannot follow // bad named arguments, #35082 @@ -48,19 +48,19 @@ fn main() { // bad syntax of the format string - format!("{"); //~ ERROR: expected `}` but string was terminated + format!("{"); //~ ERROR expected `}` but string was terminated - format!("foo } bar"); //~ ERROR: unmatched `}` found - format!("foo }"); //~ ERROR: unmatched `}` found + format!("foo } bar"); //~ ERROR unmatched `}` found + format!("foo }"); //~ ERROR unmatched `}` found - format!("foo %s baz", "bar"); //~ ERROR: argument never used + format!("foo %s baz", "bar"); //~ ERROR argument never used format!(r##" {foo} "##); - //~^^^ ERROR: cannot find value `foo` in this scope + //~^^^ ERROR cannot find value `foo` in this scope // bad syntax in format string with multiple newlines, #53836 format!("first number: {} @@ -74,7 +74,7 @@ eighth number: {} ninth number: { tenth number: {}", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - //~^^ ERROR: invalid format string + //~^^ ERROR invalid format string println!("{} {:.*} {}", 1, 3.2, 4); //~^ ERROR 4 positional arguments in format string, but there are 3 arguments //~| ERROR mismatched types diff --git a/tests/ui/fmt/ifmt-bad-format-args.rs b/tests/ui/fmt/ifmt-bad-format-args.rs index ba7301561bd0d..ff408ee2c1255 100644 --- a/tests/ui/fmt/ifmt-bad-format-args.rs +++ b/tests/ui/fmt/ifmt-bad-format-args.rs @@ -1,4 +1,4 @@ fn main() { - format_args!(); //~ ERROR: requires at least a format string argument - format_args!(|| {}); //~ ERROR: must be a string literal + format_args!(); //~ ERROR requires at least a format string argument + format_args!(|| {}); //~ ERROR must be a string literal } diff --git a/tests/ui/fmt/ifmt-unimpl.rs b/tests/ui/fmt/ifmt-unimpl.rs index 258f4eea509d0..73237be69c484 100644 --- a/tests/ui/fmt/ifmt-unimpl.rs +++ b/tests/ui/fmt/ifmt-unimpl.rs @@ -1,4 +1,4 @@ fn main() { format!("{:X}", "3"); - //~^ ERROR: `str: UpperHex` is not satisfied + //~^ ERROR `str: UpperHex` is not satisfied } diff --git a/tests/ui/fmt/ifmt-unknown-trait.rs b/tests/ui/fmt/ifmt-unknown-trait.rs index 158152c89a428..38d7119193690 100644 --- a/tests/ui/fmt/ifmt-unknown-trait.rs +++ b/tests/ui/fmt/ifmt-unknown-trait.rs @@ -1,4 +1,4 @@ fn main() { format!("{:notimplemented}", "3"); - //~^ ERROR: unknown format trait `notimplemented` + //~^ ERROR unknown format trait `notimplemented` } diff --git a/tests/ui/fmt/issue-86085.rs b/tests/ui/fmt/issue-86085.rs index 63d42b76969cd..e2583586a6a5d 100644 --- a/tests/ui/fmt/issue-86085.rs +++ b/tests/ui/fmt/issue-86085.rs @@ -2,5 +2,5 @@ fn main ( ) { format ! ( concat ! ( r#"lJ𐏿Æ�.𐏿�"# , "r} {}" ) ) ; -//~^ ERROR: invalid format string: unmatched `}` found +//~^ ERROR invalid format string: unmatched `}` found } diff --git a/tests/ui/fmt/issue-89173.rs b/tests/ui/fmt/issue-89173.rs index fc99af4085921..5d0d8f8776b1c 100644 --- a/tests/ui/fmt/issue-89173.rs +++ b/tests/ui/fmt/issue-89173.rs @@ -5,10 +5,10 @@ fn main() { let num = 0x0abcde; let width = 6; print!("%0*x", width, num); - //~^ ERROR: multiple unused formatting arguments - //~| NOTE: multiple missing formatting specifiers - //~| NOTE: argument never used - //~| NOTE: argument never used - //~| NOTE: format specifiers use curly braces, and you have to use a positional or named parameter for the width - //~| NOTE: printf formatting is not supported + //~^ ERROR multiple unused formatting arguments + //~| NOTE multiple missing formatting specifiers + //~| NOTE argument never used + //~| NOTE argument never used + //~| NOTE format specifiers use curly braces, and you have to use a positional or named parameter for the width + //~| NOTE printf formatting is not supported } diff --git a/tests/ui/fmt/issue-91556.rs b/tests/ui/fmt/issue-91556.rs index fcf8909859c60..9af00aa2c3834 100644 --- a/tests/ui/fmt/issue-91556.rs +++ b/tests/ui/fmt/issue-91556.rs @@ -1,8 +1,8 @@ fn main() { let _ = format!(concat!("{0}𝖳𝖾𝗌𝗍{"), i); - //~^ ERROR: invalid format string: expected `}` but string was terminated - //~| NOTE: if you intended to print `{`, you can escape it using `{{` - //~| NOTE: in this expansion of concat! - //~| NOTE: in this expansion of concat! - //~| NOTE: expected `}` in format string + //~^ ERROR invalid format string: expected `}` but string was terminated + //~| NOTE if you intended to print `{`, you can escape it using `{{` + //~| NOTE in this expansion of concat! + //~| NOTE in this expansion of concat! + //~| NOTE expected `}` in format string } diff --git a/tests/ui/fmt/raw-idents.rs b/tests/ui/fmt/raw-idents.rs index 29a74c55a4a54..2c263463b7254 100644 --- a/tests/ui/fmt/raw-idents.rs +++ b/tests/ui/fmt/raw-idents.rs @@ -5,10 +5,10 @@ fn main() { let r#type = "foobar"; - println!("It is {r#type}"); //~ ERROR: invalid format string: raw identifiers are not supported - println!(r##"It still is {r#type}"##); //~ ERROR: invalid format string: raw identifiers are not supported - println!(concat!("{r#", "type}")); //~ ERROR: invalid format string: raw identifiers are not supported - println!("{\x72\x23type:?}"); //~ ERROR: invalid format string: raw identifiers are not supported + println!("It is {r#type}"); //~ ERROR invalid format string: raw identifiers are not supported + println!(r##"It still is {r#type}"##); //~ ERROR invalid format string: raw identifiers are not supported + println!(concat!("{r#", "type}")); //~ ERROR invalid format string: raw identifiers are not supported + println!("{\x72\x23type:?}"); //~ ERROR invalid format string: raw identifiers are not supported // OK println!("{type}"); diff --git a/tests/ui/fn-main/wrong-type.rs b/tests/ui/fn-main/wrong-type.rs index 31deba72af4b3..96b9ffc8c6a19 100644 --- a/tests/ui/fn-main/wrong-type.rs +++ b/tests/ui/fn-main/wrong-type.rs @@ -4,5 +4,5 @@ struct S { } fn main(foo: S) { -//~^ ERROR: `main` function has wrong type [E0580] +//~^ ERROR `main` function has wrong type [E0580] } diff --git a/tests/ui/fn/bad-main.rs b/tests/ui/fn/bad-main.rs index 7511599614247..bd49616f0fe95 100644 --- a/tests/ui/fn/bad-main.rs +++ b/tests/ui/fn/bad-main.rs @@ -1 +1 @@ -fn main(x: isize) { } //~ ERROR: `main` function has wrong type [E0580] +fn main(x: isize) { } //~ ERROR `main` function has wrong type [E0580] diff --git a/tests/ui/fn/bad-turbofish-hints-issue-121901.rs b/tests/ui/fn/bad-turbofish-hints-issue-121901.rs index 1425e576d75a3..a36b418cb4d1c 100644 --- a/tests/ui/fn/bad-turbofish-hints-issue-121901.rs +++ b/tests/ui/fn/bad-turbofish-hints-issue-121901.rs @@ -1,8 +1,8 @@ // Regression test for the parser wrongfully suggesting turbofish syntax in below syntax errors type One = for<'a> fn(Box`, found `)` +//~^ ERROR expected one of `+`, `,`, or `>`, found `)` type Two = for<'a> fn(Box>); -//~^ ERROR: unmatched angle bracket +//~^ ERROR unmatched angle bracket fn main() {} diff --git a/tests/ui/fn/fn_def_coercion.rs b/tests/ui/fn/fn_def_coercion.rs index 31c8fa41de17c..f733599d4f153 100644 --- a/tests/ui/fn/fn_def_coercion.rs +++ b/tests/ui/fn/fn_def_coercion.rs @@ -7,8 +7,8 @@ fn foo(t: T) -> T { } fn f<'a, 'b, 'c: 'a + 'b>(a: &'a (), b: &'b (), c: &'c ()) { - let mut x = foo::<&'a ()>; //~ ERROR: lifetime may not live long enough - x = foo::<&'b ()>; //~ ERROR: lifetime may not live long enough + let mut x = foo::<&'a ()>; //~ ERROR lifetime may not live long enough + x = foo::<&'b ()>; //~ ERROR lifetime may not live long enough x = foo::<&'c ()>; x(a); x(b); diff --git a/tests/ui/fn/fn_def_opaque_coercion_to_fn_ptr.rs b/tests/ui/fn/fn_def_opaque_coercion_to_fn_ptr.rs index e090b7039b8d7..3740246e985ad 100644 --- a/tests/ui/fn/fn_def_opaque_coercion_to_fn_ptr.rs +++ b/tests/ui/fn/fn_def_opaque_coercion_to_fn_ptr.rs @@ -16,7 +16,7 @@ type F = impl Sized; #[define_opaque(F)] fn f(a: F) { let mut x = bar::; - x = foo::<()>; //~ ERROR: mismatched types + x = foo::<()>; //~ ERROR mismatched types x(a); x(()); } @@ -26,7 +26,7 @@ type I = impl Sized; #[define_opaque(I)] fn i(a: I) { let mut x = bar::<()>; - x = foo::; //~ ERROR: mismatched types + x = foo::; //~ ERROR mismatched types x(a); x(()); } diff --git a/tests/ui/fn/suggest-return-closure.rs b/tests/ui/fn/suggest-return-closure.rs index 30e25ca8edccd..e2c65a0d52b22 100644 --- a/tests/ui/fn/suggest-return-closure.rs +++ b/tests/ui/fn/suggest-return-closure.rs @@ -17,17 +17,17 @@ fn fn_mut() -> _ { //~| SUGGESTION impl FnMut(char) //~| NOTE for more information on `Fn` traits and closure types let x = String::new(); - //~^ HELP: consider changing this to be mutable + //~^ HELP consider changing this to be mutable //~| NOTE binding `x` declared here - |c| { //~ NOTE: value captured here + |c| { //~ NOTE value captured here x.push(c); - //~^ ERROR: does not live long enough - //~| NOTE: does not live long enough - //~| NOTE: cannot borrow as mutable - //~| ERROR: not declared as mutable + //~^ ERROR does not live long enough + //~| NOTE does not live long enough + //~| NOTE cannot borrow as mutable + //~| ERROR not declared as mutable } -} //~ NOTE: borrow later used here -//~^ NOTE: dropped here +} //~ NOTE borrow later used here +//~^ NOTE dropped here fn fun() -> _ { //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types [E0121] diff --git a/tests/ui/for-loop-while/break-outside-loop.rs b/tests/ui/for-loop-while/break-outside-loop.rs index 26769b30dd5f0..b0e1396d7a9b3 100644 --- a/tests/ui/for-loop-while/break-outside-loop.rs +++ b/tests/ui/for-loop-while/break-outside-loop.rs @@ -7,21 +7,21 @@ fn cond() -> bool { true } fn foo(_: F) where F: FnOnce() {} fn main() { - let pth = break; //~ ERROR: `break` outside of a loop - if cond() { continue } //~ ERROR: `continue` outside of a loop + let pth = break; //~ ERROR `break` outside of a loop + if cond() { continue } //~ ERROR `continue` outside of a loop while cond() { if cond() { break } if cond() { continue } foo(|| { - if cond() { break } //~ ERROR: `break` inside of a closure - if cond() { continue } //~ ERROR: `continue` inside of a closure + if cond() { break } //~ ERROR `break` inside of a closure + if cond() { continue } //~ ERROR `continue` inside of a closure }) } let rs: Foo = Foo{t: pth}; - let unconstrained = break; //~ ERROR: `break` outside of a loop + let unconstrained = break; //~ ERROR `break` outside of a loop // This used to ICE because `target_id` passed to `check_expr_break` would be the closure and // not the `loop`, which failed in the call to `find_breakable`. (#65383) diff --git a/tests/ui/function-pointer/signature-mismatch.rs b/tests/ui/function-pointer/signature-mismatch.rs index f269e9bf84b31..b3b152105b470 100644 --- a/tests/ui/function-pointer/signature-mismatch.rs +++ b/tests/ui/function-pointer/signature-mismatch.rs @@ -2,5 +2,5 @@ fn main() { let _ = [std::ops::Add::add, std::ops::Mul::mul, std::ops::Mul::mul as fn(_, &_)]; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/generic-associated-types/const_params_have_right_type.rs b/tests/ui/generic-associated-types/const_params_have_right_type.rs index d2cb12697e423..699c152029590 100644 --- a/tests/ui/generic-associated-types/const_params_have_right_type.rs +++ b/tests/ui/generic-associated-types/const_params_have_right_type.rs @@ -4,7 +4,7 @@ trait Trait { impl Trait for () { type Foo = u32; - //~^ error: type `Foo` has an incompatible generic parameter for trait + //~^ error type `Foo` has an incompatible generic parameter for trait } fn main() {} diff --git a/tests/ui/generic-associated-types/gat-bounds-not-checked-with-right-substitutions.rs b/tests/ui/generic-associated-types/gat-bounds-not-checked-with-right-substitutions.rs index 05d205266b442..998f768db962e 100644 --- a/tests/ui/generic-associated-types/gat-bounds-not-checked-with-right-substitutions.rs +++ b/tests/ui/generic-associated-types/gat-bounds-not-checked-with-right-substitutions.rs @@ -17,7 +17,7 @@ trait Gat { } impl Gat for () { - type Gat<'a> = &'a str; //~ ERROR: implementation of `Lengthen` is not general enough + type Gat<'a> = &'a str; //~ ERROR implementation of `Lengthen` is not general enough } fn main() { diff --git a/tests/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.rs b/tests/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.rs index b02739a7d0acb..4866ad35931cc 100644 --- a/tests/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.rs +++ b/tests/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.rs @@ -4,9 +4,9 @@ trait X { fn main() { fn _f(arg : Box X = &'a [u32]>>) {} - //~^ ERROR: use of undeclared lifetime name `'x` - //~| ERROR: binding for associated type `Y` references lifetime - //~| ERROR: binding for associated type `Y` references lifetime - //~| ERROR: binding for associated type `Y` references lifetime - //~| ERROR: the trait `X` is not dyn compatible + //~^ ERROR use of undeclared lifetime name `'x` + //~| ERROR binding for associated type `Y` references lifetime + //~| ERROR binding for associated type `Y` references lifetime + //~| ERROR binding for associated type `Y` references lifetime + //~| ERROR the trait `X` is not dyn compatible } diff --git a/tests/ui/generic-associated-types/gat-trait-path-generic-type-arg.rs b/tests/ui/generic-associated-types/gat-trait-path-generic-type-arg.rs index d00c036fbd550..958efc5973c39 100644 --- a/tests/ui/generic-associated-types/gat-trait-path-generic-type-arg.rs +++ b/tests/ui/generic-associated-types/gat-trait-path-generic-type-arg.rs @@ -5,10 +5,10 @@ trait Foo { } impl Foo for T { - //~^ ERROR: the type parameter `T1` is not constrained + //~^ ERROR the type parameter `T1` is not constrained type F = &[u8]; - //~^ ERROR: the name `T1` is already used for - //~| ERROR: `&` without an explicit lifetime name cannot be used here + //~^ ERROR the name `T1` is already used for + //~| ERROR `&` without an explicit lifetime name cannot be used here } fn main() {} diff --git a/tests/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs b/tests/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs index 946cb1a62b7da..1c546d0d2aee7 100644 --- a/tests/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs +++ b/tests/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs @@ -4,7 +4,7 @@ trait X { fn foo<'a>(t : Self::Y<'a>) -> Self::Y<'a> { t } } -impl X for T { //~ ERROR: not all trait items implemented +impl X for T { //~ ERROR not all trait items implemented fn foo<'a, T1: X>(t : T1) -> T1::Y<'a> { //~^ ERROR missing generics for associated type //~^^ ERROR missing generics for associated type diff --git a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs index 85661c1b84480..9262c2c6502e6 100644 --- a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs +++ b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs @@ -3,8 +3,8 @@ trait X { } fn foo<'a>(arg: Box>) {} - //~^ ERROR: lifetime in trait object type must be followed by `+` - //~| ERROR: parenthesized generic arguments cannot be used + //~^ ERROR lifetime in trait object type must be followed by `+` + //~| ERROR parenthesized generic arguments cannot be used //~| ERROR associated type takes 0 generic arguments but 1 generic argument //~| ERROR associated type takes 1 lifetime argument but 0 lifetime arguments //~| ERROR associated type takes 0 generic arguments but 1 generic argument @@ -12,14 +12,14 @@ fn foo<'a>(arg: Box>) {} //~| ERROR associated type takes 0 generic arguments but 1 generic argument //~| ERROR associated type takes 1 lifetime argument but 0 lifetime arguments //~| ERROR at least one trait is required - //~| ERROR: the trait `X` is not dyn compatible + //~| ERROR the trait `X` is not dyn compatible fn bar<'a>(arg: Box>) {} - //~^ ERROR: parenthesized generic arguments cannot be used + //~^ ERROR parenthesized generic arguments cannot be used //~| ERROR associated type takes 1 lifetime argument but 0 lifetime arguments //~| ERROR associated type takes 1 lifetime argument but 0 lifetime arguments //~| ERROR associated type takes 1 lifetime argument but 0 lifetime arguments - //~| ERROR: the trait `X` is not dyn compatible + //~| ERROR the trait `X` is not dyn compatible fn main() {} diff --git a/tests/ui/generic-associated-types/issue-67510.rs b/tests/ui/generic-associated-types/issue-67510.rs index 5c3150a77ed1b..23f1263228cdd 100644 --- a/tests/ui/generic-associated-types/issue-67510.rs +++ b/tests/ui/generic-associated-types/issue-67510.rs @@ -3,8 +3,8 @@ trait X { } fn f(x: Box = &'a ()>>) {} -//~^ ERROR: use of undeclared lifetime name `'a` -//~| ERROR: use of undeclared lifetime name `'a` -//~| ERROR: the trait `X` is not dyn compatible [E0038] +//~^ ERROR use of undeclared lifetime name `'a` +//~| ERROR use of undeclared lifetime name `'a` +//~| ERROR the trait `X` is not dyn compatible [E0038] fn main() {} diff --git a/tests/ui/generic-associated-types/issue-68648-2.rs b/tests/ui/generic-associated-types/issue-68648-2.rs index 0f963d58f5e82..d5174ab05d996 100644 --- a/tests/ui/generic-associated-types/issue-68648-2.rs +++ b/tests/ui/generic-associated-types/issue-68648-2.rs @@ -10,7 +10,7 @@ impl Fun for T { fn bug<'a, T: Fun = T>>(t: T) -> T::F<'a> { T::identity(()) - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/generic-associated-types/issue-70304.rs b/tests/ui/generic-associated-types/issue-70304.rs index 8898d4c7d1352..995562e137dc7 100644 --- a/tests/ui/generic-associated-types/issue-70304.rs +++ b/tests/ui/generic-associated-types/issue-70304.rs @@ -1,6 +1,6 @@ trait Document { type Cursor<'a>: DocCursor<'a>; - //~^ ERROR: missing required bound on `Cursor` + //~^ ERROR missing required bound on `Cursor` fn cursor(&self) -> Self::Cursor<'_>; } @@ -45,7 +45,7 @@ where fn create_doc() -> impl Document = DocCursorImpl<'_>> { //~^ ERROR `'_` cannot be used here [E0637] - //~| ERROR: missing lifetime specifier + //~| ERROR missing lifetime specifier DocumentImpl {} } diff --git a/tests/ui/generic-associated-types/issue-71176.rs b/tests/ui/generic-associated-types/issue-71176.rs index d3a0caffec1e7..5466a226d90c5 100644 --- a/tests/ui/generic-associated-types/issue-71176.rs +++ b/tests/ui/generic-associated-types/issue-71176.rs @@ -8,16 +8,16 @@ impl Provider for () { struct Holder { inner: Box>, - //~^ ERROR: missing generics for associated type - //~| ERROR: missing generics for associated type - //~| ERROR: missing generics for associated type - //~| ERROR: the trait `Provider` is not dyn compatible + //~^ ERROR missing generics for associated type + //~| ERROR missing generics for associated type + //~| ERROR missing generics for associated type + //~| ERROR the trait `Provider` is not dyn compatible } fn main() { Holder { inner: Box::new(()), - //~^ ERROR: the trait `Provider` is not dyn compatible - //~| ERROR: the trait `Provider` is not dyn compatible + //~^ ERROR the trait `Provider` is not dyn compatible + //~| ERROR the trait `Provider` is not dyn compatible }; } diff --git a/tests/ui/generic-associated-types/issue-74684-1.rs b/tests/ui/generic-associated-types/issue-74684-1.rs index e9ec80074f896..ee355636a3080 100644 --- a/tests/ui/generic-associated-types/issue-74684-1.rs +++ b/tests/ui/generic-associated-types/issue-74684-1.rs @@ -11,7 +11,7 @@ impl Fun for T { fn bug<'a, T: ?Sized + Fun = [u8]>>(_ : Box) -> &'static T::F<'a> { let a = [0; 1]; let _x = T::identity(&a); - //~^ ERROR: `a` does not live long enough + //~^ ERROR `a` does not live long enough todo!() } diff --git a/tests/ui/generic-associated-types/issue-74684-2.rs b/tests/ui/generic-associated-types/issue-74684-2.rs index 96cdb01be3b60..6536836ee1f1f 100644 --- a/tests/ui/generic-associated-types/issue-74684-2.rs +++ b/tests/ui/generic-associated-types/issue-74684-2.rs @@ -10,7 +10,7 @@ impl Fun for T { fn bug<'a, T: ?Sized + Fun = [u8]>>(t: Box) -> &'static T::F<'a> { let a = [0; 1]; - let x = T::identity(&a); //~ ERROR: does not live long enough + let x = T::identity(&a); //~ ERROR does not live long enough todo!() } @@ -19,5 +19,5 @@ fn main() { let x = 10; bug(Box::new(x)); - //~^ ERROR: type mismatch resolving `<{integer} as Fun>::F<'_> == [u8]` + //~^ ERROR type mismatch resolving `<{integer} as Fun>::F<'_> == [u8]` } diff --git a/tests/ui/generic-associated-types/issue-74816.rs b/tests/ui/generic-associated-types/issue-74816.rs index e2f4ddc7485c3..2edeb1afdc193 100644 --- a/tests/ui/generic-associated-types/issue-74816.rs +++ b/tests/ui/generic-associated-types/issue-74816.rs @@ -10,7 +10,7 @@ trait Trait1 { trait Trait2 { type Associated: Trait1 = Self; - //~^ ERROR: the trait bound `Self: Trait1` is not satisfied + //~^ ERROR the trait bound `Self: Trait1` is not satisfied //~| the size for values of type `Self` cannot be known } diff --git a/tests/ui/generic-associated-types/issue-78671.rs b/tests/ui/generic-associated-types/issue-78671.rs index 1e1863799a523..dcd49e8b5f63b 100644 --- a/tests/ui/generic-associated-types/issue-78671.rs +++ b/tests/ui/generic-associated-types/issue-78671.rs @@ -3,8 +3,8 @@ trait CollectionFamily { } fn floatify() { Box::new(Family) as &dyn CollectionFamily - //~^ ERROR: missing generics for associated type - //~| ERROR: the trait `CollectionFamily` is not dyn compatible + //~^ ERROR missing generics for associated type + //~| ERROR the trait `CollectionFamily` is not dyn compatible } struct Family; diff --git a/tests/ui/generic-associated-types/issue-79636-1.rs b/tests/ui/generic-associated-types/issue-79636-1.rs index 3357afb9d4dce..ea5d93c440cef 100644 --- a/tests/ui/generic-associated-types/issue-79636-1.rs +++ b/tests/ui/generic-associated-types/issue-79636-1.rs @@ -3,7 +3,7 @@ trait Monad { type Wrapped; fn bind(self, f: F) -> Self::Wrapped { - //~^ ERROR: the size for values of type `Self` cannot be known + //~^ ERROR the size for values of type `Self` cannot be known todo!() } } @@ -12,12 +12,12 @@ fn join(outer: MOuter) -> MOuter::Wrapped where MOuter: Monad, MInner: Monad>, - //~^ ERROR: missing generics for associated type `Monad::Wrapped` + //~^ ERROR missing generics for associated type `Monad::Wrapped` { outer.bind(|inner| inner) } fn main() { assert_eq!(join(Some(Some(true))), Some(true)); - //~^ ERROR: `Option>: Monad` is not satisfied + //~^ ERROR `Option>: Monad` is not satisfied } diff --git a/tests/ui/generic-associated-types/issue-79636-2.rs b/tests/ui/generic-associated-types/issue-79636-2.rs index ff5ff38c968d2..700bb42997d3d 100644 --- a/tests/ui/generic-associated-types/issue-79636-2.rs +++ b/tests/ui/generic-associated-types/issue-79636-2.rs @@ -7,7 +7,7 @@ trait SomeTrait { fn program() -> () where W: SomeTrait, - //~^ ERROR: missing generics for associated type `SomeTrait::Wrapped` + //~^ ERROR missing generics for associated type `SomeTrait::Wrapped` { return W::f(); } diff --git a/tests/ui/generic-associated-types/issue-84931.rs b/tests/ui/generic-associated-types/issue-84931.rs index ed3d564c94886..04ba77cc5cba9 100644 --- a/tests/ui/generic-associated-types/issue-84931.rs +++ b/tests/ui/generic-associated-types/issue-84931.rs @@ -12,8 +12,8 @@ struct StreamingSliceIter<'a, T> { impl<'b, T: 'b> StreamingIter for StreamingSliceIter<'b, T> { type Item<'a> = &'a mut T; - //~^ ERROR: the parameter type - //~| ERROR: does not fulfill the required lifetime + //~^ ERROR the parameter type + //~| ERROR does not fulfill the required lifetime fn next(&mut self) -> Option<&mut T> { loop {} } diff --git a/tests/ui/generic-associated-types/issue-88287.rs b/tests/ui/generic-associated-types/issue-88287.rs index ce0b9827d1103..53bdbd4923eec 100644 --- a/tests/ui/generic-associated-types/issue-88287.rs +++ b/tests/ui/generic-associated-types/issue-88287.rs @@ -33,7 +33,7 @@ where #[define_opaque(SearchFutureTy)] fn search<'c>(&'c self, _client: &'c ()) -> Self::Future<'c, Self, Criteria> { async move { todo!() } - //~^ ERROR: the size for values of type `A` cannot be known at compilation time + //~^ ERROR the size for values of type `A` cannot be known at compilation time } } diff --git a/tests/ui/generic-associated-types/issue-88595.rs b/tests/ui/generic-associated-types/issue-88595.rs index b1fe542a5681f..af68bfe1dff93 100644 --- a/tests/ui/generic-associated-types/issue-88595.rs +++ b/tests/ui/generic-associated-types/issue-88595.rs @@ -18,6 +18,6 @@ struct C; impl<'a> A<'a> for C { type B<'b> = impl Clone; - fn a(&'a self) -> Self::B<'a> {} //~ ERROR: non-defining opaque type use in defining scope - //~^ ERROR: non-defining opaque type use in defining scope + fn a(&'a self) -> Self::B<'a> {} //~ ERROR non-defining opaque type use in defining scope + //~^ ERROR non-defining opaque type use in defining scope } diff --git a/tests/ui/generic-associated-types/issue-90014.rs b/tests/ui/generic-associated-types/issue-90014.rs index 6a66a0c60c6d6..d93a00351bbe9 100644 --- a/tests/ui/generic-associated-types/issue-90014.rs +++ b/tests/ui/generic-associated-types/issue-90014.rs @@ -13,7 +13,7 @@ trait MakeFut { impl MakeFut for &'_ mut () { type Fut<'a> = impl Future; - //~^ ERROR: the type `&mut ()` does not fulfill the required lifetime + //~^ ERROR the type `&mut ()` does not fulfill the required lifetime fn make_fut<'a>(&'a self) -> Self::Fut<'a> { async { () } diff --git a/tests/ui/generic-associated-types/parse/trait-path-expected-token.rs b/tests/ui/generic-associated-types/parse/trait-path-expected-token.rs index cbb05189201da..b389f46437d89 100644 --- a/tests/ui/generic-associated-types/parse/trait-path-expected-token.rs +++ b/tests/ui/generic-associated-types/parse/trait-path-expected-token.rs @@ -3,6 +3,6 @@ trait X { } fn f1<'a>(arg : Box>) {} - //~^ ERROR: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=` + //~^ ERROR expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=` fn main() {} diff --git a/tests/ui/generic-associated-types/parse/trait-path-expressions.rs b/tests/ui/generic-associated-types/parse/trait-path-expressions.rs index 9183ec4976b02..a2324ad738bc2 100644 --- a/tests/ui/generic-associated-types/parse/trait-path-expressions.rs +++ b/tests/ui/generic-associated-types/parse/trait-path-expressions.rs @@ -4,7 +4,7 @@ mod error1 { } fn f1<'a>(arg : Box>) {} - //~^ ERROR: expected expression, found `)` + //~^ ERROR expected expression, found `)` } mod error2 { @@ -14,7 +14,7 @@ mod error2 { } fn f2<'a>(arg : Box>) {} - //~^ ERROR: expected one of + //~^ ERROR expected one of } fn main() {} diff --git a/tests/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs b/tests/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs index b7b93ef1c443b..4a76182aeeb1e 100644 --- a/tests/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs +++ b/tests/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs @@ -4,12 +4,12 @@ trait X { const _: () = { fn f1<'a>(arg : Box>) {} - //~^ ERROR: expected one of `>`, a const expression, lifetime, or type, found `:` + //~^ ERROR expected one of `>`, a const expression, lifetime, or type, found `:` }; const _: () = { fn f1<'a>(arg : Box>) {} - //~^ ERROR: expected one of `>`, a const expression, lifetime, or type, found `=` + //~^ ERROR expected one of `>`, a const expression, lifetime, or type, found `=` }; fn main() {} diff --git a/tests/ui/generic-associated-types/parse/trait-path-segments.rs b/tests/ui/generic-associated-types/parse/trait-path-segments.rs index 458e203eb3ce4..5135c30e96090 100644 --- a/tests/ui/generic-associated-types/parse/trait-path-segments.rs +++ b/tests/ui/generic-associated-types/parse/trait-path-segments.rs @@ -4,7 +4,7 @@ const _: () = { } fn f1<'a>(arg : Box>) {} - //~^ ERROR: expected one of + //~^ ERROR expected one of }; const _: () = { @@ -15,7 +15,7 @@ const _: () = { trait Z {} impl::Y<'a> = &'a u32>> Z for T {} - //~^ ERROR: expected one of + //~^ ERROR expected one of }; const _: () = { @@ -26,7 +26,7 @@ const _: () = { trait Z {} impl = &'a u32>> Z for T {} - //~^ ERROR: expected one of + //~^ ERROR expected one of }; fn main() {} diff --git a/tests/ui/generic-associated-types/parse/trait-path-types.rs b/tests/ui/generic-associated-types/parse/trait-path-types.rs index 74a00342ff4b5..57d7ef191c061 100644 --- a/tests/ui/generic-associated-types/parse/trait-path-types.rs +++ b/tests/ui/generic-associated-types/parse/trait-path-types.rs @@ -4,17 +4,17 @@ trait X { const _: () = { fn f<'a>(arg : Box>) {} - //~^ ERROR: expected one of + //~^ ERROR expected one of }; const _: () = { fn f1<'a>(arg : Box) = &'a ()>>) {} - //~^ ERROR: expected one of + //~^ ERROR expected one of }; const _: () = { fn f1<'a>(arg : Box>) {} - //~^ ERROR: expected one of + //~^ ERROR expected one of }; fn main() {} diff --git a/tests/ui/generic-associated-types/static-lifetime-tip-with-default-type.rs b/tests/ui/generic-associated-types/static-lifetime-tip-with-default-type.rs index 68879a0af292a..4ddaeb9742976 100644 --- a/tests/ui/generic-associated-types/static-lifetime-tip-with-default-type.rs +++ b/tests/ui/generic-associated-types/static-lifetime-tip-with-default-type.rs @@ -5,22 +5,22 @@ // https://github.com/rust-lang/rust/issues/124785 struct Foo(&'static T, &'static K); -//~^ ERROR: the parameter type `T` may not live long enough -//~| ERROR: the parameter type `K` may not live long enough +//~^ ERROR the parameter type `T` may not live long enough +//~| ERROR the parameter type `K` may not live long enough struct Bar(&'static r#T, &'static r#K); -//~^ ERROR: the parameter type `T` may not live long enough -//~| ERROR: the parameter type `K` may not live long enough +//~^ ERROR the parameter type `T` may not live long enough +//~| ERROR the parameter type `K` may not live long enough struct Boo(&'static T); -//~^ ERROR: the parameter type `T` may not live long enough +//~^ ERROR the parameter type `T` may not live long enough struct Far(&'static T); -//~^ ERROR: the parameter type `T` may not live long enough +//~^ ERROR the parameter type `T` may not live long enough struct S<'a, K: 'a = i32>(&'static K); -//~^ ERROR: lifetime parameter `'a` is never used -//~| ERROR: the parameter type `K` may not live long enough +//~^ ERROR lifetime parameter `'a` is never used +//~| ERROR the parameter type `K` may not live long enough fn main() {} diff --git a/tests/ui/generic-const-items/recursive.rs b/tests/ui/generic-const-items/recursive.rs index 94cf98ec64b25..38f01ee7e33f0 100644 --- a/tests/ui/generic-const-items/recursive.rs +++ b/tests/ui/generic-const-items/recursive.rs @@ -7,5 +7,5 @@ const RECUR: () = RECUR::<(T,)>; fn main() { - let _ = RECUR::<()>; //~ ERROR: queries overflow the depth limit! + let _ = RECUR::<()>; //~ ERROR queries overflow the depth limit! } diff --git a/tests/ui/generics/post_monomorphization_error_backtrace.rs b/tests/ui/generics/post_monomorphization_error_backtrace.rs index f5f36ef03ae66..874f1eb0dcd9f 100644 --- a/tests/ui/generics/post_monomorphization_error_backtrace.rs +++ b/tests/ui/generics/post_monomorphization_error_backtrace.rs @@ -4,23 +4,23 @@ fn assert_zst() { struct F(T); impl F { const V: () = assert!(std::mem::size_of::() == 0); - //~^ ERROR: evaluation of `assert_zst::F::::V` failed [E0080] - //~| NOTE: in this expansion of assert! - //~| NOTE: assertion failed - //~| ERROR: evaluation of `assert_zst::F::::V` failed [E0080] - //~| NOTE: in this expansion of assert! - //~| NOTE: assertion failed + //~^ ERROR evaluation of `assert_zst::F::::V` failed [E0080] + //~| NOTE in this expansion of assert! + //~| NOTE assertion failed + //~| ERROR evaluation of `assert_zst::F::::V` failed [E0080] + //~| NOTE in this expansion of assert! + //~| NOTE assertion failed } F::::V; - //~^NOTE: erroneous constant - //~|NOTE: erroneous constant - //~|NOTE: duplicate + //~^NOTE erroneous constant + //~|NOTE erroneous constant + //~|NOTE duplicate } fn foo() { assert_zst::() - //~^ NOTE: the above error was encountered while instantiating `fn assert_zst::` - //~| NOTE: the above error was encountered while instantiating `fn assert_zst::` + //~^ NOTE the above error was encountered while instantiating `fn assert_zst::` + //~| NOTE the above error was encountered while instantiating `fn assert_zst::` } diff --git a/tests/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.rs b/tests/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.rs index a7b0ca6fe4a54..7a718b3639c2e 100644 --- a/tests/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.rs +++ b/tests/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.rs @@ -2,5 +2,5 @@ fn main() { let xs = [13, 1, 5, 2, 3, 1, 21, 8]; let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs; //~^ `X..` patterns in slices are experimental - //~| ERROR: refutable pattern + //~| ERROR refutable pattern } diff --git a/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-match-arrow.rs b/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-match-arrow.rs index cff0c42eb52fc..cf74441eaa735 100644 --- a/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-match-arrow.rs +++ b/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-match-arrow.rs @@ -1,9 +1,9 @@ fn main() { let x = 42; match x { - //~^ ERROR: non-exhaustive patterns - //~| NOTE: not covered - //~| NOTE: matched value is of type + //~^ ERROR non-exhaustive patterns + //~| NOTE not covered + //~| NOTE matched value is of type 0..=73 => {}, 74..=> {}, //~^ ERROR unexpected `>` after inclusive range diff --git a/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs b/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs index 2f1ec65897211..d1a87aac63aa6 100644 --- a/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs +++ b/tests/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs @@ -16,9 +16,9 @@ fn bar() { macro_rules! mac { ($e:expr) => { let $e...; //~ ERROR inclusive range with no end - //~^ ERROR: refutable pattern + //~^ ERROR refutable pattern let $e..=; //~ ERROR inclusive range with no end - //~^ ERROR: refutable pattern + //~^ ERROR refutable pattern } } diff --git a/tests/ui/half-open-range-patterns/range_pat_interactions1.rs b/tests/ui/half-open-range-patterns/range_pat_interactions1.rs index c5705d5db60f8..5e9eca830baff 100644 --- a/tests/ui/half-open-range-patterns/range_pat_interactions1.rs +++ b/tests/ui/half-open-range-patterns/range_pat_interactions1.rs @@ -8,14 +8,14 @@ fn main() { for x in -9 + 1..=(9 - 2) { if let n @ 2..3|4 = x { - //~^ error: variable `n` is not bound in all patterns + //~^ error variable `n` is not bound in all patterns errors_only.push(x); } else if let 2..3 | 4 = x { if_lettable.push(x); } match x as i32 { 0..5+1 => errors_only.push(x), - //~^ error: expected a pattern range bound, found an expression + //~^ error expected a pattern range bound, found an expression 1 | -3..0 => first_or.push(x), y @ (0..5 | 6) => or_two.push(y), y @ -5.. => range_from.push(y), diff --git a/tests/ui/half-open-range-patterns/slice_pattern_syntax_problem1.rs b/tests/ui/half-open-range-patterns/slice_pattern_syntax_problem1.rs index 60b056fbcb694..617cd29f0073a 100644 --- a/tests/ui/half-open-range-patterns/slice_pattern_syntax_problem1.rs +++ b/tests/ui/half-open-range-patterns/slice_pattern_syntax_problem1.rs @@ -3,5 +3,5 @@ fn main() { let xs = [13, 1, 5, 2, 3, 1, 21, 8]; let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs; //~^ `X..` patterns in slices are experimental - //~| ERROR: refutable pattern + //~| ERROR refutable pattern } diff --git a/tests/ui/higher-ranked/subtype/placeholder-pattern-fail.rs b/tests/ui/higher-ranked/subtype/placeholder-pattern-fail.rs index dc865605ed3c0..a251ec1eb616f 100644 --- a/tests/ui/higher-ranked/subtype/placeholder-pattern-fail.rs +++ b/tests/ui/higher-ranked/subtype/placeholder-pattern-fail.rs @@ -12,12 +12,12 @@ fn hr_subtype<'c>(f: for<'a, 'b> fn(Inv<'a>, Inv<'a>)) { fn simple1<'c>(x: (&'c i32,)) { let _x: (&'static i32,) = x; - //~^ ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn simple2<'c>(x: (&'c i32,)) { let _: (&'static i32,) = x; - //~^ ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() { diff --git a/tests/ui/higher-ranked/trait-bounds/issue-59311.rs b/tests/ui/higher-ranked/trait-bounds/issue-59311.rs index 4e722dc0e8009..f0bfc6bc03654 100644 --- a/tests/ui/higher-ranked/trait-bounds/issue-59311.rs +++ b/tests/ui/higher-ranked/trait-bounds/issue-59311.rs @@ -15,9 +15,9 @@ where for<'a> &'a V: Trait + 'static, { v.t(|| {}); - //~^ ERROR: implementation of `Trait` is not general enough - //~| ERROR: implementation of `Trait` is not general enough - //~| ERROR: higher-ranked lifetime error + //~^ ERROR implementation of `Trait` is not general enough + //~| ERROR implementation of `Trait` is not general enough + //~| ERROR higher-ranked lifetime error } fn main() {} diff --git a/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89118.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89118.rs index fffb54f86ca03..ab42bc2f0cc0b 100644 --- a/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89118.rs +++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89118.rs @@ -17,16 +17,16 @@ trait TimerContext { impl TimerContext for C where C: StackContext, - //~^ ERROR: is not satisfied [E0277] + //~^ ERROR is not satisfied [E0277] { type Handler = Ctx; - //~^ ERROR: is not satisfied [E0277] + //~^ ERROR is not satisfied [E0277] } struct EthernetWorker(C) where Ctx<()>: for<'a> BufferUdpStateContext<&'a ()>; impl EthernetWorker {} -//~^ ERROR: is not satisfied [E0277] +//~^ ERROR is not satisfied [E0277] fn main() {} diff --git a/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/norm-before-method-resolution-opaque-type.rs b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/norm-before-method-resolution-opaque-type.rs index f881fcb779fa8..4fd6d87115dc4 100644 --- a/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/norm-before-method-resolution-opaque-type.rs +++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/norm-before-method-resolution-opaque-type.rs @@ -19,7 +19,7 @@ where for<'a> X: Trait<'a>, for<'a> >::Out<()>: Copy, { - let x = *x; //[old]~ ERROR: cannot move out of `*x` + let x = *x; //[old]~ ERROR cannot move out of `*x` todo!(); } diff --git a/tests/ui/impl-trait/associated-type-cycle.rs b/tests/ui/impl-trait/associated-type-cycle.rs index 4c1fc1a0fa612..df4610fc16fbc 100644 --- a/tests/ui/impl-trait/associated-type-cycle.rs +++ b/tests/ui/impl-trait/associated-type-cycle.rs @@ -4,7 +4,7 @@ trait Foo { } impl Foo for Box { - //~^ ERROR: the value of the associated type `Bar` in `Foo` must be specified + //~^ ERROR the value of the associated type `Bar` in `Foo` must be specified type Bar = ::Bar; fn foo(self) -> ::Bar { (*self).foo() diff --git a/tests/ui/impl-trait/associated-type-undefine.rs b/tests/ui/impl-trait/associated-type-undefine.rs index 895525960fc1a..b895ae7242dca 100644 --- a/tests/ui/impl-trait/associated-type-undefine.rs +++ b/tests/ui/impl-trait/associated-type-undefine.rs @@ -16,13 +16,13 @@ impl Foo for u32 { impl Foo for () { type Bar = impl Sized; - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type type Gat = ::Bar; // Because we encounter `Gat` first, we never walk into another `Gat` // again, thus missing the opaque type that we could be defining. fn foo(self) -> (::Gat, ::Gat) { ((), ()) - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } } diff --git a/tests/ui/impl-trait/auto-trait-leak.rs b/tests/ui/impl-trait/auto-trait-leak.rs index de4f523c23aa1..bc7de49594eb2 100644 --- a/tests/ui/impl-trait/auto-trait-leak.rs +++ b/tests/ui/impl-trait/auto-trait-leak.rs @@ -16,7 +16,7 @@ fn cycle1() -> impl Clone { fn cycle2() -> impl Clone { send(cycle1().clone()); - //~^ ERROR: cannot check whether the hidden type of opaque type satisfies auto traits + //~^ ERROR cannot check whether the hidden type of opaque type satisfies auto traits Rc::new(String::from("foo")) } diff --git a/tests/ui/impl-trait/auto-trait-selection-freeze.rs b/tests/ui/impl-trait/auto-trait-selection-freeze.rs index 7306a1c41f746..b5a34cc0e85e6 100644 --- a/tests/ui/impl-trait/auto-trait-selection-freeze.rs +++ b/tests/ui/impl-trait/auto-trait-selection-freeze.rs @@ -17,7 +17,7 @@ impl Trait for T {} impl Trait for T {} fn foo() -> impl Sized { if false { is_trait(foo()) } else { Default::default() } - //~^ ERROR: type annotations needed + //~^ ERROR type annotations needed } fn main() {} diff --git a/tests/ui/impl-trait/auto-trait-selection.rs b/tests/ui/impl-trait/auto-trait-selection.rs index ee5612459c257..2b0383d48b906 100644 --- a/tests/ui/impl-trait/auto-trait-selection.rs +++ b/tests/ui/impl-trait/auto-trait-selection.rs @@ -13,7 +13,7 @@ impl Trait for T {} impl Trait for T {} fn foo() -> impl Sized { if false { is_trait(foo()) } else { Default::default() } - //~^ ERROR: type annotations needed + //~^ ERROR type annotations needed } fn main() {} diff --git a/tests/ui/impl-trait/bound-normalization-fail.rs b/tests/ui/impl-trait/bound-normalization-fail.rs index f6e5e6c17aa53..6c37a7a3c934f 100644 --- a/tests/ui/impl-trait/bound-normalization-fail.rs +++ b/tests/ui/impl-trait/bound-normalization-fail.rs @@ -23,7 +23,7 @@ mod impl_trait { /// `T::Assoc` can't be normalized any further here. fn foo_fail() -> impl FooLike { - //~^ ERROR: type mismatch + //~^ ERROR type mismatch Foo(()) } } @@ -39,7 +39,7 @@ mod lifetimes { /// Missing bound constraining `Assoc`, `T::Assoc` can't be normalized further. fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike { - //~^ ERROR: type mismatch + //~^ ERROR type mismatch Foo(()) } } diff --git a/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.rs b/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.rs index 7fb2ff3b2bcc6..74ef827142db1 100644 --- a/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.rs +++ b/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.rs @@ -12,9 +12,9 @@ impl MyDebug for &() { fn my_foo() -> impl std::fmt::Debug { if false { let x = &my_foo(); - //[next]~^ ERROR: type annotations needed + //[next]~^ ERROR type annotations needed x.my_debug(); - //[current]~^ ERROR: no method named `my_debug` + //[current]~^ ERROR no method named `my_debug` } () } diff --git a/tests/ui/impl-trait/call_method_without_import.rs b/tests/ui/impl-trait/call_method_without_import.rs index d62777ea2835d..8b6868beb7e4b 100644 --- a/tests/ui/impl-trait/call_method_without_import.rs +++ b/tests/ui/impl-trait/call_method_without_import.rs @@ -15,7 +15,7 @@ fn foo(f: &mut std::fmt::Formatter<'_>) -> impl std::fmt::Debug { if false { let x = foo(f); x.fmt(f); - //[no_import]~^ ERROR: no method named `fmt` found + //[no_import]~^ ERROR no method named `fmt` found } () } @@ -24,7 +24,7 @@ fn foo1(f: &mut std::fmt::Formatter<'_>) -> impl std::fmt::Debug { if false { let x = &mut foo(f); x.fmt(f); - //[no_import]~^ ERROR: no method named `fmt` found + //[no_import]~^ ERROR no method named `fmt` found } () } diff --git a/tests/ui/impl-trait/extra-impl-in-trait-impl.fixed b/tests/ui/impl-trait/extra-impl-in-trait-impl.fixed index 886fc1d005802..4f0b2b1282a47 100644 --- a/tests/ui/impl-trait/extra-impl-in-trait-impl.fixed +++ b/tests/ui/impl-trait/extra-impl-in-trait-impl.fixed @@ -4,14 +4,14 @@ struct S(T); struct S2; impl Default for S { - //~^ ERROR: unexpected `impl` keyword - //~| HELP: remove the extra `impl` + //~^ ERROR unexpected `impl` keyword + //~| HELP remove the extra `impl` fn default() -> Self { todo!() } } impl Default for S2 { - //~^ ERROR: unexpected `impl` keyword - //~| HELP: remove the extra `impl` + //~^ ERROR unexpected `impl` keyword + //~| HELP remove the extra `impl` fn default() -> Self { todo!() } } diff --git a/tests/ui/impl-trait/extra-impl-in-trait-impl.rs b/tests/ui/impl-trait/extra-impl-in-trait-impl.rs index f3271993867cb..9e5cfca12ac42 100644 --- a/tests/ui/impl-trait/extra-impl-in-trait-impl.rs +++ b/tests/ui/impl-trait/extra-impl-in-trait-impl.rs @@ -4,14 +4,14 @@ struct S(T); struct S2; impl impl Default for S { - //~^ ERROR: unexpected `impl` keyword - //~| HELP: remove the extra `impl` + //~^ ERROR unexpected `impl` keyword + //~| HELP remove the extra `impl` fn default() -> Self { todo!() } } impl impl Default for S2 { - //~^ ERROR: unexpected `impl` keyword - //~| HELP: remove the extra `impl` + //~^ ERROR unexpected `impl` keyword + //~| HELP remove the extra `impl` fn default() -> Self { todo!() } } diff --git a/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs b/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs index df43250f15153..aa71ace3faf54 100644 --- a/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs +++ b/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs @@ -4,9 +4,9 @@ #![allow(warnings)] fn ice() -> impl AsRef { - //[edition2015]~^ ERROR: the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied [E0277] - //[edition2021]~^^ ERROR: expected a type, found a trait [E0782] - //[edition2021]~| ERROR: expected a type, found a trait [E0782] + //[edition2015]~^ ERROR the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied [E0277] + //[edition2021]~^^ ERROR expected a type, found a trait [E0782] + //[edition2021]~| ERROR expected a type, found a trait [E0782] todo!() } diff --git a/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.rs b/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.rs index a5a37dbb210fe..0835258d7c2b3 100644 --- a/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.rs +++ b/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.rs @@ -24,7 +24,7 @@ struct Y; impl X for Y { type LineStream<'c, 'd> = impl Stream; //~^ ERROR type `LineStream` has 0 type parameters but its trait declaration has 1 type parameter - //~| ERROR: unconstrained opaque type + //~| ERROR unconstrained opaque type type LineStreamFut<'a, Repr> = impl Future>; fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {} //~^ method `line_stream` is not a member of trait `X` diff --git a/tests/ui/impl-trait/in-assoc-type-unconstrained.rs b/tests/ui/impl-trait/in-assoc-type-unconstrained.rs index c395b4195a05f..0842a175e163e 100644 --- a/tests/ui/impl-trait/in-assoc-type-unconstrained.rs +++ b/tests/ui/impl-trait/in-assoc-type-unconstrained.rs @@ -6,8 +6,8 @@ mod compare_ty { } impl Trait for () { type Ty = Option; - //~^ ERROR: unconstrained opaque type - //~| ERROR: type mismatch resolving `::Ty::{opaque#0}> as IntoIterator>::Item == ()` + //~^ ERROR unconstrained opaque type + //~| ERROR type mismatch resolving `::Ty::{opaque#0}> as IntoIterator>::Item == ()` } } @@ -18,9 +18,9 @@ mod compare_method { } impl Trait for () { type Ty = impl Sized; - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type fn method() -> () {} - //~^ ERROR: method `method` has an incompatible type for trait + //~^ ERROR method `method` has an incompatible type for trait } } diff --git a/tests/ui/impl-trait/in-assoc-type.rs b/tests/ui/impl-trait/in-assoc-type.rs index 38ad2fa6f02ee..804fb244e11fc 100644 --- a/tests/ui/impl-trait/in-assoc-type.rs +++ b/tests/ui/impl-trait/in-assoc-type.rs @@ -18,7 +18,7 @@ impl Foo<()> for () { impl Foo for () { type Bar = u32; fn foo(&self) -> >::Bar {} - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } fn main() {} diff --git a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs index ff265e576b90f..feec2cffd6f16 100644 --- a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs +++ b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs @@ -6,9 +6,9 @@ struct Bar; impl Foo for Bar { fn foo>(self) -> impl Foo { - //~^ ERROR: the trait bound `impl Foo: Foo` is not satisfied [E0277] - //~| ERROR: the trait bound `Bar: Foo` is not satisfied [E0277] - //~| ERROR: impl has stricter requirements than trait + //~^ ERROR the trait bound `impl Foo: Foo` is not satisfied [E0277] + //~| ERROR the trait bound `Bar: Foo` is not satisfied [E0277] + //~| ERROR impl has stricter requirements than trait self } } diff --git a/tests/ui/impl-trait/issue-72911.rs b/tests/ui/impl-trait/issue-72911.rs index 63f4898f4306b..9183368f934cc 100644 --- a/tests/ui/impl-trait/issue-72911.rs +++ b/tests/ui/impl-trait/issue-72911.rs @@ -9,12 +9,12 @@ pub fn gather_all() -> impl Iterator { } fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator { - //~^ ERROR: failed to resolve + //~^ ERROR failed to resolve unimplemented!() } fn lint_files() -> impl Iterator { - //~^ ERROR: failed to resolve + //~^ ERROR failed to resolve unimplemented!() } diff --git a/tests/ui/impl-trait/issues/issue-21659-show-relevant-trait-impls-3.rs b/tests/ui/impl-trait/issues/issue-21659-show-relevant-trait-impls-3.rs index 41f48cb56933e..f2d27b88276eb 100644 --- a/tests/ui/impl-trait/issues/issue-21659-show-relevant-trait-impls-3.rs +++ b/tests/ui/impl-trait/issues/issue-21659-show-relevant-trait-impls-3.rs @@ -18,5 +18,5 @@ fn main() { let f1 = Bar; f1.foo(1usize); - //~^ error: method named `foo` found for struct `Bar` in the current scope + //~^ error method named `foo` found for struct `Bar` in the current scope } diff --git a/tests/ui/impl-trait/issues/issue-70877.rs b/tests/ui/impl-trait/issues/issue-70877.rs index 0f0a1b5187d3f..bb9f97ef97d06 100644 --- a/tests/ui/impl-trait/issues/issue-70877.rs +++ b/tests/ui/impl-trait/issues/issue-70877.rs @@ -23,17 +23,17 @@ pub fn quux(st: FooArg) -> FooRet { pub type Foo = impl Iterator; #[define_opaque(Foo)] pub fn ham() -> Foo { - //~^ ERROR: item does not constrain `FooRet::{opaque#0}` + //~^ ERROR item does not constrain `FooRet::{opaque#0}` Bar(1) } #[define_opaque(Foo)] pub fn oof() -> impl std::fmt::Debug { - //~^ ERROR: item does not constrain `FooRet::{opaque#0}` - //~| ERROR: item does not constrain `Foo::{opaque#0}` + //~^ ERROR item does not constrain `FooRet::{opaque#0}` + //~| ERROR item does not constrain `Foo::{opaque#0}` let mut bar = ham(); let func = bar.next().unwrap(); return func(&"oof"); - //~^ ERROR: opaque type's hidden type cannot be another opaque type + //~^ ERROR opaque type's hidden type cannot be another opaque type } fn main() { diff --git a/tests/ui/impl-trait/issues/issue-86800.rs b/tests/ui/impl-trait/issues/issue-86800.rs index cf82467b72ee3..3bfa8558ad4a0 100644 --- a/tests/ui/impl-trait/issues/issue-86800.rs +++ b/tests/ui/impl-trait/issues/issue-86800.rs @@ -22,7 +22,7 @@ type TransactionFuture<'__, O> = impl '__ + Future #[define_opaque(TransactionFuture)] fn execute_transaction_fut<'f, F, O>( - //~^ ERROR: item does not constrain + //~^ ERROR item does not constrain f: F, ) -> impl FnOnce(&mut dyn Transaction) -> TransactionFuture<'_, O> where @@ -34,7 +34,7 @@ where impl Context { #[define_opaque(TransactionFuture)] async fn do_transaction( - //~^ ERROR: item does not constrain + //~^ ERROR item does not constrain &self, f: impl FnOnce(&mut dyn Transaction) -> TransactionFuture<'_, O>, ) -> TransactionResult { diff --git a/tests/ui/impl-trait/issues/issue-92305.rs b/tests/ui/impl-trait/issues/issue-92305.rs index be98ce807ec5c..77340a48a3904 100644 --- a/tests/ui/impl-trait/issues/issue-92305.rs +++ b/tests/ui/impl-trait/issues/issue-92305.rs @@ -3,8 +3,8 @@ use std::iter; fn f(data: &[T]) -> impl Iterator { - //~^ ERROR: missing generics for struct `Vec` [E0107] - //~| ERROR: missing generics for struct `Vec` [E0107] + //~^ ERROR missing generics for struct `Vec` [E0107] + //~| ERROR missing generics for struct `Vec` [E0107] iter::empty() } diff --git a/tests/ui/impl-trait/method-resolution2.rs b/tests/ui/impl-trait/method-resolution2.rs index 88d4f3d9896c7..3d28a29c1db6d 100644 --- a/tests/ui/impl-trait/method-resolution2.rs +++ b/tests/ui/impl-trait/method-resolution2.rs @@ -23,7 +23,7 @@ fn foo(x: bool) -> Bar { if x { let x = foo(false); x.bar(); - //[next]~^ ERROR: multiple applicable items in scope + //[next]~^ ERROR multiple applicable items in scope } Bar(42_i32) } diff --git a/tests/ui/impl-trait/method-resolution3.rs b/tests/ui/impl-trait/method-resolution3.rs index 8c47ef4fc75c7..822f69b9741da 100644 --- a/tests/ui/impl-trait/method-resolution3.rs +++ b/tests/ui/impl-trait/method-resolution3.rs @@ -19,7 +19,7 @@ fn foo(x: bool) -> Bar { if x { let x = foo(false); x.bar(); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope } todo!() } diff --git a/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs b/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs index 9762ac982721f..30516a98831af 100644 --- a/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs +++ b/tests/ui/impl-trait/must_outlive_least_region_or_bound.rs @@ -1,10 +1,10 @@ use std::fmt::Debug; fn elided(x: &i32) -> impl Copy { x } -//~^ ERROR: captures lifetime that does not appear in bounds +//~^ ERROR captures lifetime that does not appear in bounds fn explicit<'a>(x: &'a i32) -> impl Copy { x } -//~^ ERROR: captures lifetime that does not appear in bounds +//~^ ERROR captures lifetime that does not appear in bounds fn elided2(x: &i32) -> impl Copy + 'static { x } //~^ ERROR lifetime may not live long enough @@ -16,16 +16,16 @@ fn foo<'a>(x: &i32) -> impl Copy + 'a { x } //~^ ERROR explicit lifetime required in the type of `x` fn elided3(x: &i32) -> Box { Box::new(x) } -//~^ ERROR: lifetime may not live long enough +//~^ ERROR lifetime may not live long enough fn explicit3<'a>(x: &'a i32) -> Box { Box::new(x) } -//~^ ERROR: lifetime may not live long enough +//~^ ERROR lifetime may not live long enough fn elided4(x: &i32) -> Box { Box::new(x) } -//~^ ERROR: lifetime may not live long enough +//~^ ERROR lifetime may not live long enough fn explicit4<'a>(x: &'a i32) -> Box { Box::new(x) } -//~^ ERROR: lifetime may not live long enough +//~^ ERROR lifetime may not live long enough fn elided5(x: &i32) -> (Box, impl Debug) { (Box::new(x), x) } //~^ ERROR lifetime may not live long enough @@ -40,7 +40,7 @@ fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } // only 'a was expected. fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) { move |_| println!("{}", y) - //~^ ERROR: captures lifetime that does not appear in bounds + //~^ ERROR captures lifetime that does not appear in bounds } fn ty_param_wont_outlive_static(x: T) -> impl Debug + 'static { diff --git a/tests/ui/impl-trait/nested-rpit-hrtb.rs b/tests/ui/impl-trait/nested-rpit-hrtb.rs index 11d79bcff7371..48259113ba59e 100644 --- a/tests/ui/impl-trait/nested-rpit-hrtb.rs +++ b/tests/ui/impl-trait/nested-rpit-hrtb.rs @@ -58,7 +58,7 @@ fn two_htrb_outlives() -> impl for<'a> Foo<'a, Assoc = impl for<'b> Sized + 'b> // This should resolve. fn two_htrb_trait_param_uses() -> impl for<'a> Bar<'a, Assoc = impl for<'b> Qux<'b>> {} -//~^ ERROR: the trait bound `for<'a, 'b> &'a (): Qux<'b>` is not satisfied +//~^ ERROR the trait bound `for<'a, 'b> &'a (): Qux<'b>` is not satisfied // `'b` is not in scope for the outlives bound. fn two_htrb_outlives_uses() -> impl for<'a> Bar<'a, Assoc = impl for<'b> Sized + 'b> {} diff --git a/tests/ui/impl-trait/opt-out-bound-not-satisfied.rs b/tests/ui/impl-trait/opt-out-bound-not-satisfied.rs index 27c493a13bf91..eb86e61e0cb27 100644 --- a/tests/ui/impl-trait/opt-out-bound-not-satisfied.rs +++ b/tests/ui/impl-trait/opt-out-bound-not-satisfied.rs @@ -3,8 +3,8 @@ use std::future::Future; fn foo() -> impl ?Future { - //~^ ERROR: relaxing a default bound only does something for `?Sized` - //~| ERROR: relaxing a default bound only does something for `?Sized` + //~^ ERROR relaxing a default bound only does something for `?Sized` + //~| ERROR relaxing a default bound only does something for `?Sized` () } diff --git a/tests/ui/impl-trait/recursive-bound-eval.rs b/tests/ui/impl-trait/recursive-bound-eval.rs index 7859c8983fc89..f73519c28e709 100644 --- a/tests/ui/impl-trait/recursive-bound-eval.rs +++ b/tests/ui/impl-trait/recursive-bound-eval.rs @@ -18,7 +18,7 @@ impl E> Parser for T { pub fn recursive_fn() -> impl Parser { move || recursive_fn().parse() - //[next]~^ ERROR: type annotations needed + //[next]~^ ERROR type annotations needed } fn main() {} diff --git a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.rs b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.rs index 5b9c40ecedea8..47a72f463193d 100644 --- a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.rs +++ b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.rs @@ -8,8 +8,8 @@ mod a { impl PartialEq<(Bar, i32)> for Bar { #[define_opaque(Foo)] fn eq(&self, _other: &(Foo, i32)) -> bool { - //~^ ERROR: `eq` has an incompatible type for trait - //~| ERROR: item does not constrain `a::Foo::{opaque#0}` + //~^ ERROR `eq` has an incompatible type for trait + //~| ERROR item does not constrain `a::Foo::{opaque#0}` true } } @@ -17,13 +17,13 @@ mod a { mod b { type Foo = impl PartialEq<(Foo, i32)>; - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type struct Bar; impl PartialEq<(Foo, i32)> for Bar { fn eq(&self, _other: &(Bar, i32)) -> bool { - //~^ ERROR: `eq` has an incompatible type for trait + //~^ ERROR `eq` has an incompatible type for trait true } } diff --git a/tests/ui/impl-trait/static-return-lifetime-infered.rs b/tests/ui/impl-trait/static-return-lifetime-infered.rs index 36ef9ea444345..b215f767ce163 100644 --- a/tests/ui/impl-trait/static-return-lifetime-infered.rs +++ b/tests/ui/impl-trait/static-return-lifetime-infered.rs @@ -5,11 +5,11 @@ struct A { impl A { fn iter_values_anon(&self) -> impl Iterator { self.x.iter().map(|a| a.0) - //~^ ERROR: captures lifetime that does not appear in bounds + //~^ ERROR captures lifetime that does not appear in bounds } fn iter_values<'a>(&'a self) -> impl Iterator { self.x.iter().map(|a| a.0) - //~^ ERROR: captures lifetime that does not appear in bounds + //~^ ERROR captures lifetime that does not appear in bounds } } diff --git a/tests/ui/impl-trait/trait_upcasting_reference_mismatch.rs b/tests/ui/impl-trait/trait_upcasting_reference_mismatch.rs index bed88db1accee..ddd999733647b 100644 --- a/tests/ui/impl-trait/trait_upcasting_reference_mismatch.rs +++ b/tests/ui/impl-trait/trait_upcasting_reference_mismatch.rs @@ -5,7 +5,7 @@ trait Trait {} impl Trait for U {} fn hello() -> &'static (dyn Trait + Send) { - //~^ ERROR: type annotations needed + //~^ ERROR type annotations needed if false { let x = hello(); let _: &'static dyn Trait<()> = &x; diff --git a/tests/ui/impl-trait/two_tait_defining_each_other2.rs b/tests/ui/impl-trait/two_tait_defining_each_other2.rs index 6c454bba5023f..82124ae187629 100644 --- a/tests/ui/impl-trait/two_tait_defining_each_other2.rs +++ b/tests/ui/impl-trait/two_tait_defining_each_other2.rs @@ -10,7 +10,7 @@ trait Foo {} #[define_opaque(A, B)] fn muh(x: A) -> B { - //[next]~^ ERROR: cannot satisfy `_ == A` + //[next]~^ ERROR cannot satisfy `_ == A` x // B's hidden type is A (opaquely) //[current]~^ ERROR opaque type's hidden type cannot be another opaque type } diff --git a/tests/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs b/tests/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs index 77b2407e304fe..078d9fc753509 100644 --- a/tests/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs +++ b/tests/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs @@ -6,7 +6,7 @@ use std::fmt::Debug; fn main() { - //~^ ERROR: item does not constrain + //~^ ERROR item does not constrain type Existential = impl Debug; #[define_opaque(Existential)] diff --git a/tests/ui/impl-trait/unactionable_diagnostic.fixed b/tests/ui/impl-trait/unactionable_diagnostic.fixed index e9ab9f2cf18ae..d5c9f49a8d290 100644 --- a/tests/ui/impl-trait/unactionable_diagnostic.fixed +++ b/tests/ui/impl-trait/unactionable_diagnostic.fixed @@ -14,12 +14,12 @@ fn foo<'x, P>( } pub fn bar<'t, T: 't>( - //~^ HELP: consider adding an explicit lifetime bound + //~^ HELP consider adding an explicit lifetime bound post: T, x: &'t Foo, ) -> &'t impl Trait { foo(post, x) - //~^ ERROR: the parameter type `T` may not live long enough + //~^ ERROR the parameter type `T` may not live long enough } fn main() {} diff --git a/tests/ui/impl-trait/unactionable_diagnostic.rs b/tests/ui/impl-trait/unactionable_diagnostic.rs index 7e65650277a4a..cd4130f9147b0 100644 --- a/tests/ui/impl-trait/unactionable_diagnostic.rs +++ b/tests/ui/impl-trait/unactionable_diagnostic.rs @@ -14,12 +14,12 @@ fn foo<'x, P>( } pub fn bar<'t, T>( - //~^ HELP: consider adding an explicit lifetime bound + //~^ HELP consider adding an explicit lifetime bound post: T, x: &'t Foo, ) -> &'t impl Trait { foo(post, x) - //~^ ERROR: the parameter type `T` may not live long enough + //~^ ERROR the parameter type `T` may not live long enough } fn main() {} diff --git a/tests/ui/impl-trait/unsized_coercion.rs b/tests/ui/impl-trait/unsized_coercion.rs index 2cbf0d25d7ec6..06e45fd269d5a 100644 --- a/tests/ui/impl-trait/unsized_coercion.rs +++ b/tests/ui/impl-trait/unsized_coercion.rs @@ -12,7 +12,7 @@ impl Trait for u32 {} fn hello() -> Box { if true { let x = hello(); - //[next]~^ ERROR: the size for values of type `dyn Trait` cannot be known at compilation time + //[next]~^ ERROR the size for values of type `dyn Trait` cannot be known at compilation time let y: Box = x; } Box::new(1u32) diff --git a/tests/ui/impl-trait/unsized_coercion2.rs b/tests/ui/impl-trait/unsized_coercion2.rs index 7368d47dbe2c0..7ed8609798d42 100644 --- a/tests/ui/impl-trait/unsized_coercion2.rs +++ b/tests/ui/impl-trait/unsized_coercion2.rs @@ -13,7 +13,7 @@ fn hello() -> Box { if true { let x = hello(); let y: Box = x; - //[old]~^ ERROR: the size for values of type `impl Trait + ?Sized` cannot be know + //[old]~^ ERROR the size for values of type `impl Trait + ?Sized` cannot be know } Box::new(1u32) } diff --git a/tests/ui/impl-trait/unsized_coercion3.rs b/tests/ui/impl-trait/unsized_coercion3.rs index ebfbb2955de55..a76c3f13f6ccd 100644 --- a/tests/ui/impl-trait/unsized_coercion3.rs +++ b/tests/ui/impl-trait/unsized_coercion3.rs @@ -11,9 +11,9 @@ impl Trait for u32 {} fn hello() -> Box { if true { let x = hello(); - //[next]~^ ERROR: the trait bound `dyn Send: Trait` is not satisfied + //[next]~^ ERROR the trait bound `dyn Send: Trait` is not satisfied let y: Box = x; - //[old]~^ ERROR: the size for values of type `impl Trait + ?Sized` cannot be know + //[old]~^ ERROR the size for values of type `impl Trait + ?Sized` cannot be know } Box::new(1u32) } diff --git a/tests/ui/impl-trait/unsized_coercion5.rs b/tests/ui/impl-trait/unsized_coercion5.rs index 51ae4f20671e0..3fbbb3e3b2d85 100644 --- a/tests/ui/impl-trait/unsized_coercion5.rs +++ b/tests/ui/impl-trait/unsized_coercion5.rs @@ -13,7 +13,7 @@ fn hello() -> Box { if true { let x = hello(); let y: Box = x as Box; - //[old]~^ ERROR: the size for values of type `impl Trait + ?Sized` cannot be know + //[old]~^ ERROR the size for values of type `impl Trait + ?Sized` cannot be know } Box::new(1u32) } diff --git a/tests/ui/impl-trait/where-allowed.rs b/tests/ui/impl-trait/where-allowed.rs index 1c3c66c537ff9..38296523cf570 100644 --- a/tests/ui/impl-trait/where-allowed.rs +++ b/tests/ui/impl-trait/where-allowed.rs @@ -44,7 +44,7 @@ fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!() } // Allowed (but it's still ambiguous; nothing constrains the RPIT in this body). fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() } -//~^ ERROR: type annotations needed +//~^ ERROR type annotations needed // Disallowed fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() } @@ -62,7 +62,7 @@ fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() } // Allowed fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() } -//~^ ERROR: type annotations needed +//~^ ERROR type annotations needed // Disallowed fn in_Fn_parameter_in_generics (_: F) { panic!() } diff --git a/tests/ui/imports/append-import-suggestion.rs b/tests/ui/imports/append-import-suggestion.rs index 6b75804b86fcb..87ba11ab5245d 100644 --- a/tests/ui/imports/append-import-suggestion.rs +++ b/tests/ui/imports/append-import-suggestion.rs @@ -11,6 +11,6 @@ mod mod2 { } use mod2::{sub_mod::TraitA}; -//~^ ERROR: module `sub_mod` is private +//~^ ERROR module `sub_mod` is private fn main() {} diff --git a/tests/ui/imports/cycle-import-in-std-1.rs b/tests/ui/imports/cycle-import-in-std-1.rs index 2fa492c155d7a..331b8ca6edddd 100644 --- a/tests/ui/imports/cycle-import-in-std-1.rs +++ b/tests/ui/imports/cycle-import-in-std-1.rs @@ -3,7 +3,7 @@ // https://github.com/rust-lang/rust/issues/124490 use ops::{self as std}; -//~^ ERROR: unresolved import `ops` +//~^ ERROR unresolved import `ops` use std::collections::{self as ops}; fn main() {} diff --git a/tests/ui/imports/cycle-import-in-std-2.rs b/tests/ui/imports/cycle-import-in-std-2.rs index d73c57944bc29..8279a7c84bcd4 100644 --- a/tests/ui/imports/cycle-import-in-std-2.rs +++ b/tests/ui/imports/cycle-import-in-std-2.rs @@ -3,7 +3,7 @@ // https://github.com/rust-lang/rust/issues/125013 use ops::{self as std}; -//~^ ERROR: unresolved import `ops` +//~^ ERROR unresolved import `ops` use std::ops::Deref::{self as ops}; fn main() {} diff --git a/tests/ui/imports/glob-resolve1.rs b/tests/ui/imports/glob-resolve1.rs index 904b77117dafc..a24939bc83e89 100644 --- a/tests/ui/imports/glob-resolve1.rs +++ b/tests/ui/imports/glob-resolve1.rs @@ -27,11 +27,11 @@ fn main() { epriv(); //~ ERROR cannot find function `epriv` in this scope B; //~ ERROR expected value, found enum `B` C; //~ ERROR cannot find value `C` in this scope - import(); //~ ERROR: cannot find function `import` in this scope + import(); //~ ERROR cannot find function `import` in this scope - foo::(); //~ ERROR: cannot find type `A` in this scope - foo::(); //~ ERROR: cannot find type `C` in this scope - foo::(); //~ ERROR: cannot find type `D` in this scope + foo::(); //~ ERROR cannot find type `A` in this scope + foo::(); //~ ERROR cannot find type `C` in this scope + foo::(); //~ ERROR cannot find type `D` in this scope } mod other { diff --git a/tests/ui/imports/inaccessible_type_aliases.rs b/tests/ui/imports/inaccessible_type_aliases.rs index c3d4214e282d7..b84bd21cbc7ea 100644 --- a/tests/ui/imports/inaccessible_type_aliases.rs +++ b/tests/ui/imports/inaccessible_type_aliases.rs @@ -8,7 +8,7 @@ mod b { } fn main() { - let x: Foo = 100; //~ ERROR: cannot find type `Foo` in this scope - let y: Bar = 100; //~ ERROR: cannot find type `Bar` in this scope + let x: Foo = 100; //~ ERROR cannot find type `Foo` in this scope + let y: Bar = 100; //~ ERROR cannot find type `Bar` in this scope println!("x: {}, y: {}", x, y); } diff --git a/tests/ui/imports/issue-114682-2.rs b/tests/ui/imports/issue-114682-2.rs index e99bcf77ab62d..f25cd20f8a179 100644 --- a/tests/ui/imports/issue-114682-2.rs +++ b/tests/ui/imports/issue-114682-2.rs @@ -6,7 +6,7 @@ extern crate issue_114682_2_extern; use issue_114682_2_extern::max; type A = issue_114682_2_extern::max; -//~^ ERROR: expected type, found function `issue_114682_2_extern::max` +//~^ ERROR expected type, found function `issue_114682_2_extern::max` // FIXME: // The above error was emitted due to `(Mod(issue_114682_2_extern), Namespace(Type), Ident(max))` // being identified as an ambiguous item. diff --git a/tests/ui/imports/issue-13404.rs b/tests/ui/imports/issue-13404.rs index c5af827d50c4e..be387cd42d5e2 100644 --- a/tests/ui/imports/issue-13404.rs +++ b/tests/ui/imports/issue-13404.rs @@ -1,5 +1,5 @@ use a::f; -use b::f; //~ ERROR: unresolved import `b::f` [E0432] +use b::f; //~ ERROR unresolved import `b::f` [E0432] //~^ no `f` in `b` mod a { pub fn f() {} } diff --git a/tests/ui/imports/issue-8208.rs b/tests/ui/imports/issue-8208.rs index 1c566938f9d0e..877425666e392 100644 --- a/tests/ui/imports/issue-8208.rs +++ b/tests/ui/imports/issue-8208.rs @@ -1,13 +1,13 @@ -use self::*; //~ ERROR: unresolved import `self::*` [E0432] +use self::*; //~ ERROR unresolved import `self::*` [E0432] //~^ cannot glob-import a module into itself mod foo { - use foo::*; //~ ERROR: unresolved import `foo::*` [E0432] + use foo::*; //~ ERROR unresolved import `foo::*` [E0432] //~^ cannot glob-import a module into itself mod bar { use super::bar::*; - //~^ ERROR: unresolved import `super::bar::*` [E0432] + //~^ ERROR unresolved import `super::bar::*` [E0432] //~| cannot glob-import a module into itself } diff --git a/tests/ui/imports/multiple-extern-by-macro-for-buitlin.rs b/tests/ui/imports/multiple-extern-by-macro-for-buitlin.rs index f0e5e4b4325c1..25e03bde923d0 100644 --- a/tests/ui/imports/multiple-extern-by-macro-for-buitlin.rs +++ b/tests/ui/imports/multiple-extern-by-macro-for-buitlin.rs @@ -7,7 +7,7 @@ extern crate core; macro_rules! m { () => { extern crate std as core; - //~^ ERROR: the name `core` is defined multiple times + //~^ ERROR the name `core` is defined multiple times }; } diff --git a/tests/ui/imports/multiple-extern-by-macro-for-custom.rs b/tests/ui/imports/multiple-extern-by-macro-for-custom.rs index 6bf544566e301..07313716f1db1 100644 --- a/tests/ui/imports/multiple-extern-by-macro-for-custom.rs +++ b/tests/ui/imports/multiple-extern-by-macro-for-custom.rs @@ -8,7 +8,7 @@ extern crate empty; macro_rules! m { () => { extern crate std as empty; - //~^ ERROR: the name `empty` is defined multiple times + //~^ ERROR the name `empty` is defined multiple times }; } diff --git a/tests/ui/imports/multiple-extern-by-macro-for-inexist.rs b/tests/ui/imports/multiple-extern-by-macro-for-inexist.rs index c23f275b9ff9f..62cfe79befef3 100644 --- a/tests/ui/imports/multiple-extern-by-macro-for-inexist.rs +++ b/tests/ui/imports/multiple-extern-by-macro-for-inexist.rs @@ -3,12 +3,12 @@ // issue#128813 extern crate non_existent; -//~^ ERROR: can't find crate for `non_existent` +//~^ ERROR can't find crate for `non_existent` macro_rules! m { () => { extern crate std as non_existent; - //~^ ERROR: the name `non_existent` is defined multiple times + //~^ ERROR the name `non_existent` is defined multiple times }; } diff --git a/tests/ui/imports/multiple-extern-by-macro-for-underscore.rs b/tests/ui/imports/multiple-extern-by-macro-for-underscore.rs index ddf735d894753..a80df24eed3de 100644 --- a/tests/ui/imports/multiple-extern-by-macro-for-underscore.rs +++ b/tests/ui/imports/multiple-extern-by-macro-for-underscore.rs @@ -14,5 +14,5 @@ m!(); fn main() { use ::_; - //~^ ERROR: expected identifier, found reserved identifier `_` + //~^ ERROR expected identifier, found reserved identifier `_` } diff --git a/tests/ui/imports/no-pub-reexports-but-used.rs b/tests/ui/imports/no-pub-reexports-but-used.rs index c0d7964ea71e8..de2daab50f522 100644 --- a/tests/ui/imports/no-pub-reexports-but-used.rs +++ b/tests/ui/imports/no-pub-reexports-but-used.rs @@ -5,10 +5,10 @@ mod m { pub(crate) type A = u8; } -#[warn(unused_imports)] //~ NOTE: the lint level is defined here +#[warn(unused_imports)] //~ NOTE the lint level is defined here pub use m::*; -//~^ WARNING: glob import doesn't reexport anything with visibility `pub` because no imported item is public enough -//~| NOTE: the most public imported item is `pub(crate)` +//~^ WARNING glob import doesn't reexport anything with visibility `pub` because no imported item is public enough +//~| NOTE the most public imported item is `pub(crate)` fn main() { let _: A; diff --git a/tests/ui/imports/no-std-inject.rs b/tests/ui/imports/no-std-inject.rs index e9664a4dd480e..de3ff5f0c135d 100644 --- a/tests/ui/imports/no-std-inject.rs +++ b/tests/ui/imports/no-std-inject.rs @@ -1,6 +1,6 @@ #![no_std] -extern crate core; //~ ERROR: the name `core` is defined multiple times +extern crate core; //~ ERROR the name `core` is defined multiple times extern crate std; fn main() {} diff --git a/tests/ui/imports/pub-reexport-empty.rs b/tests/ui/imports/pub-reexport-empty.rs index 2a46f4c8de86c..1fe9154c548da 100644 --- a/tests/ui/imports/pub-reexport-empty.rs +++ b/tests/ui/imports/pub-reexport-empty.rs @@ -3,7 +3,7 @@ mod a {} pub use a::*; -//~^ ERROR: unused import: `a::*` +//~^ ERROR unused import: `a::*` mod b { mod c { @@ -20,6 +20,6 @@ mod d { } pub use d::*; -//~^ ERROR: unused import: `d::*` +//~^ ERROR unused import: `d::*` fn main() {} diff --git a/tests/ui/imports/resolve-other-libc.rs b/tests/ui/imports/resolve-other-libc.rs index e23083276ce2b..b9b6637861040 100644 --- a/tests/ui/imports/resolve-other-libc.rs +++ b/tests/ui/imports/resolve-other-libc.rs @@ -9,6 +9,6 @@ // error[E0658]: use of unstable library feature `rustc_private`: \ // this crate is being loaded from the sysroot // -extern crate libc; //~ ERROR: extern location for libc does not exist: test.rlib +extern crate libc; //~ ERROR extern location for libc does not exist: test.rlib fn main() {} diff --git a/tests/ui/imports/shadow-glob-module-resolution-1.rs b/tests/ui/imports/shadow-glob-module-resolution-1.rs index ba1e65cddc652..a0be51a4a042d 100644 --- a/tests/ui/imports/shadow-glob-module-resolution-1.rs +++ b/tests/ui/imports/shadow-glob-module-resolution-1.rs @@ -9,9 +9,9 @@ mod a { use a::*; use b::c; -//~^ ERROR: cannot determine resolution for the import -//~| ERROR: cannot determine resolution for the import -//~| ERROR: unresolved import `b::c` +//~^ ERROR cannot determine resolution for the import +//~| ERROR cannot determine resolution for the import +//~| ERROR unresolved import `b::c` use c as b; fn main() {} diff --git a/tests/ui/imports/shadow-glob-module-resolution-2.rs b/tests/ui/imports/shadow-glob-module-resolution-2.rs index 36bd72658ae84..01c2a7b2d3161 100644 --- a/tests/ui/imports/shadow-glob-module-resolution-2.rs +++ b/tests/ui/imports/shadow-glob-module-resolution-2.rs @@ -11,9 +11,9 @@ mod a { use a::*; use e as b; -//~^ ERROR: unresolved import `e` +//~^ ERROR unresolved import `e` use b::c::D as e; -//~^ ERROR: cannot determine resolution for the import -//~| ERROR: cannot determine resolution for the import +//~^ ERROR cannot determine resolution for the import +//~| ERROR cannot determine resolution for the import fn main() { } diff --git a/tests/ui/imports/shadow-glob-module-resolution-3.rs b/tests/ui/imports/shadow-glob-module-resolution-3.rs index f5a43373261b2..6b8037eda9a52 100644 --- a/tests/ui/imports/shadow-glob-module-resolution-3.rs +++ b/tests/ui/imports/shadow-glob-module-resolution-3.rs @@ -9,9 +9,9 @@ mod a { use a::*; use b::c; -//~^ ERROR: unresolved import `b::c` -//~| ERROR: cannot determine resolution for the import -//~| ERROR: cannot determine resolution for the import +//~^ ERROR unresolved import `b::c` +//~| ERROR cannot determine resolution for the import +//~| ERROR cannot determine resolution for the import use c as b; fn c() {} diff --git a/tests/ui/imports/shadow-glob-module-resolution-4.rs b/tests/ui/imports/shadow-glob-module-resolution-4.rs index 581cdc185d3f3..036f0671a242f 100644 --- a/tests/ui/imports/shadow-glob-module-resolution-4.rs +++ b/tests/ui/imports/shadow-glob-module-resolution-4.rs @@ -11,9 +11,9 @@ use a::*; use e as b; use b::C as e; -//~^ ERROR: unresolved import `b::C` -//~| ERROR: cannot determine resolution for the import -//~| ERROR: cannot determine resolution for the import +//~^ ERROR unresolved import `b::C` +//~| ERROR cannot determine resolution for the import +//~| ERROR cannot determine resolution for the import fn e() {} diff --git a/tests/ui/imports/unresolved-seg-after-ambiguous.rs b/tests/ui/imports/unresolved-seg-after-ambiguous.rs index dcabc528a85ed..6bb7340d28d7e 100644 --- a/tests/ui/imports/unresolved-seg-after-ambiguous.rs +++ b/tests/ui/imports/unresolved-seg-after-ambiguous.rs @@ -17,8 +17,8 @@ mod a { } use self::a::E::in_exist; -//~^ ERROR: unresolved import `self::a::E` -//~| WARNING: `E` is ambiguous -//~| WARNING: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! +//~^ ERROR unresolved import `self::a::E` +//~| WARNING `E` is ambiguous +//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! fn main() {} diff --git a/tests/ui/indexing/indexing-requires-a-uint.rs b/tests/ui/indexing/indexing-requires-a-uint.rs index dbe9b44a13890..d4a830f58fa33 100644 --- a/tests/ui/indexing/indexing-requires-a-uint.rs +++ b/tests/ui/indexing/indexing-requires-a-uint.rs @@ -3,12 +3,12 @@ fn main() { fn bar(_: T) {} - [0][0u8]; //~ ERROR: the type `[{integer}]` cannot be indexed by `u8` + [0][0u8]; //~ ERROR the type `[{integer}]` cannot be indexed by `u8` [0][0]; // should infer to be a usize let i = 0; // i is an IntVar [0][i]; // i should be locked to usize bar::(i); // i should not be re-coerced back to an isize - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/inference/hint-closure-signature-119266.rs b/tests/ui/inference/hint-closure-signature-119266.rs index 35be600fd6ab8..c874f7bac56b6 100644 --- a/tests/ui/inference/hint-closure-signature-119266.rs +++ b/tests/ui/inference/hint-closure-signature-119266.rs @@ -1,11 +1,11 @@ fn main() { let x = |a: u8, b: (usize, u32), c: fn() -> char| -> String { "I love beans.".to_string() }; - //~^ NOTE: the found closure + //~^ NOTE the found closure let x: fn(i32) = x; - //~^ ERROR: 5:22: 5:23: mismatched types [E0308] - //~| NOTE: incorrect number of function parameters - //~| NOTE: expected due to this - //~| NOTE: expected fn pointer `fn(i32)` - //~| NOTE: closure has signature: `fn(u8, (usize, u32), fn() -> char) -> String` + //~^ ERROR 5:22: 5:23: mismatched types [E0308] + //~| NOTE incorrect number of function parameters + //~| NOTE expected due to this + //~| NOTE expected fn pointer `fn(i32)` + //~| NOTE closure has signature: `fn(u8, (usize, u32), fn() -> char) -> String` } diff --git a/tests/ui/inference/issue-71309.rs b/tests/ui/inference/issue-71309.rs index c31107d8fed05..89ce3601ae119 100644 --- a/tests/ui/inference/issue-71309.rs +++ b/tests/ui/inference/issue-71309.rs @@ -1,6 +1,6 @@ fn foo(x: Result) -> Result<(), ()> { let y: u32 = x?; - //~^ ERROR: `?` operator has incompatible types + //~^ ERROR `?` operator has incompatible types Ok(()) } diff --git a/tests/ui/inference/issue-80816.rs b/tests/ui/inference/issue-80816.rs index 4d319b44987e2..e69d8506a8042 100644 --- a/tests/ui/inference/issue-80816.rs +++ b/tests/ui/inference/issue-80816.rs @@ -29,12 +29,12 @@ pub trait Access { } } impl, P: Deref> Access for P { - //~^ NOTE: required for `Arc>>` to implement `Access<_>` + //~^ NOTE required for `Arc>>` to implement `Access<_>` //~| NOTE unsatisfied trait bound introduced here type Guard = A::Guard; } impl Access for ArcSwapAny { - //~^ NOTE: multiple `impl`s satisfying `ArcSwapAny>: Access<_>` found + //~^ NOTE multiple `impl`s satisfying `ArcSwapAny>: Access<_>` found type Guard = Guard; } impl Access for ArcSwapAny> { @@ -48,8 +48,8 @@ pub struct ArcSwapAny { pub fn foo() { let s: Arc>> = unimplemented!(); let guard: Guard> = s.load(); - //~^ ERROR: type annotations needed - //~| HELP: try using a fully qualified path to specify the expected types + //~^ ERROR type annotations needed + //~| HELP try using a fully qualified path to specify the expected types } fn main() {} diff --git a/tests/ui/inference/issue-86162-1.rs b/tests/ui/inference/issue-86162-1.rs index 5a547eb38d1f9..d8d9a26bf0eec 100644 --- a/tests/ui/inference/issue-86162-1.rs +++ b/tests/ui/inference/issue-86162-1.rs @@ -5,5 +5,5 @@ fn gen() -> T { todo!() } fn main() { foo(gen()); //<- Do not suggest `foo::()`! - //~^ ERROR: type annotations needed + //~^ ERROR type annotations needed } diff --git a/tests/ui/inference/issue-86162-2.rs b/tests/ui/inference/issue-86162-2.rs index b8c75dd7728d2..e399ca677eca8 100644 --- a/tests/ui/inference/issue-86162-2.rs +++ b/tests/ui/inference/issue-86162-2.rs @@ -10,5 +10,5 @@ impl Foo { fn main() { Foo::bar(gen()); //<- Do not suggest `Foo::bar::()`! - //~^ ERROR: type annotations needed + //~^ ERROR type annotations needed } diff --git a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.rs b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.rs index 830a6390fce6d..c0f8582c4eca3 100644 --- a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.rs +++ b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.rs @@ -19,6 +19,6 @@ fn f() {} fn main() { ::Assoc {}; f(|a, b| a.cmp(b)); - //~^ ERROR: type annotations needed - //~| ERROR: this function takes 0 arguments but 1 argument was supplied + //~^ ERROR type annotations needed + //~| ERROR this function takes 0 arguments but 1 argument was supplied } diff --git a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.rs b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.rs index 6b786332a8f43..fef3ccb9900cc 100644 --- a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.rs +++ b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.rs @@ -23,6 +23,6 @@ fn main() { a: 1 }; f(|a, b| a.cmp(b)); - //~^ ERROR: type annotations needed - //~| ERROR: this function takes 0 arguments but 1 argument was supplied + //~^ ERROR type annotations needed + //~| ERROR this function takes 0 arguments but 1 argument was supplied } diff --git a/tests/ui/inference/need_type_info/type-alias.rs b/tests/ui/inference/need_type_info/type-alias.rs index b24af2d484954..be9bbe969db05 100644 --- a/tests/ui/inference/need_type_info/type-alias.rs +++ b/tests/ui/inference/need_type_info/type-alias.rs @@ -15,7 +15,7 @@ fn direct_alias() { type IndirectAlias = Ty>; fn indirect_alias() { - IndirectAlias::new(); //~ ERROR: type annotations needed + IndirectAlias::new(); //~ ERROR type annotations needed // FIXME: This should also emit an error. // // Added it separately as `type-alias-indirect.rs` diff --git a/tests/ui/infinite/infinite-assoc.rs b/tests/ui/infinite/infinite-assoc.rs index d128a7e0d2d59..ba2d1bf3f0197 100644 --- a/tests/ui/infinite/infinite-assoc.rs +++ b/tests/ui/infinite/infinite-assoc.rs @@ -10,7 +10,7 @@ impl Trait for S { type T = (); } struct A((A, ::T)); -//~^ ERROR: invalid `?` in type -//~| ERROR: recursive type `A` has infinite size +//~^ ERROR invalid `?` in type +//~| ERROR recursive type `A` has infinite size fn main() {} diff --git a/tests/ui/infinite/infinite-type-alias-mutual-recursion.rs b/tests/ui/infinite/infinite-type-alias-mutual-recursion.rs index cf9ea0db4cbee..b1dbb95532a63 100644 --- a/tests/ui/infinite/infinite-type-alias-mutual-recursion.rs +++ b/tests/ui/infinite/infinite-type-alias-mutual-recursion.rs @@ -5,10 +5,10 @@ type X1 = X2; //[gated]~^ ERROR cycle detected when expanding type alias `X1` -//[feature]~^^ ERROR: overflow normalizing the type alias `X2` +//[feature]~^^ ERROR overflow normalizing the type alias `X2` type X2 = X3; -//[feature]~^ ERROR: overflow normalizing the type alias `X3` +//[feature]~^ ERROR overflow normalizing the type alias `X3` type X3 = X1; -//[feature]~^ ERROR: overflow normalizing the type alias `X1` +//[feature]~^ ERROR overflow normalizing the type alias `X1` fn main() {} diff --git a/tests/ui/infinite/infinite-vec-type-recursion.rs b/tests/ui/infinite/infinite-vec-type-recursion.rs index c051d11d376c8..2145fdc6725ba 100644 --- a/tests/ui/infinite/infinite-vec-type-recursion.rs +++ b/tests/ui/infinite/infinite-vec-type-recursion.rs @@ -5,7 +5,7 @@ type X = Vec; //[gated]~^ ERROR cycle detected -//[feature]~^^ ERROR: overflow normalizing the type alias `X` +//[feature]~^^ ERROR overflow normalizing the type alias `X` #[rustfmt::skip] fn main() { let b: X = Vec::new(); } diff --git a/tests/ui/inline-const/const-expr-generic-err2.rs b/tests/ui/inline-const/const-expr-generic-err2.rs index 49cbdbfda5da8..94223a91035b0 100644 --- a/tests/ui/inline-const/const-expr-generic-err2.rs +++ b/tests/ui/inline-const/const-expr-generic-err2.rs @@ -1,6 +1,6 @@ fn foo() { let _ = [0u8; const { std::mem::size_of::() }]; - //~^ ERROR: constant expression depends on a generic parameter + //~^ ERROR constant expression depends on a generic parameter } fn main() { diff --git a/tests/ui/inline-const/cross-const-control-flow-125846.rs b/tests/ui/inline-const/cross-const-control-flow-125846.rs index 109764a1812d2..3086e381d05ed 100644 --- a/tests/ui/inline-const/cross-const-control-flow-125846.rs +++ b/tests/ui/inline-const/cross-const-control-flow-125846.rs @@ -2,44 +2,44 @@ fn foo() { const { return } - //~^ ERROR: return statement outside of function body + //~^ ERROR return statement outside of function body } fn labelled_block_break() { 'a: { const { break 'a } } - //~^ ERROR: `break` outside of a loop or labeled block - //~| ERROR: use of unreachable label + //~^ ERROR `break` outside of a loop or labeled block + //~| ERROR use of unreachable label } fn loop_break() { loop { const { break } - //~^ ERROR: `break` outside of a loop or labeled block + //~^ ERROR `break` outside of a loop or labeled block } } fn continue_to_labelled_block() { 'a: { const { continue 'a } } - //~^ ERROR: `continue` outside of a loop - //~| ERROR: use of unreachable label + //~^ ERROR `continue` outside of a loop + //~| ERROR use of unreachable label } fn loop_continue() { loop { const { continue } - //~^ ERROR: `continue` outside of a loop + //~^ ERROR `continue` outside of a loop } } async fn await_across_const_block() { const { async {}.await } - //~^ ERROR: `await` is only allowed inside `async` functions and blocks + //~^ ERROR `await` is only allowed inside `async` functions and blocks } fn reference_to_non_constant_in_const_block() { let x = 1; const { &x }; - //~^ ERROR: attempt to use a non-constant value in a constant + //~^ ERROR attempt to use a non-constant value in a constant } diff --git a/tests/ui/inline-const/promotion.rs b/tests/ui/inline-const/promotion.rs index 2cfb8a0d19fc3..5313ee00256d2 100644 --- a/tests/ui/inline-const/promotion.rs +++ b/tests/ui/inline-const/promotion.rs @@ -14,7 +14,7 @@ fn main() { let v = const { if mk_false() { let _x: &'static i32 = &div_by_zero(); - //~^ ERROR: temporary value dropped while borrowed + //~^ ERROR temporary value dropped while borrowed } 42 }; diff --git a/tests/ui/inline-const/referencing-local-variables.rs b/tests/ui/inline-const/referencing-local-variables.rs index f9f0fef07f08b..1cffc979ff776 100644 --- a/tests/ui/inline-const/referencing-local-variables.rs +++ b/tests/ui/inline-const/referencing-local-variables.rs @@ -1,6 +1,6 @@ const fn test_me(a: usize) -> usize { const { a } - //~^ ERROR: attempt to use a non-constant value in a constant + //~^ ERROR attempt to use a non-constant value in a constant } fn main() {} diff --git a/tests/ui/inline-const/uninit-local.rs b/tests/ui/inline-const/uninit-local.rs index 548c053affc7f..5d2b0a6d3cd3d 100644 --- a/tests/ui/inline-const/uninit-local.rs +++ b/tests/ui/inline-const/uninit-local.rs @@ -1,6 +1,6 @@ fn main() { let _my_usize = const { let x: bool; - while x {} //~ ERROR: `x` isn't initialized + while x {} //~ ERROR `x` isn't initialized }; } diff --git a/tests/ui/intrinsics/issue-28575.rs b/tests/ui/intrinsics/issue-28575.rs index 141136d25b215..03335ce2fc54a 100644 --- a/tests/ui/intrinsics/issue-28575.rs +++ b/tests/ui/intrinsics/issue-28575.rs @@ -5,5 +5,5 @@ extern "C" { } fn main() { - FOO() //~ ERROR: use of extern static is unsafe + FOO() //~ ERROR use of extern static is unsafe } diff --git a/tests/ui/intrinsics/not-overridden.rs b/tests/ui/intrinsics/not-overridden.rs index 2359eee8b26d6..e0e468d568ca6 100644 --- a/tests/ui/intrinsics/not-overridden.rs +++ b/tests/ui/intrinsics/not-overridden.rs @@ -13,5 +13,5 @@ pub const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) fn main() { unsafe { const_deallocate(std::ptr::null_mut(), 0, 0) } - //~^ ERROR: must be overridden + //~^ ERROR must be overridden } diff --git a/tests/ui/issues/issue-10465.rs b/tests/ui/issues/issue-10465.rs index d899c3ffa9129..4dd90d954ad45 100644 --- a/tests/ui/issues/issue-10465.rs +++ b/tests/ui/issues/issue-10465.rs @@ -14,7 +14,7 @@ pub mod b { use b::B; fn foo(b: &B) { - b.foo(); //~ ERROR: no method named `foo` found + b.foo(); //~ ERROR no method named `foo` found } } diff --git a/tests/ui/issues/issue-10545.rs b/tests/ui/issues/issue-10545.rs index acd0714961906..cf7f458b446ca 100644 --- a/tests/ui/issues/issue-10545.rs +++ b/tests/ui/issues/issue-10545.rs @@ -3,7 +3,7 @@ mod a { impl S { } } -fn foo(_: a::S) { //~ ERROR: struct `S` is private +fn foo(_: a::S) { //~ ERROR struct `S` is private } fn main() {} diff --git a/tests/ui/issues/issue-10877.rs b/tests/ui/issues/issue-10877.rs index 15a383175b975..b0c43640bca99 100644 --- a/tests/ui/issues/issue-10877.rs +++ b/tests/ui/issues/issue-10877.rs @@ -3,13 +3,13 @@ struct Foo { } extern "C" { fn foo(1: ()); - //~^ ERROR: patterns aren't allowed in foreign function declarations + //~^ ERROR patterns aren't allowed in foreign function declarations fn bar((): isize); - //~^ ERROR: patterns aren't allowed in foreign function declarations + //~^ ERROR patterns aren't allowed in foreign function declarations fn baz(Foo { x }: isize); - //~^ ERROR: patterns aren't allowed in foreign function declarations + //~^ ERROR patterns aren't allowed in foreign function declarations fn qux((x, y): ()); - //~^ ERROR: patterns aren't allowed in foreign function declarations + //~^ ERROR patterns aren't allowed in foreign function declarations fn this_is_actually_ok(a: usize); fn and_so_is_this(_: usize); } diff --git a/tests/ui/issues/issue-11192.rs b/tests/ui/issues/issue-11192.rs index 1a3d8c9fe5869..f28928f41bc04 100644 --- a/tests/ui/issues/issue-11192.rs +++ b/tests/ui/issues/issue-11192.rs @@ -18,5 +18,5 @@ fn main() { println!("access {}", foo.x); }; test(&*ptr); - //~^ ERROR: cannot borrow `*ptr` as immutable + //~^ ERROR cannot borrow `*ptr` as immutable } diff --git a/tests/ui/issues/issue-11680.rs b/tests/ui/issues/issue-11680.rs index 9f3dfebcc812c..8679794985bca 100644 --- a/tests/ui/issues/issue-11680.rs +++ b/tests/ui/issues/issue-11680.rs @@ -4,8 +4,8 @@ extern crate issue_11680 as other; fn main() { let _b = other::Foo::Bar(1); - //~^ ERROR: enum `Foo` is private + //~^ ERROR enum `Foo` is private let _b = other::test::Foo::Bar(1); - //~^ ERROR: enum `Foo` is private + //~^ ERROR enum `Foo` is private } diff --git a/tests/ui/issues/issue-11844.rs b/tests/ui/issues/issue-11844.rs index f974a4702960a..20dfb41cffc7b 100644 --- a/tests/ui/issues/issue-11844.rs +++ b/tests/ui/issues/issue-11844.rs @@ -1,7 +1,7 @@ fn main() { let a = Some(Box::new(1)); match a { - Ok(a) => //~ ERROR: mismatched types + Ok(a) => //~ ERROR mismatched types println!("{}",a), None => panic!() } diff --git a/tests/ui/issues/issue-12041.rs b/tests/ui/issues/issue-12041.rs index 091e8fe8b2a66..3e4eb4ddb7aea 100644 --- a/tests/ui/issues/issue-12041.rs +++ b/tests/ui/issues/issue-12041.rs @@ -6,7 +6,7 @@ fn main() { let _t = thread::spawn(move|| -> () { loop { let tx = tx; - //~^ ERROR: use of moved value: `tx` + //~^ ERROR use of moved value: `tx` tx.send(1); } }); diff --git a/tests/ui/issues/issue-12127.rs b/tests/ui/issues/issue-12127.rs index 199d542e816f4..ee8dc80bd642f 100644 --- a/tests/ui/issues/issue-12127.rs +++ b/tests/ui/issues/issue-12127.rs @@ -9,6 +9,6 @@ fn main() { to_fn_once(move|| { f(); f(); - //~^ ERROR: use of moved value: `f` + //~^ ERROR use of moved value: `f` })() } diff --git a/tests/ui/issues/issue-12567.rs b/tests/ui/issues/issue-12567.rs index 1b2a37de47539..4038405599917 100644 --- a/tests/ui/issues/issue-12567.rs +++ b/tests/ui/issues/issue-12567.rs @@ -1,7 +1,7 @@ fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) { match (l1, l2) { - //~^ ERROR: cannot move out of type `[T]`, a non-copy slice - //~| ERROR: cannot move out of type `[T]`, a non-copy slice + //~^ ERROR cannot move out of type `[T]`, a non-copy slice + //~| ERROR cannot move out of type `[T]`, a non-copy slice (&[], &[]) => println!("both empty"), (&[], &[hd, ..]) | (&[hd, ..], &[]) => println!("one empty"), diff --git a/tests/ui/issues/issue-13407.rs b/tests/ui/issues/issue-13407.rs index 7794be37b8507..faf613d3d04da 100644 --- a/tests/ui/issues/issue-13407.rs +++ b/tests/ui/issues/issue-13407.rs @@ -4,6 +4,6 @@ mod A { fn main() { A::C = 1; - //~^ ERROR: mismatched types - //~| ERROR: unit struct `C` is private + //~^ ERROR mismatched types + //~| ERROR unit struct `C` is private } diff --git a/tests/ui/issues/issue-16725.rs b/tests/ui/issues/issue-16725.rs index 7741f828c4740..f4b2b85f2fbf8 100644 --- a/tests/ui/issues/issue-16725.rs +++ b/tests/ui/issues/issue-16725.rs @@ -4,5 +4,5 @@ extern crate issue_16725 as foo; fn main() { unsafe { foo::bar(); } - //~^ ERROR: function `bar` is private + //~^ ERROR function `bar` is private } diff --git a/tests/ui/issues/issue-17252.rs b/tests/ui/issues/issue-17252.rs index 5941e10f8b068..8bf1276d57146 100644 --- a/tests/ui/issues/issue-17252.rs +++ b/tests/ui/issues/issue-17252.rs @@ -4,7 +4,7 @@ fn main() { let _x: [u8; FOO]; // caused stack overflow prior to fix let _y: usize = 1 + { const BAR: usize = BAR; - //~^ ERROR: cycle + //~^ ERROR cycle let _z: [u8; BAR]; // caused stack overflow prior to fix 1 }; diff --git a/tests/ui/issues/issue-17999.rs b/tests/ui/issues/issue-17999.rs index 941f1e7755afe..e8c7115c391d8 100644 --- a/tests/ui/issues/issue-17999.rs +++ b/tests/ui/issues/issue-17999.rs @@ -2,9 +2,9 @@ fn main() { for _ in 1..101 { - let x = (); //~ ERROR: unused variable: `x` + let x = (); //~ ERROR unused variable: `x` match () { - a => {} //~ ERROR: unused variable: `a` + a => {} //~ ERROR unused variable: `a` } } } diff --git a/tests/ui/issues/issue-20225.rs b/tests/ui/issues/issue-20225.rs index 0c8e6e402e2ce..e4a7164de80cc 100644 --- a/tests/ui/issues/issue-20225.rs +++ b/tests/ui/issues/issue-20225.rs @@ -4,19 +4,19 @@ struct Foo; impl<'a, T> Fn<(&'a T,)> for Foo { extern "rust-call" fn call(&self, (_,): (T,)) {} - //~^ ERROR: has an incompatible type for trait + //~^ ERROR has an incompatible type for trait } impl<'a, T> FnMut<(&'a T,)> for Foo { extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} - //~^ ERROR: has an incompatible type for trait + //~^ ERROR has an incompatible type for trait } impl<'a, T> FnOnce<(&'a T,)> for Foo { type Output = (); extern "rust-call" fn call_once(self, (_,): (T,)) {} - //~^ ERROR: has an incompatible type for trait + //~^ ERROR has an incompatible type for trait } fn main() {} diff --git a/tests/ui/issues/issue-20413.rs b/tests/ui/issues/issue-20413.rs index 138a235e675e3..81f0fa7a12a91 100644 --- a/tests/ui/issues/issue-20413.rs +++ b/tests/ui/issues/issue-20413.rs @@ -3,10 +3,10 @@ trait Foo { } struct NoData; -//~^ ERROR: parameter `T` is never used +//~^ ERROR parameter `T` is never used impl Foo for T where NoData: Foo { - //~^ ERROR: overflow evaluating the requirement + //~^ ERROR overflow evaluating the requirement fn answer(self) { let val: NoData = NoData; } @@ -25,14 +25,14 @@ struct AlmostNoData(Option); struct EvenLessData(Option); impl Bar for T where EvenLessData: Baz { -//~^ ERROR: overflow evaluating the requirement +//~^ ERROR overflow evaluating the requirement fn answer(self) { let val: EvenLessData = EvenLessData(None); } } impl Baz for T where AlmostNoData: Bar { -//~^ ERROR: overflow evaluating the requirement +//~^ ERROR overflow evaluating the requirement fn answer(self) { let val: NoData = AlmostNoData(None); } diff --git a/tests/ui/issues/issue-20714.rs b/tests/ui/issues/issue-20714.rs index 3aa39bb7388fa..f2ddef0c7209d 100644 --- a/tests/ui/issues/issue-20714.rs +++ b/tests/ui/issues/issue-20714.rs @@ -1,5 +1,5 @@ struct G; fn main() { - let g = G(); //~ ERROR: expected function, found struct `G` + let g = G(); //~ ERROR expected function, found struct `G` } diff --git a/tests/ui/issues/issue-21160.rs b/tests/ui/issues/issue-21160.rs index 10136ba11aa5c..e9009fefc45b6 100644 --- a/tests/ui/issues/issue-21160.rs +++ b/tests/ui/issues/issue-21160.rs @@ -6,6 +6,6 @@ impl Bar { #[derive(Hash)] struct Foo(Bar); -//~^ error: `Bar: Hash` is not satisfied +//~^ error `Bar: Hash` is not satisfied fn main() {} diff --git a/tests/ui/issues/issue-21174.rs b/tests/ui/issues/issue-21174.rs index 07827425116af..785dc86fe1484 100644 --- a/tests/ui/issues/issue-21174.rs +++ b/tests/ui/issues/issue-21174.rs @@ -5,7 +5,7 @@ trait Trait<'a> { fn foo<'a, T: Trait<'a>>(value: T::A) { let new: T::B = unsafe { std::mem::transmute(value) }; -//~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types +//~^ ERROR cannot transmute between types of different sizes, or dependently-sized types } fn main() { } diff --git a/tests/ui/issues/issue-21202.rs b/tests/ui/issues/issue-21202.rs index 66f6ef3b83fb5..22ecc4803a311 100644 --- a/tests/ui/issues/issue-21202.rs +++ b/tests/ui/issues/issue-21202.rs @@ -8,7 +8,7 @@ mod B { use crate1::A::Foo; fn bar(f: Foo) { Foo::foo(&f); - //~^ ERROR: method `foo` is private + //~^ ERROR method `foo` is private } } diff --git a/tests/ui/issues/issue-2150.rs b/tests/ui/issues/issue-2150.rs index baa1dde0fc2e8..a10c3f9812355 100644 --- a/tests/ui/issues/issue-2150.rs +++ b/tests/ui/issues/issue-2150.rs @@ -6,7 +6,7 @@ fn fail_len(v: Vec ) -> usize { let mut i = 3; panic!(); for x in &v { i += 1; } - //~^ ERROR: unreachable statement + //~^ ERROR unreachable statement return i; } fn main() {} diff --git a/tests/ui/issues/issue-21701.rs b/tests/ui/issues/issue-21701.rs index bfa03c5e42f8d..fc75bfb614431 100644 --- a/tests/ui/issues/issue-21701.rs +++ b/tests/ui/issues/issue-21701.rs @@ -1,13 +1,13 @@ fn foo(t: U) { let y = t(); -//~^ ERROR: expected function, found `U` +//~^ ERROR expected function, found `U` } struct Bar; pub fn some_func() { let f = Bar(); -//~^ ERROR: expected function, found struct `Bar` +//~^ ERROR expected function, found struct `Bar` } fn main() { diff --git a/tests/ui/issues/issue-22468.rs b/tests/ui/issues/issue-22468.rs index 197a19c038c4b..8212bd71f5c82 100644 --- a/tests/ui/issues/issue-22468.rs +++ b/tests/ui/issues/issue-22468.rs @@ -1,7 +1,7 @@ fn main() { let foo = "bar"; let x = foo("baz"); - //~^ ERROR: expected function, found `&str` + //~^ ERROR expected function, found `&str` } fn foo(file: &str) -> bool { diff --git a/tests/ui/issues/issue-22599.rs b/tests/ui/issues/issue-22599.rs index 05096e5c18531..0e733f0cf6c51 100644 --- a/tests/ui/issues/issue-22599.rs +++ b/tests/ui/issues/issue-22599.rs @@ -5,6 +5,6 @@ fn f(_: i32) {} fn main() { let mut v = 0; f(v); - v = match 0 { a => 0 }; //~ ERROR: unused variable: `a` + v = match 0 { a => 0 }; //~ ERROR unused variable: `a` f(v); } diff --git a/tests/ui/issues/issue-2848.rs b/tests/ui/issues/issue-2848.rs index 34181acdd0556..4110780194b71 100644 --- a/tests/ui/issues/issue-2848.rs +++ b/tests/ui/issues/issue-2848.rs @@ -12,7 +12,7 @@ fn main() { use bar::foo::{alpha, charlie}; match alpha { alpha | beta => {} //~ ERROR variable `beta` is not bound in all patterns - //~^ ERROR: `beta` is named the same as one of the variants + //~^ ERROR `beta` is named the same as one of the variants charlie => {} } } diff --git a/tests/ui/issues/issue-28971.rs b/tests/ui/issues/issue-28971.rs index 8e7a2fe0ef209..325416b183a2c 100644 --- a/tests/ui/issues/issue-28971.rs +++ b/tests/ui/issues/issue-28971.rs @@ -13,5 +13,5 @@ fn main(){ fn foo(f: F) where F: FnMut() { f(); - //~^ ERROR: cannot borrow + //~^ ERROR cannot borrow } diff --git a/tests/ui/issues/issue-31511.rs b/tests/ui/issues/issue-31511.rs index 6c8df1157c6c8..eaa96019dee6f 100644 --- a/tests/ui/issues/issue-31511.rs +++ b/tests/ui/issues/issue-31511.rs @@ -1,6 +1,6 @@ fn cast_thin_to_fat(x: *const ()) { x as *const [u8]; - //~^ ERROR: cannot cast thin pointer `*const ()` to wide pointer `*const [u8]` + //~^ ERROR cannot cast thin pointer `*const ()` to wide pointer `*const [u8]` } fn main() {} diff --git a/tests/ui/issues/issue-31910.rs b/tests/ui/issues/issue-31910.rs index 19cfc4627c756..328c77a4615f3 100644 --- a/tests/ui/issues/issue-31910.rs +++ b/tests/ui/issues/issue-31910.rs @@ -1,5 +1,5 @@ enum Enum { - //~^ ERROR: `T` is never used + //~^ ERROR `T` is never used X = Trait::Number, //~^ ERROR mismatched types //~| expected `isize`, found `i32` diff --git a/tests/ui/issues/issue-37665.rs b/tests/ui/issues/issue-37665.rs index db74b1f025987..e860a22694a89 100644 --- a/tests/ui/issues/issue-37665.rs +++ b/tests/ui/issues/issue-37665.rs @@ -6,5 +6,5 @@ fn main() { let mut foo : String = "hello".to_string(); foo.push(MAIN_SEPARATOR); println!("{}", foo); - let x: () = 0; //~ ERROR: mismatched types + let x: () = 0; //~ ERROR mismatched types } diff --git a/tests/ui/issues/issue-3993.rs b/tests/ui/issues/issue-3993.rs index 9dea54ea779e1..e287e3d7dbdd9 100644 --- a/tests/ui/issues/issue-3993.rs +++ b/tests/ui/issues/issue-3993.rs @@ -1,4 +1,4 @@ -use zoo::fly; //~ ERROR: function `fly` is private +use zoo::fly; //~ ERROR function `fly` is private mod zoo { fn fly() {} diff --git a/tests/ui/issues/issue-4265.rs b/tests/ui/issues/issue-4265.rs index 99b13283bc972..6ec32baf79c67 100644 --- a/tests/ui/issues/issue-4265.rs +++ b/tests/ui/issues/issue-4265.rs @@ -5,7 +5,7 @@ struct Foo { impl Foo { fn bar() { Foo { baz: 0 }.bar(); - //~^ ERROR: no method named `bar` found + //~^ ERROR no method named `bar` found } fn bar() { //~ ERROR duplicate definitions diff --git a/tests/ui/issues/issue-43424.rs b/tests/ui/issues/issue-43424.rs index b3f76d8b04992..4227f497db3fd 100644 --- a/tests/ui/issues/issue-43424.rs +++ b/tests/ui/issues/issue-43424.rs @@ -7,6 +7,6 @@ macro_rules! m { } } -m!(inline); //~ ERROR: unexpected generic arguments in path +m!(inline); //~ ERROR unexpected generic arguments in path fn main() {} diff --git a/tests/ui/issues/issue-44405.rs b/tests/ui/issues/issue-44405.rs index d404b9044dd6f..f7e838e6013c5 100644 --- a/tests/ui/issues/issue-44405.rs +++ b/tests/ui/issues/issue-44405.rs @@ -18,5 +18,5 @@ impl<'a> Index<&'a bool> for Container { fn main() { let container = Container(Test); let mut val = true; - container[&mut val].test(); //~ ERROR: cannot borrow data + container[&mut val].test(); //~ ERROR cannot borrow data } diff --git a/tests/ui/issues/issue-47486.rs b/tests/ui/issues/issue-47486.rs index d686f02a9fe39..b8fb1c9d3c4a0 100644 --- a/tests/ui/issues/issue-47486.rs +++ b/tests/ui/issues/issue-47486.rs @@ -1,4 +1,4 @@ fn main() { - () < std::mem::size_of::<_>(); //~ ERROR: mismatched types - [0u8; std::mem::size_of::<_>()]; //~ ERROR: type annotations needed + () < std::mem::size_of::<_>(); //~ ERROR mismatched types + [0u8; std::mem::size_of::<_>()]; //~ ERROR type annotations needed } diff --git a/tests/ui/issues/issue-48276.rs b/tests/ui/issues/issue-48276.rs index f55c056fa67d2..dba7ebad5be6a 100644 --- a/tests/ui/issues/issue-48276.rs +++ b/tests/ui/issues/issue-48276.rs @@ -9,7 +9,7 @@ struct A; impl<'a, 'b> MyFrom for &'a str { fn from(self: &'a Self) -> &'b str { - //~^ ERROR: method `from` has a `&self` declaration in the impl, but not in the trait + //~^ ERROR method `from` has a `&self` declaration in the impl, but not in the trait "asdf" } } @@ -18,14 +18,14 @@ struct B; impl From for B { fn from(&self) -> B { - //~^ ERROR: method `from` has a `&self` declaration in the impl, but not in the trait + //~^ ERROR method `from` has a `&self` declaration in the impl, but not in the trait B } } impl From for &'static str { fn from(&self) -> &'static str { - //~^ ERROR: method `from` has a `&self` declaration in the impl, but not in the trait + //~^ ERROR method `from` has a `&self` declaration in the impl, but not in the trait "" } } diff --git a/tests/ui/issues/issue-49919.rs b/tests/ui/issues/issue-49919.rs index 780f338681dd3..c1aa0bcf16934 100644 --- a/tests/ui/issues/issue-49919.rs +++ b/tests/ui/issues/issue-49919.rs @@ -1,6 +1,6 @@ fn foo<'a, T: 'a>(t: T) -> Box &'a T + 'a> { let foo: Box Fn() -> &'c T> = Box::new(move || &t); - //~^ ERROR: binding for associated type + //~^ ERROR binding for associated type unimplemented!() } diff --git a/tests/ui/issues/issue-50571.fixed b/tests/ui/issues/issue-50571.fixed index 37ed729be8168..81ec766458386 100644 --- a/tests/ui/issues/issue-50571.fixed +++ b/tests/ui/issues/issue-50571.fixed @@ -3,7 +3,7 @@ #![allow(dead_code)] trait Foo { fn foo(_: [i32; 2]) {} - //~^ ERROR: patterns aren't allowed in methods without bodies + //~^ ERROR patterns aren't allowed in methods without bodies } fn main() {} diff --git a/tests/ui/issues/issue-50571.rs b/tests/ui/issues/issue-50571.rs index 97a042d3ec1fb..fa098dc107f7e 100644 --- a/tests/ui/issues/issue-50571.rs +++ b/tests/ui/issues/issue-50571.rs @@ -3,7 +3,7 @@ #![allow(dead_code)] trait Foo { fn foo([a, b]: [i32; 2]) {} - //~^ ERROR: patterns aren't allowed in methods without bodies + //~^ ERROR patterns aren't allowed in methods without bodies } fn main() {} diff --git a/tests/ui/issues/issue-51632-try-desugar-incompatible-types.rs b/tests/ui/issues/issue-51632-try-desugar-incompatible-types.rs index 35402dff67553..69d7316331fff 100644 --- a/tests/ui/issues/issue-51632-try-desugar-incompatible-types.rs +++ b/tests/ui/issues/issue-51632-try-desugar-incompatible-types.rs @@ -6,7 +6,7 @@ fn missing_discourses() -> Result { fn forbidden_narratives() -> Result { missing_discourses()? - //~^ ERROR: `?` operator has incompatible types + //~^ ERROR `?` operator has incompatible types } fn main() {} diff --git a/tests/ui/issues/issue-51714.rs b/tests/ui/issues/issue-51714.rs index 03b50b7963ea5..a2537dbc1f56b 100644 --- a/tests/ui/issues/issue-51714.rs +++ b/tests/ui/issues/issue-51714.rs @@ -1,21 +1,21 @@ fn main() { - //~^ NOTE: not the enclosing function body - //~| NOTE: not the enclosing function body - //~| NOTE: not the enclosing function body - //~| NOTE: not the enclosing function body + //~^ NOTE not the enclosing function body + //~| NOTE not the enclosing function body + //~| NOTE not the enclosing function body + //~| NOTE not the enclosing function body |_: [_; return || {}]| {}; - //~^ ERROR: return statement outside of function body [E0572] - //~| NOTE: the return is part of this body... + //~^ ERROR return statement outside of function body [E0572] + //~| NOTE the return is part of this body... [(); return || {}]; - //~^ ERROR: return statement outside of function body [E0572] - //~| NOTE: the return is part of this body... + //~^ ERROR return statement outside of function body [E0572] + //~| NOTE the return is part of this body... [(); return |ice| {}]; - //~^ ERROR: return statement outside of function body [E0572] - //~| NOTE: the return is part of this body... + //~^ ERROR return statement outside of function body [E0572] + //~| NOTE the return is part of this body... [(); return while let Some(n) = Some(0) {}]; - //~^ ERROR: return statement outside of function body [E0572] - //~| NOTE: the return is part of this body... + //~^ ERROR return statement outside of function body [E0572] + //~| NOTE the return is part of this body... } diff --git a/tests/ui/issues/issue-54062.rs b/tests/ui/issues/issue-54062.rs index 093d6601d4e2e..5bcdcc51a820f 100644 --- a/tests/ui/issues/issue-54062.rs +++ b/tests/ui/issues/issue-54062.rs @@ -8,5 +8,5 @@ fn main() {} fn testing(test: Test) { let _ = test.comps.inner.try_lock(); - //~^ ERROR: field `inner` of struct `Mutex` is private + //~^ ERROR field `inner` of struct `Mutex` is private } diff --git a/tests/ui/issues/issue-5439.rs b/tests/ui/issues/issue-5439.rs index 852b264dc5dbf..910b18d160c9e 100644 --- a/tests/ui/issues/issue-5439.rs +++ b/tests/ui/issues/issue-5439.rs @@ -8,7 +8,7 @@ struct Bar { impl Bar { fn make_foo (&self, i: isize) -> Box { - return Box::new(Foo { nonexistent: self, foo: i }); //~ ERROR: no field named + return Box::new(Foo { nonexistent: self, foo: i }); //~ ERROR no field named } } diff --git a/tests/ui/issues/issue-5844.rs b/tests/ui/issues/issue-5844.rs index 23021207ae195..ac05c18d06f92 100644 --- a/tests/ui/issues/issue-5844.rs +++ b/tests/ui/issues/issue-5844.rs @@ -3,5 +3,5 @@ extern crate issue_5844_aux; fn main() { - issue_5844_aux::rand(); //~ ERROR: requires unsafe + issue_5844_aux::rand(); //~ ERROR requires unsafe } diff --git a/tests/ui/issues/issue-65131.rs b/tests/ui/issues/issue-65131.rs index 8b5345da900aa..290f2059995fc 100644 --- a/tests/ui/issues/issue-65131.rs +++ b/tests/ui/issues/issue-65131.rs @@ -12,7 +12,7 @@ fn main() { let mut x = 1; get_pair(&mut x, &mut x); - //~^ ERROR: cannot borrow `x` as mutable more than once at a time + //~^ ERROR cannot borrow `x` as mutable more than once at a time x10! { x10!{ x10!{ if x > 0 { x += 2 } else { x += 1 } } } } } diff --git a/tests/ui/issues/issue-66702-break-outside-loop-val.rs b/tests/ui/issues/issue-66702-break-outside-loop-val.rs index 05b86cbbf8f05..6cc507fb45ffa 100644 --- a/tests/ui/issues/issue-66702-break-outside-loop-val.rs +++ b/tests/ui/issues/issue-66702-break-outside-loop-val.rs @@ -3,7 +3,7 @@ fn main() { 'some_label: loop { || break 'some_label (); - //~^ ERROR: use of unreachable label `'some_label` - //~| ERROR: `break` inside of a closure + //~^ ERROR use of unreachable label `'some_label` + //~| ERROR `break` inside of a closure } } diff --git a/tests/ui/issues/issue-6738.rs b/tests/ui/issues/issue-6738.rs index a2f8dfe9c493c..36da92ea08ad5 100644 --- a/tests/ui/issues/issue-6738.rs +++ b/tests/ui/issues/issue-6738.rs @@ -4,7 +4,7 @@ struct Foo { impl Foo { fn add(&mut self, v: Foo){ self.x += v.x; - //~^ ERROR: binary assignment operation `+=` cannot be applied + //~^ ERROR binary assignment operation `+=` cannot be applied } } fn main() {} diff --git a/tests/ui/issues/issue-69455.rs b/tests/ui/issues/issue-69455.rs index a53aadcfad024..9bc3729adb85c 100644 --- a/tests/ui/issues/issue-69455.rs +++ b/tests/ui/issues/issue-69455.rs @@ -26,6 +26,6 @@ impl Test for u64 { fn main() { let xs: Vec = vec![1, 2, 3]; - println!("{}", 23u64.test(xs.iter().sum())); //~ ERROR: type annotations needed + println!("{}", 23u64.test(xs.iter().sum())); //~ ERROR type annotations needed //~^ ERROR type annotations needed } diff --git a/tests/ui/issues/issue-74082.rs b/tests/ui/issues/issue-74082.rs index e3e400c79d658..6b2275b3054a0 100644 --- a/tests/ui/issues/issue-74082.rs +++ b/tests/ui/issues/issue-74082.rs @@ -1,9 +1,9 @@ #![allow(dead_code)] -#[repr(i128)] //~ ERROR: attribute should be applied to an enum +#[repr(i128)] //~ ERROR attribute should be applied to an enum struct Foo; -#[repr(u128)] //~ ERROR: attribute should be applied to an enum +#[repr(u128)] //~ ERROR attribute should be applied to an enum struct Bar; fn main() {} diff --git a/tests/ui/issues/issue-83048.rs b/tests/ui/issues/issue-83048.rs index 6c941133a152c..c4b543bdf7ec8 100644 --- a/tests/ui/issues/issue-83048.rs +++ b/tests/ui/issues/issue-83048.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Z unpretty=thir-tree pub fn main() { - break; //~ ERROR: `break` outside of a loop or labeled block [E0268] + break; //~ ERROR `break` outside of a loop or labeled block [E0268] } diff --git a/tests/ui/issues/issue-87199.rs b/tests/ui/issues/issue-87199.rs index 6664119e57981..c0ffdb446a8d5 100644 --- a/tests/ui/issues/issue-87199.rs +++ b/tests/ui/issues/issue-87199.rs @@ -6,12 +6,12 @@ // Check that these function definitions only emit warnings, not errors fn arg(_: T) {} -//~^ ERROR: relaxing a default bound only does something for `?Sized` +//~^ ERROR relaxing a default bound only does something for `?Sized` fn ref_arg(_: &T) {} -//~^ ERROR: relaxing a default bound only does something for `?Sized` +//~^ ERROR relaxing a default bound only does something for `?Sized` fn ret() -> impl Iterator + ?Send { std::iter::empty() } -//~^ ERROR: relaxing a default bound only does something for `?Sized` -//~| ERROR: relaxing a default bound only does something for `?Sized` +//~^ ERROR relaxing a default bound only does something for `?Sized` +//~| ERROR relaxing a default bound only does something for `?Sized` // Check that there's no `?Sized` relaxation! fn main() { diff --git a/tests/ui/issues/issue-9725.rs b/tests/ui/issues/issue-9725.rs index 360effbd11947..4a38b60328686 100644 --- a/tests/ui/issues/issue-9725.rs +++ b/tests/ui/issues/issue-9725.rs @@ -2,6 +2,6 @@ struct A { foo: isize } fn main() { let A { foo, foo } = A { foo: 3 }; - //~^ ERROR: identifier `foo` is bound more than once in the same pattern - //~^^ ERROR: field `foo` bound multiple times + //~^ ERROR identifier `foo` is bound more than once in the same pattern + //~^^ ERROR field `foo` bound multiple times } diff --git a/tests/ui/issues/issue-98299.rs b/tests/ui/issues/issue-98299.rs index ba63d963475af..6136890042537 100644 --- a/tests/ui/issues/issue-98299.rs +++ b/tests/ui/issues/issue-98299.rs @@ -2,9 +2,9 @@ use std::convert::TryFrom; pub fn test_usage(p: ()) { SmallCString::try_from(p).map(|cstr| cstr); - //~^ ERROR: type annotations needed - //~| ERROR: type annotations needed - //~| ERROR: type annotations needed + //~^ ERROR type annotations needed + //~| ERROR type annotations needed + //~| ERROR type annotations needed } pub struct SmallCString {} diff --git a/tests/ui/keyword/keyword-false-as-identifier.rs b/tests/ui/keyword/keyword-false-as-identifier.rs index 6382f841b04ff..a0b72ac6c67fc 100644 --- a/tests/ui/keyword/keyword-false-as-identifier.rs +++ b/tests/ui/keyword/keyword-false-as-identifier.rs @@ -1,3 +1,3 @@ fn main() { - let false = 22; //~ error: mismatched types + let false = 22; //~ error mismatched types } diff --git a/tests/ui/keyword/keyword-true-as-identifier.rs b/tests/ui/keyword/keyword-true-as-identifier.rs index 8c4ad7e2a6697..22c67e53f2325 100644 --- a/tests/ui/keyword/keyword-true-as-identifier.rs +++ b/tests/ui/keyword/keyword-true-as-identifier.rs @@ -1,3 +1,3 @@ fn main() { - let true = 22; //~ error: mismatched types + let true = 22; //~ error mismatched types } diff --git a/tests/ui/kindck/kindck-impl-type-params.rs b/tests/ui/kindck/kindck-impl-type-params.rs index 707c5dbaec30e..e6ea01a1b99da 100644 --- a/tests/ui/kindck/kindck-impl-type-params.rs +++ b/tests/ui/kindck/kindck-impl-type-params.rs @@ -28,7 +28,7 @@ fn g(val: T) { fn foo<'a>() { let t: S<&'a isize> = S(marker::PhantomData); let a = &t as &dyn Gettable<&'a isize>; - //~^ ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn foo2<'a>() { diff --git a/tests/ui/kindck/kindck-send-object1.rs b/tests/ui/kindck/kindck-send-object1.rs index 76a9fc6019abc..ba28b1f7a054d 100644 --- a/tests/ui/kindck/kindck-send-object1.rs +++ b/tests/ui/kindck/kindck-send-object1.rs @@ -12,7 +12,7 @@ fn test51<'a>() { } fn test52<'a>() { assert_send::<&'a (dyn Dummy + Sync)>(); - //~^ ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } // ...unless they are properly bounded diff --git a/tests/ui/kinds-of-primitive-impl.rs b/tests/ui/kinds-of-primitive-impl.rs index f1c2ee8e5506e..d221a36836ee5 100644 --- a/tests/ui/kinds-of-primitive-impl.rs +++ b/tests/ui/kinds-of-primitive-impl.rs @@ -1,16 +1,16 @@ impl u8 { -//~^ error: cannot define inherent `impl` for primitive types +//~^ error cannot define inherent `impl` for primitive types pub const B: u8 = 0; } impl str { -//~^ error: cannot define inherent `impl` for primitive types +//~^ error cannot define inherent `impl` for primitive types fn foo() {} - fn bar(self) {} //~ ERROR: size for values of type `str` cannot be known + fn bar(self) {} //~ ERROR size for values of type `str` cannot be known } impl char { -//~^ error: cannot define inherent `impl` for primitive types +//~^ error cannot define inherent `impl` for primitive types pub const B: u8 = 0; pub const C: u8 = 0; fn foo() {} @@ -19,7 +19,7 @@ impl char { struct MyType; impl &MyType { -//~^ error: cannot define inherent `impl` for primitive types +//~^ error cannot define inherent `impl` for primitive types pub fn for_ref(self) {} } diff --git a/tests/ui/lang-items/duplicate.rs b/tests/ui/lang-items/duplicate.rs index 4594e9456a4ce..20d9b8762efd9 100644 --- a/tests/ui/lang-items/duplicate.rs +++ b/tests/ui/lang-items/duplicate.rs @@ -3,7 +3,7 @@ #[lang = "sized"] trait Sized {} -//~^ ERROR: duplicate lang item +//~^ ERROR duplicate lang item #[lang = "tuple_trait"] pub trait Tuple {} diff --git a/tests/ui/lang-items/issue-83471.rs b/tests/ui/lang-items/issue-83471.rs index 6be345ac50765..94d43d1664971 100644 --- a/tests/ui/lang-items/issue-83471.rs +++ b/tests/ui/lang-items/issue-83471.rs @@ -5,19 +5,19 @@ #![no_core] #[lang = "sized"] -//~^ ERROR: lang items are subject to change [E0658] +//~^ ERROR lang items are subject to change [E0658] trait Sized {} #[lang = "fn"] -//~^ ERROR: lang items are subject to change [E0658] -//~| ERROR: `fn` lang item must be applied to a trait with 1 generic argument +//~^ ERROR lang items are subject to change [E0658] +//~| ERROR `fn` lang item must be applied to a trait with 1 generic argument trait Fn { fn call(export_name); - //~^ ERROR: expected type - //~| WARNING: anonymous parameters are deprecated - //~| WARNING: this is accepted in the current edition + //~^ ERROR expected type + //~| WARNING anonymous parameters are deprecated + //~| WARNING this is accepted in the current edition } fn call_through_fn_trait() { a() - //~^ ERROR: cannot find function + //~^ ERROR cannot find function } diff --git a/tests/ui/lang-items/issue-87573.rs b/tests/ui/lang-items/issue-87573.rs index 7b805e8b0cdb6..54022829a1ca4 100644 --- a/tests/ui/lang-items/issue-87573.rs +++ b/tests/ui/lang-items/issue-87573.rs @@ -18,11 +18,11 @@ trait Sync {} impl Sync for bool {} #[lang = "drop_in_place"] -//~^ ERROR: `drop_in_place` lang item must be applied to a function with at least 1 generic argument +//~^ ERROR `drop_in_place` lang item must be applied to a function with at least 1 generic argument fn drop_fn() { while false {} } #[lang = "start"] -//~^ ERROR: `start` lang item must be applied to a function with 1 generic argument +//~^ ERROR `start` lang item must be applied to a function with 1 generic argument fn start(){} diff --git a/tests/ui/lang-items/lang-item-generic-requirements.rs b/tests/ui/lang-items/lang-item-generic-requirements.rs index 90ed5f3f0efd0..7cffd97efdd29 100644 --- a/tests/ui/lang-items/lang-item-generic-requirements.rs +++ b/tests/ui/lang-items/lang-item-generic-requirements.rs @@ -9,7 +9,7 @@ trait MySized {} #[lang = "add"] trait MyAdd<'a, T> {} -//~^^ ERROR: `add` lang item must be applied to a trait with 1 generic argument [E0718] +//~^^ ERROR `add` lang item must be applied to a trait with 1 generic argument [E0718] #[lang = "drop_in_place"] //~^ ERROR `drop_in_place` lang item must be applied to a function with at least 1 generic @@ -17,7 +17,7 @@ fn my_ptr_drop() {} #[lang = "index"] trait MyIndex<'a, T> {} -//~^^ ERROR: `index` lang item must be applied to a trait with 1 generic argument [E0718] +//~^^ ERROR `index` lang item must be applied to a trait with 1 generic argument [E0718] #[lang = "phantom_data"] //~^ ERROR `phantom_data` lang item must be applied to a struct with 1 generic argument diff --git a/tests/ui/late-bound-lifetimes/mismatched_arg_count.rs b/tests/ui/late-bound-lifetimes/mismatched_arg_count.rs index 792563fd82b35..eac066e0ee715 100644 --- a/tests/ui/late-bound-lifetimes/mismatched_arg_count.rs +++ b/tests/ui/late-bound-lifetimes/mismatched_arg_count.rs @@ -7,6 +7,6 @@ trait Trait<'a> { type Alias<'a, T> = >::Assoc; fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {} -//~^ error: type alias takes 1 lifetime argument but 2 lifetime arguments were supplied +//~^ error type alias takes 1 lifetime argument but 2 lifetime arguments were supplied fn main() {} diff --git a/tests/ui/layout/debug.rs b/tests/ui/layout/debug.rs index 90e3c58dad719..33153ebc92e04 100644 --- a/tests/ui/layout/debug.rs +++ b/tests/ui/layout/debug.rs @@ -5,49 +5,49 @@ #[rustc_layout(debug)] #[derive(Copy, Clone)] -enum E { Foo, Bar(!, i32, i32) } //~ ERROR: layout_of +enum E { Foo, Bar(!, i32, i32) } //~ ERROR layout_of #[rustc_layout(debug)] -struct S { f1: i32, f2: (), f3: i32 } //~ ERROR: layout_of +struct S { f1: i32, f2: (), f3: i32 } //~ ERROR layout_of #[rustc_layout(debug)] -union U { f1: (i32, i32), f3: i32 } //~ ERROR: layout_of +union U { f1: (i32, i32), f3: i32 } //~ ERROR layout_of #[rustc_layout(debug)] -type Test = Result; //~ ERROR: layout_of +type Test = Result; //~ ERROR layout_of #[rustc_layout(debug)] -type T = impl std::fmt::Debug; //~ ERROR: layout_of +type T = impl std::fmt::Debug; //~ ERROR layout_of #[define_opaque(T)] fn f() -> T { 0i32 } #[rustc_layout(debug)] -pub union V { //~ ERROR: layout_of +pub union V { //~ ERROR layout_of a: [u16; 0], b: u8, } #[rustc_layout(debug)] -pub union W { //~ ERROR: layout_of +pub union W { //~ ERROR layout_of b: u8, a: [u16; 0], } #[rustc_layout(debug)] -pub union Y { //~ ERROR: layout_of +pub union Y { //~ ERROR layout_of b: [u8; 0], a: [u16; 0], } #[rustc_layout(debug)] #[repr(packed(1))] -union P1 { x: u32 } //~ ERROR: layout_of +union P1 { x: u32 } //~ ERROR layout_of #[rustc_layout(debug)] #[repr(packed(1))] -union P2 { x: (u32, u32) } //~ ERROR: layout_of +union P2 { x: (u32, u32) } //~ ERROR layout_of #[repr(simd)] #[derive(Copy, Clone)] @@ -55,36 +55,36 @@ struct F32x4([f32; 4]); #[rustc_layout(debug)] #[repr(packed(1))] -union P3 { x: F32x4 } //~ ERROR: layout_of +union P3 { x: F32x4 } //~ ERROR layout_of #[rustc_layout(debug)] #[repr(packed(1))] -union P4 { x: E } //~ ERROR: layout_of +union P4 { x: E } //~ ERROR layout_of #[rustc_layout(debug)] #[repr(packed(1))] -union P5 { zst: [u16; 0], byte: u8 } //~ ERROR: layout_of +union P5 { zst: [u16; 0], byte: u8 } //~ ERROR layout_of #[rustc_layout(debug)] -type X = std::mem::MaybeUninit; //~ ERROR: layout_of +type X = std::mem::MaybeUninit; //~ ERROR layout_of #[rustc_layout(debug)] -const C: () = (); //~ ERROR: can only be applied to +const C: () = (); //~ ERROR can only be applied to impl S { #[rustc_layout(debug)] - const C: () = (); //~ ERROR: can only be applied to + const C: () = (); //~ ERROR can only be applied to } #[rustc_layout(debug)] -type Impossible = (str, str); //~ ERROR: cannot be known at compilation time +type Impossible = (str, str); //~ ERROR cannot be known at compilation time // Test that computing the layout of an empty union doesn't ICE. #[rustc_layout(debug)] -union EmptyUnion {} //~ ERROR: has an unknown layout -//~^ ERROR: unions cannot have zero fields +union EmptyUnion {} //~ ERROR has an unknown layout +//~^ ERROR unions cannot have zero fields // Test the error message of `LayoutError::TooGeneric` // (this error is never emitted to users). #[rustc_layout(debug)] -type TooGeneric = T; //~ ERROR: does not have a fixed layout +type TooGeneric = T; //~ ERROR does not have a fixed layout diff --git a/tests/ui/layout/enum-scalar-pair-int-ptr.rs b/tests/ui/layout/enum-scalar-pair-int-ptr.rs index 60cada5e05a8c..eccf1b80b5937 100644 --- a/tests/ui/layout/enum-scalar-pair-int-ptr.rs +++ b/tests/ui/layout/enum-scalar-pair-int-ptr.rs @@ -9,7 +9,7 @@ #![crate_type = "lib"] #[rustc_layout(abi)] -enum ScalarPairPointerWithInt { //~ERROR: abi: ScalarPair +enum ScalarPairPointerWithInt { //~ERROR abi: ScalarPair A(usize), B(Box<()>), } @@ -18,7 +18,7 @@ enum ScalarPairPointerWithInt { //~ERROR: abi: ScalarPair // of a different size. (Assumes that no target has 8 bit pointers, which // feels pretty safe.) #[rustc_layout(abi)] -enum NotScalarPairPointerWithSmallerInt { //~ERROR: abi: Memory +enum NotScalarPairPointerWithSmallerInt { //~ERROR abi: Memory A(u8), B(Box<()>), } diff --git a/tests/ui/layout/enum.rs b/tests/ui/layout/enum.rs index 005faf8ee508d..c8246f868f173 100644 --- a/tests/ui/layout/enum.rs +++ b/tests/ui/layout/enum.rs @@ -6,19 +6,19 @@ #![crate_type = "lib"] #[rustc_layout(align)] -enum UninhabitedVariantAlign { //~ERROR: abi: Align(2 bytes) +enum UninhabitedVariantAlign { //~ERROR abi: Align(2 bytes) A([u8; 32]), B([u16; 0], !), // make sure alignment in uninhabited fields is respected } #[rustc_layout(size)] -enum UninhabitedVariantSpace { //~ERROR: size: Size(16 bytes) +enum UninhabitedVariantSpace { //~ERROR size: Size(16 bytes) A, B([u8; 15], !), // make sure there is space being reserved for this field. } #[rustc_layout(abi)] -enum ScalarPairDifferingSign { //~ERROR: abi: ScalarPair +enum ScalarPairDifferingSign { //~ERROR abi: ScalarPair A(u8), B(i8), } diff --git a/tests/ui/layout/gce-rigid-const-in-array-len.rs b/tests/ui/layout/gce-rigid-const-in-array-len.rs index 8e57907a2c5ec..482cc2da9a0f3 100644 --- a/tests/ui/layout/gce-rigid-const-in-array-len.rs +++ b/tests/ui/layout/gce-rigid-const-in-array-len.rs @@ -12,7 +12,7 @@ //! constant. #![feature(rustc_attrs)] -#![feature(generic_const_exprs)] //~ WARNING: the feature `generic_const_exprs` is incomplete +#![feature(generic_const_exprs)] //~ WARNING the feature `generic_const_exprs` is incomplete #![feature(trivial_bounds)] #![crate_type = "lib"] @@ -22,6 +22,6 @@ trait A { } #[rustc_layout(debug)] -struct S([u8; ::B]) //~ ERROR: the type `[u8; ::B]` has an unknown layout +struct S([u8; ::B]) //~ ERROR the type `[u8; ::B]` has an unknown layout where u8: A; diff --git a/tests/ui/layout/hexagon-enum.rs b/tests/ui/layout/hexagon-enum.rs index 02833eb41fad7..b8da8c2ac51dd 100644 --- a/tests/ui/layout/hexagon-enum.rs +++ b/tests/ui/layout/hexagon-enum.rs @@ -15,22 +15,22 @@ use minicore::*; #[rustc_layout(debug)] #[repr(C)] -enum A { Apple } //~ ERROR: layout_of +enum A { Apple } //~ ERROR layout_of #[rustc_layout(debug)] #[repr(C)] -enum B { Banana = 255, } //~ ERROR: layout_of +enum B { Banana = 255, } //~ ERROR layout_of #[rustc_layout(debug)] #[repr(C)] -enum C { Chaenomeles = 256, } //~ ERROR: layout_of +enum C { Chaenomeles = 256, } //~ ERROR layout_of #[rustc_layout(debug)] #[repr(C)] -enum P { Peach = 0x1000_0000isize, } //~ ERROR: layout_of +enum P { Peach = 0x1000_0000isize, } //~ ERROR layout_of const TANGERINE: usize = 0x8100_0000; // hack to get negative numbers without negation operator! #[rustc_layout(debug)] #[repr(C)] -enum T { Tangerine = TANGERINE as isize } //~ ERROR: layout_of +enum T { Tangerine = TANGERINE as isize } //~ ERROR layout_of diff --git a/tests/ui/layout/invalid-unsized-in-always-sized-tail.rs b/tests/ui/layout/invalid-unsized-in-always-sized-tail.rs index c6d5f2bfa0ee3..7fd70d4fb66d2 100644 --- a/tests/ui/layout/invalid-unsized-in-always-sized-tail.rs +++ b/tests/ui/layout/invalid-unsized-in-always-sized-tail.rs @@ -9,7 +9,7 @@ type MySliceBool = MySlice<[bool]>; struct P2 { b: MySliceBool, - //~^ ERROR: the size for values of type `[bool]` cannot be known at compilation time + //~^ ERROR the size for values of type `[bool]` cannot be known at compilation time } static CHECK: () = assert!(align_of::() == 1); //~ ERROR could not evaluate static initializer diff --git a/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.rs b/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.rs index ab7e0897ce32c..c1b196db97893 100644 --- a/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.rs +++ b/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.rs @@ -14,7 +14,7 @@ enum HasNiche { // This should result in ScalarPair(Initialized, Union), // since the u8 payload will be uninit for `None`. #[rustc_layout(debug)] -pub enum MissingPayloadField { //~ ERROR: layout_of +pub enum MissingPayloadField { //~ ERROR layout_of Some(u8), None } @@ -23,7 +23,7 @@ pub enum MissingPayloadField { //~ ERROR: layout_of // since the u8 field is present in all variants, // and hence will always be initialized. #[rustc_layout(debug)] -pub enum CommonPayloadField { //~ ERROR: layout_of +pub enum CommonPayloadField { //~ ERROR layout_of A(u8), B(u8), } @@ -31,7 +31,7 @@ pub enum CommonPayloadField { //~ ERROR: layout_of // This should result in ScalarPair(Initialized, Union), // since, though a u8-sized field is present in all variants, it might be uninit. #[rustc_layout(debug)] -pub enum CommonPayloadFieldIsMaybeUninit { //~ ERROR: layout_of +pub enum CommonPayloadFieldIsMaybeUninit { //~ ERROR layout_of A(u8), B(MaybeUninit), } @@ -39,7 +39,7 @@ pub enum CommonPayloadFieldIsMaybeUninit { //~ ERROR: layout_of // This should result in ScalarPair(Initialized, Union), // since only the niche field (used for the tag) is guaranteed to be initialized. #[rustc_layout(debug)] -pub enum NicheFirst { //~ ERROR: layout_of +pub enum NicheFirst { //~ ERROR layout_of A(HasNiche, u8), B, C @@ -48,7 +48,7 @@ pub enum NicheFirst { //~ ERROR: layout_of // This should result in ScalarPair(Union, Initialized), // since only the niche field (used for the tag) is guaranteed to be initialized. #[rustc_layout(debug)] -pub enum NicheSecond { //~ ERROR: layout_of +pub enum NicheSecond { //~ ERROR layout_of A(u8, HasNiche), B, C, diff --git a/tests/ui/layout/issue-96185-overaligned-enum.rs b/tests/ui/layout/issue-96185-overaligned-enum.rs index 19da169105cec..30607722713ea 100644 --- a/tests/ui/layout/issue-96185-overaligned-enum.rs +++ b/tests/ui/layout/issue-96185-overaligned-enum.rs @@ -6,7 +6,7 @@ // This cannot use `Scalar` abi since there is padding. #[rustc_layout(debug)] #[repr(align(8))] -pub enum Aligned1 { //~ ERROR: layout_of +pub enum Aligned1 { //~ ERROR layout_of Zero = 0, One = 1, } @@ -14,7 +14,7 @@ pub enum Aligned1 { //~ ERROR: layout_of // This should use `Scalar` abi. #[rustc_layout(debug)] #[repr(align(1))] -pub enum Aligned2 { //~ ERROR: layout_of +pub enum Aligned2 { //~ ERROR layout_of Zero = 0, One = 1, } diff --git a/tests/ui/layout/layout-cycle.rs b/tests/ui/layout/layout-cycle.rs index 3c930def43b2b..a65a0fd67cfe0 100644 --- a/tests/ui/layout/layout-cycle.rs +++ b/tests/ui/layout/layout-cycle.rs @@ -1,6 +1,6 @@ //@ build-fail -//~^ ERROR: a cycle occurred during layout computation -//~| ERROR: cycle detected when computing layout of +//~^ ERROR a cycle occurred during layout computation +//~| ERROR cycle detected when computing layout of // Issue #111176 -- ensure that we do not emit ICE on layout cycles diff --git a/tests/ui/layout/normalization-failure.rs b/tests/ui/layout/normalization-failure.rs index c0f8710c03cb3..4a0793eb052a6 100644 --- a/tests/ui/layout/normalization-failure.rs +++ b/tests/ui/layout/normalization-failure.rs @@ -48,9 +48,9 @@ fn opaque() -> impl Project2 { fn check() { unsafe { std::mem::transmute::<_, ()>(opaque::().get()); - //~^ ERROR: cannot transmute - //~| NOTE: (unable to determine layout for `::Assoc2` because `::Assoc2` cannot be normalized) - //~| NOTE: (0 bits) + //~^ ERROR cannot transmute + //~| NOTE (unable to determine layout for `::Assoc2` because `::Assoc2` cannot be normalized) + //~| NOTE (0 bits) } } diff --git a/tests/ui/layout/struct.rs b/tests/ui/layout/struct.rs index 5f652b3d570db..2f653468d1c83 100644 --- a/tests/ui/layout/struct.rs +++ b/tests/ui/layout/struct.rs @@ -6,7 +6,7 @@ #![crate_type = "lib"] #[rustc_layout(abi)] -struct AlignedZstPreventsScalar(i16, [i32; 0]); //~ERROR: abi: Memory +struct AlignedZstPreventsScalar(i16, [i32; 0]); //~ERROR abi: Memory #[rustc_layout(abi)] -struct AlignedZstButStillScalar(i32, [i16; 0]); //~ERROR: abi: Scalar +struct AlignedZstButStillScalar(i32, [i16; 0]); //~ERROR abi: Scalar diff --git a/tests/ui/layout/thaw-transmute-invalid-enum.rs b/tests/ui/layout/thaw-transmute-invalid-enum.rs index a7c2e1a86de7b..854cfb02d963f 100644 --- a/tests/ui/layout/thaw-transmute-invalid-enum.rs +++ b/tests/ui/layout/thaw-transmute-invalid-enum.rs @@ -2,13 +2,13 @@ mod assert { use std::mem::{Assume, TransmuteFrom}; - //~^ ERROR: use of unstable library feature `transmutability` - //~| ERROR: use of unstable library feature `transmutability` + //~^ ERROR use of unstable library feature `transmutability` + //~| ERROR use of unstable library feature `transmutability` pub fn is_transmutable() where Dst: TransmuteFrom, - //~^ ERROR: use of unstable library feature `transmutability` + //~^ ERROR use of unstable library feature `transmutability` { } } @@ -19,7 +19,7 @@ enum Ox00 { } #[repr(C, packed(2))] -//~^ ERROR: attribute should be applied to a struct +//~^ ERROR attribute should be applied to a struct enum OxFF { V = 0xFF, } @@ -27,10 +27,10 @@ enum OxFF { fn test() { union Superset { a: Ox00, - //~^ ERROR: field must implement `Copy` + //~^ ERROR field must implement `Copy` b: OxFF, } assert::is_transmutable::(); - //~^ ERROR: cannot find type `Subset` + //~^ ERROR cannot find type `Subset` } diff --git a/tests/ui/layout/thaw-validate-invalid-enum.rs b/tests/ui/layout/thaw-validate-invalid-enum.rs index 51aff7fb556c2..4ad4c93ce6166 100644 --- a/tests/ui/layout/thaw-validate-invalid-enum.rs +++ b/tests/ui/layout/thaw-validate-invalid-enum.rs @@ -1,6 +1,6 @@ //@ compile-flags: -Zvalidate-mir -#[repr(packed)] //~ ERROR: attribute should be applied to a struct +#[repr(packed)] //~ ERROR attribute should be applied to a struct #[repr(u32)] enum E { A, @@ -11,7 +11,7 @@ enum E { fn main() { union InvalidTag { int: u32, - e: E, //~ ERROR: field must implement `Copy` + e: E, //~ ERROR field must implement `Copy` } let _invalid_tag = InvalidTag { int: 4 }; } diff --git a/tests/ui/layout/thumb-enum.rs b/tests/ui/layout/thumb-enum.rs index 1c4fab812f966..3fde3c57ca337 100644 --- a/tests/ui/layout/thumb-enum.rs +++ b/tests/ui/layout/thumb-enum.rs @@ -15,22 +15,22 @@ use minicore::*; #[rustc_layout(debug)] #[repr(C)] -enum A { Apple } //~ ERROR: layout_of +enum A { Apple } //~ ERROR layout_of #[rustc_layout(debug)] #[repr(C)] -enum B { Banana = 255, } //~ ERROR: layout_of +enum B { Banana = 255, } //~ ERROR layout_of #[rustc_layout(debug)] #[repr(C)] -enum C { Chaenomeles = 256, } //~ ERROR: layout_of +enum C { Chaenomeles = 256, } //~ ERROR layout_of #[rustc_layout(debug)] #[repr(C)] -enum P { Peach = 0x1000_0000isize, } //~ ERROR: layout_of +enum P { Peach = 0x1000_0000isize, } //~ ERROR layout_of const TANGERINE: usize = 0x8100_0000; // hack to get negative numbers without negation operator! #[rustc_layout(debug)] #[repr(C)] -enum T { Tangerine = TANGERINE as isize } //~ ERROR: layout_of +enum T { Tangerine = TANGERINE as isize } //~ ERROR layout_of diff --git a/tests/ui/layout/too-big-with-padding.rs b/tests/ui/layout/too-big-with-padding.rs index 0f03bd10fb63d..bcb00fb4df7f4 100644 --- a/tests/ui/layout/too-big-with-padding.rs +++ b/tests/ui/layout/too-big-with-padding.rs @@ -14,4 +14,4 @@ use minicore::*; #[repr(C, align(2))] pub struct Example([u8; 0x7fffffff]); -pub fn lib(_x: Example) {} //~ERROR: too big for the target architecture +pub fn lib(_x: Example) {} //~ERROR too big for the target architecture diff --git a/tests/ui/layout/unconstrained-param-ice-137308.rs b/tests/ui/layout/unconstrained-param-ice-137308.rs index c9b1e0a4b9ec3..7b3f1bfb11d0b 100644 --- a/tests/ui/layout/unconstrained-param-ice-137308.rs +++ b/tests/ui/layout/unconstrained-param-ice-137308.rs @@ -10,9 +10,9 @@ trait A { const B: usize; } -impl A for u8 { //~ ERROR: the type parameter `C` is not constrained +impl A for u8 { //~ ERROR the type parameter `C` is not constrained const B: usize = 42; } #[rustc_layout(debug)] -struct S([u8; ::B]); //~ ERROR: the type has an unknown layout +struct S([u8; ::B]); //~ ERROR the type has an unknown layout diff --git a/tests/ui/layout/zero-sized-array-enum-niche.rs b/tests/ui/layout/zero-sized-array-enum-niche.rs index d3ff016d8aa23..05946b166cefa 100644 --- a/tests/ui/layout/zero-sized-array-enum-niche.rs +++ b/tests/ui/layout/zero-sized-array-enum-niche.rs @@ -11,7 +11,7 @@ // `Result` ~= `Result`. // This is a close enough approximation: #[rustc_layout(debug)] -type AlignedResult = Result<[u32; 0], bool>; //~ ERROR: layout_of +type AlignedResult = Result<[u32; 0], bool>; //~ ERROR layout_of // The bug gave that size 1 with align 4, but the size should also be 4. // It was also using the bool niche for the enum tag, which is fine, but // after the fix, layout decides to use a direct tagged repr instead. @@ -19,7 +19,7 @@ type AlignedResult = Result<[u32; 0], bool>; //~ ERROR: layout_of // Here's another case with multiple ZST alignments, where we should // get the maximal alignment and matching size. #[rustc_layout(debug)] -enum MultipleAlignments { //~ ERROR: layout_of +enum MultipleAlignments { //~ ERROR layout_of Align2([u16; 0]), Align4([u32; 0]), Niche(bool), @@ -35,12 +35,12 @@ enum MultipleAlignments { //~ ERROR: layout_of struct Packed(T); #[rustc_layout(debug)] -type NicheLosesToTagged = Result<[u32; 0], Packed>>; //~ ERROR: layout_of +type NicheLosesToTagged = Result<[u32; 0], Packed>>; //~ ERROR layout_of // Should get tag_encoding: Direct, size == align == 4. #[repr(u16)] enum U16IsZero { _Zero = 0 } #[rustc_layout(debug)] -type NicheWinsOverTagged = Result<[u32; 0], Packed>; //~ ERROR: layout_of +type NicheWinsOverTagged = Result<[u32; 0], Packed>; //~ ERROR layout_of // Should get tag_encoding: Niche, size == align == 4. diff --git a/tests/ui/let-else/let-else-binding-immutable.rs b/tests/ui/let-else/let-else-binding-immutable.rs index ff2d9f240a094..ace74ae5bc565 100644 --- a/tests/ui/let-else/let-else-binding-immutable.rs +++ b/tests/ui/let-else/let-else-binding-immutable.rs @@ -6,5 +6,5 @@ pub fn main() { let Some(x) = &Some(3) else { panic!(); }; - *x += 1; //~ ERROR: cannot assign to `*x`, which is behind a `&` reference + *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference } diff --git a/tests/ui/let-else/let-else-no-double-error.rs b/tests/ui/let-else/let-else-no-double-error.rs index 91fcc5d7e91e8..8307c1ec6e9d1 100644 --- a/tests/ui/let-else/let-else-no-double-error.rs +++ b/tests/ui/let-else/let-else-no-double-error.rs @@ -8,5 +8,5 @@ fn main() { let foo = 22; - let u32::XXX = foo else { return }; //~ ERROR: no associated item named `XXX` found for type `u32` in the current scope [E0599] + let u32::XXX = foo else { return }; //~ ERROR no associated item named `XXX` found for type `u32` in the current scope [E0599] } diff --git a/tests/ui/lexer/lex-bad-char-literals-1.rs b/tests/ui/lexer/lex-bad-char-literals-1.rs index e7951cfd2d20c..87a1a852d843d 100644 --- a/tests/ui/lexer/lex-bad-char-literals-1.rs +++ b/tests/ui/lexer/lex-bad-char-literals-1.rs @@ -1,17 +1,17 @@ static c3: char = - '\x1' //~ ERROR: numeric character escape is too short + '\x1' //~ ERROR numeric character escape is too short ; static s3: &'static str = - "\x1" //~ ERROR: numeric character escape is too short + "\x1" //~ ERROR numeric character escape is too short ; static c: char = - '\●' //~ ERROR: unknown character escape + '\●' //~ ERROR unknown character escape ; static s: &'static str = - "\●" //~ ERROR: unknown character escape + "\●" //~ ERROR unknown character escape ; fn main() {} diff --git a/tests/ui/lexer/lex-bad-char-literals-2.rs b/tests/ui/lexer/lex-bad-char-literals-2.rs index d35dafd9a3443..5faa75d345b3b 100644 --- a/tests/ui/lexer/lex-bad-char-literals-2.rs +++ b/tests/ui/lexer/lex-bad-char-literals-2.rs @@ -1,6 +1,6 @@ // This test needs to the last one appearing in this file as it kills the parser static c: char = - 'nope' //~ ERROR: character literal may only contain one codepoint + 'nope' //~ ERROR character literal may only contain one codepoint ; fn main() {} diff --git a/tests/ui/lexer/lex-bad-char-literals-3.rs b/tests/ui/lexer/lex-bad-char-literals-3.rs index 5194ff4d9354f..7ca708655af48 100644 --- a/tests/ui/lexer/lex-bad-char-literals-3.rs +++ b/tests/ui/lexer/lex-bad-char-literals-3.rs @@ -1,7 +1,7 @@ static c: char = '●●'; -//~^ ERROR: character literal may only contain one codepoint +//~^ ERROR character literal may only contain one codepoint fn main() { let ch: &str = '●●'; - //~^ ERROR: character literal may only contain one codepoint + //~^ ERROR character literal may only contain one codepoint } diff --git a/tests/ui/lexer/lex-bad-char-literals-4.rs b/tests/ui/lexer/lex-bad-char-literals-4.rs index de0a19df99360..2703e4e986c65 100644 --- a/tests/ui/lexer/lex-bad-char-literals-4.rs +++ b/tests/ui/lexer/lex-bad-char-literals-4.rs @@ -1,5 +1,5 @@ // // This test needs to the last one appearing in this file as it kills the parser static c: char = - '● //~ ERROR: unterminated character literal + '● //~ ERROR unterminated character literal ; diff --git a/tests/ui/lexer/lex-bad-char-literals-5.rs b/tests/ui/lexer/lex-bad-char-literals-5.rs index 0c4339edc4fa7..91c9a9e9056fb 100644 --- a/tests/ui/lexer/lex-bad-char-literals-5.rs +++ b/tests/ui/lexer/lex-bad-char-literals-5.rs @@ -1,7 +1,7 @@ static c: char = '\x10\x10'; -//~^ ERROR: character literal may only contain one codepoint +//~^ ERROR character literal may only contain one codepoint fn main() { let ch: &str = '\x10\x10'; - //~^ ERROR: character literal may only contain one codepoint + //~^ ERROR character literal may only contain one codepoint } diff --git a/tests/ui/lexer/lex-bad-char-literals-6.rs b/tests/ui/lexer/lex-bad-char-literals-6.rs index 1b498c0fbca67..05b60cb61871d 100644 --- a/tests/ui/lexer/lex-bad-char-literals-6.rs +++ b/tests/ui/lexer/lex-bad-char-literals-6.rs @@ -1,15 +1,15 @@ fn main() { let x: &str = 'ab'; - //~^ ERROR: character literal may only contain one codepoint + //~^ ERROR character literal may only contain one codepoint let y: char = 'cd'; - //~^ ERROR: character literal may only contain one codepoint + //~^ ERROR character literal may only contain one codepoint let z = 'ef'; - //~^ ERROR: character literal may only contain one codepoint + //~^ ERROR character literal may only contain one codepoint if x == y {} if y == z {} // no error here if x == z {} let a: usize = ""; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/lexer/lex-bad-char-literals-7.rs b/tests/ui/lexer/lex-bad-char-literals-7.rs index c675df2f3ccd0..246f45486cd17 100644 --- a/tests/ui/lexer/lex-bad-char-literals-7.rs +++ b/tests/ui/lexer/lex-bad-char-literals-7.rs @@ -1,13 +1,13 @@ fn main() { let _: char = ''; - //~^ ERROR: empty character literal + //~^ ERROR empty character literal let _: char = '\u{}'; - //~^ ERROR: empty unicode escape + //~^ ERROR empty unicode escape // Next two are OK, but may befool error recovery let _ = '/'; let _ = b'/'; let _ = ' hello // here's a comment - //~^ ERROR: unterminated character literal + //~^ ERROR unterminated character literal } diff --git a/tests/ui/lexer/lex-bad-numeric-literals.rs b/tests/ui/lexer/lex-bad-numeric-literals.rs index 56bdc50e40d68..1502191dc7ddb 100644 --- a/tests/ui/lexer/lex-bad-numeric-literals.rs +++ b/tests/ui/lexer/lex-bad-numeric-literals.rs @@ -1,35 +1,35 @@ // ignore-tidy-linelength fn main() { - 0o1.0; //~ ERROR: octal float literal is not supported - 0o2f32; //~ ERROR: octal float literal is not supported - 0o3.0f32; //~ ERROR: octal float literal is not supported - 0o4e4; //~ ERROR: octal float literal is not supported - 0o5.0e5; //~ ERROR: octal float literal is not supported - 0o6e6f32; //~ ERROR: octal float literal is not supported - 0o7.0e7f64; //~ ERROR: octal float literal is not supported - 0x8.0e+9; //~ ERROR: hexadecimal float literal is not supported - 0x9.0e-9; //~ ERROR: hexadecimal float literal is not supported - 0o; //~ ERROR: no valid digits - 1e+; //~ ERROR: expected at least one digit in exponent - 0x539.0; //~ ERROR: hexadecimal float literal is not supported + 0o1.0; //~ ERROR octal float literal is not supported + 0o2f32; //~ ERROR octal float literal is not supported + 0o3.0f32; //~ ERROR octal float literal is not supported + 0o4e4; //~ ERROR octal float literal is not supported + 0o5.0e5; //~ ERROR octal float literal is not supported + 0o6e6f32; //~ ERROR octal float literal is not supported + 0o7.0e7f64; //~ ERROR octal float literal is not supported + 0x8.0e+9; //~ ERROR hexadecimal float literal is not supported + 0x9.0e-9; //~ ERROR hexadecimal float literal is not supported + 0o; //~ ERROR no valid digits + 1e+; //~ ERROR expected at least one digit in exponent + 0x539.0; //~ ERROR hexadecimal float literal is not supported 9900000000000000000000000000999999999999999999999999999999; - //~^ ERROR: integer literal is too large + //~^ ERROR integer literal is too large 9900000000000000000000000000999999999999999999999999999999; - //~^ ERROR: integer literal is too large + //~^ ERROR integer literal is too large 0b111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110; - //~^ ERROR: integer literal is too large + //~^ ERROR integer literal is too large 0o37777777777777777777777777777777777777777770; - //~^ ERROR: integer literal is too large + //~^ ERROR integer literal is too large 0xffffffffffffffffffffffffffffffff0; - //~^ ERROR: integer literal is too large - 0x; //~ ERROR: no valid digits - 0xu32; //~ ERROR: no valid digits - 0ou32; //~ ERROR: no valid digits - 0bu32; //~ ERROR: no valid digits - 0b; //~ ERROR: no valid digits - 0o123f64; //~ ERROR: octal float literal is not supported - 0o123.456; //~ ERROR: octal float literal is not supported - 0b101f64; //~ ERROR: binary float literal is not supported - 0b111.101; //~ ERROR: binary float literal is not supported + //~^ ERROR integer literal is too large + 0x; //~ ERROR no valid digits + 0xu32; //~ ERROR no valid digits + 0ou32; //~ ERROR no valid digits + 0bu32; //~ ERROR no valid digits + 0b; //~ ERROR no valid digits + 0o123f64; //~ ERROR octal float literal is not supported + 0o123.456; //~ ERROR octal float literal is not supported + 0b101f64; //~ ERROR binary float literal is not supported + 0b111.101; //~ ERROR binary float literal is not supported } diff --git a/tests/ui/lexer/lex-bad-token.rs b/tests/ui/lexer/lex-bad-token.rs index 9e4824611128d..d74a833dc7706 100644 --- a/tests/ui/lexer/lex-bad-token.rs +++ b/tests/ui/lexer/lex-bad-token.rs @@ -1,3 +1,3 @@ -● //~ ERROR: unknown start of token +● //~ ERROR unknown start of token fn main() {} diff --git a/tests/ui/lexer/lex-bare-cr-string-literal-doc-comment.rs b/tests/ui/lexer/lex-bare-cr-string-literal-doc-comment.rs index b7752e1f0c45f..cdea910590a2c 100644 --- a/tests/ui/lexer/lex-bare-cr-string-literal-doc-comment.rs +++ b/tests/ui/lexer/lex-bare-cr-string-literal-doc-comment.rs @@ -2,25 +2,25 @@ /// doc comment with bare CR: ' ' pub fn foo() {} -//~^^ ERROR: bare CR not allowed in doc-comment +//~^^ ERROR bare CR not allowed in doc-comment /** block doc comment with bare CR: ' ' */ pub fn bar() {} -//~^^ ERROR: bare CR not allowed in block doc-comment +//~^^ ERROR bare CR not allowed in block doc-comment fn main() { //! doc comment with bare CR: ' ' - //~^ ERROR: bare CR not allowed in doc-comment + //~^ ERROR bare CR not allowed in doc-comment /*! block doc comment with bare CR: ' ' */ - //~^ ERROR: bare CR not allowed in block doc-comment + //~^ ERROR bare CR not allowed in block doc-comment // the following string literal has a bare CR in it - let _s = "foo bar"; //~ ERROR: bare CR not allowed in string + let _s = "foo bar"; //~ ERROR bare CR not allowed in string // the following string literal has a bare CR in it - let _s = r"bar foo"; //~ ERROR: bare CR not allowed in raw string + let _s = r"bar foo"; //~ ERROR bare CR not allowed in raw string // the following string literal has a bare CR in it - let _s = "foo\ bar"; //~ ERROR: unknown character escape: `\r` + let _s = "foo\ bar"; //~ ERROR unknown character escape: `\r` } diff --git a/tests/ui/lexer/lex-emoji-identifiers.rs b/tests/ui/lexer/lex-emoji-identifiers.rs index 4fcd102018beb..94adb33d7ecd8 100644 --- a/tests/ui/lexer/lex-emoji-identifiers.rs +++ b/tests/ui/lexer/lex-emoji-identifiers.rs @@ -1,13 +1,13 @@ fn invalid_emoji_usages() { - let arrow↔️ = "basic emoji"; //~ ERROR: identifiers cannot contain emoji - let planet🪐 = "basic emoji"; //~ ERROR: identifiers cannot contain emoji - let wireless🛜 = "basic emoji"; //~ ERROR: identifiers cannot contain emoji + let arrow↔️ = "basic emoji"; //~ ERROR identifiers cannot contain emoji + let planet🪐 = "basic emoji"; //~ ERROR identifiers cannot contain emoji + let wireless🛜 = "basic emoji"; //~ ERROR identifiers cannot contain emoji // FIXME - let key1️⃣ = "keycap sequence"; //~ ERROR: unknown start of token - //~^ WARN: identifier contains an uncommon character: '\u{fe0f}' - let flag🇺🇳 = "flag sequence"; //~ ERROR: identifiers cannot contain emoji - let wales🏴 = "tag sequence"; //~ ERROR: identifiers cannot contain emoji - let folded🙏🏿 = "modifier sequence"; //~ ERROR: identifiers cannot contain emoji + let key1️⃣ = "keycap sequence"; //~ ERROR unknown start of token + //~^ WARN identifier contains an uncommon character: '\u{fe0f}' + let flag🇺🇳 = "flag sequence"; //~ ERROR identifiers cannot contain emoji + let wales🏴 = "tag sequence"; //~ ERROR identifiers cannot contain emoji + let folded🙏🏿 = "modifier sequence"; //~ ERROR identifiers cannot contain emoji } fn main() { diff --git a/tests/ui/lexer/lex-stray-backslash.rs b/tests/ui/lexer/lex-stray-backslash.rs index bb27f44c279f7..30fbada2ba09d 100644 --- a/tests/ui/lexer/lex-stray-backslash.rs +++ b/tests/ui/lexer/lex-stray-backslash.rs @@ -1,3 +1,3 @@ -\ //~ ERROR: unknown start of token: \ +\ //~ ERROR unknown start of token: \ fn main() {} diff --git a/tests/ui/lifetimes/issue-17728.rs b/tests/ui/lifetimes/issue-17728.rs index ff8783029ff52..cc9c6f193508b 100644 --- a/tests/ui/lifetimes/issue-17728.rs +++ b/tests/ui/lifetimes/issue-17728.rs @@ -12,7 +12,7 @@ trait TraversesWorld { let direction = str_to_direction(directionStr); let maybe_room = room.direction_to_room.get(&direction); match maybe_room { - Some(entry) => Ok(entry), //~ ERROR: lifetime may not live long enough + Some(entry) => Ok(entry), //~ ERROR lifetime may not live long enough _ => Err("Direction does not exist in room.") } } diff --git a/tests/ui/lifetimes/issue-34979.rs b/tests/ui/lifetimes/issue-34979.rs index 252486dd92192..4ac8f845d57db 100644 --- a/tests/ui/lifetimes/issue-34979.rs +++ b/tests/ui/lifetimes/issue-34979.rs @@ -3,7 +3,7 @@ impl<'a, T> Foo for &'a T {} struct Ctx<'a>(&'a ()) where - &'a (): Foo, //~ ERROR: type annotations needed + &'a (): Foo, //~ ERROR type annotations needed &'static (): Foo; fn main() {} diff --git a/tests/ui/lifetimes/issue-64173-unused-lifetimes.rs b/tests/ui/lifetimes/issue-64173-unused-lifetimes.rs index 3879784d0b0f1..b4b0e380374eb 100644 --- a/tests/ui/lifetimes/issue-64173-unused-lifetimes.rs +++ b/tests/ui/lifetimes/issue-64173-unused-lifetimes.rs @@ -1,8 +1,8 @@ use std::mem::size_of; -struct Foo<'s> { //~ ERROR: parameter `'s` is never used +struct Foo<'s> { //~ ERROR parameter `'s` is never used array: [(); size_of::<&Self>()], - //~^ ERROR: generic `Self` types are currently not permitted in anonymous constants + //~^ ERROR generic `Self` types are currently not permitted in anonymous constants } // The below is taken from https://github.com/rust-lang/rust/issues/66152#issuecomment-550275017 @@ -12,8 +12,8 @@ const fn foo() -> usize { 0 } -struct Bar<'a> { //~ ERROR: parameter `'a` is never used - beta: [(); foo::<&'a ()>()], //~ ERROR: generic parameters may not be used in const operations +struct Bar<'a> { //~ ERROR parameter `'a` is never used + beta: [(); foo::<&'a ()>()], //~ ERROR generic parameters may not be used in const operations } fn main() {} diff --git a/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs b/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs index eab436fa3419d..7582a388c6129 100644 --- a/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs +++ b/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs @@ -4,15 +4,15 @@ use std::future::Future; async fn wrapper(f: F) -//~^ ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` -//~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` -//~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` -//~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` +//~^ ERROR expected a `FnOnce(&'a mut i32)` closure, found `i32` +//~| ERROR expected a `FnOnce(&'a mut i32)` closure, found `i32` +//~| ERROR expected a `FnOnce(&'a mut i32)` closure, found `i32` +//~| ERROR expected a `FnOnce(&'a mut i32)` closure, found `i32` where F:, for<'a> >::Output: Future + 'a, { - //~^ ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` + //~^ ERROR expected a `FnOnce(&'a mut i32)` closure, found `i32` let mut i = 41; &mut i; } diff --git a/tests/ui/lifetimes/missing-lifetime-in-alias.rs b/tests/ui/lifetimes/missing-lifetime-in-alias.rs index a0887b36b8a9d..b332ce0aa2285 100644 --- a/tests/ui/lifetimes/missing-lifetime-in-alias.rs +++ b/tests/ui/lifetimes/missing-lifetime-in-alias.rs @@ -14,8 +14,8 @@ struct Impl<'a>(&'a ()); impl<'a> Trait<'a> for Impl<'a> { type Foo = &'a (); type Bar<'b> = &'b (); - //~^ ERROR: does not fulfill the required lifetime - //~| NOTE: type must outlive the lifetime `'b` + //~^ ERROR does not fulfill the required lifetime + //~| NOTE type must outlive the lifetime `'b` } type A<'a> = Impl<'a>; diff --git a/tests/ui/lifetimes/noisy-follow-up-erro.rs b/tests/ui/lifetimes/noisy-follow-up-erro.rs index 47a87068d8fbf..6c67936cf3090 100644 --- a/tests/ui/lifetimes/noisy-follow-up-erro.rs +++ b/tests/ui/lifetimes/noisy-follow-up-erro.rs @@ -10,9 +10,9 @@ struct Bar; impl<'a> Bar { fn boom(&self, foo: &mut Foo<'_, '_, 'a>) -> Result<(), &'a ()> { - //~^ ERROR: struct takes 2 lifetime arguments but 3 lifetime arguments were supplied + //~^ ERROR struct takes 2 lifetime arguments but 3 lifetime arguments were supplied self.bar().map_err(|()| foo.acc(self))?; - //~^ ERROR: explicit lifetime required in the type of `foo` + //~^ ERROR explicit lifetime required in the type of `foo` Ok(()) } fn bar(&self) -> Result<(), &'a ()> { diff --git a/tests/ui/lifetimes/refcell-in-tail-expr.rs b/tests/ui/lifetimes/refcell-in-tail-expr.rs index 2cca7acbf5a42..db373620e520a 100644 --- a/tests/ui/lifetimes/refcell-in-tail-expr.rs +++ b/tests/ui/lifetimes/refcell-in-tail-expr.rs @@ -7,7 +7,7 @@ fn main() { let cell = std::cell::RefCell::new(0u8); if let Ok(mut byte) = cell.try_borrow_mut() { - //[edition2021]~^ ERROR: `cell` does not live long enough + //[edition2021]~^ ERROR `cell` does not live long enough *byte = 1; } } diff --git a/tests/ui/lifetimes/shorter-tail-expr-lifetime.rs b/tests/ui/lifetimes/shorter-tail-expr-lifetime.rs index 25c530d43919e..45002a5df2db4 100644 --- a/tests/ui/lifetimes/shorter-tail-expr-lifetime.rs +++ b/tests/ui/lifetimes/shorter-tail-expr-lifetime.rs @@ -4,7 +4,7 @@ fn f() -> usize { let c = std::cell::RefCell::new(".."); - c.borrow().len() //[edition2021]~ ERROR: `c` does not live long enough + c.borrow().len() //[edition2021]~ ERROR `c` does not live long enough } fn main() { diff --git a/tests/ui/link-native-libs/kind-framework.rs b/tests/ui/link-native-libs/kind-framework.rs index c2f90809e03a0..a86c6cc08ec15 100644 --- a/tests/ui/link-native-libs/kind-framework.rs +++ b/tests/ui/link-native-libs/kind-framework.rs @@ -2,6 +2,6 @@ #[link(name = "foo", kind = "framework")] extern "C" {} -//~^^ ERROR: link kind `framework` is only supported on Apple targets +//~^^ ERROR link kind `framework` is only supported on Apple targets fn main() {} diff --git a/tests/ui/linkage-attr/linkage2.rs b/tests/ui/linkage-attr/linkage2.rs index b1e64dabac7f8..da01dc1195393 100644 --- a/tests/ui/linkage-attr/linkage2.rs +++ b/tests/ui/linkage-attr/linkage2.rs @@ -5,7 +5,7 @@ extern "C" { #[linkage = "extern_weak"] static foo: i32; -//~^ ERROR: invalid type for variable with `#[linkage]` attribute +//~^ ERROR invalid type for variable with `#[linkage]` attribute } fn main() { diff --git a/tests/ui/linkage-attr/linkage3.rs b/tests/ui/linkage-attr/linkage3.rs index f95e5eecc48f7..d87a7b7b53223 100644 --- a/tests/ui/linkage-attr/linkage3.rs +++ b/tests/ui/linkage-attr/linkage3.rs @@ -5,7 +5,7 @@ extern "C" { #[linkage = "foo"] static foo: *const i32; -//~^ ERROR: invalid linkage specified +//~^ ERROR invalid linkage specified } fn main() { diff --git a/tests/ui/linkage-attr/linkage4.rs b/tests/ui/linkage-attr/linkage4.rs index 3b935f9723dc1..419b7031ee4ab 100644 --- a/tests/ui/linkage-attr/linkage4.rs +++ b/tests/ui/linkage-attr/linkage4.rs @@ -1,5 +1,5 @@ #[linkage = "external"] static foo: isize = 0; -//~^^ ERROR: the `linkage` attribute is experimental and not portable +//~^^ ERROR the `linkage` attribute is experimental and not portable fn main() {} diff --git a/tests/ui/linkage-attr/raw-dylib/windows/raw-dylib-windows-only.rs b/tests/ui/linkage-attr/raw-dylib/windows/raw-dylib-windows-only.rs index 935c59b5aaa5e..74fbd7f5f51c3 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/raw-dylib-windows-only.rs +++ b/tests/ui/linkage-attr/raw-dylib/windows/raw-dylib-windows-only.rs @@ -4,6 +4,6 @@ //@ [notelf] ignore-elf //@ compile-flags: --crate-type lib #[link(name = "foo", kind = "raw-dylib")] -//[notelf]~^ ERROR: link kind `raw-dylib` is only supported on Windows targets -//[elf]~^^ ERROR: link kind `raw-dylib` is unstable on ELF platforms +//[notelf]~^ ERROR link kind `raw-dylib` is only supported on Windows targets +//[elf]~^^ ERROR link kind `raw-dylib` is unstable on ELF platforms extern "C" {} diff --git a/tests/ui/lint/dead-code/closure-bang.rs b/tests/ui/lint/dead-code/closure-bang.rs index bca131a15d325..a354823e63b9c 100644 --- a/tests/ui/lint/dead-code/closure-bang.rs +++ b/tests/ui/lint/dead-code/closure-bang.rs @@ -3,5 +3,5 @@ fn main() { let x = || -> ! { panic!() }; x(); - println!("Foo bar"); //~ ERROR: unreachable statement + println!("Foo bar"); //~ ERROR unreachable statement } diff --git a/tests/ui/lint/dead-code/issue-85071-2.rs b/tests/ui/lint/dead-code/issue-85071-2.rs index 5db8735899410..9a75b8e3a3a91 100644 --- a/tests/ui/lint/dead-code/issue-85071-2.rs +++ b/tests/ui/lint/dead-code/issue-85071-2.rs @@ -16,7 +16,7 @@ impl S { fn main() { let s = S; let x = s.f(); - //~^ WARNING: unused variable: `x` + //~^ WARNING unused variable: `x` let _y = x; - //~^ WARNING: unreachable definition + //~^ WARNING unreachable definition } diff --git a/tests/ui/lint/dead-code/issue-85071.rs b/tests/ui/lint/dead-code/issue-85071.rs index 84f2c9fc74eeb..3d7dc7273aeaa 100644 --- a/tests/ui/lint/dead-code/issue-85071.rs +++ b/tests/ui/lint/dead-code/issue-85071.rs @@ -13,7 +13,7 @@ fn f() -> Foo {todo!()} fn main() { let x = f(); - //~^ WARNING: unused variable: `x` + //~^ WARNING unused variable: `x` let _ = x; - //~^ WARNING: unreachable expression + //~^ WARNING unreachable expression } diff --git a/tests/ui/lint/dead-code/issue-85255.rs b/tests/ui/lint/dead-code/issue-85255.rs index cba951eef729d..2b2442c624cbf 100644 --- a/tests/ui/lint/dead-code/issue-85255.rs +++ b/tests/ui/lint/dead-code/issue-85255.rs @@ -4,38 +4,38 @@ #![warn(dead_code)] struct Foo { - a: i32, //~ WARNING: fields `a` and `b` are never read + a: i32, //~ WARNING fields `a` and `b` are never read pub b: i32, } struct Bar; impl Bar { - fn a(&self) -> i32 { 5 } //~ WARNING: methods `a` and `b` are never used [dead_code] + fn a(&self) -> i32 { 5 } //~ WARNING methods `a` and `b` are never used [dead_code] pub fn b(&self) -> i32 { 6 } } pub(crate) struct Foo1 { - a: i32, //~ WARNING: fields `a` and `b` are never read + a: i32, //~ WARNING fields `a` and `b` are never read pub b: i32, } pub(crate) struct Bar1; impl Bar1 { - fn a(&self) -> i32 { 5 } //~ WARNING: methods `a` and `b` are never used [dead_code] + fn a(&self) -> i32 { 5 } //~ WARNING methods `a` and `b` are never used [dead_code] pub fn b(&self) -> i32 { 6 } } pub(crate) struct Foo2 { - a: i32, //~ WARNING: fields `a` and `b` are never read + a: i32, //~ WARNING fields `a` and `b` are never read pub b: i32, } pub(crate) struct Bar2; impl Bar2 { - fn a(&self) -> i32 { 5 } //~ WARNING: methods `a` and `b` are never used [dead_code] + fn a(&self) -> i32 { 5 } //~ WARNING methods `a` and `b` are never used [dead_code] pub fn b(&self) -> i32 { 6 } } diff --git a/tests/ui/lint/dead-code/lint-dead-code-1.rs b/tests/ui/lint/dead-code/lint-dead-code-1.rs index a7f654b5d8bf4..fe717865d0445 100644 --- a/tests/ui/lint/dead-code/lint-dead-code-1.rs +++ b/tests/ui/lint/dead-code/lint-dead-code-1.rs @@ -9,7 +9,7 @@ pub use foo2::Bar2; mod foo { - pub struct Bar; //~ ERROR: struct `Bar` is never constructed + pub struct Bar; //~ ERROR struct `Bar` is never constructed } mod foo2 { @@ -17,14 +17,14 @@ mod foo2 { } pub static pub_static: isize = 0; -static priv_static: isize = 0; //~ ERROR: static `priv_static` is never used +static priv_static: isize = 0; //~ ERROR static `priv_static` is never used const used_static: isize = 0; pub static used_static2: isize = used_static; const USED_STATIC: isize = 0; const STATIC_USED_IN_ENUM_DISCRIMINANT: isize = 10; pub const pub_const: isize = 0; -const priv_const: isize = 0; //~ ERROR: constant `priv_const` is never used +const priv_const: isize = 0; //~ ERROR constant `priv_const` is never used const used_const: isize = 0; pub const used_const2: isize = used_const; const USED_CONST: isize = 1; @@ -33,7 +33,7 @@ const CONST_USED_IN_RANGE_PATTERN: isize = 12; pub type typ = *const UsedStruct4; pub struct PubStruct; -struct PrivStruct; //~ ERROR: struct `PrivStruct` is never constructed +struct PrivStruct; //~ ERROR struct `PrivStruct` is never constructed struct UsedStruct1 { #[allow(dead_code)] x: isize @@ -62,7 +62,7 @@ pub enum pub_enum3 { Bar = CONST_USED_IN_ENUM_DISCRIMINANT, } -enum priv_enum { foo2, bar2 } //~ ERROR: enum `priv_enum` is never used +enum priv_enum { foo2, bar2 } //~ ERROR enum `priv_enum` is never used enum used_enum { foo3, bar3 //~ ERROR variant `bar3` is never constructed @@ -87,21 +87,21 @@ pub fn pub_fn() { } f::(); } -fn priv_fn() { //~ ERROR: function `priv_fn` is never used +fn priv_fn() { //~ ERROR function `priv_fn` is never used let unused_struct = PrivStruct; } fn used_fn() {} -fn foo() { //~ ERROR: function `foo` is never used +fn foo() { //~ ERROR function `foo` is never used bar(); let unused_enum = priv_enum::foo2; } -fn bar() { //~ ERROR: function `bar` is never used +fn bar() { //~ ERROR function `bar` is never used foo(); } -fn baz() -> impl Copy { //~ ERROR: function `baz` is never used +fn baz() -> impl Copy { //~ ERROR function `baz` is never used "I'm unused, too" } diff --git a/tests/ui/lint/dead-code/lint-dead-code-2.rs b/tests/ui/lint/dead-code/lint-dead-code-2.rs index c82088ec54be9..4027d501449d3 100644 --- a/tests/ui/lint/dead-code/lint-dead-code-2.rs +++ b/tests/ui/lint/dead-code/lint-dead-code-2.rs @@ -19,7 +19,7 @@ impl Bar for Foo { fn live_fn() {} -fn dead_fn() {} //~ ERROR: function `dead_fn` is never used +fn dead_fn() {} //~ ERROR function `dead_fn` is never used fn used_fn() {} @@ -31,6 +31,6 @@ fn actual_main() { } // this is not main -fn main() { //~ ERROR: function `main` is never used +fn main() { //~ ERROR function `main` is never used dead_fn(); } diff --git a/tests/ui/lint/dead-code/lint-dead-code-3.rs b/tests/ui/lint/dead-code/lint-dead-code-3.rs index 20b568054dfb7..66d535f983d86 100644 --- a/tests/ui/lint/dead-code/lint-dead-code-3.rs +++ b/tests/ui/lint/dead-code/lint-dead-code-3.rs @@ -11,14 +11,14 @@ extern "C" { pub fn extern_foo(); } -struct Foo; //~ ERROR: struct `Foo` is never constructed +struct Foo; //~ ERROR struct `Foo` is never constructed impl Foo { - fn foo(&self) { //~ ERROR: method `foo` is never used + fn foo(&self) { //~ ERROR method `foo` is never used bar() } } -fn bar() { //~ ERROR: function `bar` is never used +fn bar() { //~ ERROR function `bar` is never used fn baz() {} Foo.foo(); @@ -57,9 +57,9 @@ mod blah { } } -enum c_void {} //~ ERROR: enum `c_void` is never used +enum c_void {} //~ ERROR enum `c_void` is never used extern "C" { - fn free(p: *const c_void); //~ ERROR: function `free` is never used + fn free(p: *const c_void); //~ ERROR function `free` is never used } // Check provided method @@ -74,11 +74,11 @@ mod inner { } fn anon_const() -> [(); { - fn blah() {} //~ ERROR: function `blah` is never used + fn blah() {} //~ ERROR function `blah` is never used 1 }] { [(); { - fn blah() {} //~ ERROR: function `blah` is never used + fn blah() {} //~ ERROR function `blah` is never used 1 }] } diff --git a/tests/ui/lint/dead-code/lint-dead-code-4.rs b/tests/ui/lint/dead-code/lint-dead-code-4.rs index 0fc6c6156fd93..0dc56c0a34337 100644 --- a/tests/ui/lint/dead-code/lint-dead-code-4.rs +++ b/tests/ui/lint/dead-code/lint-dead-code-4.rs @@ -4,7 +4,7 @@ struct Foo { x: usize, - b: bool, //~ ERROR: field `b` is never read + b: bool, //~ ERROR field `b` is never read } fn field_read(f: Foo) -> usize { @@ -58,7 +58,7 @@ fn field_match_in_patterns(b: XYZ) -> String { } struct Bar { - x: usize, //~ ERROR: fields `x` and `c` are never read + x: usize, //~ ERROR fields `x` and `c` are never read b: bool, c: bool, _guard: () diff --git a/tests/ui/lint/dead-code/lint-dead-code-5.rs b/tests/ui/lint/dead-code/lint-dead-code-5.rs index 76067d114a1ee..0e34b7f2552fb 100644 --- a/tests/ui/lint/dead-code/lint-dead-code-5.rs +++ b/tests/ui/lint/dead-code/lint-dead-code-5.rs @@ -3,14 +3,14 @@ enum Enum1 { Variant1(#[allow(dead_code)] isize), - Variant2 //~ ERROR: variant `Variant2` is never constructed + Variant2 //~ ERROR variant `Variant2` is never constructed } enum Enum2 { Variant3(#[allow(dead_code)] bool), #[allow(dead_code)] Variant4(isize), - Variant5 { _x: isize }, //~ ERROR: variants `Variant5` and `Variant6` are never constructed + Variant5 { _x: isize }, //~ ERROR variants `Variant5` and `Variant6` are never constructed Variant6(isize), _Variant7, Variant8 { _field: bool }, @@ -32,7 +32,7 @@ impl Enum2 { } } -enum Enum3 { //~ ERROR: enum `Enum3` is never used +enum Enum3 { //~ ERROR enum `Enum3` is never used Variant8, Variant9 } diff --git a/tests/ui/lint/dead-code/newline-span.rs b/tests/ui/lint/dead-code/newline-span.rs index 209c3cd937f9e..777c76091e798 100644 --- a/tests/ui/lint/dead-code/newline-span.rs +++ b/tests/ui/lint/dead-code/newline-span.rs @@ -1,14 +1,14 @@ #![deny(dead_code)] -fn unused() { //~ error: function `unused` is never used +fn unused() { //~ error function `unused` is never used println!("blah"); } -fn unused2(var: i32) { //~ error: function `unused2` is never used +fn unused2(var: i32) { //~ error function `unused2` is never used println!("foo {}", var); } -fn unused3( //~ error: function `unused3` is never used +fn unused3( //~ error function `unused3` is never used var: i32, ) { println!("bar {}", var); diff --git a/tests/ui/lint/dead-code/self-assign.rs b/tests/ui/lint/dead-code/self-assign.rs index 072a899e1bdb1..924166e04148c 100644 --- a/tests/ui/lint/dead-code/self-assign.rs +++ b/tests/ui/lint/dead-code/self-assign.rs @@ -10,10 +10,10 @@ fn main() { let mut x = 0; x = x; - //~^ WARNING: useless assignment of variable of type `i32` to itself + //~^ WARNING useless assignment of variable of type `i32` to itself x = (x); - //~^ WARNING: useless assignment of variable of type `i32` to itself + //~^ WARNING useless assignment of variable of type `i32` to itself x = {x}; // block expressions don't count as self-assignments @@ -22,10 +22,10 @@ fn main() { struct S<'a> { f: &'a str } let mut s = S { f: "abc" }; s = s; - //~^ WARNING: useless assignment of variable of type `S` to itself + //~^ WARNING useless assignment of variable of type `S` to itself s.f = s.f; - //~^ WARNING: useless assignment of field of type `&str` to itself + //~^ WARNING useless assignment of field of type `&str` to itself struct N0 { x: Box } @@ -34,11 +34,11 @@ fn main() { struct N3 { n: N2 }; let mut n3 = N3 { n: N2(N1 { n: N0 { x: Box::new(42) } }) }; n3.n.0.n.x = n3.n.0.n.x; - //~^ WARNING: useless assignment of field of type `Box` to itself + //~^ WARNING useless assignment of field of type `Box` to itself let mut t = (1, ((2, 3, (4, 5)),)); t.1.0.2.1 = t.1.0.2.1; - //~^ WARNING: useless assignment of field of type `i32` to itself + //~^ WARNING useless assignment of field of type `i32` to itself let mut y = 0; diff --git a/tests/ui/lint/dead-code/tuple-struct-field.rs b/tests/ui/lint/dead-code/tuple-struct-field.rs index ff3da4105000d..de8d3e7b63338 100644 --- a/tests/ui/lint/dead-code/tuple-struct-field.rs +++ b/tests/ui/lint/dead-code/tuple-struct-field.rs @@ -1,24 +1,24 @@ #![deny(dead_code)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here use std::marker::PhantomData; const LEN: usize = 4; struct UnusedAtTheEnd(i32, f32, [u8; LEN], String, u8); -//~^ ERROR:fields `1`, `2`, `3`, and `4` are never read -//~| NOTE: fields in this struct -//~| HELP: consider removing these fields +//~^ ERRORfields `1`, `2`, `3`, and `4` are never read +//~| NOTE fields in this struct +//~| HELP consider removing these fields struct UnusedJustOneField(i32); -//~^ ERROR: field `0` is never read -//~| NOTE: field in this struct -//~| HELP: consider removing this field +//~^ ERROR field `0` is never read +//~| NOTE field in this struct +//~| HELP consider removing this field struct UnusedInTheMiddle(i32, f32, String, u8, u32); -//~^ ERROR: fields `1`, `2`, and `4` are never read -//~| NOTE: fields in this struct -//~| HELP: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields +//~^ ERROR fields `1`, `2`, and `4` are never read +//~| NOTE fields in this struct +//~| HELP consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields struct GoodUnit(()); diff --git a/tests/ui/lint/dead-code/unused-variant.rs b/tests/ui/lint/dead-code/unused-variant.rs index 7030681eb36d9..aad4002ab4610 100644 --- a/tests/ui/lint/dead-code/unused-variant.rs +++ b/tests/ui/lint/dead-code/unused-variant.rs @@ -2,19 +2,19 @@ #[derive(Clone)] enum Enum { - Variant1, //~ ERROR: variant `Variant1` is never constructed + Variant1, //~ ERROR variant `Variant1` is never constructed Variant2, } #[derive(Debug)] enum TupleVariant { - Variant1(i32), //~ ERROR: variant `Variant1` is never constructed + Variant1(i32), //~ ERROR variant `Variant1` is never constructed Variant2, } #[derive(Debug)] enum StructVariant { - Variant1 { id: i32 }, //~ ERROR: variant `Variant1` is never constructed + Variant1 { id: i32 }, //~ ERROR variant `Variant1` is never constructed Variant2, } diff --git a/tests/ui/lint/deny-overflowing-literals.rs b/tests/ui/lint/deny-overflowing-literals.rs index 21c8ba7d6ce4e..2e7e8eb3c8f0e 100644 --- a/tests/ui/lint/deny-overflowing-literals.rs +++ b/tests/ui/lint/deny-overflowing-literals.rs @@ -1,7 +1,7 @@ fn main() { let x: u8 = 256; - //~^ error: literal out of range for `u8` + //~^ error literal out of range for `u8` for _ in 0..256u8 {} - //~^ error: range endpoint is out of range for `u8` + //~^ error range endpoint is out of range for `u8` } diff --git a/tests/ui/lint/extern-C-fnptr-lints-slices.rs b/tests/ui/lint/extern-C-fnptr-lints-slices.rs index 0c35eb37a4890..f9b066c618200 100644 --- a/tests/ui/lint/extern-C-fnptr-lints-slices.rs +++ b/tests/ui/lint/extern-C-fnptr-lints-slices.rs @@ -3,7 +3,7 @@ // It's an improper ctype (a slice) arg in an extern "C" fnptr. pub type F = extern "C" fn(&[u8]); -//~^ ERROR: `extern` fn uses type `[u8]`, which is not FFI-safe +//~^ ERROR `extern` fn uses type `[u8]`, which is not FFI-safe fn main() {} diff --git a/tests/ui/lint/force-warn/allowed-cli-deny-by-default-lint.rs b/tests/ui/lint/force-warn/allowed-cli-deny-by-default-lint.rs index 24631bdd63946..a8b6932845d6b 100644 --- a/tests/ui/lint/force-warn/allowed-cli-deny-by-default-lint.rs +++ b/tests/ui/lint/force-warn/allowed-cli-deny-by-default-lint.rs @@ -5,6 +5,6 @@ fn main() { unsafe { - let y = std::mem::transmute::<&i32, &mut i32>(&5); //~WARN: undefined behavior + let y = std::mem::transmute::<&i32, &mut i32>(&5); //~WARN undefined behavior } } diff --git a/tests/ui/lint/force-warn/allowed-deny-by-default-lint.rs b/tests/ui/lint/force-warn/allowed-deny-by-default-lint.rs index 2eb5bfe80cfa7..c6185f5bdc559 100644 --- a/tests/ui/lint/force-warn/allowed-deny-by-default-lint.rs +++ b/tests/ui/lint/force-warn/allowed-deny-by-default-lint.rs @@ -6,6 +6,6 @@ #![allow(mutable_transmutes)] fn main() { unsafe { - let y = std::mem::transmute::<&i32, &mut i32>(&5); //~WARN: undefined behavior + let y = std::mem::transmute::<&i32, &mut i32>(&5); //~WARN undefined behavior } } diff --git a/tests/ui/lint/force-warn/deny-by-default-lint.rs b/tests/ui/lint/force-warn/deny-by-default-lint.rs index c4a2da03facda..20b25f01c5863 100644 --- a/tests/ui/lint/force-warn/deny-by-default-lint.rs +++ b/tests/ui/lint/force-warn/deny-by-default-lint.rs @@ -4,6 +4,6 @@ fn main() { unsafe { - let y = std::mem::transmute::<&i32, &mut i32>(&5); //~WARN: undefined behavior + let y = std::mem::transmute::<&i32, &mut i32>(&5); //~WARN undefined behavior } } diff --git a/tests/ui/lint/inline-exported.rs b/tests/ui/lint/inline-exported.rs index 69e322ef513ae..89fb5772584c2 100644 --- a/tests/ui/lint/inline-exported.rs +++ b/tests/ui/lint/inline-exported.rs @@ -8,17 +8,17 @@ #![deny(unused_attributes)] #[inline] -//~^ ERROR: `#[inline]` is ignored on externally exported functions +//~^ ERROR `#[inline]` is ignored on externally exported functions #[no_mangle] fn no_mangle() {} #[inline] -//~^ ERROR: `#[inline]` is ignored on externally exported functions +//~^ ERROR `#[inline]` is ignored on externally exported functions #[export_name = "export_name"] fn export_name() {} #[inline] -//~^ ERROR: `#[inline]` is ignored on externally exported functions +//~^ ERROR `#[inline]` is ignored on externally exported functions #[linkage = "external"] fn external_linkage() {} diff --git a/tests/ui/lint/internal_features.rs b/tests/ui/lint/internal_features.rs index 32ce9540cb364..fdbacec4407e0 100644 --- a/tests/ui/lint/internal_features.rs +++ b/tests/ui/lint/internal_features.rs @@ -1,8 +1,8 @@ #![forbid(internal_features)] // A lang feature and a lib feature. #![feature(intrinsics, panic_internals)] -//~^ ERROR: internal -//~| ERROR: internal +//~^ ERROR internal +//~| ERROR internal extern "rust-intrinsic" { fn copy_nonoverlapping(src: *const T, dst: *mut T, count: usize); diff --git a/tests/ui/lint/invalid_value.rs b/tests/ui/lint/invalid_value.rs index 29e8e6cfef6dd..d4341afeecf60 100644 --- a/tests/ui/lint/invalid_value.rs +++ b/tests/ui/lint/invalid_value.rs @@ -50,97 +50,97 @@ pub(crate) struct WrapAroundRange(u8); #[allow(unused)] fn generic() { unsafe { - let _val: &'static T = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: &'static T = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: &'static T = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: &'static T = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: Wrap<&'static T> = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: Wrap<&'static T> = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: Wrap<&'static T> = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: Wrap<&'static T> = mem::uninitialized(); //~ ERROR does not permit being left uninitialized } } fn main() { unsafe { // Things that cannot even be zero. - let _val: ! = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: ! = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: ! = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: ! = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: (i32, !) = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: (i32, !) = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: (i32, !) = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: (i32, !) = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: Void = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: Void = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: Void = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: Void = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: &'static i32 = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: &'static i32 = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: &'static i32 = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: &'static i32 = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: Ref = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: Ref = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: Ref = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: Ref = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: fn() = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: fn() = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: fn() = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: fn() = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: Wrap = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: Wrap = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: Wrap = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: Wrap = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: WrapEnum = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: WrapEnum = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: WrapEnum = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: WrapEnum = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: Wrap<(RefPair, i32)> = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: Wrap<(RefPair, i32)> = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: Wrap<(RefPair, i32)> = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: Wrap<(RefPair, i32)> = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: NonNull = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: NonNull = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: NonNull = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: NonNull = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: (NonZero, i32) = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: (NonZero, i32) = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: (NonZero, i32) = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: (NonZero, i32) = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: *const dyn Send = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: *const dyn Send = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: *const dyn Send = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: *const dyn Send = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: [fn(); 2] = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: [fn(); 2] = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: [fn(); 2] = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: [fn(); 2] = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: TwoUninhabited = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: TwoUninhabited = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: TwoUninhabited = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: TwoUninhabited = mem::uninitialized(); //~ ERROR does not permit being left uninitialized - let _val: OneFruitNonZero = mem::zeroed(); //~ ERROR: does not permit zero-initialization - let _val: OneFruitNonZero = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: OneFruitNonZero = mem::zeroed(); //~ ERROR does not permit zero-initialization + let _val: OneFruitNonZero = mem::uninitialized(); //~ ERROR does not permit being left uninitialized // Things that can be zero, but not uninit. let _val: bool = mem::zeroed(); - let _val: bool = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: bool = mem::uninitialized(); //~ ERROR does not permit being left uninitialized let _val: Wrap = mem::zeroed(); - let _val: Wrap = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: Wrap = mem::uninitialized(); //~ ERROR does not permit being left uninitialized let _val: NonBig = mem::zeroed(); - let _val: NonBig = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: NonBig = mem::uninitialized(); //~ ERROR does not permit being left uninitialized let _val: Fruit = mem::zeroed(); - let _val: Fruit = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: Fruit = mem::uninitialized(); //~ ERROR does not permit being left uninitialized let _val: [bool; 2] = mem::zeroed(); - let _val: [bool; 2] = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: [bool; 2] = mem::uninitialized(); //~ ERROR does not permit being left uninitialized let _val: i32 = mem::zeroed(); - let _val: i32 = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: i32 = mem::uninitialized(); //~ ERROR does not permit being left uninitialized let _val: f32 = mem::zeroed(); - let _val: f32 = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: f32 = mem::uninitialized(); //~ ERROR does not permit being left uninitialized let _val: *const () = mem::zeroed(); - let _val: *const () = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: *const () = mem::uninitialized(); //~ ERROR does not permit being left uninitialized let _val: *const [()] = mem::zeroed(); - let _val: *const [()] = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: *const [()] = mem::uninitialized(); //~ ERROR does not permit being left uninitialized let _val: WrapAroundRange = mem::zeroed(); - let _val: WrapAroundRange = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: WrapAroundRange = mem::uninitialized(); //~ ERROR does not permit being left uninitialized // Things where 0 is okay due to rustc implementation details, // but that are not guaranteed to keep working. let _val: Result = mem::zeroed(); - let _val: Result = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized + let _val: Result = mem::uninitialized(); //~ ERROR does not permit being left uninitialized // Some things that happen to be UB-free due to rustc implementation details, // but are not guaranteed to keep working. @@ -148,14 +148,14 @@ fn main() { let _val: OneFruit = mem::uninitialized(); // Transmute-from-0 - let _val: &'static i32 = mem::transmute(0usize); //~ ERROR: does not permit zero-initialization - let _val: &'static [i32] = mem::transmute((0usize, 0usize)); //~ ERROR: does not permit zero-initialization - let _val: NonZero = mem::transmute(0); //~ ERROR: does not permit zero-initialization + let _val: &'static i32 = mem::transmute(0usize); //~ ERROR does not permit zero-initialization + let _val: &'static [i32] = mem::transmute((0usize, 0usize)); //~ ERROR does not permit zero-initialization + let _val: NonZero = mem::transmute(0); //~ ERROR does not permit zero-initialization // `MaybeUninit` cases - let _val: NonNull = MaybeUninit::zeroed().assume_init(); //~ ERROR: does not permit zero-initialization - let _val: NonNull = MaybeUninit::uninit().assume_init(); //~ ERROR: does not permit being left uninitialized - let _val: bool = MaybeUninit::uninit().assume_init(); //~ ERROR: does not permit being left uninitialized + let _val: NonNull = MaybeUninit::zeroed().assume_init(); //~ ERROR does not permit zero-initialization + let _val: NonNull = MaybeUninit::uninit().assume_init(); //~ ERROR does not permit being left uninitialized + let _val: bool = MaybeUninit::uninit().assume_init(); //~ ERROR does not permit being left uninitialized // Some more types that should work just fine. let _val: Option<&'static i32> = mem::zeroed(); diff --git a/tests/ui/lint/issue-117949.rs b/tests/ui/lint/issue-117949.rs index 5673227f35d39..9d623e6d824e4 100644 --- a/tests/ui/lint/issue-117949.rs +++ b/tests/ui/lint/issue-117949.rs @@ -9,12 +9,12 @@ fn main() { - format_args!("{}", 1 << 32); //~ ERROR: arithmetic operation will overflow - format_args!("{}", 1 >> 32); //~ ERROR: arithmetic operation will overflow - format_args!("{}", 1 + i32::MAX); //~ ERROR: arithmetic operation will overflow - format_args!("{}", -5 - i32::MAX); //~ ERROR: arithmetic operation will overflow - format_args!("{}", 5 * i32::MAX); //~ ERROR: arithmetic operation will overflow - format_args!("{}", 1 / 0); //~ ERROR: this operation will panic at runtime - format_args!("{}", 1 % 0); //~ ERROR: this operation will panic at runtime - format_args!("{}", [1, 2, 3][4]); //~ ERROR: this operation will panic at runtime + format_args!("{}", 1 << 32); //~ ERROR arithmetic operation will overflow + format_args!("{}", 1 >> 32); //~ ERROR arithmetic operation will overflow + format_args!("{}", 1 + i32::MAX); //~ ERROR arithmetic operation will overflow + format_args!("{}", -5 - i32::MAX); //~ ERROR arithmetic operation will overflow + format_args!("{}", 5 * i32::MAX); //~ ERROR arithmetic operation will overflow + format_args!("{}", 1 / 0); //~ ERROR this operation will panic at runtime + format_args!("{}", 1 % 0); //~ ERROR this operation will panic at runtime + format_args!("{}", [1, 2, 3][4]); //~ ERROR this operation will panic at runtime } diff --git a/tests/ui/lint/issue-17718-const-naming.rs b/tests/ui/lint/issue-17718-const-naming.rs index d7f0e72769b05..edb04635129e5 100644 --- a/tests/ui/lint/issue-17718-const-naming.rs +++ b/tests/ui/lint/issue-17718-const-naming.rs @@ -2,7 +2,7 @@ #![deny(warnings)] const foo: isize = 3; -//~^ ERROR: should have an upper case name -//~^^ ERROR: constant `foo` is never used +//~^ ERROR should have an upper case name +//~^^ ERROR constant `foo` is never used fn main() {} diff --git a/tests/ui/lint/issue-63364.rs b/tests/ui/lint/issue-63364.rs index 5223267a69a49..d6b9a7180fca4 100644 --- a/tests/ui/lint/issue-63364.rs +++ b/tests/ui/lint/issue-63364.rs @@ -4,7 +4,7 @@ fn part(_: u16) -> u32 { fn main() { for n in 100_000.. { - //~^ ERROR: literal out of range for `u16` + //~^ ERROR literal out of range for `u16` let _ = part(n); } } diff --git a/tests/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs b/tests/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs index 45b78d75b2749..e9f0226f89184 100644 --- a/tests/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs +++ b/tests/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs @@ -20,7 +20,7 @@ fn forbid_first(num: i32) -> i32 { #![forbid(unused)] #![deny(unused)] #![warn(unused)] - //~^ ERROR: warn(unused) incompatible with previous forbid + //~^ ERROR warn(unused) incompatible with previous forbid //~| WARNING being phased out #![allow(unused)] diff --git a/tests/ui/lint/lint-change-warnings.rs b/tests/ui/lint/lint-change-warnings.rs index 37af3b7612c2c..b40703d55cd5f 100644 --- a/tests/ui/lint/lint-change-warnings.rs +++ b/tests/ui/lint/lint-change-warnings.rs @@ -2,7 +2,7 @@ #![allow(dead_code)] fn main() { - while true {} //~ ERROR: infinite + while true {} //~ ERROR infinite } #[allow(warnings)] @@ -12,10 +12,10 @@ fn foo() { #[warn(warnings)] fn bar() { - while true {} //~ WARNING: infinite + while true {} //~ WARNING infinite } #[forbid(warnings)] fn baz() { - while true {} //~ ERROR: infinite + while true {} //~ ERROR infinite } diff --git a/tests/ui/lint/lint-ctypes-73249-2.rs b/tests/ui/lint/lint-ctypes-73249-2.rs index 31af0e3d381ef..582c8413a0037 100644 --- a/tests/ui/lint/lint-ctypes-73249-2.rs +++ b/tests/ui/lint/lint-ctypes-73249-2.rs @@ -24,7 +24,7 @@ struct A { } extern "C" { - fn lint_me() -> A<()>; //~ ERROR: uses type `Qux` + fn lint_me() -> A<()>; //~ ERROR uses type `Qux` } fn main() {} diff --git a/tests/ui/lint/lint-ctypes-73249-3.rs b/tests/ui/lint/lint-ctypes-73249-3.rs index 8bdf536bf77e6..f050a8808f9fb 100644 --- a/tests/ui/lint/lint-ctypes-73249-3.rs +++ b/tests/ui/lint/lint-ctypes-73249-3.rs @@ -18,7 +18,7 @@ pub struct A { } extern "C" { - pub fn lint_me() -> A; //~ ERROR: uses type `Qux` + pub fn lint_me() -> A; //~ ERROR uses type `Qux` } fn main() {} diff --git a/tests/ui/lint/lint-ctypes-73249-5.rs b/tests/ui/lint/lint-ctypes-73249-5.rs index cc6da59950d7a..8809a67341ccc 100644 --- a/tests/ui/lint/lint-ctypes-73249-5.rs +++ b/tests/ui/lint/lint-ctypes-73249-5.rs @@ -18,7 +18,7 @@ pub struct A { } extern "C" { - pub fn lint_me() -> A; //~ ERROR: uses type `Qux` + pub fn lint_me() -> A; //~ ERROR uses type `Qux` } fn main() {} diff --git a/tests/ui/lint/lint-ctypes-73251-1.rs b/tests/ui/lint/lint-ctypes-73251-1.rs index 07ae05be69f6c..f7988c13e9782 100644 --- a/tests/ui/lint/lint-ctypes-73251-1.rs +++ b/tests/ui/lint/lint-ctypes-73251-1.rs @@ -21,7 +21,7 @@ fn assign() -> Qux { } extern "C" { - fn lint_me() -> ::Assoc; //~ ERROR: uses type `Qux` + fn lint_me() -> ::Assoc; //~ ERROR uses type `Qux` } fn main() {} diff --git a/tests/ui/lint/lint-ctypes-73251-2.rs b/tests/ui/lint/lint-ctypes-73251-2.rs index c47118672e072..7daf63d7be227 100644 --- a/tests/ui/lint/lint-ctypes-73251-2.rs +++ b/tests/ui/lint/lint-ctypes-73251-2.rs @@ -35,7 +35,7 @@ fn use_of_b() -> AliasB { } extern "C" { - fn lint_me() -> ::Assoc; //~ ERROR: uses type `AliasA` + fn lint_me() -> ::Assoc; //~ ERROR uses type `AliasA` } fn main() {} diff --git a/tests/ui/lint/lint-ctypes-fn.rs b/tests/ui/lint/lint-ctypes-fn.rs index 73820c86d1a02..10efa07fd9eec 100644 --- a/tests/ui/lint/lint-ctypes-fn.rs +++ b/tests/ui/lint/lint-ctypes-fn.rs @@ -68,23 +68,23 @@ pub extern "C" fn ptr_unit(p: *const ()) { } pub extern "C" fn ptr_tuple(p: *const ((),)) { } pub extern "C" fn slice_type(p: &[u32]) { } -//~^ ERROR: uses type `[u32]` +//~^ ERROR uses type `[u32]` pub extern "C" fn str_type(p: &str) { } -//~^ ERROR: uses type `str` +//~^ ERROR uses type `str` pub extern "C" fn box_type(p: Box) { } pub extern "C" fn opt_box_type(p: Option>) { } pub extern "C" fn boxed_slice(p: Box<[u8]>) { } -//~^ ERROR: uses type `Box<[u8]>` +//~^ ERROR uses type `Box<[u8]>` pub extern "C" fn boxed_string(p: Box) { } -//~^ ERROR: uses type `Box` +//~^ ERROR uses type `Box` pub extern "C" fn boxed_trait(p: Box) { } -//~^ ERROR: uses type `Box` +//~^ ERROR uses type `Box` pub extern "C" fn char_type(p: char) { } //~^ ERROR uses type `char` @@ -121,10 +121,10 @@ pub extern "C" fn fn_type2(p: fn()) { } pub extern "C" fn fn_contained(p: RustBadRet) { } pub extern "C" fn transparent_i128(p: TransparentI128) { } -//~^ ERROR: uses type `i128` +//~^ ERROR uses type `i128` pub extern "C" fn transparent_str(p: TransparentStr) { } -//~^ ERROR: uses type `str` +//~^ ERROR uses type `str` pub extern "C" fn transparent_fn(p: TransparentBadFn) { } @@ -183,10 +183,10 @@ pub extern "C" fn used_generic3() -> T { } pub extern "C" fn used_generic4(x: Vec) { } -//~^ ERROR: uses type `Vec` +//~^ ERROR uses type `Vec` pub extern "C" fn used_generic5() -> Vec { -//~^ ERROR: uses type `Vec` +//~^ ERROR uses type `Vec` Default::default() } diff --git a/tests/ui/lint/lint-ctypes.rs b/tests/ui/lint/lint-ctypes.rs index 6dd9be10a48f8..619f3e1b0f149 100644 --- a/tests/ui/lint/lint-ctypes.rs +++ b/tests/ui/lint/lint-ctypes.rs @@ -44,12 +44,12 @@ pub struct TransparentCustomZst(i32, ZeroSize); pub struct ZeroSizeWithPhantomData(::std::marker::PhantomData); extern "C" { - pub fn ptr_type1(size: *const Foo); //~ ERROR: uses type `Foo` - pub fn ptr_type2(size: *const Foo); //~ ERROR: uses type `Foo` + pub fn ptr_type1(size: *const Foo); //~ ERROR uses type `Foo` + pub fn ptr_type2(size: *const Foo); //~ ERROR uses type `Foo` pub fn ptr_unit(p: *const ()); - pub fn ptr_tuple(p: *const ((),)); //~ ERROR: uses type `((),)` - pub fn slice_type(p: &[u32]); //~ ERROR: uses type `[u32]` - pub fn str_type(p: &str); //~ ERROR: uses type `str` + pub fn ptr_tuple(p: *const ((),)); //~ ERROR uses type `((),)` + pub fn slice_type(p: &[u32]); //~ ERROR uses type `[u32]` + pub fn str_type(p: &str); //~ ERROR uses type `str` pub fn box_type(p: Box); //~ ERROR uses type `Box` pub fn opt_box_type(p: Option>); //~^ ERROR uses type `Option>` @@ -66,19 +66,19 @@ extern "C" { -> ::std::marker::PhantomData; //~ ERROR uses type `PhantomData` pub fn fn_type(p: RustFn); //~ ERROR uses type `fn()` pub fn fn_type2(p: fn()); //~ ERROR uses type `fn()` - pub fn fn_contained(p: RustBadRet); //~ ERROR: uses type `Box` - pub fn transparent_i128(p: TransparentI128); //~ ERROR: uses type `i128` - pub fn transparent_str(p: TransparentStr); //~ ERROR: uses type `str` - pub fn transparent_fn(p: TransparentBadFn); //~ ERROR: uses type `Box` - pub fn raw_array(arr: [u8; 8]); //~ ERROR: uses type `[u8; 8]` + pub fn fn_contained(p: RustBadRet); //~ ERROR uses type `Box` + pub fn transparent_i128(p: TransparentI128); //~ ERROR uses type `i128` + pub fn transparent_str(p: TransparentStr); //~ ERROR uses type `str` + pub fn transparent_fn(p: TransparentBadFn); //~ ERROR uses type `Box` + pub fn raw_array(arr: [u8; 8]); //~ ERROR uses type `[u8; 8]` pub fn no_niche_a(a: Option>); - //~^ ERROR: uses type `Option>` + //~^ ERROR uses type `Option>` pub fn no_niche_b(b: Option>); - //~^ ERROR: uses type `Option>` + //~^ ERROR uses type `Option>` - pub static static_u128_type: u128; //~ ERROR: uses type `u128` - pub static static_u128_array_type: [u128; 16]; //~ ERROR: uses type `u128` + pub static static_u128_type: u128; //~ ERROR uses type `u128` + pub static static_u128_array_type: [u128; 16]; //~ ERROR uses type `u128` pub fn good3(fptr: Option); pub fn good4(aptr: &[u8; 4 as usize]); diff --git a/tests/ui/lint/lint-directives-on-use-items-issue-10534.rs b/tests/ui/lint/lint-directives-on-use-items-issue-10534.rs index e5cb0d3df0e7c..ed522b3cf35cc 100644 --- a/tests/ui/lint/lint-directives-on-use-items-issue-10534.rs +++ b/tests/ui/lint/lint-directives-on-use-items-issue-10534.rs @@ -9,7 +9,7 @@ mod a { pub static x: isize = 3; pub static y: isize = 4; } mod b { - use a::x; //~ ERROR: unused import + use a::x; //~ ERROR unused import #[allow(unused_imports)] use a::y; // no error here } @@ -18,7 +18,7 @@ mod b { mod c { use a::x; #[deny(unused_imports)] - use a::y; //~ ERROR: unused import + use a::y; //~ ERROR unused import } fn main() {} diff --git a/tests/ui/lint/lint-enum-intrinsics-non-enums.rs b/tests/ui/lint/lint-enum-intrinsics-non-enums.rs index 8ad337064e5bf..e07863ec75f12 100644 --- a/tests/ui/lint/lint-enum-intrinsics-non-enums.rs +++ b/tests/ui/lint/lint-enum-intrinsics-non-enums.rs @@ -24,19 +24,19 @@ fn test_discriminant() { generic_discriminant(&SomeEnum::B); discriminant(&()); - //~^ error: the return value of `mem::discriminant` is unspecified when called with a non-enum type + //~^ error the return value of `mem::discriminant` is unspecified when called with a non-enum type discriminant(&&SomeEnum::B); - //~^ error: the return value of `mem::discriminant` is unspecified when called with a non-enum type + //~^ error the return value of `mem::discriminant` is unspecified when called with a non-enum type discriminant(&SomeStruct); - //~^ error: the return value of `mem::discriminant` is unspecified when called with a non-enum type + //~^ error the return value of `mem::discriminant` is unspecified when called with a non-enum type discriminant(&123u32); - //~^ error: the return value of `mem::discriminant` is unspecified when called with a non-enum type + //~^ error the return value of `mem::discriminant` is unspecified when called with a non-enum type discriminant(&&123i8); - //~^ error: the return value of `mem::discriminant` is unspecified when called with a non-enum type + //~^ error the return value of `mem::discriminant` is unspecified when called with a non-enum type } fn test_variant_count() { @@ -44,16 +44,16 @@ fn test_variant_count() { generic_variant_count::(); variant_count::<&str>(); - //~^ error: the return value of `mem::variant_count` is unspecified when called with a non-enum type + //~^ error the return value of `mem::variant_count` is unspecified when called with a non-enum type variant_count::<*const u8>(); - //~^ error: the return value of `mem::variant_count` is unspecified when called with a non-enum type + //~^ error the return value of `mem::variant_count` is unspecified when called with a non-enum type variant_count::<()>(); - //~^ error: the return value of `mem::variant_count` is unspecified when called with a non-enum type + //~^ error the return value of `mem::variant_count` is unspecified when called with a non-enum type variant_count::<&SomeEnum>(); - //~^ error: the return value of `mem::variant_count` is unspecified when called with a non-enum type + //~^ error the return value of `mem::variant_count` is unspecified when called with a non-enum type } fn main() { diff --git a/tests/ui/lint/lint-forbid-internal-unsafe.rs b/tests/ui/lint/lint-forbid-internal-unsafe.rs index 3ee55ba96b137..349f831a0de1a 100644 --- a/tests/ui/lint/lint-forbid-internal-unsafe.rs +++ b/tests/ui/lint/lint-forbid-internal-unsafe.rs @@ -2,7 +2,7 @@ #![feature(allow_internal_unsafe)] #[allow_internal_unsafe] -//~^ ERROR: `allow_internal_unsafe` allows defining +//~^ ERROR `allow_internal_unsafe` allows defining macro_rules! evil { ($e:expr) => { unsafe { diff --git a/tests/ui/lint/lint-impl-fn.rs b/tests/ui/lint/lint-impl-fn.rs index 46874d95c32fb..35d377c10bf44 100644 --- a/tests/ui/lint/lint-impl-fn.rs +++ b/tests/ui/lint/lint-impl-fn.rs @@ -7,7 +7,7 @@ impl A { fn foo(&self) { while true {} } #[deny(while_true)] - fn bar(&self) { while true {} } //~ ERROR: infinite loops + fn bar(&self) { while true {} } //~ ERROR infinite loops } #[deny(while_true)] @@ -15,7 +15,7 @@ mod foo { struct B(isize); impl B { - fn foo(&self) { while true {} } //~ ERROR: infinite loops + fn foo(&self) { while true {} } //~ ERROR infinite loops #[allow(while_true)] fn bar(&self) { while true {} } @@ -24,7 +24,7 @@ mod foo { #[deny(while_true)] fn main() { - while true {} //~ ERROR: infinite loops + while true {} //~ ERROR infinite loops } #[deny(while_true)] diff --git a/tests/ui/lint/lint-missing-doc.rs b/tests/ui/lint/lint-missing-doc.rs index 0b7c99e501216..461d038ab03e7 100644 --- a/tests/ui/lint/lint-missing-doc.rs +++ b/tests/ui/lint/lint-missing-doc.rs @@ -13,15 +13,15 @@ pub extern crate missing_docs; type Typedef = String; -pub type PubTypedef = String; //~ ERROR: missing documentation for a type alias +pub type PubTypedef = String; //~ ERROR missing documentation for a type alias struct Foo { a: isize, b: isize, } -pub struct PubFoo { //~ ERROR: missing documentation for a struct - pub a: isize, //~ ERROR: missing documentation for a struct field +pub struct PubFoo { //~ ERROR missing documentation for a struct + pub a: isize, //~ ERROR missing documentation for a struct field b: isize, } @@ -32,11 +32,11 @@ pub struct PubFoo2 { } mod module_no_dox {} -pub mod pub_module_no_dox {} //~ ERROR: missing documentation for a module +pub mod pub_module_no_dox {} //~ ERROR missing documentation for a module /// dox pub fn foo() {} -pub fn foo2() {} //~ ERROR: missing documentation for a function +pub fn foo2() {} //~ ERROR missing documentation for a function fn foo3() {} #[allow(missing_docs)] pub fn foo4() {} @@ -54,11 +54,11 @@ trait B { fn foo_with_impl(&self) {} } -pub trait C { //~ ERROR: missing documentation for a trait - fn foo(&self); //~ ERROR: missing documentation for a method - fn foo_with_impl(&self) {} //~ ERROR: missing documentation for a method - fn foo_no_self(); //~ ERROR: missing documentation for an associated function - fn foo_no_self_with_impl() {} //~ ERROR: missing documentation for an associated function +pub trait C { //~ ERROR missing documentation for a trait + fn foo(&self); //~ ERROR missing documentation for a method + fn foo_with_impl(&self) {} //~ ERROR missing documentation for a method + fn foo_no_self(); //~ ERROR missing documentation for an associated function + fn foo_no_self_with_impl() {} //~ ERROR missing documentation for an associated function } #[allow(missing_docs)] @@ -68,8 +68,8 @@ pub trait D { /// dox pub trait E: Sized { - type AssociatedType; //~ ERROR: missing documentation for an associated type - type AssociatedTypeDef = Self; //~ ERROR: missing documentation for an associated type + type AssociatedType; //~ ERROR missing documentation for an associated type + type AssociatedTypeDef = Self; //~ ERROR missing documentation for an associated type /// dox type DocumentedType; @@ -85,7 +85,7 @@ impl Foo { } impl PubFoo { - pub fn foo() {} //~ ERROR: missing documentation for an associated function + pub fn foo() {} //~ ERROR missing documentation for an associated function /// dox pub fn foo1() {} fn foo2() {} @@ -122,9 +122,9 @@ enum Baz { BarB } -pub enum PubBaz { //~ ERROR: missing documentation for an enum - PubBazA { //~ ERROR: missing documentation for a variant - a: isize, //~ ERROR: missing documentation for a struct field +pub enum PubBaz { //~ ERROR missing documentation for an enum + PubBazA { //~ ERROR missing documentation for a variant + a: isize, //~ ERROR missing documentation for a struct field }, } @@ -155,7 +155,7 @@ pub const FOO1: u32 = 0; pub const FOO2: u32 = 0; #[doc(hidden)] pub const FOO3: u32 = 0; -pub const FOO4: u32 = 0; //~ ERROR: missing documentation for a const +pub const FOO4: u32 = 0; //~ ERROR missing documentation for a const static BAR: u32 = 0; @@ -165,20 +165,20 @@ pub static BAR1: u32 = 0; pub static BAR2: u32 = 0; #[doc(hidden)] pub static BAR3: u32 = 0; -pub static BAR4: u32 = 0; //~ ERROR: missing documentation for a static +pub static BAR4: u32 = 0; //~ ERROR missing documentation for a static mod internal_impl { /// dox pub fn documented() {} - pub fn undocumented1() {} //~ ERROR: missing documentation for a function - pub fn undocumented2() {} //~ ERROR: missing documentation for a function + pub fn undocumented1() {} //~ ERROR missing documentation for a function + pub fn undocumented2() {} //~ ERROR missing documentation for a function fn undocumented3() {} /// dox pub mod globbed { /// dox pub fn also_documented() {} - pub fn also_undocumented1() {} //~ ERROR: missing documentation for a function + pub fn also_undocumented1() {} //~ ERROR missing documentation for a function fn also_undocumented2() {} } } @@ -194,19 +194,19 @@ extern "C" { /// dox pub fn extern_fn_documented(f: f32) -> f32; pub fn extern_fn_undocumented(f: f32) -> f32; - //~^ ERROR: missing documentation for a function + //~^ ERROR missing documentation for a function /// dox pub static EXTERN_STATIC_DOCUMENTED: u8; pub static EXTERN_STATIC_UNDOCUMENTED: u8; - //~^ ERROR: missing documentation for a static + //~^ ERROR missing documentation for a static /// dox pub type ExternTyDocumented; pub type ExternTyUndocumented; - //~^ ERROR: missing documentation for a foreign type + //~^ ERROR missing documentation for a foreign type } -pub trait T = Sync; //~ ERROR: missing documentation for a trait alias +pub trait T = Sync; //~ ERROR missing documentation for a trait alias fn main() {} diff --git a/tests/ui/lint/lint-overflowing-ops.rs b/tests/ui/lint/lint-overflowing-ops.rs index 116460f11cc01..d45a69e45697d 100644 --- a/tests/ui/lint/lint-overflowing-ops.rs +++ b/tests/ui/lint/lint-overflowing-ops.rs @@ -25,307 +25,307 @@ use std::thread; fn main() { // Shift left - let _n = 1u8 << 8; //~ ERROR: arithmetic operation will overflow - let _n = &(1u8 << 8); //~ ERROR: arithmetic operation will overflow + let _n = 1u8 << 8; //~ ERROR arithmetic operation will overflow + let _n = &(1u8 << 8); //~ ERROR arithmetic operation will overflow - let _n = 1u16 << 16; //~ ERROR: arithmetic operation will overflow - let _n = &(1u16 << 16); //~ ERROR: arithmetic operation will overflow + let _n = 1u16 << 16; //~ ERROR arithmetic operation will overflow + let _n = &(1u16 << 16); //~ ERROR arithmetic operation will overflow - let _n = 1u32 << 32; //~ ERROR: arithmetic operation will overflow - let _n = &(1u32 << 32); //~ ERROR: arithmetic operation will overflow + let _n = 1u32 << 32; //~ ERROR arithmetic operation will overflow + let _n = &(1u32 << 32); //~ ERROR arithmetic operation will overflow - let _n = 1u64 << 64; //~ ERROR: arithmetic operation will overflow - let _n = &(1u64 << 64); //~ ERROR: arithmetic operation will overflow + let _n = 1u64 << 64; //~ ERROR arithmetic operation will overflow + let _n = &(1u64 << 64); //~ ERROR arithmetic operation will overflow - let _n = 1u128 << 128; //~ ERROR: arithmetic operation will overflow - let _n = &(1u128 << 128); //~ ERROR: arithmetic operation will overflow + let _n = 1u128 << 128; //~ ERROR arithmetic operation will overflow + let _n = &(1u128 << 128); //~ ERROR arithmetic operation will overflow - let _n = 1i8 << 8; //~ ERROR: arithmetic operation will overflow - let _n = &(1i8 << 8); //~ ERROR: arithmetic operation will overflow + let _n = 1i8 << 8; //~ ERROR arithmetic operation will overflow + let _n = &(1i8 << 8); //~ ERROR arithmetic operation will overflow - let _n = 1i16 << 16; //~ ERROR: arithmetic operation will overflow - let _n = &(1i16 << 16); //~ ERROR: arithmetic operation will overflow + let _n = 1i16 << 16; //~ ERROR arithmetic operation will overflow + let _n = &(1i16 << 16); //~ ERROR arithmetic operation will overflow - let _n = 1i32 << 32; //~ ERROR: arithmetic operation will overflow - let _n = &(1i32 << 32); //~ ERROR: arithmetic operation will overflow + let _n = 1i32 << 32; //~ ERROR arithmetic operation will overflow + let _n = &(1i32 << 32); //~ ERROR arithmetic operation will overflow - let _n = 1i64 << 64; //~ ERROR: arithmetic operation will overflow - let _n = &(1i64 << 64); //~ ERROR: arithmetic operation will overflow + let _n = 1i64 << 64; //~ ERROR arithmetic operation will overflow + let _n = &(1i64 << 64); //~ ERROR arithmetic operation will overflow - let _n = 1i128 << 128; //~ ERROR: arithmetic operation will overflow - let _n = &(1i128 << 128); //~ ERROR: arithmetic operation will overflow + let _n = 1i128 << 128; //~ ERROR arithmetic operation will overflow + let _n = &(1i128 << 128); //~ ERROR arithmetic operation will overflow - let _n = 1_isize << BITS; //~ ERROR: arithmetic operation will overflow - let _n = &(1_isize << BITS); //~ ERROR: arithmetic operation will overflow + let _n = 1_isize << BITS; //~ ERROR arithmetic operation will overflow + let _n = &(1_isize << BITS); //~ ERROR arithmetic operation will overflow - let _n = 1_usize << BITS; //~ ERROR: arithmetic operation will overflow - let _n = &(1_usize << BITS); //~ ERROR: arithmetic operation will overflow + let _n = 1_usize << BITS; //~ ERROR arithmetic operation will overflow + let _n = &(1_usize << BITS); //~ ERROR arithmetic operation will overflow - let _n = 1 << -1; //~ ERROR: arithmetic operation will overflow - let _n = &(1 << -1); //~ ERROR: arithmetic operation will overflow + let _n = 1 << -1; //~ ERROR arithmetic operation will overflow + let _n = &(1 << -1); //~ ERROR arithmetic operation will overflow // Shift right - let _n = -1_i64 >> 64; //~ ERROR: arithmetic operation will overflow - let _n = -1_i32 >> 32; //~ ERROR: arithmetic operation will overflow - let _n = -1_i32 >> -1; //~ ERROR: arithmetic operation will overflow + let _n = -1_i64 >> 64; //~ ERROR arithmetic operation will overflow + let _n = -1_i32 >> 32; //~ ERROR arithmetic operation will overflow + let _n = -1_i32 >> -1; //~ ERROR arithmetic operation will overflow - let _n = 1u8 >> 8; //~ ERROR: arithmetic operation will overflow - let _n = &(1u8 >> 8); //~ ERROR: arithmetic operation will overflow + let _n = 1u8 >> 8; //~ ERROR arithmetic operation will overflow + let _n = &(1u8 >> 8); //~ ERROR arithmetic operation will overflow - let _n = 1u16 >> 16; //~ ERROR: arithmetic operation will overflow - let _n = &(1u16 >> 16); //~ ERROR: arithmetic operation will overflow + let _n = 1u16 >> 16; //~ ERROR arithmetic operation will overflow + let _n = &(1u16 >> 16); //~ ERROR arithmetic operation will overflow - let _n = 1u32 >> 32; //~ ERROR: arithmetic operation will overflow - let _n = &(1u32 >> 32); //~ ERROR: arithmetic operation will overflow + let _n = 1u32 >> 32; //~ ERROR arithmetic operation will overflow + let _n = &(1u32 >> 32); //~ ERROR arithmetic operation will overflow - let _n = 1u64 >> 64; //~ ERROR: arithmetic operation will overflow - let _n = &(1u64 >> 64); //~ ERROR: arithmetic operation will overflow + let _n = 1u64 >> 64; //~ ERROR arithmetic operation will overflow + let _n = &(1u64 >> 64); //~ ERROR arithmetic operation will overflow - let _n = 1u128 >> 128; //~ ERROR: arithmetic operation will overflow - let _n = &(1u128 >> 128); //~ ERROR: arithmetic operation will overflow + let _n = 1u128 >> 128; //~ ERROR arithmetic operation will overflow + let _n = &(1u128 >> 128); //~ ERROR arithmetic operation will overflow - let _n = 1i8 >> 8; //~ ERROR: arithmetic operation will overflow - let _n = &(1i8 >> 8); //~ ERROR: arithmetic operation will overflow + let _n = 1i8 >> 8; //~ ERROR arithmetic operation will overflow + let _n = &(1i8 >> 8); //~ ERROR arithmetic operation will overflow - let _n = 1i16 >> 16; //~ ERROR: arithmetic operation will overflow - let _n = &(1i16 >> 16); //~ ERROR: arithmetic operation will overflow + let _n = 1i16 >> 16; //~ ERROR arithmetic operation will overflow + let _n = &(1i16 >> 16); //~ ERROR arithmetic operation will overflow - let _n = 1i32 >> 32; //~ ERROR: arithmetic operation will overflow - let _n = &(1i32 >> 32); //~ ERROR: arithmetic operation will overflow + let _n = 1i32 >> 32; //~ ERROR arithmetic operation will overflow + let _n = &(1i32 >> 32); //~ ERROR arithmetic operation will overflow - let _n = 1i64 >> 64; //~ ERROR: arithmetic operation will overflow - let _n = &(1i64 >> 64); //~ ERROR: arithmetic operation will overflow + let _n = 1i64 >> 64; //~ ERROR arithmetic operation will overflow + let _n = &(1i64 >> 64); //~ ERROR arithmetic operation will overflow - let _n = 1i128 >> 128; //~ ERROR: arithmetic operation will overflow - let _n = &(1i128 >> 128); //~ ERROR: arithmetic operation will overflow + let _n = 1i128 >> 128; //~ ERROR arithmetic operation will overflow + let _n = &(1i128 >> 128); //~ ERROR arithmetic operation will overflow - let _n = 1_isize >> BITS; //~ ERROR: arithmetic operation will overflow - let _n = &(1_isize >> BITS); //~ ERROR: arithmetic operation will overflow + let _n = 1_isize >> BITS; //~ ERROR arithmetic operation will overflow + let _n = &(1_isize >> BITS); //~ ERROR arithmetic operation will overflow - let _n = 1_usize >> BITS; //~ ERROR: arithmetic operation will overflow - let _n = &(1_usize >> BITS); //~ ERROR: arithmetic operation will overflow + let _n = 1_usize >> BITS; //~ ERROR arithmetic operation will overflow + let _n = &(1_usize >> BITS); //~ ERROR arithmetic operation will overflow - let _n = 1i64 >> [64][0]; //~ ERROR: arithmetic operation will overflow - let _n = &(1i64 >> [64][0]); //~ ERROR: arithmetic operation will overflow + let _n = 1i64 >> [64][0]; //~ ERROR arithmetic operation will overflow + let _n = &(1i64 >> [64][0]); //~ ERROR arithmetic operation will overflow // Addition - let _n = 1u8 + u8::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(1u8 + u8::MAX); //~ ERROR: arithmetic operation will overflow + let _n = 1u8 + u8::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(1u8 + u8::MAX); //~ ERROR arithmetic operation will overflow - let _n = 1u16 + u16::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(1u16 + u16::MAX); //~ ERROR: arithmetic operation will overflow + let _n = 1u16 + u16::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(1u16 + u16::MAX); //~ ERROR arithmetic operation will overflow - let _n = 1u32 + u32::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(1u32 + u32::MAX); //~ ERROR: arithmetic operation will overflow + let _n = 1u32 + u32::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(1u32 + u32::MAX); //~ ERROR arithmetic operation will overflow - let _n = 1u64 + u64::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(1u64 + u64::MAX); //~ ERROR: arithmetic operation will overflow + let _n = 1u64 + u64::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(1u64 + u64::MAX); //~ ERROR arithmetic operation will overflow - let _n = 1u128 + u128::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(1u128 + u128::MAX); //~ ERROR: arithmetic operation will overflow + let _n = 1u128 + u128::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(1u128 + u128::MAX); //~ ERROR arithmetic operation will overflow - let _n = 1i8 + i8::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(1i8 + i8::MAX); //~ ERROR: arithmetic operation will overflow + let _n = 1i8 + i8::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(1i8 + i8::MAX); //~ ERROR arithmetic operation will overflow - let _n = 1i16 + i16::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(1i16 + i16::MAX); //~ ERROR: arithmetic operation will overflow + let _n = 1i16 + i16::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(1i16 + i16::MAX); //~ ERROR arithmetic operation will overflow - let _n = 1i32 + i32::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(1i32 + i32::MAX); //~ ERROR: arithmetic operation will overflow + let _n = 1i32 + i32::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(1i32 + i32::MAX); //~ ERROR arithmetic operation will overflow - let _n = 1i64 + i64::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(1i64 + i64::MAX); //~ ERROR: arithmetic operation will overflow + let _n = 1i64 + i64::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(1i64 + i64::MAX); //~ ERROR arithmetic operation will overflow - let _n = 1i128 + i128::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(1i128 + i128::MAX); //~ ERROR: arithmetic operation will overflow + let _n = 1i128 + i128::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(1i128 + i128::MAX); //~ ERROR arithmetic operation will overflow - let _n = 1isize + isize::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(1isize + isize::MAX); //~ ERROR: arithmetic operation will overflow + let _n = 1isize + isize::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(1isize + isize::MAX); //~ ERROR arithmetic operation will overflow - let _n = 1usize + usize::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(1usize + usize::MAX); //~ ERROR: arithmetic operation will overflow + let _n = 1usize + usize::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(1usize + usize::MAX); //~ ERROR arithmetic operation will overflow // Subtraction - let _n = 1u8 - 5; //~ ERROR: arithmetic operation will overflow - let _n = &(1u8 - 5); //~ ERROR: arithmetic operation will overflow + let _n = 1u8 - 5; //~ ERROR arithmetic operation will overflow + let _n = &(1u8 - 5); //~ ERROR arithmetic operation will overflow - let _n = 1u16 - 5; //~ ERROR: arithmetic operation will overflow - let _n = &(1u16 - 5); //~ ERROR: arithmetic operation will overflow + let _n = 1u16 - 5; //~ ERROR arithmetic operation will overflow + let _n = &(1u16 - 5); //~ ERROR arithmetic operation will overflow - let _n = 1u32 - 5; //~ ERROR: arithmetic operation will overflow - let _n = &(1u32 - 5); //~ ERROR: arithmetic operation will overflow + let _n = 1u32 - 5; //~ ERROR arithmetic operation will overflow + let _n = &(1u32 - 5); //~ ERROR arithmetic operation will overflow - let _n = 1u64 - 5 ; //~ ERROR: arithmetic operation will overflow - let _n = &(1u64 - 5); //~ ERROR: arithmetic operation will overflow + let _n = 1u64 - 5 ; //~ ERROR arithmetic operation will overflow + let _n = &(1u64 - 5); //~ ERROR arithmetic operation will overflow - let _n = 1u128 - 5 ; //~ ERROR: arithmetic operation will overflow - let _n = &(1u128 - 5); //~ ERROR: arithmetic operation will overflow + let _n = 1u128 - 5 ; //~ ERROR arithmetic operation will overflow + let _n = &(1u128 - 5); //~ ERROR arithmetic operation will overflow - let _n = -5i8 - i8::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(-5i8 - i8::MAX); //~ ERROR: arithmetic operation will overflow + let _n = -5i8 - i8::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(-5i8 - i8::MAX); //~ ERROR arithmetic operation will overflow - let _n = -5i16 - i16::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(-5i16 - i16::MAX); //~ ERROR: arithmetic operation will overflow + let _n = -5i16 - i16::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(-5i16 - i16::MAX); //~ ERROR arithmetic operation will overflow - let _n = -5i32 - i32::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(-5i32 - i32::MAX); //~ ERROR: arithmetic operation will overflow + let _n = -5i32 - i32::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(-5i32 - i32::MAX); //~ ERROR arithmetic operation will overflow - let _n = -5i64 - i64::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(-5i64 - i64::MAX); //~ ERROR: arithmetic operation will overflow + let _n = -5i64 - i64::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(-5i64 - i64::MAX); //~ ERROR arithmetic operation will overflow - let _n = -5i128 - i128::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(-5i128 - i128::MAX); //~ ERROR: arithmetic operation will overflow + let _n = -5i128 - i128::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(-5i128 - i128::MAX); //~ ERROR arithmetic operation will overflow - let _n = -5isize - isize::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(-5isize - isize::MAX); //~ ERROR: arithmetic operation will overflow + let _n = -5isize - isize::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(-5isize - isize::MAX); //~ ERROR arithmetic operation will overflow - let _n = 1usize - 5; //~ ERROR: arithmetic operation will overflow - let _n = &(1usize - 5); //~ ERROR: arithmetic operation will overflow + let _n = 1usize - 5; //~ ERROR arithmetic operation will overflow + let _n = &(1usize - 5); //~ ERROR arithmetic operation will overflow let _n = -i8::MIN; //~ ERROR this arithmetic operation will overflow let _n = &(-i8::MIN); //~ ERROR this arithmetic operation will overflow // Multiplication - let _n = u8::MAX * 5; //~ ERROR: arithmetic operation will overflow - let _n = &(u8::MAX * 5); //~ ERROR: arithmetic operation will overflow + let _n = u8::MAX * 5; //~ ERROR arithmetic operation will overflow + let _n = &(u8::MAX * 5); //~ ERROR arithmetic operation will overflow - let _n = u16::MAX * 5; //~ ERROR: arithmetic operation will overflow - let _n = &(u16::MAX * 5); //~ ERROR: arithmetic operation will overflow + let _n = u16::MAX * 5; //~ ERROR arithmetic operation will overflow + let _n = &(u16::MAX * 5); //~ ERROR arithmetic operation will overflow - let _n = u32::MAX * 5; //~ ERROR: arithmetic operation will overflow - let _n = &(u32::MAX * 5); //~ ERROR: arithmetic operation will overflow + let _n = u32::MAX * 5; //~ ERROR arithmetic operation will overflow + let _n = &(u32::MAX * 5); //~ ERROR arithmetic operation will overflow - let _n = u64::MAX * 5; //~ ERROR: arithmetic operation will overflow - let _n = &(u64::MAX * 5); //~ ERROR: arithmetic operation will overflow + let _n = u64::MAX * 5; //~ ERROR arithmetic operation will overflow + let _n = &(u64::MAX * 5); //~ ERROR arithmetic operation will overflow - let _n = u128::MAX * 5; //~ ERROR: arithmetic operation will overflow - let _n = &(u128::MAX * 5); //~ ERROR: arithmetic operation will overflow + let _n = u128::MAX * 5; //~ ERROR arithmetic operation will overflow + let _n = &(u128::MAX * 5); //~ ERROR arithmetic operation will overflow - let _n = usize::MAX * 5; //~ ERROR: arithmetic operation will overflow - let _n = &(usize::MAX * 5); //~ ERROR: arithmetic operation will overflow + let _n = usize::MAX * 5; //~ ERROR arithmetic operation will overflow + let _n = &(usize::MAX * 5); //~ ERROR arithmetic operation will overflow - let _n = i8::MAX * i8::MAX; //~ ERROR: arithmetic operation will overflow - let _n = &(i8::MAX * i8::MAX); //~ ERROR: arithmetic operation will overflow + let _n = i8::MAX * i8::MAX; //~ ERROR arithmetic operation will overflow + let _n = &(i8::MAX * i8::MAX); //~ ERROR arithmetic operation will overflow - let _n = i16::MAX * 5; //~ ERROR: arithmetic operation will overflow - let _n = &(i16::MAX * 5); //~ ERROR: arithmetic operation will overflow + let _n = i16::MAX * 5; //~ ERROR arithmetic operation will overflow + let _n = &(i16::MAX * 5); //~ ERROR arithmetic operation will overflow - let _n = i32::MAX * 5; //~ ERROR: arithmetic operation will overflow - let _n = &(i32::MAX * 5); //~ ERROR: arithmetic operation will overflow + let _n = i32::MAX * 5; //~ ERROR arithmetic operation will overflow + let _n = &(i32::MAX * 5); //~ ERROR arithmetic operation will overflow - let _n = i64::MAX * 5; //~ ERROR: arithmetic operation will overflow - let _n = &(i64::MAX * 5); //~ ERROR: arithmetic operation will overflow + let _n = i64::MAX * 5; //~ ERROR arithmetic operation will overflow + let _n = &(i64::MAX * 5); //~ ERROR arithmetic operation will overflow - let _n = i128::MAX * 5; //~ ERROR: arithmetic operation will overflow - let _n = &(i128::MAX * 5); //~ ERROR: arithmetic operation will overflow + let _n = i128::MAX * 5; //~ ERROR arithmetic operation will overflow + let _n = &(i128::MAX * 5); //~ ERROR arithmetic operation will overflow - let _n = isize::MAX * 5; //~ ERROR: arithmetic operation will overflow - let _n = &(isize::MAX * 5); //~ ERROR: arithmetic operation will overflow + let _n = isize::MAX * 5; //~ ERROR arithmetic operation will overflow + let _n = &(isize::MAX * 5); //~ ERROR arithmetic operation will overflow // Division - let _n = 1u8 / 0; //~ ERROR: this operation will panic at runtime - let _n = &(1u8 / 0); //~ ERROR: this operation will panic at runtime + let _n = 1u8 / 0; //~ ERROR this operation will panic at runtime + let _n = &(1u8 / 0); //~ ERROR this operation will panic at runtime - let _n = 1u16 / 0; //~ ERROR: this operation will panic at runtime - let _n = &(1u16 / 0); //~ ERROR: this operation will panic at runtime + let _n = 1u16 / 0; //~ ERROR this operation will panic at runtime + let _n = &(1u16 / 0); //~ ERROR this operation will panic at runtime - let _n = 1u32 / 0; //~ ERROR: this operation will panic at runtime - let _n = &(1u32 / 0); //~ ERROR: this operation will panic at runtime + let _n = 1u32 / 0; //~ ERROR this operation will panic at runtime + let _n = &(1u32 / 0); //~ ERROR this operation will panic at runtime - let _n = 1u64 / 0; //~ ERROR: this operation will panic at runtime - let _n = &(1u64 / 0); //~ ERROR: this operation will panic at runtime + let _n = 1u64 / 0; //~ ERROR this operation will panic at runtime + let _n = &(1u64 / 0); //~ ERROR this operation will panic at runtime - let _n = 1u128 / 0; //~ ERROR: this operation will panic at runtime - let _n = &(1u128 / 0); //~ ERROR: this operation will panic at runtime + let _n = 1u128 / 0; //~ ERROR this operation will panic at runtime + let _n = &(1u128 / 0); //~ ERROR this operation will panic at runtime - let _n = 1usize / 0; //~ ERROR: this operation will panic at runtime - let _n = &(1usize / 0); //~ ERROR: this operation will panic at runtime + let _n = 1usize / 0; //~ ERROR this operation will panic at runtime + let _n = &(1usize / 0); //~ ERROR this operation will panic at runtime - let _n = 1i8 / 0; //~ ERROR: this operation will panic at runtime - let _n = &(1i8 / 0); //~ ERROR: this operation will panic at runtime - let _n = i8::MIN / -1; //~ ERROR: this operation will panic at runtime - let _n = &(i8::MIN / -1); //~ ERROR: this operation will panic at runtime + let _n = 1i8 / 0; //~ ERROR this operation will panic at runtime + let _n = &(1i8 / 0); //~ ERROR this operation will panic at runtime + let _n = i8::MIN / -1; //~ ERROR this operation will panic at runtime + let _n = &(i8::MIN / -1); //~ ERROR this operation will panic at runtime - let _n = 1i16 / 0; //~ ERROR: this operation will panic at runtime - let _n = &(1i16 / 0); //~ ERROR: this operation will panic at runtime - let _n = i16::MIN / -1; //~ ERROR: this operation will panic at runtime - let _n = &(i16::MIN / -1); //~ ERROR: this operation will panic at runtime + let _n = 1i16 / 0; //~ ERROR this operation will panic at runtime + let _n = &(1i16 / 0); //~ ERROR this operation will panic at runtime + let _n = i16::MIN / -1; //~ ERROR this operation will panic at runtime + let _n = &(i16::MIN / -1); //~ ERROR this operation will panic at runtime - let _n = 1i32 / 0; //~ ERROR: this operation will panic at runtime - let _n = &(1i32 / 0); //~ ERROR: this operation will panic at runtime - let _n = i32::MIN / -1; //~ ERROR: this operation will panic at runtime - let _n = &(i32::MIN / -1); //~ ERROR: this operation will panic at runtime + let _n = 1i32 / 0; //~ ERROR this operation will panic at runtime + let _n = &(1i32 / 0); //~ ERROR this operation will panic at runtime + let _n = i32::MIN / -1; //~ ERROR this operation will panic at runtime + let _n = &(i32::MIN / -1); //~ ERROR this operation will panic at runtime - let _n = 1i64 / 0; //~ ERROR: this operation will panic at runtime - let _n = &(1i64 / 0); //~ ERROR: this operation will panic at runtime - let _n = i64::MIN / -1; //~ ERROR: this operation will panic at runtime - let _n = &(i64::MIN / -1); //~ ERROR: this operation will panic at runtime + let _n = 1i64 / 0; //~ ERROR this operation will panic at runtime + let _n = &(1i64 / 0); //~ ERROR this operation will panic at runtime + let _n = i64::MIN / -1; //~ ERROR this operation will panic at runtime + let _n = &(i64::MIN / -1); //~ ERROR this operation will panic at runtime - let _n = 1i128 / 0; //~ ERROR: this operation will panic at runtime - let _n = &(1i128 / 0); //~ ERROR: this operation will panic at runtime - let _n = i128::MIN / -1; //~ ERROR: this operation will panic at runtime - let _n = &(i128::MIN / -1); //~ ERROR: this operation will panic at runtime + let _n = 1i128 / 0; //~ ERROR this operation will panic at runtime + let _n = &(1i128 / 0); //~ ERROR this operation will panic at runtime + let _n = i128::MIN / -1; //~ ERROR this operation will panic at runtime + let _n = &(i128::MIN / -1); //~ ERROR this operation will panic at runtime - let _n = 1isize / 0; //~ ERROR: this operation will panic at runtime - let _n = &(1isize / 0); //~ ERROR: this operation will panic at runtime - let _n = isize::MIN / -1; //~ ERROR: this operation will panic at runtime - let _n = &(isize::MIN / -1); //~ ERROR: this operation will panic at runtime + let _n = 1isize / 0; //~ ERROR this operation will panic at runtime + let _n = &(1isize / 0); //~ ERROR this operation will panic at runtime + let _n = isize::MIN / -1; //~ ERROR this operation will panic at runtime + let _n = &(isize::MIN / -1); //~ ERROR this operation will panic at runtime // Modulus - let _n = 1u8 % 0; //~ ERROR: this operation will panic at runtime - let _n = &(1u8 % 0); //~ ERROR: this operation will panic at runtime + let _n = 1u8 % 0; //~ ERROR this operation will panic at runtime + let _n = &(1u8 % 0); //~ ERROR this operation will panic at runtime - let _n = 1u16 % 0; //~ ERROR: this operation will panic at runtime - let _n = &(1u16 % 0); //~ ERROR: this operation will panic at runtime + let _n = 1u16 % 0; //~ ERROR this operation will panic at runtime + let _n = &(1u16 % 0); //~ ERROR this operation will panic at runtime - let _n = 1u32 % 0; //~ ERROR: this operation will panic at runtime - let _n = &(1u32 % 0); //~ ERROR: this operation will panic at runtime + let _n = 1u32 % 0; //~ ERROR this operation will panic at runtime + let _n = &(1u32 % 0); //~ ERROR this operation will panic at runtime - let _n = 1u64 % 0; //~ ERROR: this operation will panic at runtime - let _n = &(1u64 % 0); //~ ERROR: this operation will panic at runtime + let _n = 1u64 % 0; //~ ERROR this operation will panic at runtime + let _n = &(1u64 % 0); //~ ERROR this operation will panic at runtime - let _n = 1u128 % 0; //~ ERROR: this operation will panic at runtime - let _n = &(1u128 % 0); //~ ERROR: this operation will panic at runtime + let _n = 1u128 % 0; //~ ERROR this operation will panic at runtime + let _n = &(1u128 % 0); //~ ERROR this operation will panic at runtime - let _n = 1usize % 0; //~ ERROR: this operation will panic at runtime - let _n = &(1usize % 0); //~ ERROR: this operation will panic at runtime + let _n = 1usize % 0; //~ ERROR this operation will panic at runtime + let _n = &(1usize % 0); //~ ERROR this operation will panic at runtime - let _n = 1i8 % 0; //~ ERROR: this operation will panic at runtime - let _n = &(1i8 % 0); //~ ERROR: this operation will panic at runtime - let _n = i8::MIN % -1; //~ ERROR: this operation will panic at runtime - let _n = &(i8::MIN % -1); //~ ERROR: this operation will panic at runtime + let _n = 1i8 % 0; //~ ERROR this operation will panic at runtime + let _n = &(1i8 % 0); //~ ERROR this operation will panic at runtime + let _n = i8::MIN % -1; //~ ERROR this operation will panic at runtime + let _n = &(i8::MIN % -1); //~ ERROR this operation will panic at runtime - let _n = 1i16 % 0; //~ ERROR: this operation will panic at runtime - let _n = &(1i16 % 0); //~ ERROR: this operation will panic at runtime - let _n = i16::MIN % -1; //~ ERROR: this operation will panic at runtime - let _n = &(i16::MIN % -1); //~ ERROR: this operation will panic at runtime + let _n = 1i16 % 0; //~ ERROR this operation will panic at runtime + let _n = &(1i16 % 0); //~ ERROR this operation will panic at runtime + let _n = i16::MIN % -1; //~ ERROR this operation will panic at runtime + let _n = &(i16::MIN % -1); //~ ERROR this operation will panic at runtime - let _n = 1i32 % 0; //~ ERROR: this operation will panic at runtime - let _n = &(1i32 % 0); //~ ERROR: this operation will panic at runtime - let _n = i32::MIN % -1; //~ ERROR: this operation will panic at runtime - let _n = &(i32::MIN % -1); //~ ERROR: this operation will panic at runtime + let _n = 1i32 % 0; //~ ERROR this operation will panic at runtime + let _n = &(1i32 % 0); //~ ERROR this operation will panic at runtime + let _n = i32::MIN % -1; //~ ERROR this operation will panic at runtime + let _n = &(i32::MIN % -1); //~ ERROR this operation will panic at runtime - let _n = 1i64 % 0; //~ ERROR: this operation will panic at runtime - let _n = &(1i64 % 0); //~ ERROR: this operation will panic at runtime - let _n = i64::MIN % -1; //~ ERROR: this operation will panic at runtime - let _n = &(i64::MIN % -1); //~ ERROR: this operation will panic at runtime + let _n = 1i64 % 0; //~ ERROR this operation will panic at runtime + let _n = &(1i64 % 0); //~ ERROR this operation will panic at runtime + let _n = i64::MIN % -1; //~ ERROR this operation will panic at runtime + let _n = &(i64::MIN % -1); //~ ERROR this operation will panic at runtime - let _n = 1i128 % 0; //~ ERROR: this operation will panic at runtime - let _n = &(1i128 % 0); //~ ERROR: this operation will panic at runtime - let _n = i128::MIN % -1; //~ ERROR: this operation will panic at runtime - let _n = &(i128::MIN % -1); //~ ERROR: this operation will panic at runtime + let _n = 1i128 % 0; //~ ERROR this operation will panic at runtime + let _n = &(1i128 % 0); //~ ERROR this operation will panic at runtime + let _n = i128::MIN % -1; //~ ERROR this operation will panic at runtime + let _n = &(i128::MIN % -1); //~ ERROR this operation will panic at runtime - let _n = 1isize % 0; //~ ERROR: this operation will panic at runtime - let _n = &(1isize % 0); //~ ERROR: this operation will panic at runtime - let _n = isize::MIN % -1; //~ ERROR: this operation will panic at runtime - let _n = &(isize::MIN % -1); //~ ERROR: this operation will panic at runtime + let _n = 1isize % 0; //~ ERROR this operation will panic at runtime + let _n = &(1isize % 0); //~ ERROR this operation will panic at runtime + let _n = isize::MIN % -1; //~ ERROR this operation will panic at runtime + let _n = &(isize::MIN % -1); //~ ERROR this operation will panic at runtime // Out of bounds access - let _n = [1, 2, 3][4]; //~ ERROR: this operation will panic at runtime - let _n = &([1, 2, 3][4]); //~ ERROR: this operation will panic at runtime + let _n = [1, 2, 3][4]; //~ ERROR this operation will panic at runtime + let _n = &([1, 2, 3][4]); //~ ERROR this operation will panic at runtime } diff --git a/tests/ui/lint/lint-qualification.fixed b/tests/ui/lint/lint-qualification.fixed index 7c8fd5236e608..10a7ad7a15553 100644 --- a/tests/ui/lint/lint-qualification.fixed +++ b/tests/ui/lint/lint-qualification.fixed @@ -9,25 +9,25 @@ mod foo { fn main() { use foo::bar; - bar(); //~ ERROR: unnecessary qualification - bar(); //~ ERROR: unnecessary qualification + bar(); //~ ERROR unnecessary qualification + bar(); //~ ERROR unnecessary qualification bar(); let _ = || -> Result<(), ()> { try!(Ok(())); Ok(()) }; // issue #37345 - let _ = String::new(); //~ ERROR: unnecessary qualification + let _ = String::new(); //~ ERROR unnecessary qualification let _: Vec = Vec::::new(); - //~^ ERROR: unnecessary qualification - //~| ERROR: unnecessary qualification + //~^ ERROR unnecessary qualification + //~| ERROR unnecessary qualification - - //~^ ERROR: unused import: `std::fmt` + + //~^ ERROR unused import: `std::fmt` let _: std::fmt::Result = Ok(()); // don't report unnecessary qualification because fix(#122373) for issue #121331 let _ = ::default(); // issue #121999 (modified) - //~^ ERROR: unnecessary qualification + //~^ ERROR unnecessary qualification macro_rules! m { ($a:ident, $b:ident) => { $crate::foo::bar(); // issue #37357 diff --git a/tests/ui/lint/lint-qualification.rs b/tests/ui/lint/lint-qualification.rs index 009b3080d5c79..a1537fbb70b9b 100644 --- a/tests/ui/lint/lint-qualification.rs +++ b/tests/ui/lint/lint-qualification.rs @@ -9,25 +9,25 @@ mod foo { fn main() { use foo::bar; - foo::bar(); //~ ERROR: unnecessary qualification - crate::foo::bar(); //~ ERROR: unnecessary qualification + foo::bar(); //~ ERROR unnecessary qualification + crate::foo::bar(); //~ ERROR unnecessary qualification bar(); let _ = || -> Result<(), ()> { try!(Ok(())); Ok(()) }; // issue #37345 - let _ = std::string::String::new(); //~ ERROR: unnecessary qualification + let _ = std::string::String::new(); //~ ERROR unnecessary qualification let _: std::vec::Vec = std::vec::Vec::::new(); - //~^ ERROR: unnecessary qualification - //~| ERROR: unnecessary qualification + //~^ ERROR unnecessary qualification + //~| ERROR unnecessary qualification use std::fmt; - //~^ ERROR: unused import: `std::fmt` + //~^ ERROR unused import: `std::fmt` let _: std::fmt::Result = Ok(()); // don't report unnecessary qualification because fix(#122373) for issue #121331 let _ = ::default(); // issue #121999 (modified) - //~^ ERROR: unnecessary qualification + //~^ ERROR unnecessary qualification macro_rules! m { ($a:ident, $b:ident) => { $crate::foo::bar(); // issue #37357 diff --git a/tests/ui/lint/lint-type-overflow.rs b/tests/ui/lint/lint-type-overflow.rs index 9672da6d3586c..72b35881ca20d 100644 --- a/tests/ui/lint/lint-type-overflow.rs +++ b/tests/ui/lint/lint-type-overflow.rs @@ -7,39 +7,39 @@ fn test(x: i8) { #[allow(unused_variables)] fn main() { let x1: u8 = 255; // should be OK - let x1: u8 = 256; //~ error: literal out of range for `u8` + let x1: u8 = 256; //~ error literal out of range for `u8` let x1 = 255_u8; // should be OK - let x1 = 256_u8; //~ error: literal out of range for `u8` + let x1 = 256_u8; //~ error literal out of range for `u8` let x2: i8 = -128; // should be OK - let x1: i8 = 128; //~ error: literal out of range for `i8` + let x1: i8 = 128; //~ error literal out of range for `i8` - let x3: i8 = -129; //~ error: literal out of range for `i8` - let x3: i8 = -(129); //~ error: literal out of range for `i8` - let x3: i8 = -{129}; //~ error: literal out of range for `i8` + let x3: i8 = -129; //~ error literal out of range for `i8` + let x3: i8 = -(129); //~ error literal out of range for `i8` + let x3: i8 = -{129}; //~ error literal out of range for `i8` - test(1000); //~ error: literal out of range for `i8` + test(1000); //~ error literal out of range for `i8` - let x = 128_i8; //~ error: literal out of range for `i8` + let x = 128_i8; //~ error literal out of range for `i8` let x = 127_i8; let x = -128_i8; let x = -(128_i8); - let x = -129_i8; //~ error: literal out of range for `i8` + let x = -129_i8; //~ error literal out of range for `i8` let x: i32 = 2147483647; // should be OK let x = 2147483647_i32; // should be OK - let x: i32 = 2147483648; //~ error: literal out of range for `i32` - let x = 2147483648_i32; //~ error: literal out of range for `i32` + let x: i32 = 2147483648; //~ error literal out of range for `i32` + let x = 2147483648_i32; //~ error literal out of range for `i32` let x: i32 = -2147483648; // should be OK let x = -2147483648_i32; // should be OK - let x: i32 = -2147483649; //~ error: literal out of range for `i32` - let x = -2147483649_i32; //~ error: literal out of range for `i32` - let x = 2147483648; //~ error: literal out of range for `i32` + let x: i32 = -2147483649; //~ error literal out of range for `i32` + let x = -2147483649_i32; //~ error literal out of range for `i32` + let x = 2147483648; //~ error literal out of range for `i32` - let x = 9223372036854775808_i64; //~ error: literal out of range for `i64` + let x = 9223372036854775808_i64; //~ error literal out of range for `i64` let x = -9223372036854775808_i64; // should be OK - let x = 18446744073709551615_i64; //~ error: literal out of range for `i64` - let x: i64 = -9223372036854775809; //~ error: literal out of range for `i64` - let x = -9223372036854775809_i64; //~ error: literal out of range for `i64` + let x = 18446744073709551615_i64; //~ error literal out of range for `i64` + let x: i64 = -9223372036854775809; //~ error literal out of range for `i64` + let x = -9223372036854775809_i64; //~ error literal out of range for `i64` } diff --git a/tests/ui/lint/lint-unconditional-recursion-tail-calls.rs b/tests/ui/lint/lint-unconditional-recursion-tail-calls.rs index c94bf03257972..9d4fc8e66f551 100644 --- a/tests/ui/lint/lint-unconditional-recursion-tail-calls.rs +++ b/tests/ui/lint/lint-unconditional-recursion-tail-calls.rs @@ -1,14 +1,14 @@ #![allow(incomplete_features, dead_code)] -#![deny(unconditional_recursion)] //~ note: the lint level is defined here +#![deny(unconditional_recursion)] //~ note the lint level is defined here #![feature(explicit_tail_calls)] fn f(x: bool) { - //~^ error: function cannot return without recursing - //~| note: cannot return without recursing + //~^ error function cannot return without recursing + //~| note cannot return without recursing if x { become f(!x) } else { - f(!x) //~ note: recursive call site + f(!x) //~ note recursive call site } } diff --git a/tests/ui/lint/lint-unsafe-code.rs b/tests/ui/lint/lint-unsafe-code.rs index b72e4c3a9e7fb..1166b644a8f1a 100644 --- a/tests/ui/lint/lint-unsafe-code.rs +++ b/tests/ui/lint/lint-unsafe-code.rs @@ -18,18 +18,18 @@ mod allowed_unsafe { macro_rules! unsafe_in_macro { () => {{ - #[no_mangle] fn foo() {} //~ ERROR: declaration of a `no_mangle` function - #[no_mangle] static FOO: u32 = 5; //~ ERROR: declaration of a `no_mangle` static + #[no_mangle] fn foo() {} //~ ERROR declaration of a `no_mangle` function + #[no_mangle] static FOO: u32 = 5; //~ ERROR declaration of a `no_mangle` static #[export_name = "bar"] fn bar() {} - //~^ ERROR: declaration of a function with `export_name` + //~^ ERROR declaration of a function with `export_name` #[export_name = "BAR"] static BAR: u32 = 5; - //~^ ERROR: declaration of a static with `export_name` - unsafe {} //~ ERROR: usage of an `unsafe` block + //~^ ERROR declaration of a static with `export_name` + unsafe {} //~ ERROR usage of an `unsafe` block }} } -#[no_mangle] fn foo() {} //~ ERROR: declaration of a `no_mangle` function -#[no_mangle] static FOO: u32 = 5; //~ ERROR: declaration of a `no_mangle` static +#[no_mangle] fn foo() {} //~ ERROR declaration of a `no_mangle` function +#[no_mangle] static FOO: u32 = 5; //~ ERROR declaration of a `no_mangle` static trait AssocFnTrait { fn foo(); @@ -38,42 +38,42 @@ trait AssocFnTrait { struct AssocFnFoo; impl AssocFnFoo { - #[no_mangle] fn foo() {} //~ ERROR: declaration of a `no_mangle` method + #[no_mangle] fn foo() {} //~ ERROR declaration of a `no_mangle` method } impl AssocFnTrait for AssocFnFoo { - #[no_mangle] fn foo() {} //~ ERROR: declaration of a `no_mangle` method + #[no_mangle] fn foo() {} //~ ERROR declaration of a `no_mangle` method } -#[export_name = "bar"] fn bar() {} //~ ERROR: declaration of a function with `export_name` -#[export_name = "BAR"] static BAR: u32 = 5; //~ ERROR: declaration of a static with `export_name` +#[export_name = "bar"] fn bar() {} //~ ERROR declaration of a function with `export_name` +#[export_name = "BAR"] static BAR: u32 = 5; //~ ERROR declaration of a static with `export_name` -#[link_section = ".example_section"] fn uwu() {} //~ ERROR: declaration of a function with `link_section` -#[link_section = ".example_section"] static UWU: u32 = 5; //~ ERROR: declaration of a static with `link_section` +#[link_section = ".example_section"] fn uwu() {} //~ ERROR declaration of a function with `link_section` +#[link_section = ".example_section"] static UWU: u32 = 5; //~ ERROR declaration of a static with `link_section` struct AssocFnBar; impl AssocFnBar { - #[export_name = "bar"] fn bar() {} //~ ERROR: declaration of a method with `export_name` + #[export_name = "bar"] fn bar() {} //~ ERROR declaration of a method with `export_name` } impl AssocFnTrait for AssocFnBar { - #[export_name = "bar"] fn foo() {} //~ ERROR: declaration of a method with `export_name` + #[export_name = "bar"] fn foo() {} //~ ERROR declaration of a method with `export_name` } -unsafe fn baz() {} //~ ERROR: declaration of an `unsafe` function -unsafe trait Foo {} //~ ERROR: declaration of an `unsafe` trait -unsafe impl Foo for Bar {} //~ ERROR: implementation of an `unsafe` trait +unsafe fn baz() {} //~ ERROR declaration of an `unsafe` function +unsafe trait Foo {} //~ ERROR declaration of an `unsafe` trait +unsafe impl Foo for Bar {} //~ ERROR implementation of an `unsafe` trait trait Baz { - unsafe fn baz(&self); //~ ERROR: declaration of an `unsafe` method - unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method - unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method + unsafe fn baz(&self); //~ ERROR declaration of an `unsafe` method + unsafe fn provided(&self) {} //~ ERROR implementation of an `unsafe` method + unsafe fn provided_override(&self) {} //~ ERROR implementation of an `unsafe` method } impl Baz for Bar { - unsafe fn baz(&self) {} //~ ERROR: implementation of an `unsafe` method - unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method + unsafe fn baz(&self) {} //~ ERROR implementation of an `unsafe` method + unsafe fn provided_override(&self) {} //~ ERROR implementation of an `unsafe` method } @@ -92,7 +92,7 @@ impl Baz for Bar2 { impl Baz for Bar3 { #[allow(unsafe_code)] unsafe fn baz(&self) {} - unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method + unsafe fn provided_override(&self) {} //~ ERROR implementation of an `unsafe` method } #[allow(unsafe_code)] @@ -103,17 +103,17 @@ unsafe trait B { trait C { #[allow(unsafe_code)] unsafe fn baz(&self); - unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method + unsafe fn provided(&self) {} //~ ERROR implementation of an `unsafe` method } impl C for Bar { #[allow(unsafe_code)] unsafe fn baz(&self) {} - unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method + unsafe fn provided(&self) {} //~ ERROR implementation of an `unsafe` method } impl C for Bar2 { - unsafe fn baz(&self) {} //~ ERROR: implementation of an `unsafe` method + unsafe fn baz(&self) {} //~ ERROR implementation of an `unsafe` method } trait D { @@ -124,7 +124,7 @@ trait D { impl D for Bar {} fn main() { - unsafe {} //~ ERROR: usage of an `unsafe` block + unsafe {} //~ ERROR usage of an `unsafe` block unsafe_in_macro!() } diff --git a/tests/ui/lint/lints-in-foreign-macros.rs b/tests/ui/lint/lints-in-foreign-macros.rs index 49e83bae6421f..adbfcb90cc75d 100644 --- a/tests/ui/lint/lints-in-foreign-macros.rs +++ b/tests/ui/lint/lints-in-foreign-macros.rs @@ -8,14 +8,14 @@ extern crate lints_in_foreign_macros; macro_rules! foo { - () => {use std::string::ToString;} //~ WARN: unused import + () => {use std::string::ToString;} //~ WARN unused import } mod a { foo!(); } mod b { bar!(); } -mod c { baz!(use std::string::ToString;); } //~ WARN: unused import -mod d { baz2!(use std::string::ToString;); } //~ WARN: unused import -baz!(pub fn undocumented() {}); //~ WARN: missing documentation for a function -baz2!(pub fn undocumented2() {}); //~ WARN: missing documentation for a function +mod c { baz!(use std::string::ToString;); } //~ WARN unused import +mod d { baz2!(use std::string::ToString;); } //~ WARN unused import +baz!(pub fn undocumented() {}); //~ WARN missing documentation for a function +baz2!(pub fn undocumented2() {}); //~ WARN missing documentation for a function fn main() {} diff --git a/tests/ui/lint/recommend-literal.rs b/tests/ui/lint/recommend-literal.rs index 453cbf28569e9..036a37596c1a3 100644 --- a/tests/ui/lint/recommend-literal.rs +++ b/tests/ui/lint/recommend-literal.rs @@ -8,10 +8,10 @@ fn main() { //~^ ERROR cannot find type `long` in this scope //~| HELP perhaps you intended to use this type let v1: Boolean = true; - //~^ ERROR: cannot find type `Boolean` in this scope [E0412] + //~^ ERROR cannot find type `Boolean` in this scope [E0412] //~| HELP perhaps you intended to use this type let v2: Bool = true; - //~^ ERROR: cannot find type `Bool` in this scope [E0412] + //~^ ERROR cannot find type `Bool` in this scope [E0412] //~| HELP a builtin type with a similar name exists //~| HELP perhaps you intended to use this type } diff --git a/tests/ui/lint/special-upper-lower-cases.rs b/tests/ui/lint/special-upper-lower-cases.rs index d77ffbcbfa3d1..2bf38cfa07d60 100644 --- a/tests/ui/lint/special-upper-lower-cases.rs +++ b/tests/ui/lint/special-upper-lower-cases.rs @@ -8,16 +8,16 @@ #![allow(uncommon_codepoints, unused)] struct 𝕟𝕠𝕥𝕒𝕔𝕒𝕞𝕖𝕝; -//~^ WARN: type `𝕟𝕠𝕥𝕒𝕔𝕒𝕞𝕖𝕝` should have an upper camel case name +//~^ WARN type `𝕟𝕠𝕥𝕒𝕔𝕒𝕞𝕖𝕝` should have an upper camel case name // FIXME: How we should handle this? struct 𝕟𝕠𝕥_𝕒_𝕔𝕒𝕞𝕖𝕝; -//~^ WARN: type `𝕟𝕠𝕥_𝕒_𝕔𝕒𝕞𝕖𝕝` should have an upper camel case name +//~^ WARN type `𝕟𝕠𝕥_𝕒_𝕔𝕒𝕞𝕖𝕝` should have an upper camel case name static 𝗻𝗼𝗻𝘂𝗽𝗽𝗲𝗿𝗰𝗮𝘀𝗲: i32 = 1; -//~^ WARN: static variable `𝗻𝗼𝗻𝘂𝗽𝗽𝗲𝗿𝗰𝗮𝘀𝗲` should have an upper case name +//~^ WARN static variable `𝗻𝗼𝗻𝘂𝗽𝗽𝗲𝗿𝗰𝗮𝘀𝗲` should have an upper case name fn main() { let 𝓢𝓝𝓐𝓐𝓐𝓐𝓚𝓔𝓢 = 1; - //~^ WARN: variable `𝓢𝓝𝓐𝓐𝓐𝓐𝓚𝓔𝓢` should have a snake case name + //~^ WARN variable `𝓢𝓝𝓐𝓐𝓐𝓐𝓚𝓔𝓢` should have a snake case name } diff --git a/tests/ui/lint/unconditional_panic_98444.rs b/tests/ui/lint/unconditional_panic_98444.rs index 56e0cf68d8a86..07f44e78b2a60 100644 --- a/tests/ui/lint/unconditional_panic_98444.rs +++ b/tests/ui/lint/unconditional_panic_98444.rs @@ -3,5 +3,5 @@ fn main() { let xs: [i32; 5] = [1, 2, 3, 4, 5]; let _ = &xs; - let _ = xs[7]; //~ ERROR: this operation will panic at runtime [unconditional_panic] + let _ = xs[7]; //~ ERROR this operation will panic at runtime [unconditional_panic] } diff --git a/tests/ui/lint/unconditional_panic_promoted.rs b/tests/ui/lint/unconditional_panic_promoted.rs index e9ae834c8d80a..d2c7a2123cf93 100644 --- a/tests/ui/lint/unconditional_panic_promoted.rs +++ b/tests/ui/lint/unconditional_panic_promoted.rs @@ -4,5 +4,5 @@ fn main() { // MIR encodes this as a reborrow from a promoted constant. // But the array length can still be gotten from the type. let slice = &[0, 1]; - let _ = slice[2]; //~ ERROR: this operation will panic at runtime [unconditional_panic] + let _ = slice[2]; //~ ERROR this operation will panic at runtime [unconditional_panic] } diff --git a/tests/ui/lint/unqualified_local_imports.rs b/tests/ui/lint/unqualified_local_imports.rs index 9de71471342dc..4fb388967af2d 100644 --- a/tests/ui/lint/unqualified_local_imports.rs +++ b/tests/ui/lint/unqualified_local_imports.rs @@ -11,7 +11,7 @@ mod localmod { use std::cell::Cell; // Implicitly local import, gets lint. -use localmod::S; //~ERROR: unqualified +use localmod::S; //~ERROR unqualified // Explicitly local import, no lint. use self::localmod::T; diff --git a/tests/ui/lint/unsafe_code/lint-global-asm-as-unsafe.rs b/tests/ui/lint/unsafe_code/lint-global-asm-as-unsafe.rs index 02df0e6de9509..5b81ffeb73798 100644 --- a/tests/ui/lint/unsafe_code/lint-global-asm-as-unsafe.rs +++ b/tests/ui/lint/unsafe_code/lint-global-asm-as-unsafe.rs @@ -10,11 +10,11 @@ mod allowed_unsafe { macro_rules! unsafe_in_macro { () => { - global_asm!(""); //~ ERROR: usage of `core::arch::global_asm` + global_asm!(""); //~ ERROR usage of `core::arch::global_asm` }; } -global_asm!(""); //~ ERROR: usage of `core::arch::global_asm` +global_asm!(""); //~ ERROR usage of `core::arch::global_asm` unsafe_in_macro!(); fn main() {} diff --git a/tests/ui/lint/unused/issue-30730.rs b/tests/ui/lint/unused/issue-30730.rs index d6be90c8148d7..2e6402a466c6a 100644 --- a/tests/ui/lint/unused/issue-30730.rs +++ b/tests/ui/lint/unused/issue-30730.rs @@ -1,5 +1,5 @@ #![warn(unused)] #![deny(warnings)] use std::thread; -//~^ ERROR: unused import +//~^ ERROR unused import fn main() {} diff --git a/tests/ui/lint/unused/issue-74883-unused-paren-baren-yield.rs b/tests/ui/lint/unused/issue-74883-unused-paren-baren-yield.rs index 12e2bcb898cad..5d04664b50e66 100644 --- a/tests/ui/lint/unused/issue-74883-unused-paren-baren-yield.rs +++ b/tests/ui/lint/unused/issue-74883-unused-paren-baren-yield.rs @@ -11,12 +11,12 @@ fn main() { while let Some(_) = {yield} {} // Only warn these cases - while let Some(_) = ({yield}) {} //~ ERROR: unnecessary parentheses - while let Some(_) = ((yield)) {} //~ ERROR: unnecessary parentheses - {{yield}}; //~ ERROR: unnecessary braces - {( yield )}; //~ ERROR: unnecessary parentheses - while let Some(_) = {(yield)} {} //~ ERROR: unnecessary parentheses - while let Some(_) = {{yield}} {} //~ ERROR: unnecessary braces + while let Some(_) = ({yield}) {} //~ ERROR unnecessary parentheses + while let Some(_) = ((yield)) {} //~ ERROR unnecessary parentheses + {{yield}}; //~ ERROR unnecessary braces + {( yield )}; //~ ERROR unnecessary parentheses + while let Some(_) = {(yield)} {} //~ ERROR unnecessary parentheses + while let Some(_) = {{yield}} {} //~ ERROR unnecessary braces // FIXME: It'd be great if we could also warn them. ((yield)); diff --git a/tests/ui/lint/unused/issue-85913.rs b/tests/ui/lint/unused/issue-85913.rs index 7f3817b6ef1cc..a64e1d98e72da 100644 --- a/tests/ui/lint/unused/issue-85913.rs +++ b/tests/ui/lint/unused/issue-85913.rs @@ -2,7 +2,7 @@ pub fn fun() -> i32 { function() && return 1; - //~^ ERROR: unused logical operation that must be used + //~^ ERROR unused logical operation that must be used return 0; } diff --git a/tests/ui/lint/unused/lint-unused-extern-crate.rs b/tests/ui/lint/unused/lint-unused-extern-crate.rs index 58ce3a4f55c7d..57bb909790f7d 100644 --- a/tests/ui/lint/unused/lint-unused-extern-crate.rs +++ b/tests/ui/lint/unused/lint-unused-extern-crate.rs @@ -8,7 +8,7 @@ #![allow(unused_variables)] #![allow(deprecated)] -extern crate lint_unused_extern_crate5; //~ ERROR: unused extern crate +extern crate lint_unused_extern_crate5; //~ ERROR unused extern crate pub extern crate lint_unused_extern_crate4; // no error, it is re-exported diff --git a/tests/ui/lint/unused/lint-unused-mut-self.fixed b/tests/ui/lint/unused/lint-unused-mut-self.fixed index d64facb50d3b4..b6b22ddf9268c 100644 --- a/tests/ui/lint/unused/lint-unused-mut-self.fixed +++ b/tests/ui/lint/unused/lint-unused-mut-self.fixed @@ -7,8 +7,8 @@ struct Foo; impl Foo { - fn foo(self) {} //~ ERROR: variable does not need to be mutable - fn bar(self: Box) {} //~ ERROR: variable does not need to be mutable + fn foo(self) {} //~ ERROR variable does not need to be mutable + fn bar(self: Box) {} //~ ERROR variable does not need to be mutable } fn main() {} diff --git a/tests/ui/lint/unused/lint-unused-mut-self.rs b/tests/ui/lint/unused/lint-unused-mut-self.rs index 6333dca34da43..409cc6e56cace 100644 --- a/tests/ui/lint/unused/lint-unused-mut-self.rs +++ b/tests/ui/lint/unused/lint-unused-mut-self.rs @@ -7,8 +7,8 @@ struct Foo; impl Foo { - fn foo(mut self) {} //~ ERROR: variable does not need to be mutable - fn bar(mut self: Box) {} //~ ERROR: variable does not need to be mutable + fn foo(mut self) {} //~ ERROR variable does not need to be mutable + fn bar(mut self: Box) {} //~ ERROR variable does not need to be mutable } fn main() {} diff --git a/tests/ui/lint/unused/lint-unused-mut-variables.rs b/tests/ui/lint/unused/lint-unused-mut-variables.rs index 0467e87ce229b..ddff166fc6324 100644 --- a/tests/ui/lint/unused/lint-unused-mut-variables.rs +++ b/tests/ui/lint/unused/lint-unused-mut-variables.rs @@ -6,12 +6,12 @@ async fn baz_async( mut a: i32, - //~^ WARN: variable does not need to be mutable + //~^ WARN variable does not need to be mutable #[allow(unused_mut)] mut b: i32, ) {} fn baz( mut a: i32, - //~^ WARN: variable does not need to be mutable + //~^ WARN variable does not need to be mutable #[allow(unused_mut)] mut b: i32, #[allow(unused_mut)] (mut c, d): (i32, i32) ) {} @@ -20,13 +20,13 @@ struct RefStruct {} impl RefStruct { async fn baz_async( mut a: i32, - //~^ WARN: variable does not need to be mutable + //~^ WARN variable does not need to be mutable #[allow(unused_mut)] mut b: i32, ) {} fn baz( &self, mut a: i32, - //~^ WARN: variable does not need to be mutable + //~^ WARN variable does not need to be mutable #[allow(unused_mut)] mut b: i32, #[allow(unused_mut)] (mut c, d): (i32, i32) ) {} @@ -36,7 +36,7 @@ trait RefTrait { fn baz( &self, mut a: i32, - //~^ WARN: variable does not need to be mutable + //~^ WARN variable does not need to be mutable #[allow(unused_mut)] mut b: i32, #[allow(unused_mut)] (mut c, d): (i32, i32) ) {} @@ -45,7 +45,7 @@ impl RefTrait for () { fn baz( &self, mut a: i32, - //~^ WARN: variable does not need to be mutable + //~^ WARN variable does not need to be mutable #[allow(unused_mut)] mut b: i32, #[allow(unused_mut)] (mut c, d): (i32, i32) ) {} @@ -54,32 +54,32 @@ impl RefTrait for () { fn main() { let _ = async move | mut a: i32, - //~^ WARN: variable does not need to be mutable + //~^ WARN variable does not need to be mutable #[allow(unused_mut)] mut b: i32, | {}; let _ = | mut a: i32, - //~^ WARN: variable does not need to be mutable + //~^ WARN variable does not need to be mutable #[allow(unused_mut)] mut b: i32, #[allow(unused_mut)] (mut c, d): (i32, i32) | {}; // negative cases - let mut a = 3; //~ WARN: variable does not need to be mutable + let mut a = 3; //~ WARN variable does not need to be mutable - let mut a = 2; //~ WARN: variable does not need to be mutable + let mut a = 2; //~ WARN variable does not need to be mutable - let mut b = 3; //~ WARN: variable does not need to be mutable + let mut b = 3; //~ WARN variable does not need to be mutable - let mut a = vec![3]; //~ WARN: variable does not need to be mutable + let mut a = vec![3]; //~ WARN variable does not need to be mutable - let (mut a, b) = (1, 2); //~ WARN: variable does not need to be mutable + let (mut a, b) = (1, 2); //~ WARN variable does not need to be mutable - let mut a; //~ WARN: variable does not need to be mutable + let mut a; //~ WARN variable does not need to be mutable a = 3; - let mut b; //~ WARN: variable does not need to be mutable + let mut b; //~ WARN variable does not need to be mutable if true { b = 3; @@ -88,14 +88,14 @@ fn main() { } match 30 { - mut x => {} //~ WARN: variable does not need to be mutable + mut x => {} //~ WARN variable does not need to be mutable } match (30, 2) { // FIXME: Here's a false positive, // shouldn't be removed `mut` not to be bound with a different way. - (mut x, 1) | //~ WARN: variable does not need to be mutable + (mut x, 1) | //~ WARN variable does not need to be mutable (mut x, 2) | (mut x, 3) => { @@ -103,20 +103,20 @@ fn main() { _ => {} } - let x = |mut y: isize| 10; //~ WARN: variable does not need to be mutable + let x = |mut y: isize| 10; //~ WARN variable does not need to be mutable - fn what(mut foo: isize) {} //~ WARN: variable does not need to be mutable + fn what(mut foo: isize) {} //~ WARN variable does not need to be mutable - let mut a = &mut 5; //~ WARN: variable does not need to be mutable + let mut a = &mut 5; //~ WARN variable does not need to be mutable *a = 4; let mut a = 5; - let mut b = (&mut a,); //~ WARN: variable does not need to be mutable + let mut b = (&mut a,); //~ WARN variable does not need to be mutable *b.0 = 4; - let mut x = &mut 1; //~ WARN: variable does not need to be mutable + let mut x = &mut 1; //~ WARN variable does not need to be mutable let mut f = || { *x += 1; @@ -124,11 +124,11 @@ fn main() { f(); fn mut_ref_arg(mut arg : &mut [u8]) -> &mut [u8] { - &mut arg[..] //~^ WARN: variable does not need to be mutable + &mut arg[..] //~^ WARN variable does not need to be mutable } - let mut v : &mut Vec<()> = &mut vec![]; //~ WARN: variable does not need to be mutable + let mut v : &mut Vec<()> = &mut vec![]; //~ WARN variable does not need to be mutable v.push(()); @@ -183,7 +183,7 @@ fn main() { let mut raw_address_of_mut = 1; // OK let mut_ptr = &raw mut raw_address_of_mut; - let mut raw_address_of_const = 1; //~ WARN: variable does not need to be mutable + let mut raw_address_of_const = 1; //~ WARN variable does not need to be mutable let const_ptr = &raw const raw_address_of_const; } @@ -201,7 +201,7 @@ fn foo(mut a: isize) { fn bar() { #[allow(unused_mut)] let mut a = 3; - let mut b = vec![2]; //~ ERROR: variable does not need to be mutable + let mut b = vec![2]; //~ ERROR variable does not need to be mutable } @@ -209,6 +209,6 @@ struct Arg(i32); // Regression test for https://github.com/rust-lang/rust/issues/110849 fn write_through_reference(mut arg: &mut Arg) { - //~^ WARN: variable does not need to be mutable + //~^ WARN variable does not need to be mutable arg.0 = 1 } diff --git a/tests/ui/lint/unused/unused-allocation.rs b/tests/ui/lint/unused/unused-allocation.rs index 1d5727362ea64..d7c8cd5ad00b9 100644 --- a/tests/ui/lint/unused/unused-allocation.rs +++ b/tests/ui/lint/unused/unused-allocation.rs @@ -1,5 +1,5 @@ #![deny(unused_allocation)] fn main() { - _ = Box::new([1]).len(); //~ error: unnecessary allocation, use `&` instead + _ = Box::new([1]).len(); //~ error unnecessary allocation, use `&` instead } diff --git a/tests/ui/lint/unused/unused-doc-comments-edge-cases.rs b/tests/ui/lint/unused/unused-doc-comments-edge-cases.rs index ba32fb566e83b..147407f05fc2b 100644 --- a/tests/ui/lint/unused/unused-doc-comments-edge-cases.rs +++ b/tests/ui/lint/unused/unused-doc-comments-edge-cases.rs @@ -4,25 +4,25 @@ fn doc_comment_on_match_arms(num: u8) -> bool { match num { 3 => true, /// useless doc comment - //~^ ERROR: unused doc comment + //~^ ERROR unused doc comment _ => false, } } fn doc_comment_between_if_else(num: u8) -> bool { if num == 3 { - true //~ ERROR: mismatched types + true //~ ERROR mismatched types } /// useless doc comment - else { //~ ERROR: expected expression, found keyword `else` + else { //~ ERROR expected expression, found keyword `else` false } } fn doc_comment_on_expr(num: u8) -> bool { /// useless doc comment - //~^ ERROR: attributes on expressions are experimental - //~| ERROR: unused doc comment + //~^ ERROR attributes on expressions are experimental + //~| ERROR unused doc comment num == 3 } @@ -31,7 +31,7 @@ fn doc_comment_on_expr_field() -> bool { let x = S { /// useless doc comment - //~^ ERROR: unused doc comment + //~^ ERROR unused doc comment foo: 3 }; @@ -43,7 +43,7 @@ fn doc_comment_on_pat_field() -> bool { let S { /// useless doc comment - //~^ ERROR: unused doc comment + //~^ ERROR unused doc comment foo } = S { foo: 3 @@ -53,18 +53,18 @@ fn doc_comment_on_pat_field() -> bool { } fn doc_comment_on_generic<#[doc = "x"] T>(val: T) {} -//~^ ERROR: unused doc comment +//~^ ERROR unused doc comment fn doc_comment_on_block() { /// unused doc comment - //~^ ERROR: unused doc comment + //~^ ERROR unused doc comment { let x = 12; } } /// unused doc comment -//~^ ERROR: unused doc comment +//~^ ERROR unused doc comment extern "C" { fn foo(); } diff --git a/tests/ui/lint/unused/unused-doc-comments-for-macros.rs b/tests/ui/lint/unused/unused-doc-comments-for-macros.rs index 05828ebb2c353..87ba01c23b3b8 100644 --- a/tests/ui/lint/unused/unused-doc-comments-for-macros.rs +++ b/tests/ui/lint/unused/unused-doc-comments-for-macros.rs @@ -4,13 +4,13 @@ macro_rules! foo { () => {}; } fn main() { - /// line1 //~ ERROR: unused doc comment + /// line1 //~ ERROR unused doc comment /// line2 /// line3 foo!(); // Ensure we still detect another doc-comment block. - /// line1 //~ ERROR: unused doc comment + /// line1 //~ ERROR unused doc comment /// line2 /// line3 foo!(); diff --git a/tests/ui/lint/unused/unused-macro-rules-compile-error.rs b/tests/ui/lint/unused/unused-macro-rules-compile-error.rs index 0c8fe65bd5ccd..294724931460f 100644 --- a/tests/ui/lint/unused/unused-macro-rules-compile-error.rs +++ b/tests/ui/lint/unused/unused-macro-rules-compile-error.rs @@ -9,7 +9,7 @@ macro_rules! num { // Some nested use (two_) => { foo(compile_error!("foo")); }; (three) => { 3 }; - (four) => { 4 }; //~ ERROR: rule #5 of macro + (four) => { 4 }; //~ ERROR rule #5 of macro } const _NUM: u8 = num!(one) + num!(three); @@ -17,9 +17,9 @@ const _NUM: u8 = num!(one) + num!(three); macro_rules! num2 { (one) => { 1 }; // Only identifier present - (two) => { fn compile_error() {} }; //~ ERROR: rule #2 of macro + (two) => { fn compile_error() {} }; //~ ERROR rule #2 of macro // Only identifier and bang present - (two_) => { compile_error! }; //~ ERROR: rule #3 of macro + (two_) => { compile_error! }; //~ ERROR rule #3 of macro (three) => { 3 }; } const _NUM2: u8 = num2!(one) + num2!(three); diff --git a/tests/ui/lint/unused/unused-macro-rules-decl.rs b/tests/ui/lint/unused/unused-macro-rules-decl.rs index ca14d58e52486..1b1c1b5c25dc6 100644 --- a/tests/ui/lint/unused/unused-macro-rules-decl.rs +++ b/tests/ui/lint/unused/unused-macro-rules-decl.rs @@ -6,9 +6,9 @@ // Most simple case macro num { (one) => { 1 }, - (two) => { 2 }, //~ ERROR: rule #2 of macro + (two) => { 2 }, //~ ERROR rule #2 of macro (three) => { 3 }, - (four) => { 4 }, //~ ERROR: rule #4 of macro + (four) => { 4 }, //~ ERROR rule #4 of macro } const _NUM: u8 = num!(one) + num!(three); @@ -28,7 +28,7 @@ macro num_rec { (two) => { num_rec!(one) + num_rec!(one) }, - (three) => { //~ ERROR: rule #3 of macro + (three) => { //~ ERROR rule #3 of macro num_rec!(one) + num_rec!(two) }, (four) => { diff --git a/tests/ui/lint/unused/unused-macro-rules-malformed-rule.rs b/tests/ui/lint/unused/unused-macro-rules-malformed-rule.rs index a826026ec405c..88b799ee5edaa 100644 --- a/tests/ui/lint/unused/unused-macro-rules-malformed-rule.rs +++ b/tests/ui/lint/unused/unused-macro-rules-malformed-rule.rs @@ -3,7 +3,7 @@ macro_rules! foo { (v) => {}; (w) => {}; - () => 0; //~ ERROR: macro rhs must be delimited + () => 0; //~ ERROR macro rhs must be delimited } fn main() { diff --git a/tests/ui/lint/unused/unused-macro-rules.rs b/tests/ui/lint/unused/unused-macro-rules.rs index 39a882e8e4d9b..498a3803d234a 100644 --- a/tests/ui/lint/unused/unused-macro-rules.rs +++ b/tests/ui/lint/unused/unused-macro-rules.rs @@ -5,9 +5,9 @@ // Most simple case macro_rules! num { (one) => { 1 }; - (two) => { 2 }; //~ ERROR: rule #2 of macro + (two) => { 2 }; //~ ERROR rule #2 of macro (three) => { 3 }; - (four) => { 4 }; //~ ERROR: rule #4 of macro + (four) => { 4 }; //~ ERROR rule #4 of macro } const _NUM: u8 = num!(one) + num!(three); @@ -27,7 +27,7 @@ macro_rules! num_rec { (two) => { num_rec!(one) + num_rec!(one) }; - (three) => { //~ ERROR: rule #3 of macro + (three) => { //~ ERROR rule #3 of macro num_rec!(one) + num_rec!(two) }; (four) => { num_rec!(two) + num_rec!(two) }; diff --git a/tests/ui/lint/unused/unused-macros-decl.rs b/tests/ui/lint/unused/unused-macros-decl.rs index 21f6108b18ad5..e8d802a1dbe29 100644 --- a/tests/ui/lint/unused/unused-macros-decl.rs +++ b/tests/ui/lint/unused/unused-macros-decl.rs @@ -4,7 +4,7 @@ #![deny(unused_macro_rules)] // Most simple case -macro unused { //~ ERROR: unused macro definition +macro unused { //~ ERROR unused macro definition () => {} } @@ -14,13 +14,13 @@ mod bar { // works. #[deny(unused_macros)] - macro unused { //~ ERROR: unused macro definition + macro unused { //~ ERROR unused macro definition () => {} } } mod boo { - pub(crate) macro unused { //~ ERROR: unused macro definition + pub(crate) macro unused { //~ ERROR unused macro definition () => {} } } diff --git a/tests/ui/lint/unused/unused-macros-malformed-rule.rs b/tests/ui/lint/unused/unused-macros-malformed-rule.rs index d4c35fad9b0f0..bab32b262764f 100644 --- a/tests/ui/lint/unused/unused-macros-malformed-rule.rs +++ b/tests/ui/lint/unused/unused-macros-malformed-rule.rs @@ -1,13 +1,13 @@ #![deny(unused_macros)] -macro_rules! foo { //~ ERROR: unused macro definition +macro_rules! foo { //~ ERROR unused macro definition (v) => {}; - () => 0; //~ ERROR: macro rhs must be delimited + () => 0; //~ ERROR macro rhs must be delimited } macro_rules! bar { (v) => {}; - () => 0; //~ ERROR: macro rhs must be delimited + () => 0; //~ ERROR macro rhs must be delimited } fn main() { diff --git a/tests/ui/lint/unused/unused-macros.rs b/tests/ui/lint/unused/unused-macros.rs index 70b50b2082b36..c1b140979e28c 100644 --- a/tests/ui/lint/unused/unused-macros.rs +++ b/tests/ui/lint/unused/unused-macros.rs @@ -3,14 +3,14 @@ #![deny(unused_macro_rules)] // Most simple case -macro_rules! unused { //~ ERROR: unused macro definition +macro_rules! unused { //~ ERROR unused macro definition () => {}; } // Test macros created by macros macro_rules! create_macro { () => { - macro_rules! m { //~ ERROR: unused macro definition + macro_rules! m { //~ ERROR unused macro definition () => {}; } }; @@ -23,7 +23,7 @@ mod bar { // works. #[deny(unused_macros)] - macro_rules! unused { //~ ERROR: unused macro definition + macro_rules! unused { //~ ERROR unused macro definition () => {}; } } diff --git a/tests/ui/lint/unused/unused-mut-warning-captured-var.fixed b/tests/ui/lint/unused/unused-mut-warning-captured-var.fixed index e8b6dd8640346..ff48311cd3255 100644 --- a/tests/ui/lint/unused/unused-mut-warning-captured-var.fixed +++ b/tests/ui/lint/unused/unused-mut-warning-captured-var.fixed @@ -4,6 +4,6 @@ fn main() { let x = 1; - //~^ ERROR: variable does not need to be mutable + //~^ ERROR variable does not need to be mutable (move|| { println!("{}", x); })(); } diff --git a/tests/ui/lint/unused/unused-mut-warning-captured-var.rs b/tests/ui/lint/unused/unused-mut-warning-captured-var.rs index f46c76b3f5976..db09fcc3cca04 100644 --- a/tests/ui/lint/unused/unused-mut-warning-captured-var.rs +++ b/tests/ui/lint/unused/unused-mut-warning-captured-var.rs @@ -4,6 +4,6 @@ fn main() { let mut x = 1; - //~^ ERROR: variable does not need to be mutable + //~^ ERROR variable does not need to be mutable (move|| { println!("{}", x); })(); } diff --git a/tests/ui/lint/unused/unused-result.rs b/tests/ui/lint/unused/unused-result.rs index e283eaa88dd13..de4a538c7c707 100644 --- a/tests/ui/lint/unused/unused-result.rs +++ b/tests/ui/lint/unused/unused-result.rs @@ -1,7 +1,7 @@ #![allow(dead_code)] #![deny(unused_results, unused_must_use)] -//~^ NOTE: the lint level is defined here -//~| NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here +//~| NOTE the lint level is defined here #[must_use] enum MustUse { Test } @@ -18,9 +18,9 @@ fn qux() -> MustUseMsg { return foo::(); } #[allow(unused_results)] fn test() { foo::(); - foo::(); //~ ERROR: unused `MustUse` that must be used - foo::(); //~ ERROR: unused `MustUseMsg` that must be used - //~^ NOTE: some message + foo::(); //~ ERROR unused `MustUse` that must be used + foo::(); //~ ERROR unused `MustUseMsg` that must be used + //~^ NOTE some message } #[allow(unused_results, unused_must_use)] @@ -31,10 +31,10 @@ fn test2() { } fn main() { - foo::(); //~ ERROR: unused result of type `isize` - foo::(); //~ ERROR: unused `MustUse` that must be used - foo::(); //~ ERROR: unused `MustUseMsg` that must be used - //~^ NOTE: some message + foo::(); //~ ERROR unused result of type `isize` + foo::(); //~ ERROR unused `MustUse` that must be used + foo::(); //~ ERROR unused `MustUseMsg` that must be used + //~^ NOTE some message let _ = foo::(); let _ = foo::(); diff --git a/tests/ui/lint/wasm_c_abi_transition.rs b/tests/ui/lint/wasm_c_abi_transition.rs index 1fe81679e65d0..105d2ed188c50 100644 --- a/tests/ui/lint/wasm_c_abi_transition.rs +++ b/tests/ui/lint/wasm_c_abi_transition.rs @@ -15,8 +15,8 @@ pub extern "C" fn my_fun_trivial(_x: i32, _y: f32) {} #[repr(C)] pub struct MyType(i32, i32); -pub extern "C" fn my_fun(_x: MyType) {} //~ERROR: wasm ABI transition -//~^WARN: previously accepted +pub extern "C" fn my_fun(_x: MyType) {} //~ERROR wasm ABI transition +//~^WARN previously accepted // This one is ABI-safe as it only wraps a single field, // and the return type can be anything. @@ -27,8 +27,8 @@ pub extern "C" fn my_fun_safe(_x: MySafeType) -> MyType { loop {} } // This one not ABI-safe due to the alignment. #[repr(C, align(16))] pub struct MyAlignedType(i32); -pub extern "C" fn my_fun_aligned(_x: MyAlignedType) {} //~ERROR: wasm ABI transition -//~^WARN: previously accepted +pub extern "C" fn my_fun_aligned(_x: MyAlignedType) {} //~ERROR wasm ABI transition +//~^WARN previously accepted // Check call-site warning extern "C" { @@ -36,6 +36,6 @@ extern "C" { } pub fn call_other_fun(x: MyType) { - unsafe { other_fun(x) } //~ERROR: wasm ABI transition - //~^WARN: previously accepted + unsafe { other_fun(x) } //~ERROR wasm ABI transition + //~^WARN previously accepted } diff --git a/tests/ui/liveness/liveness-dead.rs b/tests/ui/liveness/liveness-dead.rs index 004663c85ee50..1fc54f4b50fc7 100644 --- a/tests/ui/liveness/liveness-dead.rs +++ b/tests/ui/liveness/liveness-dead.rs @@ -6,7 +6,7 @@ fn f1(x: &mut isize) { } fn f2() { - let mut x: isize = 3; //~ ERROR: value assigned to `x` is never read + let mut x: isize = 3; //~ ERROR value assigned to `x` is never read x = 4; x.clone(); } @@ -14,17 +14,17 @@ fn f2() { fn f3() { let mut x: isize = 3; x.clone(); - x = 4; //~ ERROR: value assigned to `x` is never read + x = 4; //~ ERROR value assigned to `x` is never read } -fn f4(mut x: i32) { //~ ERROR: value passed to `x` is never read +fn f4(mut x: i32) { //~ ERROR value passed to `x` is never read x = 4; x.clone(); } fn f5(mut x: i32) { x.clone(); - x = 4; //~ ERROR: value assigned to `x` is never read + x = 4; //~ ERROR value assigned to `x` is never read } // #22630 diff --git a/tests/ui/loops/label-on-block-suggest-move.rs b/tests/ui/loops/label-on-block-suggest-move.rs index 656034cd0e95f..22458cde70f57 100644 --- a/tests/ui/loops/label-on-block-suggest-move.rs +++ b/tests/ui/loops/label-on-block-suggest-move.rs @@ -3,56 +3,56 @@ fn main() { loop 'a: {} - //~^ ERROR: block label not supported here - //~| HELP: if you meant to label the loop, move this label before the loop + //~^ ERROR block label not supported here + //~| HELP if you meant to label the loop, move this label before the loop while false 'a: {} - //~^ ERROR: block label not supported here - //~| HELP: if you meant to label the loop, move this label before the loop + //~^ ERROR block label not supported here + //~| HELP if you meant to label the loop, move this label before the loop for i in [0] 'a: {} - //~^ ERROR: block label not supported here - //~| HELP: if you meant to label the loop, move this label before the loop + //~^ ERROR block label not supported here + //~| HELP if you meant to label the loop, move this label before the loop 'a: loop { // first block is parsed as the break expr's value with or without parens while break 'a 'b: {} 'c: {} - //~^ ERROR: block label not supported here - //~| HELP: if you meant to label the loop, move this label before the loop + //~^ ERROR block label not supported here + //~| HELP if you meant to label the loop, move this label before the loop while break 'a ('b: {}) 'c: {} - //~^ ERROR: block label not supported here - //~| HELP: if you meant to label the loop, move this label before the loop + //~^ ERROR block label not supported here + //~| HELP if you meant to label the loop, move this label before the loop // without the parens, the first block is parsed as the while-loop's body // (see the 'no errors' section) // #[allow(break_with_label_and_loop)] (doesn't work locally) while (break 'a {}) 'c: {} - //~^ ERROR: block label not supported here - //~| HELP: if you meant to label the loop, move this label before the loop + //~^ ERROR block label not supported here + //~| HELP if you meant to label the loop, move this label before the loop } // do not suggest moving the label if there is already a label on the loop 'a: loop 'b: {} - //~^ ERROR: block label not supported here - //~| HELP: remove this block label + //~^ ERROR block label not supported here + //~| HELP remove this block label 'a: while false 'b: {} - //~^ ERROR: block label not supported here - //~| HELP: remove this block label + //~^ ERROR block label not supported here + //~| HELP remove this block label 'a: for i in [0] 'b: {} - //~^ ERROR: block label not supported here - //~| HELP: remove this block label + //~^ ERROR block label not supported here + //~| HELP remove this block label 'a: loop { // first block is parsed as the break expr's value with or without parens 'd: while break 'a 'b: {} 'c: {} - //~^ ERROR: block label not supported here - //~| HELP: remove this block label + //~^ ERROR block label not supported here + //~| HELP remove this block label 'd: while break 'a ('b: {}) 'c: {} - //~^ ERROR: block label not supported here - //~| HELP: remove this block label + //~^ ERROR block label not supported here + //~| HELP remove this block label // without the parens, the first block is parsed as the while-loop's body // (see the 'no errors' section) // #[allow(break_with_label_and_loop)] (doesn't work locally) 'd: while (break 'a {}) 'c: {} - //~^ ERROR: block label not supported here - //~| HELP: remove this block label + //~^ ERROR block label not supported here + //~| HELP remove this block label } // no errors @@ -81,10 +81,10 @@ fn main() { // unrelated errors that should not be affected 'a: 'b: {} - //~^ ERROR: expected `while`, `for`, `loop` or `{` after a label - //~| HELP: consider removing the label + //~^ ERROR expected `while`, `for`, `loop` or `{` after a label + //~| HELP consider removing the label loop { while break 'b: {} {} } - //~^ ERROR: parentheses are required around this expression to avoid confusion with a labeled break expression - //~| HELP: wrap the expression in parentheses - //~| ERROR: `break` or `continue` with no label in the condition of a `while` loop [E0590] + //~^ ERROR parentheses are required around this expression to avoid confusion with a labeled break expression + //~| HELP wrap the expression in parentheses + //~| ERROR `break` or `continue` with no label in the condition of a `while` loop [E0590] } diff --git a/tests/ui/macros/compile_error_macro.rs b/tests/ui/macros/compile_error_macro.rs index 3f7b57cd07847..566a263b76cf1 100644 --- a/tests/ui/macros/compile_error_macro.rs +++ b/tests/ui/macros/compile_error_macro.rs @@ -1,3 +1,3 @@ fn main() { - compile_error!("a very descriptive error message"); //~ ERROR: a very descriptive error message + compile_error!("a very descriptive error message"); //~ ERROR a very descriptive error message } diff --git a/tests/ui/macros/concat.rs b/tests/ui/macros/concat.rs index d7ab7d62625d7..7e7996c995404 100644 --- a/tests/ui/macros/concat.rs +++ b/tests/ui/macros/concat.rs @@ -1,6 +1,6 @@ fn main() { - concat!(b'f'); //~ ERROR: cannot concatenate a byte string literal - concat!(b"foo"); //~ ERROR: cannot concatenate a byte string literal - concat!(foo); //~ ERROR: expected a literal - concat!(foo()); //~ ERROR: expected a literal + concat!(b'f'); //~ ERROR cannot concatenate a byte string literal + concat!(b"foo"); //~ ERROR cannot concatenate a byte string literal + concat!(foo); //~ ERROR expected a literal + concat!(foo()); //~ ERROR expected a literal } diff --git a/tests/ui/macros/expand-full-no-resolution.rs b/tests/ui/macros/expand-full-no-resolution.rs index 4d90b8e2a531a..7288dcf907e1c 100644 --- a/tests/ui/macros/expand-full-no-resolution.rs +++ b/tests/ui/macros/expand-full-no-resolution.rs @@ -15,6 +15,6 @@ macro_rules! wrap { wrap!(); fn main() { - format_args!(a!()); //~ ERROR: cannot find macro `a` in this scope - env!(a!()); //~ ERROR: cannot find macro `a` in this scope + format_args!(a!()); //~ ERROR cannot find macro `a` in this scope + env!(a!()); //~ ERROR cannot find macro `a` in this scope } diff --git a/tests/ui/macros/expr_2021_cargo_fix_edition.fixed b/tests/ui/macros/expr_2021_cargo_fix_edition.fixed index 061a4b98033c4..770ea1a8f9aa9 100644 --- a/tests/ui/macros/expr_2021_cargo_fix_edition.fixed +++ b/tests/ui/macros/expr_2021_cargo_fix_edition.fixed @@ -4,12 +4,12 @@ #![warn(edition_2024_expr_fragment_specifier)] macro_rules! m { - ($e:expr_2021) => { //~ WARN: the `expr` fragment specifier will accept more expressions in the 2024 edition - //~^ WARN: this changes meaning in Rust 2024 + ($e:expr_2021) => { //~ WARN the `expr` fragment specifier will accept more expressions in the 2024 edition + //~^ WARN this changes meaning in Rust 2024 $e }; - ($($i:expr_2021)*) => { }; //~ WARN: the `expr` fragment specifier will accept more expressions in the 2024 edition - //~^ WARN: this changes meaning in Rust 2024 + ($($i:expr_2021)*) => { }; //~ WARN the `expr` fragment specifier will accept more expressions in the 2024 edition + //~^ WARN this changes meaning in Rust 2024 } macro_rules! test { diff --git a/tests/ui/macros/expr_2021_cargo_fix_edition.rs b/tests/ui/macros/expr_2021_cargo_fix_edition.rs index cd9cd965fad22..cf7ab4807598d 100644 --- a/tests/ui/macros/expr_2021_cargo_fix_edition.rs +++ b/tests/ui/macros/expr_2021_cargo_fix_edition.rs @@ -4,12 +4,12 @@ #![warn(edition_2024_expr_fragment_specifier)] macro_rules! m { - ($e:expr) => { //~ WARN: the `expr` fragment specifier will accept more expressions in the 2024 edition - //~^ WARN: this changes meaning in Rust 2024 + ($e:expr) => { //~ WARN the `expr` fragment specifier will accept more expressions in the 2024 edition + //~^ WARN this changes meaning in Rust 2024 $e }; - ($($i:expr)*) => { }; //~ WARN: the `expr` fragment specifier will accept more expressions in the 2024 edition - //~^ WARN: this changes meaning in Rust 2024 + ($($i:expr)*) => { }; //~ WARN the `expr` fragment specifier will accept more expressions in the 2024 edition + //~^ WARN this changes meaning in Rust 2024 } macro_rules! test { diff --git a/tests/ui/macros/expr_2021_inline_const.rs b/tests/ui/macros/expr_2021_inline_const.rs index 257f5b2f8cf98..8d226d8011c0e 100644 --- a/tests/ui/macros/expr_2021_inline_const.rs +++ b/tests/ui/macros/expr_2021_inline_const.rs @@ -20,8 +20,8 @@ macro_rules! test { } fn main() { - m2021!(const { 1 }); //~ ERROR: no rules expected keyword `const` - m2024!(const { 1 }); //[edi2021]~ ERROR: no rules expected keyword `const` + m2021!(const { 1 }); //~ ERROR no rules expected keyword `const` + m2024!(const { 1 }); //[edi2021]~ ERROR no rules expected keyword `const` test!(expr); } diff --git a/tests/ui/macros/expr_2024_underscore_expr.rs b/tests/ui/macros/expr_2024_underscore_expr.rs index 1d45d60c13644..a2ce13fdd36f8 100644 --- a/tests/ui/macros/expr_2024_underscore_expr.rs +++ b/tests/ui/macros/expr_2024_underscore_expr.rs @@ -16,6 +16,6 @@ macro_rules! m2024 { } fn main() { - m2021!(_); //~ ERROR: no rules expected reserved identifier `_` - m2024!(_); //[edi2021]~ ERROR: no rules expected reserved identifier `_` + m2021!(_); //~ ERROR no rules expected reserved identifier `_` + m2024!(_); //[edi2021]~ ERROR no rules expected reserved identifier `_` } diff --git a/tests/ui/macros/genercs-in-path-with-prettry-hir.rs b/tests/ui/macros/genercs-in-path-with-prettry-hir.rs index 84370fcebbcbc..68593a9757660 100644 --- a/tests/ui/macros/genercs-in-path-with-prettry-hir.rs +++ b/tests/ui/macros/genercs-in-path-with-prettry-hir.rs @@ -9,6 +9,6 @@ macro_rules! m { } } -m!(inline); //~ ERROR: unexpected generic arguments in path +m!(inline); //~ ERROR unexpected generic arguments in path fn main() {} diff --git a/tests/ui/macros/invalid-fragment-specifier.rs b/tests/ui/macros/invalid-fragment-specifier.rs index 1daf0a95434f9..2e5ec956456e5 100644 --- a/tests/ui/macros/invalid-fragment-specifier.rs +++ b/tests/ui/macros/invalid-fragment-specifier.rs @@ -1,10 +1,10 @@ macro_rules! test { ($wrong:id) => {}; -} //~^ ERROR: invalid fragment specifier `id` +} //~^ ERROR invalid fragment specifier `id` // guard against breaking raw identifier diagnostic macro_rules! test_raw_identifer { ($wrong:r#if) => {}; -} //~^ ERROR: invalid fragment specifier `r#if` +} //~^ ERROR invalid fragment specifier `r#if` fn main() {} diff --git a/tests/ui/macros/issue-21356.rs b/tests/ui/macros/issue-21356.rs index ae623929d6391..7fd4d0cdca6f2 100644 --- a/tests/ui/macros/issue-21356.rs +++ b/tests/ui/macros/issue-21356.rs @@ -1,6 +1,6 @@ #![allow(unused_macros)] macro_rules! test { ($wrong:t_ty ..) => () } - //~^ ERROR: invalid fragment specifier `t_ty` + //~^ ERROR invalid fragment specifier `t_ty` fn main() {} diff --git a/tests/ui/macros/issue-58490.rs b/tests/ui/macros/issue-58490.rs index 97e71c9a1ce40..925982fffa3bf 100644 --- a/tests/ui/macros/issue-58490.rs +++ b/tests/ui/macros/issue-58490.rs @@ -16,7 +16,7 @@ mod b { } #[macro_export] macro_rules! b { () => () } - //~^ ERROR: the name `b` is defined multiple times + //~^ ERROR the name `b` is defined multiple times } mod c { #[allow(unused_imports)] diff --git a/tests/ui/macros/issue-68060.rs b/tests/ui/macros/issue-68060.rs index 4eddb96848cd0..a4f52ff5b1dc2 100644 --- a/tests/ui/macros/issue-68060.rs +++ b/tests/ui/macros/issue-68060.rs @@ -2,13 +2,13 @@ fn main() { (0..) .map( #[target_feature(enable = "")] - //~^ ERROR: attribute should be applied to a function + //~^ ERROR attribute should be applied to a function #[track_caller] - //~^ ERROR: `#[track_caller]` on closures is currently unstable - //~| NOTE: see issue #87417 - //~| NOTE: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + //~^ ERROR `#[track_caller]` on closures is currently unstable + //~| NOTE see issue #87417 + //~| NOTE this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |_| (), - //~^ NOTE: not a function + //~^ NOTE not a function ) .next(); } diff --git a/tests/ui/macros/issue-83340.rs b/tests/ui/macros/issue-83340.rs index edf9c5612fb0c..3a5b561ad8f85 100644 --- a/tests/ui/macros/issue-83340.rs +++ b/tests/ui/macros/issue-83340.rs @@ -3,6 +3,6 @@ fn main() { println!( "\ -\n {} │", //~ ERROR: 1 positional argument in format string, but no arguments were given +\n {} │", //~ ERROR 1 positional argument in format string, but no arguments were given ); } diff --git a/tests/ui/macros/issue-83344.rs b/tests/ui/macros/issue-83344.rs index 61ae1739095bf..786025aabceff 100644 --- a/tests/ui/macros/issue-83344.rs +++ b/tests/ui/macros/issue-83344.rs @@ -2,5 +2,5 @@ fn main() { println!("{}\ -"); //~^ ERROR: 1 positional argument in format string, but no arguments were given +"); //~^ ERROR 1 positional argument in format string, but no arguments were given } diff --git a/tests/ui/macros/macro-expand-within-generics-in-path.rs b/tests/ui/macros/macro-expand-within-generics-in-path.rs index 017d5152221bf..4c3c91a0b4834 100644 --- a/tests/ui/macros/macro-expand-within-generics-in-path.rs +++ b/tests/ui/macros/macro-expand-within-generics-in-path.rs @@ -13,7 +13,7 @@ macro_rules! p { } m!(generic); -//~^ ERROR: unexpected generic arguments in path -//~| ERROR: cannot find attribute `generic` in this scope +//~^ ERROR unexpected generic arguments in path +//~| ERROR cannot find attribute `generic` in this scope fn main() {} diff --git a/tests/ui/macros/nonterminal-matching.rs b/tests/ui/macros/nonterminal-matching.rs index a03ede20c5499..4d62d22fc94ce 100644 --- a/tests/ui/macros/nonterminal-matching.rs +++ b/tests/ui/macros/nonterminal-matching.rs @@ -29,10 +29,10 @@ macro_rules! foo { (ident $x:ident) => { bar!(ident $x); }; (lifetime $x:lifetime) => { bar!(lifetime $x); }; (tt $x:tt) => { bar!(tt $x); }; - (expr $x:expr) => { bar!(expr $x); }; //~ ERROR: no rules expected `expr` metavariable - (literal $x:literal) => { bar!(literal $x); }; //~ ERROR: no rules expected `literal` metavariable - (path $x:path) => { bar!(path $x); }; //~ ERROR: no rules expected `path` metavariable - (stmt $x:stmt) => { bar!(stmt $x); }; //~ ERROR: no rules expected `stmt` metavariable + (expr $x:expr) => { bar!(expr $x); }; //~ ERROR no rules expected `expr` metavariable + (literal $x:literal) => { bar!(literal $x); }; //~ ERROR no rules expected `literal` metavariable + (path $x:path) => { bar!(path $x); }; //~ ERROR no rules expected `path` metavariable + (stmt $x:stmt) => { bar!(stmt $x); }; //~ ERROR no rules expected `stmt` metavariable } macro_rules! bar { diff --git a/tests/ui/match/match_non_exhaustive.rs b/tests/ui/match/match_non_exhaustive.rs index 25ff0942833fe..e31f933570300 100644 --- a/tests/ui/match/match_non_exhaustive.rs +++ b/tests/ui/match/match_non_exhaustive.rs @@ -21,12 +21,12 @@ fn main() { match l { L::A => (), L::B => () }; // (except if the match is already non-exhaustive) match l { L::A => () }; - //~^ ERROR: non-exhaustive patterns: `L::B` not covered [E0004] + //~^ ERROR non-exhaustive patterns: `L::B` not covered [E0004] // E1 is not visibly uninhabited from here let (e1, e2) = bar(); match e1 {}; - //~^ ERROR: non-exhaustive patterns: type `E1` is non-empty [E0004] + //~^ ERROR non-exhaustive patterns: type `E1` is non-empty [E0004] match e2 { E2::A => (), E2::B => () }; - //~^ ERROR: non-exhaustive patterns: `_` not covered [E0004] + //~^ ERROR non-exhaustive patterns: `_` not covered [E0004] } diff --git a/tests/ui/mir/issue-67947.rs b/tests/ui/mir/issue-67947.rs index f73d38f80426f..33be24e567f92 100644 --- a/tests/ui/mir/issue-67947.rs +++ b/tests/ui/mir/issue-67947.rs @@ -1,7 +1,7 @@ struct Bug { A: [(); { *"" }.len()], - //~^ ERROR: cannot move a value of type `str` - //~| ERROR: cannot move out of a shared reference + //~^ ERROR cannot move a value of type `str` + //~| ERROR cannot move out of a shared reference } fn main() {} diff --git a/tests/ui/mismatched_types/assignment-operator-unimplemented.rs b/tests/ui/mismatched_types/assignment-operator-unimplemented.rs index 21df464d5e450..ca2df65834022 100644 --- a/tests/ui/mismatched_types/assignment-operator-unimplemented.rs +++ b/tests/ui/mismatched_types/assignment-operator-unimplemented.rs @@ -3,5 +3,5 @@ struct Foo; fn main() { let mut a = Foo; let ref b = Foo; - a += *b; //~ Error: binary assignment operation `+=` cannot be applied to type `Foo` + a += *b; //~ Error binary assignment operation `+=` cannot be applied to type `Foo` } diff --git a/tests/ui/mismatched_types/closure-arg-type-mismatch.rs b/tests/ui/mismatched_types/closure-arg-type-mismatch.rs index 55a4a0b5707ff..8e97bd3281552 100644 --- a/tests/ui/mismatched_types/closure-arg-type-mismatch.rs +++ b/tests/ui/mismatched_types/closure-arg-type-mismatch.rs @@ -8,7 +8,7 @@ fn main() { fn baz(_: F) {} fn _test<'a>(f: fn(*mut &'a u32)) { baz(f); - //~^ ERROR: implementation of `FnOnce` is not general enough - //~| ERROR: borrowed data escapes - //~| ERROR: not general enough + //~^ ERROR implementation of `FnOnce` is not general enough + //~| ERROR borrowed data escapes + //~| ERROR not general enough } diff --git a/tests/ui/mismatched_types/issue-19109.rs b/tests/ui/mismatched_types/issue-19109.rs index eae6a87905b33..dd2bdfdf477cd 100644 --- a/tests/ui/mismatched_types/issue-19109.rs +++ b/tests/ui/mismatched_types/issue-19109.rs @@ -2,7 +2,7 @@ trait Trait { } fn function(t: &mut dyn Trait) { t as *mut dyn Trait - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } fn main() { } diff --git a/tests/ui/missing-trait-bounds/issue-69725.fixed b/tests/ui/missing-trait-bounds/issue-69725.fixed index f23468abcb0a4..dc261dcadcb7e 100644 --- a/tests/ui/missing-trait-bounds/issue-69725.fixed +++ b/tests/ui/missing-trait-bounds/issue-69725.fixed @@ -7,7 +7,7 @@ use issue_69725::Struct; fn crash() where A: Clone { let _ = Struct::::new().clone(); - //~^ ERROR: the method + //~^ ERROR the method } fn main() {} diff --git a/tests/ui/missing-trait-bounds/issue-69725.rs b/tests/ui/missing-trait-bounds/issue-69725.rs index a51d2540b4ccc..ddac5810d025f 100644 --- a/tests/ui/missing-trait-bounds/issue-69725.rs +++ b/tests/ui/missing-trait-bounds/issue-69725.rs @@ -7,7 +7,7 @@ use issue_69725::Struct; fn crash() { let _ = Struct::::new().clone(); - //~^ ERROR: the method + //~^ ERROR the method } fn main() {} diff --git a/tests/ui/modules/issue-107649.rs b/tests/ui/modules/issue-107649.rs index af5758d798588..8db1ef45a21bc 100644 --- a/tests/ui/modules/issue-107649.rs +++ b/tests/ui/modules/issue-107649.rs @@ -102,5 +102,5 @@ fn main() { (); (); (); - dbg!(lib::Dummy); //~ Error: `Dummy` doesn't implement `Debug` + dbg!(lib::Dummy); //~ Error `Dummy` doesn't implement `Debug` } diff --git a/tests/ui/moves/moves-based-on-type-no-recursive-stack-closure.rs b/tests/ui/moves/moves-based-on-type-no-recursive-stack-closure.rs index 86fd37e78142c..ae57a4ea70242 100644 --- a/tests/ui/moves/moves-based-on-type-no-recursive-stack-closure.rs +++ b/tests/ui/moves/moves-based-on-type-no-recursive-stack-closure.rs @@ -18,7 +18,7 @@ fn innocent_looking_victim() { match x { Some(ref msg) => { (f.c)(f, true); - //~^ ERROR: cannot borrow `*f` as mutable more than once at a time + //~^ ERROR cannot borrow `*f` as mutable more than once at a time println!("{}", msg); }, None => panic!("oops"), diff --git a/tests/ui/never_type/defaulted-never-note.rs b/tests/ui/never_type/defaulted-never-note.rs index badb5d4c51d83..68b07c212e4f7 100644 --- a/tests/ui/never_type/defaulted-never-note.rs +++ b/tests/ui/never_type/defaulted-never-note.rs @@ -26,8 +26,8 @@ fn foo(_t: T) {} //[fallback]~^ NOTE required by this bound in `foo` //[fallback]~| NOTE required by a bound in `foo` fn smeg() { - //[nofallback]~^ warn: this function depends on never type fallback being `()` - //[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + //[nofallback]~^ warn this function depends on never type fallback being `()` + //[nofallback]~| warn this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! let _x = return; foo(_x); //[fallback]~^ ERROR the trait bound diff --git a/tests/ui/never_type/dependency-on-fallback-to-unit.rs b/tests/ui/never_type/dependency-on-fallback-to-unit.rs index fad4c7c7df7b8..54f14b76602fc 100644 --- a/tests/ui/never_type/dependency-on-fallback-to-unit.rs +++ b/tests/ui/never_type/dependency-on-fallback-to-unit.rs @@ -6,8 +6,8 @@ fn main() { } fn def() { - //~^ warn: this function depends on never type fallback being `()` - //~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + //~^ warn this function depends on never type fallback being `()` + //~| warn this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! match true { false => <_>::default(), true => return, @@ -17,8 +17,8 @@ fn def() { // // fn question_mark() -> Result<(), ()> { - //~^ warn: this function depends on never type fallback being `()` - //~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + //~^ warn this function depends on never type fallback being `()` + //~| warn this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! deserialize()?; Ok(()) } diff --git a/tests/ui/never_type/diverging-fallback-control-flow.rs b/tests/ui/never_type/diverging-fallback-control-flow.rs index 647667126d493..6ad0a35599029 100644 --- a/tests/ui/never_type/diverging-fallback-control-flow.rs +++ b/tests/ui/never_type/diverging-fallback-control-flow.rs @@ -28,8 +28,8 @@ impl UnitDefault for () { } fn assignment() { - //[nofallback]~^ warn: this function depends on never type fallback being `()` - //[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + //[nofallback]~^ warn this function depends on never type fallback being `()` + //[nofallback]~| warn this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! let x; if true { @@ -40,8 +40,8 @@ fn assignment() { } fn assignment_rev() { - //[nofallback]~^ warn: this function depends on never type fallback being `()` - //[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + //[nofallback]~^ warn this function depends on never type fallback being `()` + //[nofallback]~| warn this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! let x; if true { diff --git a/tests/ui/never_type/diverging-fallback-no-leak.rs b/tests/ui/never_type/diverging-fallback-no-leak.rs index 75ca491bf46a5..7aa84b88c698d 100644 --- a/tests/ui/never_type/diverging-fallback-no-leak.rs +++ b/tests/ui/never_type/diverging-fallback-no-leak.rs @@ -12,8 +12,8 @@ impl Test for () {} fn unconstrained_arg(_: T) {} fn main() { - //[nofallback]~^ warn: this function depends on never type fallback being `()` - //[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + //[nofallback]~^ warn this function depends on never type fallback being `()` + //[nofallback]~| warn this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! // Here the type variable falls back to `!`, // and hence we get a type error. diff --git a/tests/ui/never_type/diverging-fallback-unconstrained-return.rs b/tests/ui/never_type/diverging-fallback-unconstrained-return.rs index fdea3a94d28f6..8224f0a8ec4bc 100644 --- a/tests/ui/never_type/diverging-fallback-unconstrained-return.rs +++ b/tests/ui/never_type/diverging-fallback-unconstrained-return.rs @@ -26,8 +26,8 @@ fn unconstrained_return() -> T { } fn main() { - //[nofallback]~^ warn: this function depends on never type fallback being `()` - //[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + //[nofallback]~^ warn this function depends on never type fallback being `()` + //[nofallback]~| warn this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! // In Ye Olde Days, the `T` parameter of `unconstrained_return` // winds up "entangled" with the `!` type that results from diff --git a/tests/ui/never_type/fallback-closure-ret.rs b/tests/ui/never_type/fallback-closure-ret.rs index f1423354f1325..e7bd45c5927bb 100644 --- a/tests/ui/never_type/fallback-closure-ret.rs +++ b/tests/ui/never_type/fallback-closure-ret.rs @@ -19,7 +19,7 @@ impl Bar for u32 {} fn foo(_: impl Fn() -> R) {} fn main() { - //[nofallback]~^ warn: this function depends on never type fallback being `()` - //[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + //[nofallback]~^ warn this function depends on never type fallback being `()` + //[nofallback]~| warn this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! foo(|| panic!()); } diff --git a/tests/ui/never_type/from_infer_breaking_with_unit_fallback.rs b/tests/ui/never_type/from_infer_breaking_with_unit_fallback.rs index 19a1f9d0e1318..3f03e8cd5bc65 100644 --- a/tests/ui/never_type/from_infer_breaking_with_unit_fallback.rs +++ b/tests/ui/never_type/from_infer_breaking_with_unit_fallback.rs @@ -23,7 +23,7 @@ impl From for E { fn foo(never: !) { >::from(never); // Ok >::from(never); // Should the inference fail? - //[unit]~^ error: the trait bound `E: From<()>` is not satisfied + //[unit]~^ error the trait bound `E: From<()>` is not satisfied } fn main() {} diff --git a/tests/ui/never_type/impl_trait_fallback.rs b/tests/ui/never_type/impl_trait_fallback.rs index bd4caeb2b726d..c3fb9463aa4cb 100644 --- a/tests/ui/never_type/impl_trait_fallback.rs +++ b/tests/ui/never_type/impl_trait_fallback.rs @@ -6,7 +6,7 @@ trait T {} impl T for () {} fn should_ret_unit() -> impl T { - //~^ warn: this function depends on never type fallback being `()` - //~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! + //~^ warn this function depends on never type fallback being `()` + //~| warn this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions! panic!() } diff --git a/tests/ui/never_type/issue-51506.rs b/tests/ui/never_type/issue-51506.rs index d0fe6a0f59a87..4ce80f79ad087 100644 --- a/tests/ui/never_type/issue-51506.rs +++ b/tests/ui/never_type/issue-51506.rs @@ -10,7 +10,7 @@ trait Trait { } impl Trait for T { - default type Out = !; //~ ERROR: `!` is not an iterator + default type Out = !; //~ ERROR `!` is not an iterator default fn f(&self) -> Option { None diff --git a/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.rs b/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.rs index 97e7a2f56bdaa..8dc61f0277932 100644 --- a/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.rs +++ b/tests/ui/never_type/lint-never-type-fallback-flowing-into-unsafe.rs @@ -10,10 +10,10 @@ fn main() {} fn _zero() { if false { unsafe { mem::zeroed() } - //[e2015]~^ warn: never type fallback affects this call to an `unsafe` function - //[e2024]~^^ error: never type fallback affects this call to an `unsafe` function - //~| warn: this changes meaning in Rust 2024 and in a future release in all editions! - //[e2024]~| warning: the type `!` does not permit zero-initialization + //[e2015]~^ warn never type fallback affects this call to an `unsafe` function + //[e2024]~^^ error never type fallback affects this call to an `unsafe` function + //~| warn this changes meaning in Rust 2024 and in a future release in all editions! + //[e2024]~| warning the type `!` does not permit zero-initialization } else { return; }; @@ -27,9 +27,9 @@ fn _trans() { unsafe { struct Zst; core::mem::transmute(Zst) - //[e2015]~^ warn: never type fallback affects this call to an `unsafe` function - //[e2024]~^^ error: never type fallback affects this call to an `unsafe` function - //~| warn: this changes meaning in Rust 2024 and in a future release in all editions! + //[e2015]~^ warn never type fallback affects this call to an `unsafe` function + //[e2024]~^^ error never type fallback affects this call to an `unsafe` function + //~| warn this changes meaning in Rust 2024 and in a future release in all editions! } } else { return; @@ -44,9 +44,9 @@ fn _union() { } unsafe { Union { a: () }.b } - //[e2015]~^ warn: never type fallback affects this union access - //[e2024]~^^ error: never type fallback affects this union access - //~| warn: this changes meaning in Rust 2024 and in a future release in all editions! + //[e2015]~^ warn never type fallback affects this union access + //[e2024]~^^ error never type fallback affects this union access + //~| warn this changes meaning in Rust 2024 and in a future release in all editions! } else { return; }; @@ -55,9 +55,9 @@ fn _union() { fn _deref() { if false { unsafe { *ptr::from_ref(&()).cast() } - //[e2015]~^ warn: never type fallback affects this raw pointer dereference - //[e2024]~^^ error: never type fallback affects this raw pointer dereference - //~| warn: this changes meaning in Rust 2024 and in a future release in all editions! + //[e2015]~^ warn never type fallback affects this raw pointer dereference + //[e2024]~^^ error never type fallback affects this raw pointer dereference + //~| warn this changes meaning in Rust 2024 and in a future release in all editions! } else { return; }; @@ -76,9 +76,9 @@ fn _only_generics() { let x = None; unsafe { internally_create(x) } - //[e2015]~^ warn: never type fallback affects this call to an `unsafe` function - //[e2024]~^^ error: never type fallback affects this call to an `unsafe` function - //~| warn: this changes meaning in Rust 2024 and in a future release in all editions! + //[e2015]~^ warn never type fallback affects this call to an `unsafe` function + //[e2024]~^^ error never type fallback affects this call to an `unsafe` function + //~| warn this changes meaning in Rust 2024 and in a future release in all editions! x.unwrap() } else { @@ -89,14 +89,14 @@ fn _only_generics() { fn _stored_function() { if false { let zeroed = mem::zeroed; - //[e2015]~^ warn: never type fallback affects this `unsafe` function - //[e2024]~^^ error: never type fallback affects this `unsafe` function - //~| warn: this changes meaning in Rust 2024 and in a future release in all editions! + //[e2015]~^ warn never type fallback affects this `unsafe` function + //[e2024]~^^ error never type fallback affects this `unsafe` function + //~| warn this changes meaning in Rust 2024 and in a future release in all editions! unsafe { zeroed() } - //[e2015]~^ warn: never type fallback affects this call to an `unsafe` function - //[e2024]~^^ error: never type fallback affects this call to an `unsafe` function - //~| warn: this changes meaning in Rust 2024 and in a future release in all editions! + //[e2015]~^ warn never type fallback affects this call to an `unsafe` function + //[e2024]~^^ error never type fallback affects this call to an `unsafe` function + //~| warn this changes meaning in Rust 2024 and in a future release in all editions! } else { return; }; @@ -112,9 +112,9 @@ fn _only_generics_stored_function() { let x = None; let f = internally_create; - //[e2015]~^ warn: never type fallback affects this `unsafe` function - //[e2024]~^^ error: never type fallback affects this `unsafe` function - //~| warn: this changes meaning in Rust 2024 and in a future release in all editions! + //[e2015]~^ warn never type fallback affects this `unsafe` function + //[e2024]~^^ error never type fallback affects this `unsafe` function + //~| warn this changes meaning in Rust 2024 and in a future release in all editions! unsafe { f(x) } @@ -137,9 +137,9 @@ fn _method() { if false { unsafe { S(marker::PhantomData).create_out_of_thin_air() - //[e2015]~^ warn: never type fallback affects this call to an `unsafe` method - //[e2024]~^^ error: never type fallback affects this call to an `unsafe` method - //~| warn: this changes meaning in Rust 2024 and in a future release in all editions! + //[e2015]~^ warn never type fallback affects this call to an `unsafe` method + //[e2024]~^^ error never type fallback affects this call to an `unsafe` method + //~| warn this changes meaning in Rust 2024 and in a future release in all editions! } } else { return; @@ -155,9 +155,9 @@ fn _objc() { macro_rules! msg_send { () => { match send_message::<_ /* ?0 */>() { - //[e2015]~^ warn: never type fallback affects this call to an `unsafe` function - //[e2024]~^^ error: never type fallback affects this call to an `unsafe` function - //~| warn: this changes meaning in Rust 2024 and in a future release in all editions! + //[e2015]~^ warn never type fallback affects this call to an `unsafe` function + //[e2024]~^^ error never type fallback affects this call to an `unsafe` function + //~| warn this changes meaning in Rust 2024 and in a future release in all editions! Ok(x) => x, Err(_) => loop {}, } diff --git a/tests/ui/nll/continue-after-missing-main.rs b/tests/ui/nll/continue-after-missing-main.rs index 5968364878994..4cc33bd23b5f8 100644 --- a/tests/ui/nll/continue-after-missing-main.rs +++ b/tests/ui/nll/continue-after-missing-main.rs @@ -26,6 +26,6 @@ fn create_and_solve_subproblems<'data_provider, 'original_data, MP>( tableau: Tableau<'data_provider, AdaptedMatrixProvider<'original_data, MP>>, ) { let _: AdaptedMatrixProvider<'original_data, MP> = tableau.provider().clone_with_extra_bound(); - //~^ ERROR: lifetime may not live long enough - //~| ERROR: `tableau` does not live long enough + //~^ ERROR lifetime may not live long enough + //~| ERROR `tableau` does not live long enough } //~ ERROR `main` function not found in crate diff --git a/tests/ui/nll/issue-30438-a.rs b/tests/ui/nll/issue-30438-a.rs index 0d4eb796ad9b0..03759b78a208f 100644 --- a/tests/ui/nll/issue-30438-a.rs +++ b/tests/ui/nll/issue-30438-a.rs @@ -10,7 +10,7 @@ impl <'a> Index for Test<'a> { type Output = Test<'a>; fn index(&self, _: usize) -> &Self::Output { return &Test { s: &self.s}; - //~^ ERROR: cannot return reference to temporary value + //~^ ERROR cannot return reference to temporary value } } diff --git a/tests/ui/nll/issue-30438-b.rs b/tests/ui/nll/issue-30438-b.rs index 79510cdb66366..598071d3726ab 100644 --- a/tests/ui/nll/issue-30438-b.rs +++ b/tests/ui/nll/issue-30438-b.rs @@ -11,7 +11,7 @@ impl <'a> Index for Test<'a> { type Output = Test<'a>; fn index(&self, _: usize) -> &Self::Output { &Test { s: &self.s} - //~^ ERROR: cannot return reference to temporary value + //~^ ERROR cannot return reference to temporary value } } diff --git a/tests/ui/nll/issue-30438-c.rs b/tests/ui/nll/issue-30438-c.rs index 813c1d3e2cccd..3b6f2123abf43 100644 --- a/tests/ui/nll/issue-30438-c.rs +++ b/tests/ui/nll/issue-30438-c.rs @@ -7,7 +7,7 @@ struct Test<'a> { s: &'a str } fn silly<'y, 'z>(_s: &'y Test<'z>) -> &'y as Trait>::Out where 'z: 'static { let x = Test { s: "this cannot last" }; &x - //~^ ERROR: cannot return reference to local variable `x` + //~^ ERROR cannot return reference to local variable `x` } impl<'b> Trait for Test<'b> { type Out = Test<'b>; } diff --git a/tests/ui/nll/issue-54556-niconii.rs b/tests/ui/nll/issue-54556-niconii.rs index 9d37adede6adb..c441b487a358c 100644 --- a/tests/ui/nll/issue-54556-niconii.rs +++ b/tests/ui/nll/issue-54556-niconii.rs @@ -25,7 +25,7 @@ fn main() { let counter = Mutex; if let Ok(_) = counter.lock() { } - //[edition2021]~^ ERROR: does not live long enough + //[edition2021]~^ ERROR does not live long enough // Up until Edition 2021: // With this code as written, the dynamic semantics here implies diff --git a/tests/ui/nll/issue-61424.fixed b/tests/ui/nll/issue-61424.fixed index 5ea9d531e2434..5ee0988f66eb5 100644 --- a/tests/ui/nll/issue-61424.fixed +++ b/tests/ui/nll/issue-61424.fixed @@ -3,7 +3,7 @@ #![deny(unused_mut)] fn main() { - let x; //~ ERROR: variable does not need to be mutable + let x; //~ ERROR variable does not need to be mutable x = String::new(); dbg!(x); } diff --git a/tests/ui/nll/issue-61424.rs b/tests/ui/nll/issue-61424.rs index 9c09bd6f1d18e..7e4b9676fb1bc 100644 --- a/tests/ui/nll/issue-61424.rs +++ b/tests/ui/nll/issue-61424.rs @@ -3,7 +3,7 @@ #![deny(unused_mut)] fn main() { - let mut x; //~ ERROR: variable does not need to be mutable + let mut x; //~ ERROR variable does not need to be mutable x = String::new(); dbg!(x); } diff --git a/tests/ui/nll/issue-73159-rpit-static.rs b/tests/ui/nll/issue-73159-rpit-static.rs index 3002408b07d8b..81ab445d16c27 100644 --- a/tests/ui/nll/issue-73159-rpit-static.rs +++ b/tests/ui/nll/issue-73159-rpit-static.rs @@ -6,7 +6,7 @@ struct Foo<'a>(&'a [u8]); impl<'a> Foo<'a> { fn make_it(&self) -> impl Iterator { self.0.iter().copied() - //~^ ERROR: captures lifetime that does not appear in bounds + //~^ ERROR captures lifetime that does not appear in bounds } } diff --git a/tests/ui/nll/issue-75777.rs b/tests/ui/nll/issue-75777.rs index a1e438bc61780..eea883faf13cf 100644 --- a/tests/ui/nll/issue-75777.rs +++ b/tests/ui/nll/issue-75777.rs @@ -9,7 +9,7 @@ type BoxFuture<'a, T> = Pin + 'a + Send>>; fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box BoxFuture<'a, A>> { let fut: BoxFuture<'a, A> = Box::pin(future::ready(v)); Box::new(move |_| fut) - //~^ ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/tests/ui/nll/trait-associated-constant.rs b/tests/ui/nll/trait-associated-constant.rs index e13ae80f918b2..57163fe032033 100644 --- a/tests/ui/nll/trait-associated-constant.rs +++ b/tests/ui/nll/trait-associated-constant.rs @@ -19,7 +19,7 @@ struct FailStruct { } impl<'a: 'b, 'b, 'c> Anything<'a, 'b> for FailStruct { const AC: Option<&'c str> = None; - //~^ ERROR: const not compatible with trait + //~^ ERROR const not compatible with trait } struct OKStruct2 { } diff --git a/tests/ui/nll/unused-mut-issue-50343.fixed b/tests/ui/nll/unused-mut-issue-50343.fixed index 827a90d646fb7..11d9d6dd6ee02 100644 --- a/tests/ui/nll/unused-mut-issue-50343.fixed +++ b/tests/ui/nll/unused-mut-issue-50343.fixed @@ -5,5 +5,5 @@ fn main() { vec![(42, 22)].iter().map(|(x, _y)| ()).count(); - //~^ ERROR: variable does not need to be mutable + //~^ ERROR variable does not need to be mutable } diff --git a/tests/ui/nll/unused-mut-issue-50343.rs b/tests/ui/nll/unused-mut-issue-50343.rs index d63823ae1f74f..fa9bb6930339b 100644 --- a/tests/ui/nll/unused-mut-issue-50343.rs +++ b/tests/ui/nll/unused-mut-issue-50343.rs @@ -5,5 +5,5 @@ fn main() { vec![(42, 22)].iter().map(|(mut x, _y)| ()).count(); - //~^ ERROR: variable does not need to be mutable + //~^ ERROR variable does not need to be mutable } diff --git a/tests/ui/numbers-arithmetic/overflowing-lsh-4.rs b/tests/ui/numbers-arithmetic/overflowing-lsh-4.rs index f1943c0f439b6..77ccb3cbc8bd3 100644 --- a/tests/ui/numbers-arithmetic/overflowing-lsh-4.rs +++ b/tests/ui/numbers-arithmetic/overflowing-lsh-4.rs @@ -9,7 +9,7 @@ fn main() { // this signals overflow when checking is on let x = 1_i8 << 17; - //~^ ERROR: this arithmetic operation will overflow + //~^ ERROR this arithmetic operation will overflow // ... but when checking is off, the fallback will truncate the // input to its lower three bits (= 1). Note that this is *not* diff --git a/tests/ui/numbers-arithmetic/overflowing-rsh-4.rs b/tests/ui/numbers-arithmetic/overflowing-rsh-4.rs index 9efa1164012cb..9c76a066e627b 100644 --- a/tests/ui/numbers-arithmetic/overflowing-rsh-4.rs +++ b/tests/ui/numbers-arithmetic/overflowing-rsh-4.rs @@ -9,7 +9,7 @@ fn main() { // this signals overflow when checking is on let x = 2_i8 >> 17; - //~^ ERROR: this arithmetic operation will overflow + //~^ ERROR this arithmetic operation will overflow // ... but when checking is off, the fallback will truncate the // input to its lower three bits (= 1). Note that this is *not* diff --git a/tests/ui/offset-of/offset-of-inference.rs b/tests/ui/offset-of/offset-of-inference.rs index 1b1ae25e1ee65..da65475c1fcc9 100644 --- a/tests/ui/offset-of/offset-of-inference.rs +++ b/tests/ui/offset-of/offset-of-inference.rs @@ -5,5 +5,5 @@ struct Foo { } fn main() { - let _ = core::mem::offset_of!(Foo<_>, x); //~ ERROR: type annotations needed + let _ = core::mem::offset_of!(Foo<_>, x); //~ ERROR type annotations needed } diff --git a/tests/ui/or-patterns/missing-bindings.rs b/tests/ui/or-patterns/missing-bindings.rs index 8d1aef5d1fcc4..3cc1bdc412534 100644 --- a/tests/ui/or-patterns/missing-bindings.rs +++ b/tests/ui/or-patterns/missing-bindings.rs @@ -17,10 +17,10 @@ fn check_handling_of_paths() { use bar::foo::{alpha, charlie}; let (alpha | beta | charlie) = alpha; //~ ERROR variable `beta` is not bound in all patterns - //~^ ERROR: `beta` is named the same as one of the variants + //~^ ERROR `beta` is named the same as one of the variants match Some(alpha) { //~ ERROR `None` not covered Some(alpha | beta) => {} //~ ERROR variable `beta` is not bound in all patterns - //~^ ERROR: `beta` is named the same as one of the variants + //~^ ERROR `beta` is named the same as one of the variants } } diff --git a/tests/ui/panic-runtime/needs-gate.rs b/tests/ui/panic-runtime/needs-gate.rs index 9e143adfeb215..3f49a44a8c10b 100644 --- a/tests/ui/panic-runtime/needs-gate.rs +++ b/tests/ui/panic-runtime/needs-gate.rs @@ -1,7 +1,7 @@ // gate-test-needs_panic_runtime // gate-test-panic_runtime -#![panic_runtime] //~ ERROR: is an experimental feature -#![needs_panic_runtime] //~ ERROR: is an experimental feature +#![panic_runtime] //~ ERROR is an experimental feature +#![needs_panic_runtime] //~ ERROR is an experimental feature fn main() {} diff --git a/tests/ui/panics/panic-2021.rs b/tests/ui/panics/panic-2021.rs index 399709d5276d3..07b952e41d710 100644 --- a/tests/ui/panics/panic-2021.rs +++ b/tests/ui/panics/panic-2021.rs @@ -1,9 +1,9 @@ //@ edition:2021 fn main() { - panic!(123); //~ ERROR: format argument must be a string literal - panic!("{}"); //~ ERROR: 1 positional argument in format string - core::panic!("{}"); //~ ERROR: 1 positional argument in format string - assert!(false, 123); //~ ERROR: format argument must be a string literal - assert!(false, "{}"); //~ ERROR: 1 positional argument in format string + panic!(123); //~ ERROR format argument must be a string literal + panic!("{}"); //~ ERROR 1 positional argument in format string + core::panic!("{}"); //~ ERROR 1 positional argument in format string + assert!(false, 123); //~ ERROR format argument must be a string literal + assert!(false, "{}"); //~ ERROR 1 positional argument in format string } diff --git a/tests/ui/parser/bad-name.rs b/tests/ui/parser/bad-name.rs index fefe9122a08fb..7a1b3710ea652 100644 --- a/tests/ui/parser/bad-name.rs +++ b/tests/ui/parser/bad-name.rs @@ -1,6 +1,6 @@ fn main() { let x.y::.z foo; - //~^ error: field expressions cannot have generic arguments - //~| error: expected a pattern, found an expression - //~| error: expected one of `(`, `.`, `::`, `:`, `;`, `=`, `?`, `|`, or an operator, found `foo` + //~^ error field expressions cannot have generic arguments + //~| error expected a pattern, found an expression + //~| error expected one of `(`, `.`, `::`, `:`, `;`, `=`, `?`, `|`, or an operator, found `foo` } diff --git a/tests/ui/parser/brace-in-let-chain.rs b/tests/ui/parser/brace-in-let-chain.rs index 2009bc88d9e8d..aeab0d75ab5e5 100644 --- a/tests/ui/parser/brace-in-let-chain.rs +++ b/tests/ui/parser/brace-in-let-chain.rs @@ -55,4 +55,4 @@ fn baz() { { && let () = () } -} //~ERROR: this file contains an unclosed delimiter +} //~ERROR this file contains an unclosed delimiter diff --git a/tests/ui/parser/char/whitespace-character-literal.rs b/tests/ui/parser/char/whitespace-character-literal.rs index de5e09204b462..9fd12a6e7bcf6 100644 --- a/tests/ui/parser/char/whitespace-character-literal.rs +++ b/tests/ui/parser/char/whitespace-character-literal.rs @@ -3,8 +3,8 @@ fn main() { let _hair_space_around = ' x​'; - //~^ ERROR: character literal may only contain one codepoint - //~| NOTE: there are non-printing characters, the full sequence is `\u{200a}x\u{200b}` - //~| HELP: consider removing the non-printing characters + //~^ ERROR character literal may only contain one codepoint + //~| NOTE there are non-printing characters, the full sequence is `\u{200a}x\u{200b}` + //~| HELP consider removing the non-printing characters //~| SUGGESTION: x } diff --git a/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs b/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs index 47df107a26123..6b6c2f77cd4f5 100644 --- a/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs +++ b/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs @@ -1,7 +1,7 @@ fn main() { unsafe { - dealloc(ptr2, Layout::(x: !)(1, 1)); //~ ERROR: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `:` - //~^ ERROR: expected one of `.`, `;`, `?`, `}`, or an operator, found `)` + dealloc(ptr2, Layout::(x: !)(1, 1)); //~ ERROR expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `:` + //~^ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `)` //~| while parsing this parenthesized list of type arguments starting here } } diff --git a/tests/ui/parser/eq-less-to-less-eq.rs b/tests/ui/parser/eq-less-to-less-eq.rs index 23c6c59d7a62b..387ff326cc571 100644 --- a/tests/ui/parser/eq-less-to-less-eq.rs +++ b/tests/ui/parser/eq-less-to-less-eq.rs @@ -25,7 +25,7 @@ fn baz() { fn qux() { let a = 0; let b = 4; - if a =< i32>::abs(-4) { //~ERROR: mismatched types + if a =< i32>::abs(-4) { //~ERROR mismatched types println!("yay!"); } } diff --git a/tests/ui/parser/issues/diagnostics-parenthesized-type-arguments-issue-120892-1.rs b/tests/ui/parser/issues/diagnostics-parenthesized-type-arguments-issue-120892-1.rs index 5de3b401ab436..b33d692a45701 100644 --- a/tests/ui/parser/issues/diagnostics-parenthesized-type-arguments-issue-120892-1.rs +++ b/tests/ui/parser/issues/diagnostics-parenthesized-type-arguments-issue-120892-1.rs @@ -1,6 +1,6 @@ fn main() { - foo::( //~ HELP: consider removing the `::` here to call the expression - //~^ NOTE: while parsing this parenthesized list of type arguments starting + foo::( //~ HELP consider removing the `::` here to call the expression + //~^ NOTE while parsing this parenthesized list of type arguments starting bar(x, y, z), bar(x, y, z), bar(x, y, z), @@ -8,7 +8,7 @@ fn main() { bar(x, y, z), bar(x, y, z), bar(x, y, z), - baz("test"), //~ ERROR: expected type, found `"test"` - //~^ NOTE: expected type + baz("test"), //~ ERROR expected type, found `"test"` + //~^ NOTE expected type ) } diff --git a/tests/ui/parser/issues/diagnostics-parenthesized-type-arguments-issue-120892-2.rs b/tests/ui/parser/issues/diagnostics-parenthesized-type-arguments-issue-120892-2.rs index 2876a9afe004c..2bcc6bcd596be 100644 --- a/tests/ui/parser/issues/diagnostics-parenthesized-type-arguments-issue-120892-2.rs +++ b/tests/ui/parser/issues/diagnostics-parenthesized-type-arguments-issue-120892-2.rs @@ -1,5 +1,5 @@ fn main() { - foo::/* definitely not harmful comment */(123, "foo") -> (u32); //~ ERROR: expected type, found `123` - //~^ NOTE: while parsing this parenthesized list of type arguments starting - //~^^ NOTE: expected type + foo::/* definitely not harmful comment */(123, "foo") -> (u32); //~ ERROR expected type, found `123` + //~^ NOTE while parsing this parenthesized list of type arguments starting + //~^^ NOTE expected type } diff --git a/tests/ui/parser/issues/diagnostics-parenthesized-type-arguments-issue-120892-3.rs b/tests/ui/parser/issues/diagnostics-parenthesized-type-arguments-issue-120892-3.rs index 402afac46deff..70f065e39e31f 100644 --- a/tests/ui/parser/issues/diagnostics-parenthesized-type-arguments-issue-120892-3.rs +++ b/tests/ui/parser/issues/diagnostics-parenthesized-type-arguments-issue-120892-3.rs @@ -2,10 +2,10 @@ struct Foo(u32, u32); impl Foo { fn foo(&self) { match *self { - Foo::(1, 2) => {}, //~ HELP: consider removing the `::` here to turn this into a tuple struct pattern - //~^ NOTE: while parsing this parenthesized list of type arguments starting - //~^^ ERROR: expected type, found `1` - //~^^^ NOTE: expected type + Foo::(1, 2) => {}, //~ HELP consider removing the `::` here to turn this into a tuple struct pattern + //~^ NOTE while parsing this parenthesized list of type arguments starting + //~^^ ERROR expected type, found `1` + //~^^^ NOTE expected type _ => {}, } } diff --git a/tests/ui/parser/issues/issue-10392-2.fixed b/tests/ui/parser/issues/issue-10392-2.fixed index 09f2627f81677..c7160d4df4437 100644 --- a/tests/ui/parser/issues/issue-10392-2.fixed +++ b/tests/ui/parser/issues/issue-10392-2.fixed @@ -5,5 +5,5 @@ pub struct A { pub foo: isize } fn a() -> A { panic!() } fn main() { - let A { .. } = a(); //~ ERROR: expected `}` + let A { .. } = a(); //~ ERROR expected `}` } diff --git a/tests/ui/parser/issues/issue-10392-2.rs b/tests/ui/parser/issues/issue-10392-2.rs index 7f46c12ccf260..5b7610b98feb6 100644 --- a/tests/ui/parser/issues/issue-10392-2.rs +++ b/tests/ui/parser/issues/issue-10392-2.rs @@ -5,5 +5,5 @@ pub struct A { pub foo: isize } fn a() -> A { panic!() } fn main() { - let A { .., } = a(); //~ ERROR: expected `}` + let A { .., } = a(); //~ ERROR expected `}` } diff --git a/tests/ui/parser/issues/issue-10636-1.rs b/tests/ui/parser/issues/issue-10636-1.rs index 77c6072d6fc0a..ed24be4056bd4 100644 --- a/tests/ui/parser/issues/issue-10636-1.rs +++ b/tests/ui/parser/issues/issue-10636-1.rs @@ -1,5 +1,5 @@ struct Obj { - //~^ NOTE: unclosed delimiter + //~^ NOTE unclosed delimiter member: usize ) //~^ ERROR mismatched closing delimiter diff --git a/tests/ui/parser/issues/issue-17718-const-mut.rs b/tests/ui/parser/issues/issue-17718-const-mut.rs index 795a8c7631d9a..b58143db7eaea 100644 --- a/tests/ui/parser/issues/issue-17718-const-mut.rs +++ b/tests/ui/parser/issues/issue-17718-const-mut.rs @@ -1,5 +1,5 @@ const -mut //~ ERROR: const globals cannot be mutable +mut //~ ERROR const globals cannot be mutable //~^^ HELP you might want to declare a static instead FOO: usize = 3; diff --git a/tests/ui/parser/issues/issue-20616-1.rs b/tests/ui/parser/issues/issue-20616-1.rs index 49e9cb310c144..acc3579da6891 100644 --- a/tests/ui/parser/issues/issue-20616-1.rs +++ b/tests/ui/parser/issues/issue-20616-1.rs @@ -6,7 +6,7 @@ type Type_1_<'a, T> = &'a T; -type Type_1<'a T> = &'a T; //~ error: expected one of `,`, `:`, or `>`, found `T` +type Type_1<'a T> = &'a T; //~ error expected one of `,`, `:`, or `>`, found `T` //type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` diff --git a/tests/ui/parser/issues/issue-20616-2.rs b/tests/ui/parser/issues/issue-20616-2.rs index 2f2c6903a9f4c..a6bbb04493bf6 100644 --- a/tests/ui/parser/issues/issue-20616-2.rs +++ b/tests/ui/parser/issues/issue-20616-2.rs @@ -9,7 +9,7 @@ type Type_1_<'a, T> = &'a T; //type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T` -type Type_2 = Type_1_<'static ()>; //~ error: expected one of `,` or `>`, found `(` +type Type_2 = Type_1_<'static ()>; //~ error expected one of `,` or `>`, found `(` //type Type_3 = Box; // error: expected type, found `,` diff --git a/tests/ui/parser/issues/issue-20616-3.rs b/tests/ui/parser/issues/issue-20616-3.rs index b2371051c78f9..86c92a8c12ce5 100644 --- a/tests/ui/parser/issues/issue-20616-3.rs +++ b/tests/ui/parser/issues/issue-20616-3.rs @@ -11,7 +11,7 @@ type Type_1_<'a, T> = &'a T; type Type_3 = Box; -//~^ error: expected one of `>`, a const expression, lifetime, or type, found `,` +//~^ error expected one of `>`, a const expression, lifetime, or type, found `,` //type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` diff --git a/tests/ui/parser/issues/issue-20616-4.rs b/tests/ui/parser/issues/issue-20616-4.rs index a71f47ca4bf93..e01b1112d55a7 100644 --- a/tests/ui/parser/issues/issue-20616-4.rs +++ b/tests/ui/parser/issues/issue-20616-4.rs @@ -14,7 +14,7 @@ type Type_1_<'a, T> = &'a T; type Type_4 = Type_1_<'static,, T>; -//~^ error: expected one of `>`, a const expression, lifetime, or type, found `,` +//~^ error expected one of `>`, a const expression, lifetime, or type, found `,` type Type_5_<'a> = Type_1_<'a, ()>; diff --git a/tests/ui/parser/issues/issue-20616-5.rs b/tests/ui/parser/issues/issue-20616-5.rs index b96d09d59ae69..25ff4aaea9fa3 100644 --- a/tests/ui/parser/issues/issue-20616-5.rs +++ b/tests/ui/parser/issues/issue-20616-5.rs @@ -20,7 +20,7 @@ type Type_5_<'a> = Type_1_<'a, ()>; type Type_5<'a> = Type_1_<'a, (),,>; -//~^ error: expected one of `>`, a const expression, lifetime, or type, found `,` +//~^ error expected one of `>`, a const expression, lifetime, or type, found `,` //type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` diff --git a/tests/ui/parser/issues/issue-20616-6.rs b/tests/ui/parser/issues/issue-20616-6.rs index a2c45ecec7a4b..ccac2cd0db073 100644 --- a/tests/ui/parser/issues/issue-20616-6.rs +++ b/tests/ui/parser/issues/issue-20616-6.rs @@ -23,7 +23,7 @@ type Type_5_<'a> = Type_1_<'a, ()>; type Type_6 = Type_5_<'a,,>; -//~^ error: expected one of `>`, a const expression, lifetime, or type, found `,` +//~^ error expected one of `>`, a const expression, lifetime, or type, found `,` //type Type_7 = Box<(),,>; // error: expected type, found `,` diff --git a/tests/ui/parser/issues/issue-20616-7.rs b/tests/ui/parser/issues/issue-20616-7.rs index 67209c02adffb..3c199f6e3150a 100644 --- a/tests/ui/parser/issues/issue-20616-7.rs +++ b/tests/ui/parser/issues/issue-20616-7.rs @@ -26,7 +26,7 @@ type Type_5_<'a> = Type_1_<'a, ()>; type Type_7 = Box<(),,>; -//~^ error: expected one of `>`, a const expression, lifetime, or type, found `,` +//~^ error expected one of `>`, a const expression, lifetime, or type, found `,` //type Type_8<'a,,> = &'a (); // error: expected ident, found `,` diff --git a/tests/ui/parser/issues/issue-20616-8.rs b/tests/ui/parser/issues/issue-20616-8.rs index 3ceb58d1252d3..aa5c16c361f5c 100644 --- a/tests/ui/parser/issues/issue-20616-8.rs +++ b/tests/ui/parser/issues/issue-20616-8.rs @@ -29,7 +29,7 @@ type Type_5_<'a> = Type_1_<'a, ()>; type Type_8<'a,,> = &'a (); -//~^ error: expected one of `#`, `>`, `const`, identifier, or lifetime, found `,` +//~^ error expected one of `#`, `>`, `const`, identifier, or lifetime, found `,` //type Type_9 = Box; // error: expected identifier, found `,` diff --git a/tests/ui/parser/issues/issue-20616-9.rs b/tests/ui/parser/issues/issue-20616-9.rs index 7f84284481e2f..8543223c8d42e 100644 --- a/tests/ui/parser/issues/issue-20616-9.rs +++ b/tests/ui/parser/issues/issue-20616-9.rs @@ -32,4 +32,4 @@ type Type_5_<'a> = Type_1_<'a, ()>; type Type_9 = Box; -//~^ error: expected one of `#`, `>`, `const`, identifier, or lifetime, found `,` +//~^ error expected one of `#`, `>`, `const`, identifier, or lifetime, found `,` diff --git a/tests/ui/parser/issues/issue-24197.rs b/tests/ui/parser/issues/issue-24197.rs index 9bba16e5596ff..d03ee1aeebc2e 100644 --- a/tests/ui/parser/issues/issue-24197.rs +++ b/tests/ui/parser/issues/issue-24197.rs @@ -1,3 +1,3 @@ fn main() { - let buf[0] = 0; //~ error: expected a pattern, found an expression + let buf[0] = 0; //~ error expected a pattern, found an expression } diff --git a/tests/ui/parser/issues/issue-24375.rs b/tests/ui/parser/issues/issue-24375.rs index a5e256b7f1554..e3f8444199714 100644 --- a/tests/ui/parser/issues/issue-24375.rs +++ b/tests/ui/parser/issues/issue-24375.rs @@ -3,7 +3,7 @@ static tmp : [&'static str; 2] = ["hello", "he"]; fn main() { let z = "hello"; match z { - tmp[0] => {} //~ error: expected a pattern, found an expression + tmp[0] => {} //~ error expected a pattern, found an expression _ => {} } } diff --git a/tests/ui/parser/issues/issue-3036.fixed b/tests/ui/parser/issues/issue-3036.fixed index 14f8a401647ec..30054791b8d8e 100644 --- a/tests/ui/parser/issues/issue-3036.fixed +++ b/tests/ui/parser/issues/issue-3036.fixed @@ -3,5 +3,5 @@ // Testing that semicolon tokens are printed correctly in errors fn main() { - let _x = 3; //~ ERROR: expected `;` + let _x = 3; //~ ERROR expected `;` } diff --git a/tests/ui/parser/issues/issue-3036.rs b/tests/ui/parser/issues/issue-3036.rs index f6ce6222d4a39..9d148708863dc 100644 --- a/tests/ui/parser/issues/issue-3036.rs +++ b/tests/ui/parser/issues/issue-3036.rs @@ -3,5 +3,5 @@ // Testing that semicolon tokens are printed correctly in errors fn main() { - let _x = 3 //~ ERROR: expected `;` + let _x = 3 //~ ERROR expected `;` } diff --git a/tests/ui/parser/issues/issue-35813-postfix-after-cast.rs b/tests/ui/parser/issues/issue-35813-postfix-after-cast.rs index 316c612940c9f..1af8e99971c90 100644 --- a/tests/ui/parser/issues/issue-35813-postfix-after-cast.rs +++ b/tests/ui/parser/issues/issue-35813-postfix-after-cast.rs @@ -8,16 +8,16 @@ use std::pin::Pin; // errors and parse such that further code gives useful errors. pub fn index_after_as_cast() { vec![1, 2, 3] as Vec[0]; - //~^ ERROR: cast cannot be followed by indexing + //~^ ERROR cast cannot be followed by indexing vec![1, 2, 3]: Vec[0]; - //~^ ERROR: expected one of + //~^ ERROR expected one of } pub fn index_after_cast_to_index() { (&[0]) as &[i32][0]; - //~^ ERROR: cast cannot be followed by indexing + //~^ ERROR cast cannot be followed by indexing (&[0i32]): &[i32; 1][0]; - //~^ ERROR: expected one of + //~^ ERROR expected one of } pub fn cast_after_cast() { @@ -49,7 +49,7 @@ pub fn cast_cast_method_call_3() { pub fn cast_cast_method_call_4() { let _ = 0 as i32 as i32.count_ones(); - //~^ ERROR: cast cannot be followed by a method call + //~^ ERROR cast cannot be followed by a method call } pub fn cast_cast_method_call_5() { @@ -62,7 +62,7 @@ pub fn cast_cast_method_call_6() { pub fn cast_cast_method_call_7() { let _ = 0 as i32.count_ones(): u32; //~ ERROR expected one of - //~^ ERROR: cast cannot be followed by a method call + //~^ ERROR cast cannot be followed by a method call } pub fn cast_cast_method_call_8() { @@ -71,7 +71,7 @@ pub fn cast_cast_method_call_8() { pub fn cast_cast_method_call_9() { let _ = 0 as i32.count_ones() as u32; - //~^ ERROR: cast cannot be followed by a method call + //~^ ERROR cast cannot be followed by a method call } pub fn cast_cast_method_call_10() { @@ -82,18 +82,18 @@ pub fn multiline_error() { let _ = 0 as i32 .count_ones(); - //~^^^ ERROR: cast cannot be followed by a method call + //~^^^ ERROR cast cannot be followed by a method call } // this tests that the precedence for `!x as Y.Z` is still what we expect pub fn precedence() { let x: i32 = &vec![1, 2, 3] as &Vec[0]; - //~^ ERROR: cast cannot be followed by indexing + //~^ ERROR cast cannot be followed by indexing } pub fn method_calls() { 0 as i32.max(0); - //~^ ERROR: cast cannot be followed by a method call + //~^ ERROR cast cannot be followed by a method call 0: i32.max(0); //~ ERROR expected one of } @@ -101,45 +101,45 @@ pub fn complex() { let _ = format!( "{} and {}", if true { 33 } else { 44 } as i32.max(0), - //~^ ERROR: cast cannot be followed by a method call + //~^ ERROR cast cannot be followed by a method call if true { 33 } else { 44 }: i32.max(0) - //~^ ERROR: expected one of + //~^ ERROR expected one of ); } pub fn in_condition() { if 5u64 as i32.max(0) == 0 { - //~^ ERROR: cast cannot be followed by a method call + //~^ ERROR cast cannot be followed by a method call } if 5u64: u64.max(0) == 0 { - //~^ ERROR: expected `{`, found `:` + //~^ ERROR expected `{`, found `:` } } pub fn inside_block() { let _ = if true { 5u64 as u32.max(0) == 0 - //~^ ERROR: cast cannot be followed by a method call + //~^ ERROR cast cannot be followed by a method call } else { false }; let _ = if true { 5u64: u64.max(0) == 0 - //~^ ERROR: expected one of + //~^ ERROR expected one of } else { false }; } static bar: &[i32] = &(&[1,2,3] as &[i32][0..1]); -//~^ ERROR: cast cannot be followed by indexing -//~| ERROR: cannot call non-const operator in statics +//~^ ERROR cast cannot be followed by indexing +//~| ERROR cannot call non-const operator in statics static bar2: &[i32] = &(&[1i32,2,3]: &[i32; 3][0..1]); -//~^ ERROR: expected one of +//~^ ERROR expected one of pub fn cast_then_try() -> Result { Err(0u64) as Result?; - //~^ ERROR: cast cannot be followed by `?` + //~^ ERROR cast cannot be followed by `?` Err(0u64): Result?; - //~^ ERROR: expected one of + //~^ ERROR expected one of Ok(1) } @@ -149,9 +149,9 @@ pub fn cast_then_call() { // type ascription won't actually do [unique drop fn type] -> fn(u8) casts. let drop_ptr = drop as fn(u8); drop as F(); - //~^ ERROR: parenthesized type parameters may only be used with a `Fn` trait [E0214] + //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait [E0214] drop_ptr: F(); - //~^ ERROR: expected identifier, found `:` + //~^ ERROR expected identifier, found `:` } pub fn cast_to_fn_should_work() { @@ -164,17 +164,17 @@ pub fn cast_to_fn_should_work() { pub fn parens_after_cast_error() { let drop_ptr = drop as fn(u8); drop as fn(u8)(0); - //~^ ERROR: cast cannot be followed by a function call + //~^ ERROR cast cannot be followed by a function call drop_ptr: fn(u8)(0); - //~^ ERROR: expected one of + //~^ ERROR expected one of } pub async fn cast_then_await() { Box::pin(noop()) as Pin>>.await; - //~^ ERROR: cast cannot be followed by `.await` + //~^ ERROR cast cannot be followed by `.await` Box::pin(noop()): Pin>.await; - //~^ ERROR: expected one of + //~^ ERROR expected one of } pub async fn noop() {} @@ -186,7 +186,7 @@ pub struct Foo { pub fn struct_field() { Foo::default() as Foo.bar; - //~^ ERROR: cannot be followed by a field access + //~^ ERROR cannot be followed by a field access Foo::default(): Foo.bar; //~^ ERROR expected one of } diff --git a/tests/ui/parser/issues/issue-76597.fixed b/tests/ui/parser/issues/issue-76597.fixed index 779b4042cf49b..c5a7303427620 100644 --- a/tests/ui/parser/issues/issue-76597.fixed +++ b/tests/ui/parser/issues/issue-76597.fixed @@ -6,6 +6,6 @@ fn f( x: u8, y: u8, ) {} -//~^^ ERROR: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `y` +//~^^ ERROR expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `y` fn main() {} diff --git a/tests/ui/parser/issues/issue-76597.rs b/tests/ui/parser/issues/issue-76597.rs index d78761df18eb4..8afdd76d39076 100644 --- a/tests/ui/parser/issues/issue-76597.rs +++ b/tests/ui/parser/issues/issue-76597.rs @@ -6,6 +6,6 @@ fn f( x: u8 y: u8, ) {} -//~^^ ERROR: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `y` +//~^^ ERROR expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `y` fn main() {} diff --git a/tests/ui/parser/issues/issue-81806.rs b/tests/ui/parser/issues/issue-81806.rs index ca86788dff79c..c3b8b39fd3b40 100644 --- a/tests/ui/parser/issues/issue-81806.rs +++ b/tests/ui/parser/issues/issue-81806.rs @@ -1,5 +1,5 @@ trait T { const -impl //~ ERROR: expected identifier, found keyword `impl` +impl //~ ERROR expected identifier, found keyword `impl` } fn main() {} diff --git a/tests/ui/parser/issues/issue-84148-1.rs b/tests/ui/parser/issues/issue-84148-1.rs index 9fa8086c2c9bf..10d84e14493d0 100644 --- a/tests/ui/parser/issues/issue-84148-1.rs +++ b/tests/ui/parser/issues/issue-84148-1.rs @@ -1,3 +1,3 @@ fn f(t:for<>t?) -//~^ ERROR: expected one of -//~| ERROR: invalid `?` in type +//~^ ERROR expected one of +//~| ERROR invalid `?` in type diff --git a/tests/ui/parser/issues/issue-87086-colon-path-sep.rs b/tests/ui/parser/issues/issue-87086-colon-path-sep.rs index d081c06044f14..7c5223e63116d 100644 --- a/tests/ui/parser/issues/issue-87086-colon-path-sep.rs +++ b/tests/ui/parser/issues/issue-87086-colon-path-sep.rs @@ -15,40 +15,40 @@ fn f() -> Foo { Foo::Bar } fn g1() { match f() { Foo:Bar => {} - //~^ ERROR: expected one of - //~| HELP: maybe write a path separator here + //~^ ERROR expected one of + //~| HELP maybe write a path separator here _ => {} } match f() { qux::Foo:Bar => {} - //~^ ERROR: expected one of - //~| HELP: maybe write a path separator here + //~^ ERROR expected one of + //~| HELP maybe write a path separator here _ => {} } match f() { qux:Foo::Baz => {} - //~^ ERROR: expected one of - //~| HELP: maybe write a path separator here + //~^ ERROR expected one of + //~| HELP maybe write a path separator here _ => {} } match f() { qux: Foo::Baz if true => {} - //~^ ERROR: expected one of - //~| HELP: maybe write a path separator here + //~^ ERROR expected one of + //~| HELP maybe write a path separator here _ => {} } - if let Foo:Bar = f() { //~ WARN: irrefutable `if let` pattern - //~^ ERROR: expected one of - //~| HELP: maybe write a path separator here - //~| HELP: consider replacing the `if let` with a `let` + if let Foo:Bar = f() { //~ WARN irrefutable `if let` pattern + //~^ ERROR expected one of + //~| HELP maybe write a path separator here + //~| HELP consider replacing the `if let` with a `let` } } fn g1_neg() { match f() { ref qux: Foo::Baz => {} - //~^ ERROR: expected one of - //~| HELP: maybe write a path separator here + //~^ ERROR expected one of + //~| HELP maybe write a path separator here _ => {} } } @@ -56,8 +56,8 @@ fn g1_neg() { fn g2_neg() { match f() { mut qux: Foo::Baz => {} - //~^ ERROR: expected one of - //~| HELP: maybe write a path separator here + //~^ ERROR expected one of + //~| HELP maybe write a path separator here _ => {} } } @@ -67,13 +67,13 @@ fn main() { match myfoo { Foo::Bar => {} Foo:Bar::Baz => {} - //~^ ERROR: expected one of - //~| HELP: maybe write a path separator here + //~^ ERROR expected one of + //~| HELP maybe write a path separator here } match myfoo { Foo::Bar => {} Foo:Bar => {} - //~^ ERROR: expected one of - //~| HELP: maybe write a path separator here + //~^ ERROR expected one of + //~| HELP maybe write a path separator here } } diff --git a/tests/ui/parser/issues/issue-87197-missing-semicolon.fixed b/tests/ui/parser/issues/issue-87197-missing-semicolon.fixed index 63c4515985da4..79f96a9a9fb5c 100644 --- a/tests/ui/parser/issues/issue-87197-missing-semicolon.fixed +++ b/tests/ui/parser/issues/issue-87197-missing-semicolon.fixed @@ -3,8 +3,8 @@ // https://github.com/rust-lang/rust/issues/87197 fn main() { - let x = 100; //~ ERROR: expected `;` - println!("{}", x); //~ ERROR: expected `;` - let y = 200; //~ ERROR: expected `;` + let x = 100; //~ ERROR expected `;` + println!("{}", x); //~ ERROR expected `;` + let y = 200; //~ ERROR expected `;` println!("{}", y); } diff --git a/tests/ui/parser/issues/issue-87197-missing-semicolon.rs b/tests/ui/parser/issues/issue-87197-missing-semicolon.rs index 9a743b188c3f4..22b16b5a4d32e 100644 --- a/tests/ui/parser/issues/issue-87197-missing-semicolon.rs +++ b/tests/ui/parser/issues/issue-87197-missing-semicolon.rs @@ -3,8 +3,8 @@ // https://github.com/rust-lang/rust/issues/87197 fn main() { - let x = 100 //~ ERROR: expected `;` - println!("{}", x) //~ ERROR: expected `;` - let y = 200 //~ ERROR: expected `;` + let x = 100 //~ ERROR expected `;` + println!("{}", x) //~ ERROR expected `;` + let y = 200 //~ ERROR expected `;` println!("{}", y); } diff --git a/tests/ui/parser/issues/issue-87635.rs b/tests/ui/parser/issues/issue-87635.rs index f70a87fb0e8fb..2d749071e9227 100644 --- a/tests/ui/parser/issues/issue-87635.rs +++ b/tests/ui/parser/issues/issue-87635.rs @@ -2,7 +2,7 @@ struct Foo {} impl Foo { pub fn bar() - //~^ ERROR: associated function in `impl` without body + //~^ ERROR associated function in `impl` without body } //~^ERROR expected one of `->`, `where`, or `{`, found `}` diff --git a/tests/ui/parser/issues/issue-88818.rs b/tests/ui/parser/issues/issue-88818.rs index b9233ca8339e1..119afa7008498 100644 --- a/tests/ui/parser/issues/issue-88818.rs +++ b/tests/ui/parser/issues/issue-88818.rs @@ -3,8 +3,8 @@ struct S { } impl for S { } -//~^ ERROR: missing trait in a trait impl -//~| HELP: add a trait here -//~| HELP: for an inherent impl, drop this `for` +//~^ ERROR missing trait in a trait impl +//~| HELP add a trait here +//~| HELP for an inherent impl, drop this `for` fn main() {} diff --git a/tests/ui/parser/issues/issue-89388.rs b/tests/ui/parser/issues/issue-89388.rs index 9153c071e8e1a..09167f469efbb 100644 --- a/tests/ui/parser/issues/issue-89388.rs +++ b/tests/ui/parser/issues/issue-89388.rs @@ -3,5 +3,5 @@ fn main() { let option: Option<&[u8]> = Some(b"..."); let _ = option.map([_]::to_vec); - //~^ ERROR: missing angle brackets in associated item path + //~^ ERROR missing angle brackets in associated item path } diff --git a/tests/ui/parser/issues/issue-89396.fixed b/tests/ui/parser/issues/issue-89396.fixed index c31858d4a89b0..afe151d6b4638 100644 --- a/tests/ui/parser/issues/issue-89396.fixed +++ b/tests/ui/parser/issues/issue-89396.fixed @@ -7,10 +7,10 @@ fn main() { let opt = Some(42); let _ = match opt { Some(_) => true, - //~^ ERROR: expected one of - //~| HELP: use a fat arrow to start a match arm + //~^ ERROR expected one of + //~| HELP use a fat arrow to start a match arm None => false, - //~^ ERROR: expected one of - //~| HELP: use a fat arrow to start a match arm + //~^ ERROR expected one of + //~| HELP use a fat arrow to start a match arm }; } diff --git a/tests/ui/parser/issues/issue-89396.rs b/tests/ui/parser/issues/issue-89396.rs index b93820715fe72..ebecaacb94d18 100644 --- a/tests/ui/parser/issues/issue-89396.rs +++ b/tests/ui/parser/issues/issue-89396.rs @@ -7,10 +7,10 @@ fn main() { let opt = Some(42); let _ = match opt { Some(_) = true, - //~^ ERROR: expected one of - //~| HELP: use a fat arrow to start a match arm + //~^ ERROR expected one of + //~| HELP use a fat arrow to start a match arm None -> false, - //~^ ERROR: expected one of - //~| HELP: use a fat arrow to start a match arm + //~^ ERROR expected one of + //~| HELP use a fat arrow to start a match arm }; } diff --git a/tests/ui/parser/issues/issue-90728.rs b/tests/ui/parser/issues/issue-90728.rs index d6a898361ccaf..31db7003e7bc7 100644 --- a/tests/ui/parser/issues/issue-90728.rs +++ b/tests/ui/parser/issues/issue-90728.rs @@ -1,6 +1,6 @@ fn main() { a.5.2E+ - //~^ ERROR: unexpected token: `5.2E+` - //~| ERROR: expected one of `.`, `;`, `?`, `}`, or an operator, found `5.2E+` - //~| ERROR: expected at least one digit in exponent + //~^ ERROR unexpected token: `5.2E+` + //~| ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `5.2E+` + //~| ERROR expected at least one digit in exponent } diff --git a/tests/ui/parser/issues/issue-90993.rs b/tests/ui/parser/issues/issue-90993.rs index 40e6fc748760a..60d759e4a6058 100644 --- a/tests/ui/parser/issues/issue-90993.rs +++ b/tests/ui/parser/issues/issue-90993.rs @@ -1,6 +1,6 @@ fn main() { ...=. - //~^ ERROR: unexpected token: `...` - //~| ERROR: unexpected `=` after inclusive range - //~| ERROR: expected one of `-`, `;`, `}`, or path, found `.` + //~^ ERROR unexpected token: `...` + //~| ERROR unexpected `=` after inclusive range + //~| ERROR expected one of `-`, `;`, `}`, or path, found `.` } diff --git a/tests/ui/parser/issues/issue-91421.rs b/tests/ui/parser/issues/issue-91421.rs index 8bba27f372439..9a88b47e0f5cc 100644 --- a/tests/ui/parser/issues/issue-91421.rs +++ b/tests/ui/parser/issues/issue-91421.rs @@ -2,8 +2,8 @@ fn main() { let value = if true && { - //~^ ERROR: this `if` expression is missing a block after the condition - //~| HELP: this binary operation is possibly unfinished + //~^ ERROR this `if` expression is missing a block after the condition + //~| HELP this binary operation is possibly unfinished 3 } else { 4 }; } diff --git a/tests/ui/parser/issues/issue-91461.rs b/tests/ui/parser/issues/issue-91461.rs index 80e0940ad8f85..1ce4dcf2a9467 100644 --- a/tests/ui/parser/issues/issue-91461.rs +++ b/tests/ui/parser/issues/issue-91461.rs @@ -1,5 +1,5 @@ fn main() { a(_:b:,) //~^ ERROR expected identifier, found reserved identifier - //~| ERROR: expected one of + //~| ERROR expected one of } diff --git a/tests/ui/parser/keyword-as-as-identifier.rs b/tests/ui/parser/keyword-as-as-identifier.rs index cd47c8a3907d9..de1d48ccb63c8 100644 --- a/tests/ui/parser/keyword-as-as-identifier.rs +++ b/tests/ui/parser/keyword-as-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py as' fn main() { - let as = "foo"; //~ error: expected identifier, found keyword `as` + let as = "foo"; //~ error expected identifier, found keyword `as` } diff --git a/tests/ui/parser/keyword-break-as-identifier.rs b/tests/ui/parser/keyword-break-as-identifier.rs index 04b25a7aaf613..fe57477125d95 100644 --- a/tests/ui/parser/keyword-break-as-identifier.rs +++ b/tests/ui/parser/keyword-break-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py break' fn main() { - let break = "foo"; //~ error: expected identifier, found keyword `break` + let break = "foo"; //~ error expected identifier, found keyword `break` } diff --git a/tests/ui/parser/keyword-const-as-identifier.rs b/tests/ui/parser/keyword-const-as-identifier.rs index 6a2d926bf5796..4f1e58f6162ba 100644 --- a/tests/ui/parser/keyword-const-as-identifier.rs +++ b/tests/ui/parser/keyword-const-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py const' fn main() { - let const = "foo"; //~ error: expected identifier, found keyword `const` + let const = "foo"; //~ error expected identifier, found keyword `const` } diff --git a/tests/ui/parser/keyword-continue-as-identifier.rs b/tests/ui/parser/keyword-continue-as-identifier.rs index cfdd62a2d1bce..366716ce5cb8d 100644 --- a/tests/ui/parser/keyword-continue-as-identifier.rs +++ b/tests/ui/parser/keyword-continue-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py continue' fn main() { - let continue = "foo"; //~ error: expected identifier, found keyword `continue` + let continue = "foo"; //~ error expected identifier, found keyword `continue` } diff --git a/tests/ui/parser/keyword-else-as-identifier.rs b/tests/ui/parser/keyword-else-as-identifier.rs index f12dac3ff75eb..eef42f6dd91ee 100644 --- a/tests/ui/parser/keyword-else-as-identifier.rs +++ b/tests/ui/parser/keyword-else-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py else' fn main() { - let else = "foo"; //~ error: expected identifier, found keyword `else` + let else = "foo"; //~ error expected identifier, found keyword `else` } diff --git a/tests/ui/parser/keyword-enum-as-identifier.rs b/tests/ui/parser/keyword-enum-as-identifier.rs index fe66230d02830..166e6c73eafe0 100644 --- a/tests/ui/parser/keyword-enum-as-identifier.rs +++ b/tests/ui/parser/keyword-enum-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py enum' fn main() { - let enum = "foo"; //~ error: expected identifier, found keyword `enum` + let enum = "foo"; //~ error expected identifier, found keyword `enum` } diff --git a/tests/ui/parser/keyword-fn-as-identifier.rs b/tests/ui/parser/keyword-fn-as-identifier.rs index f30e115f7947e..09dda093e50ba 100644 --- a/tests/ui/parser/keyword-fn-as-identifier.rs +++ b/tests/ui/parser/keyword-fn-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py fn' fn main() { - let fn = "foo"; //~ error: expected identifier, found keyword `fn` + let fn = "foo"; //~ error expected identifier, found keyword `fn` } diff --git a/tests/ui/parser/keyword-for-as-identifier.rs b/tests/ui/parser/keyword-for-as-identifier.rs index 9e8a2ad53420c..bad412264d408 100644 --- a/tests/ui/parser/keyword-for-as-identifier.rs +++ b/tests/ui/parser/keyword-for-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py for' fn main() { - let for = "foo"; //~ error: expected identifier, found keyword `for` + let for = "foo"; //~ error expected identifier, found keyword `for` } diff --git a/tests/ui/parser/keyword-if-as-identifier.rs b/tests/ui/parser/keyword-if-as-identifier.rs index 0bd5756afce7f..178d569213e86 100644 --- a/tests/ui/parser/keyword-if-as-identifier.rs +++ b/tests/ui/parser/keyword-if-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py if' fn main() { - let if = "foo"; //~ error: expected identifier, found keyword `if` + let if = "foo"; //~ error expected identifier, found keyword `if` } diff --git a/tests/ui/parser/keyword-impl-as-identifier.rs b/tests/ui/parser/keyword-impl-as-identifier.rs index df529bae07214..d83fadd03830e 100644 --- a/tests/ui/parser/keyword-impl-as-identifier.rs +++ b/tests/ui/parser/keyword-impl-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py impl' fn main() { - let impl = "foo"; //~ error: expected identifier, found keyword `impl` + let impl = "foo"; //~ error expected identifier, found keyword `impl` } diff --git a/tests/ui/parser/keyword-in-as-identifier.rs b/tests/ui/parser/keyword-in-as-identifier.rs index e4499dea255e3..9bd85adafe4a4 100644 --- a/tests/ui/parser/keyword-in-as-identifier.rs +++ b/tests/ui/parser/keyword-in-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py in' fn main() { - let in = "foo"; //~ error: expected pattern, found keyword `in` + let in = "foo"; //~ error expected pattern, found keyword `in` } diff --git a/tests/ui/parser/keyword-let-as-identifier.rs b/tests/ui/parser/keyword-let-as-identifier.rs index 9b1183501b28d..49f0241e42a7c 100644 --- a/tests/ui/parser/keyword-let-as-identifier.rs +++ b/tests/ui/parser/keyword-let-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py let' fn main() { - let let = "foo"; //~ error: expected identifier, found keyword `let` + let let = "foo"; //~ error expected identifier, found keyword `let` } diff --git a/tests/ui/parser/keyword-loop-as-identifier.rs b/tests/ui/parser/keyword-loop-as-identifier.rs index 46914a19be2bd..b7256952e4170 100644 --- a/tests/ui/parser/keyword-loop-as-identifier.rs +++ b/tests/ui/parser/keyword-loop-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py loop' fn main() { - let loop = "foo"; //~ error: expected identifier, found keyword `loop` + let loop = "foo"; //~ error expected identifier, found keyword `loop` } diff --git a/tests/ui/parser/keyword-match-as-identifier.rs b/tests/ui/parser/keyword-match-as-identifier.rs index d3cecb991b8f9..08b022d3509fe 100644 --- a/tests/ui/parser/keyword-match-as-identifier.rs +++ b/tests/ui/parser/keyword-match-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py match' fn main() { - let match = "foo"; //~ error: expected identifier, found keyword `match` + let match = "foo"; //~ error expected identifier, found keyword `match` } diff --git a/tests/ui/parser/keyword-mod-as-identifier.rs b/tests/ui/parser/keyword-mod-as-identifier.rs index b9c7b6c78ed6c..8fa7b4d6cc52f 100644 --- a/tests/ui/parser/keyword-mod-as-identifier.rs +++ b/tests/ui/parser/keyword-mod-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py mod' fn main() { - let mod = "foo"; //~ error: expected identifier, found keyword `mod` + let mod = "foo"; //~ error expected identifier, found keyword `mod` } diff --git a/tests/ui/parser/keyword-move-as-identifier.rs b/tests/ui/parser/keyword-move-as-identifier.rs index 65be02e3c70cf..8cce2858d9b84 100644 --- a/tests/ui/parser/keyword-move-as-identifier.rs +++ b/tests/ui/parser/keyword-move-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py move' fn main() { - let move = "foo"; //~ error: expected identifier, found keyword `move` + let move = "foo"; //~ error expected identifier, found keyword `move` } diff --git a/tests/ui/parser/keyword-mut-as-identifier.rs b/tests/ui/parser/keyword-mut-as-identifier.rs index 9b919d2b383c2..8a77258432550 100644 --- a/tests/ui/parser/keyword-mut-as-identifier.rs +++ b/tests/ui/parser/keyword-mut-as-identifier.rs @@ -1,3 +1,3 @@ fn main() { - let mut = "foo"; //~ error: expected identifier, found `=` + let mut = "foo"; //~ error expected identifier, found `=` } diff --git a/tests/ui/parser/keyword-pub-as-identifier.rs b/tests/ui/parser/keyword-pub-as-identifier.rs index 2b2bb14118d7d..b9d859dc7b41f 100644 --- a/tests/ui/parser/keyword-pub-as-identifier.rs +++ b/tests/ui/parser/keyword-pub-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py pub' fn main() { - let pub = "foo"; //~ error: expected identifier, found keyword `pub` + let pub = "foo"; //~ error expected identifier, found keyword `pub` } diff --git a/tests/ui/parser/keyword-ref-as-identifier.rs b/tests/ui/parser/keyword-ref-as-identifier.rs index f5e04b5db7346..081469e98861a 100644 --- a/tests/ui/parser/keyword-ref-as-identifier.rs +++ b/tests/ui/parser/keyword-ref-as-identifier.rs @@ -1,3 +1,3 @@ fn main() { - let ref = "foo"; //~ error: expected identifier, found `=` + let ref = "foo"; //~ error expected identifier, found `=` } diff --git a/tests/ui/parser/keyword-return-as-identifier.rs b/tests/ui/parser/keyword-return-as-identifier.rs index e1a2db5e4d82d..34562b21ed96c 100644 --- a/tests/ui/parser/keyword-return-as-identifier.rs +++ b/tests/ui/parser/keyword-return-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py return' fn main() { - let return = "foo"; //~ error: expected identifier, found keyword `return` + let return = "foo"; //~ error expected identifier, found keyword `return` } diff --git a/tests/ui/parser/keyword-static-as-identifier.rs b/tests/ui/parser/keyword-static-as-identifier.rs index 423b9854b8aa1..7e1402a0e9bc5 100644 --- a/tests/ui/parser/keyword-static-as-identifier.rs +++ b/tests/ui/parser/keyword-static-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py static' fn main() { - let static = "foo"; //~ error: expected identifier, found keyword `static` + let static = "foo"; //~ error expected identifier, found keyword `static` } diff --git a/tests/ui/parser/keyword-struct-as-identifier.rs b/tests/ui/parser/keyword-struct-as-identifier.rs index 18cfe11592aed..c22dd52414c5a 100644 --- a/tests/ui/parser/keyword-struct-as-identifier.rs +++ b/tests/ui/parser/keyword-struct-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py struct' fn main() { - let struct = "foo"; //~ error: expected identifier, found keyword `struct` + let struct = "foo"; //~ error expected identifier, found keyword `struct` } diff --git a/tests/ui/parser/keyword-trait-as-identifier.rs b/tests/ui/parser/keyword-trait-as-identifier.rs index 67f81167dbdd3..4ab95edf1a524 100644 --- a/tests/ui/parser/keyword-trait-as-identifier.rs +++ b/tests/ui/parser/keyword-trait-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py trait' fn main() { - let trait = "foo"; //~ error: expected identifier, found keyword `trait` + let trait = "foo"; //~ error expected identifier, found keyword `trait` } diff --git a/tests/ui/parser/keyword-try-as-identifier-edition2018.rs b/tests/ui/parser/keyword-try-as-identifier-edition2018.rs index 27452f4d45e85..58925ac8ff613 100644 --- a/tests/ui/parser/keyword-try-as-identifier-edition2018.rs +++ b/tests/ui/parser/keyword-try-as-identifier-edition2018.rs @@ -1,5 +1,5 @@ //@ compile-flags: --edition 2018 fn main() { - let try = "foo"; //~ error: expected identifier, found reserved keyword `try` + let try = "foo"; //~ error expected identifier, found reserved keyword `try` } diff --git a/tests/ui/parser/keyword-type-as-identifier.rs b/tests/ui/parser/keyword-type-as-identifier.rs index 04adddf72c6ff..f0ad302a0e326 100644 --- a/tests/ui/parser/keyword-type-as-identifier.rs +++ b/tests/ui/parser/keyword-type-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py type' fn main() { - let type = "foo"; //~ error: expected identifier, found keyword `type` + let type = "foo"; //~ error expected identifier, found keyword `type` } diff --git a/tests/ui/parser/keyword-unsafe-as-identifier.rs b/tests/ui/parser/keyword-unsafe-as-identifier.rs index 0ff6d188c6480..63bb7cedc1879 100644 --- a/tests/ui/parser/keyword-unsafe-as-identifier.rs +++ b/tests/ui/parser/keyword-unsafe-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py unsafe' fn main() { - let unsafe = "foo"; //~ error: expected identifier, found keyword `unsafe` + let unsafe = "foo"; //~ error expected identifier, found keyword `unsafe` } diff --git a/tests/ui/parser/keyword-use-as-identifier.rs b/tests/ui/parser/keyword-use-as-identifier.rs index 821bedee08832..b80701aae6dff 100644 --- a/tests/ui/parser/keyword-use-as-identifier.rs +++ b/tests/ui/parser/keyword-use-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py use' fn main() { - let use = "foo"; //~ error: expected identifier, found keyword `use` + let use = "foo"; //~ error expected identifier, found keyword `use` } diff --git a/tests/ui/parser/keyword-where-as-identifier.rs b/tests/ui/parser/keyword-where-as-identifier.rs index 56301bd20adfd..42f625e23eaac 100644 --- a/tests/ui/parser/keyword-where-as-identifier.rs +++ b/tests/ui/parser/keyword-where-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py where' fn main() { - let where = "foo"; //~ error: expected identifier, found keyword `where` + let where = "foo"; //~ error expected identifier, found keyword `where` } diff --git a/tests/ui/parser/keyword-while-as-identifier.rs b/tests/ui/parser/keyword-while-as-identifier.rs index 22026d15dcbfb..5f21b6d14d3f6 100644 --- a/tests/ui/parser/keyword-while-as-identifier.rs +++ b/tests/ui/parser/keyword-while-as-identifier.rs @@ -1,5 +1,5 @@ // This file was auto-generated using 'src/etc/generate-keyword-tests.py while' fn main() { - let while = "foo"; //~ error: expected identifier, found keyword `while` + let while = "foo"; //~ error expected identifier, found keyword `while` } diff --git a/tests/ui/parser/lifetime_starts_expressions.rs b/tests/ui/parser/lifetime_starts_expressions.rs index 903b4de6ef47c..c22607f2880d3 100644 --- a/tests/ui/parser/lifetime_starts_expressions.rs +++ b/tests/ui/parser/lifetime_starts_expressions.rs @@ -6,16 +6,16 @@ fn foo() -> u32 { fn bar() -> u32 { loop { break 'label: loop { break 'label 42; }; } - //~^ ERROR: parentheses are required around this expression to avoid confusion - //~| HELP: wrap the expression in parentheses + //~^ ERROR parentheses are required around this expression to avoid confusion + //~| HELP wrap the expression in parentheses } fn baz() -> u32 { 'label: loop { break 'label - //~^ WARNING: this labeled break expression is easy to confuse with an unlabeled break + //~^ WARNING this labeled break expression is easy to confuse with an unlabeled break loop { break 42; }; - //~^ HELP: wrap this expression in parentheses + //~^ HELP wrap this expression in parentheses }; 'label2: loop { @@ -31,8 +31,8 @@ pub fn main() { }; let b = loop { break 'inner_loop: loop { - //~^ ERROR: parentheses are required around this expression to avoid confusion - //~| HELP: wrap the expression in parentheses + //~^ ERROR parentheses are required around this expression to avoid confusion + //~| HELP wrap the expression in parentheses break 'inner_loop 1; }; }; diff --git a/tests/ui/parser/macro/literals-are-validated-before-expansion.rs b/tests/ui/parser/macro/literals-are-validated-before-expansion.rs index c3fc754b5567f..eed63693ee339 100644 --- a/tests/ui/parser/macro/literals-are-validated-before-expansion.rs +++ b/tests/ui/parser/macro/literals-are-validated-before-expansion.rs @@ -4,7 +4,7 @@ macro_rules! black_hole { fn main() { black_hole! { '\u{FFFFFF}' } - //~^ ERROR: invalid unicode character escape + //~^ ERROR invalid unicode character escape black_hole! { "this is surrogate: \u{DAAA}" } - //~^ ERROR: invalid unicode character escape + //~^ ERROR invalid unicode character escape } diff --git a/tests/ui/parser/macros-no-semicolon.rs b/tests/ui/parser/macros-no-semicolon.rs index 24d1ae9e62368..6682d7a9f44b4 100644 --- a/tests/ui/parser/macros-no-semicolon.rs +++ b/tests/ui/parser/macros-no-semicolon.rs @@ -1,5 +1,5 @@ fn main() { - assert_eq!(1, 2) //~ ERROR: expected `;` - assert_eq!(3, 4) //~ ERROR: expected `;` + assert_eq!(1, 2) //~ ERROR expected `;` + assert_eq!(3, 4) //~ ERROR expected `;` println!("hello"); } diff --git a/tests/ui/parser/missing-closing-angle-bracket-eq-constraint.rs b/tests/ui/parser/missing-closing-angle-bracket-eq-constraint.rs index a56cd17773dc4..8372c88422085 100644 --- a/tests/ui/parser/missing-closing-angle-bracket-eq-constraint.rs +++ b/tests/ui/parser/missing-closing-angle-bracket-eq-constraint.rs @@ -5,19 +5,19 @@ struct Foo { fn test1(arg : T) { let v : Vec<(u32,_) = vec![]; - //~^ ERROR: expected one of - //~| ERROR: type annotations needed + //~^ ERROR expected one of + //~| ERROR type annotations needed } fn test2(arg1 : T1, arg2 : T2) { let foo : Foo::(arg : &'a u32) { let v : Vec<'a = vec![]; - //~^ ERROR: expected one of - //~| ERROR: type annotations needed for `Vec<_>` + //~^ ERROR expected one of + //~| ERROR type annotations needed for `Vec<_>` } fn main() {} diff --git a/tests/ui/parser/misspelled-macro-rules.fixed b/tests/ui/parser/misspelled-macro-rules.fixed index 7471a5641c28a..acb6e4dcf198b 100644 --- a/tests/ui/parser/misspelled-macro-rules.fixed +++ b/tests/ui/parser/misspelled-macro-rules.fixed @@ -5,8 +5,8 @@ #![allow(unused_macros)] macro_rules! thing { -//~^ ERROR: expected one of -//~| HELP: perhaps you meant to define a macro +//~^ ERROR expected one of +//~| HELP perhaps you meant to define a macro () => {} } diff --git a/tests/ui/parser/misspelled-macro-rules.rs b/tests/ui/parser/misspelled-macro-rules.rs index 8f63f37d3d388..c0065ec42e816 100644 --- a/tests/ui/parser/misspelled-macro-rules.rs +++ b/tests/ui/parser/misspelled-macro-rules.rs @@ -5,8 +5,8 @@ #![allow(unused_macros)] marco_rules! thing { -//~^ ERROR: expected one of -//~| HELP: perhaps you meant to define a macro +//~^ ERROR expected one of +//~| HELP perhaps you meant to define a macro () => {} } diff --git a/tests/ui/parser/multibyte-char-use-seperator-issue-80134.rs b/tests/ui/parser/multibyte-char-use-seperator-issue-80134.rs index 7e7995d6724eb..6e2f8ec646c6a 100644 --- a/tests/ui/parser/multibyte-char-use-seperator-issue-80134.rs +++ b/tests/ui/parser/multibyte-char-use-seperator-issue-80134.rs @@ -2,9 +2,9 @@ fn main() { (()é); - //~^ ERROR: expected one of `)`, `,`, `.`, `?`, or an operator - //~| ERROR: cannot find value `é` in this scope + //~^ ERROR expected one of `)`, `,`, `.`, `?`, or an operator + //~| ERROR cannot find value `é` in this scope (()氷); - //~^ ERROR: expected one of `)`, `,`, `.`, `?`, or an operator - //~| ERROR: cannot find value `氷` in this scope + //~^ ERROR expected one of `)`, `,`, `.`, `?`, or an operator + //~| ERROR cannot find value `氷` in this scope } diff --git a/tests/ui/parser/multitrait.rs b/tests/ui/parser/multitrait.rs index f9b4b37acc0dd..a5254a5bdc47a 100644 --- a/tests/ui/parser/multitrait.rs +++ b/tests/ui/parser/multitrait.rs @@ -3,7 +3,7 @@ struct S { } impl Cmp, ToString for S { -//~^ ERROR: expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `,` +//~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `,` fn eq(&&other: S) { false } fn to_string(&self) -> String { "hi".to_string() } } diff --git a/tests/ui/parser/nested-missing-closing-angle-bracket.rs b/tests/ui/parser/nested-missing-closing-angle-bracket.rs index 84ffdd176aea0..b2d029bc357a4 100644 --- a/tests/ui/parser/nested-missing-closing-angle-bracket.rs +++ b/tests/ui/parser/nested-missing-closing-angle-bracket.rs @@ -1,4 +1,4 @@ fn main() { let v : Vec:: = vec![vec![]]; - //~^ ERROR: expected one of + //~^ ERROR expected one of } diff --git a/tests/ui/parser/pat-lt-bracket-1.rs b/tests/ui/parser/pat-lt-bracket-1.rs index 2e2001434f28c..c435697cc62e8 100644 --- a/tests/ui/parser/pat-lt-bracket-1.rs +++ b/tests/ui/parser/pat-lt-bracket-1.rs @@ -1,7 +1,7 @@ fn main() { match 42 { x < 7 => (), - //~^ error: expected one of `=>`, `@`, `if`, or `|`, found `<` + //~^ error expected one of `=>`, `@`, `if`, or `|`, found `<` _ => () } } diff --git a/tests/ui/parser/pat-lt-bracket-2.rs b/tests/ui/parser/pat-lt-bracket-2.rs index 3a778ed14f637..ef683d082fe23 100644 --- a/tests/ui/parser/pat-lt-bracket-2.rs +++ b/tests/ui/parser/pat-lt-bracket-2.rs @@ -1,4 +1,4 @@ fn a(B<) {} - //~^ error: expected one of `:`, `@`, or `|`, found `<` + //~^ error expected one of `:`, `@`, or `|`, found `<` fn main() {} diff --git a/tests/ui/parser/pat-lt-bracket-5.rs b/tests/ui/parser/pat-lt-bracket-5.rs index 6d784494d56a3..25c182d62548b 100644 --- a/tests/ui/parser/pat-lt-bracket-5.rs +++ b/tests/ui/parser/pat-lt-bracket-5.rs @@ -1,5 +1,5 @@ fn main() { let v[0] = v[1]; - //~^ error: expected a pattern, found an expression - //~| error: cannot find value `v` in this scope + //~^ error expected a pattern, found an expression + //~| error cannot find value `v` in this scope } diff --git a/tests/ui/parser/pat-lt-bracket-6.rs b/tests/ui/parser/pat-lt-bracket-6.rs index 496525ed5370c..4269dfc4f1b5c 100644 --- a/tests/ui/parser/pat-lt-bracket-6.rs +++ b/tests/ui/parser/pat-lt-bracket-6.rs @@ -3,8 +3,8 @@ fn main() { let x = Test(&0, []); let Test(&desc[..]) = x; - //~^ error: expected a pattern, found an expression - //~| error: this pattern has 1 field, but the corresponding tuple struct has 2 fields + //~^ error expected a pattern, found an expression + //~| error this pattern has 1 field, but the corresponding tuple struct has 2 fields } const RECOVERY_WITNESS: () = 0; //~ ERROR mismatched types diff --git a/tests/ui/parser/pat-lt-bracket-7.rs b/tests/ui/parser/pat-lt-bracket-7.rs index abaeb4c83c05f..63332f679fd86 100644 --- a/tests/ui/parser/pat-lt-bracket-7.rs +++ b/tests/ui/parser/pat-lt-bracket-7.rs @@ -3,7 +3,7 @@ fn main() { let foo = core::iter::empty(); for Thing(x[]) in foo {} - //~^ ERROR: expected one of `)`, `,`, `@`, `if`, or `|`, found `[` + //~^ ERROR expected one of `)`, `,`, `@`, `if`, or `|`, found `[` } const RECOVERY_WITNESS: () = 0; //~ ERROR mismatched types diff --git a/tests/ui/parser/pat-ranges-1.rs b/tests/ui/parser/pat-ranges-1.rs index 1dafb5a07bb5a..eb8897baf2110 100644 --- a/tests/ui/parser/pat-ranges-1.rs +++ b/tests/ui/parser/pat-ranges-1.rs @@ -1,5 +1,5 @@ // Parsing of range patterns fn main() { - let macropus!() ..= 11 = 12; //~ error: expected one of `:`, `;`, `=`, or `|`, found `..=` + let macropus!() ..= 11 = 12; //~ error expected one of `:`, `;`, `=`, or `|`, found `..=` } diff --git a/tests/ui/parser/pat-ranges-2.rs b/tests/ui/parser/pat-ranges-2.rs index 1593222acca1b..d11a3fc7fc653 100644 --- a/tests/ui/parser/pat-ranges-2.rs +++ b/tests/ui/parser/pat-ranges-2.rs @@ -1,5 +1,5 @@ // Parsing of range patterns fn main() { - let 10 ..= makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, `=`, or `|`, found `!` + let 10 ..= makropulos!() = 12; //~ error expected one of `::`, `:`, `;`, `=`, or `|`, found `!` } diff --git a/tests/ui/parser/pat-ranges-3.rs b/tests/ui/parser/pat-ranges-3.rs index 419768a2a2022..9a71893148c23 100644 --- a/tests/ui/parser/pat-ranges-3.rs +++ b/tests/ui/parser/pat-ranges-3.rs @@ -2,8 +2,8 @@ fn main() { let 10 ..= 10 + 3 = 12; - //~^ error: expected a pattern range bound, found an expression + //~^ error expected a pattern range bound, found an expression let 10 - 3 ..= 10 = 8; - //~^ error: expected a pattern range bound, found an expression + //~^ error expected a pattern range bound, found an expression } diff --git a/tests/ui/parser/range-exclusive-dotdotlt.rs b/tests/ui/parser/range-exclusive-dotdotlt.rs index 5752566026f02..a610498aaeeb8 100644 --- a/tests/ui/parser/range-exclusive-dotdotlt.rs +++ b/tests/ui/parser/range-exclusive-dotdotlt.rs @@ -1,35 +1,35 @@ fn foo() { let _ = 0..<10; - //~^ ERROR: expected type, found `10` - //~| HELP: remove the `<` to write an exclusive range + //~^ ERROR expected type, found `10` + //~| HELP remove the `<` to write an exclusive range } fn bar() { let _ = 0..`, or `as`, found `;` - //~| HELP: remove the `<` to write an exclusive range + //~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `>`, or `as`, found `;` + //~| HELP remove the `<` to write an exclusive range } fn baz() { let _ = ; - //~^ ERROR: expected `::`, found `;` + //~^ ERROR expected `::`, found `;` } fn qux() { let _ = [1, 2, 3][..<1]; - //~^ ERROR: expected type, found `1` - //~| HELP: remove the `<` to write an exclusive range + //~^ ERROR expected type, found `1` + //~| HELP remove the `<` to write an exclusive range } fn quux() { let _ = [1, 2, 3][..`, or `as`, found `]` - //~| HELP: remove the `<` to write an exclusive range + //~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `>`, or `as`, found `]` + //~| HELP remove the `<` to write an exclusive range } fn foobar() { let _ = [1, 2, 3][..]; - //~^ ERROR: expected `::`, found `]` + //~^ ERROR expected `::`, found `]` } fn ok1() { diff --git a/tests/ui/parser/recover/recover-enum2.rs b/tests/ui/parser/recover/recover-enum2.rs index 56b57f625ba08..06b20f24130b1 100644 --- a/tests/ui/parser/recover/recover-enum2.rs +++ b/tests/ui/parser/recover/recover-enum2.rs @@ -3,7 +3,7 @@ fn main() { Var1, Var2(String), Var3 { - abc: {}, //~ ERROR: expected type, found `{` + abc: {}, //~ ERROR expected type, found `{` }, } @@ -22,7 +22,7 @@ fn main() { { // fail again enum Test4 { - Nope(i32 {}) //~ ERROR: found `{` + Nope(i32 {}) //~ ERROR found `{` } let () = 1; //~ ERROR mismatched types } diff --git a/tests/ui/parser/recover/recover-pat-exprs.rs b/tests/ui/parser/recover/recover-pat-exprs.rs index a78bb82828d3a..00feb00636db5 100644 --- a/tests/ui/parser/recover/recover-pat-exprs.rs +++ b/tests/ui/parser/recover/recover-pat-exprs.rs @@ -2,105 +2,105 @@ fn field_access() { match 0 { x => (), - x.y => (), //~ error: expected a pattern, found an expression - x.0 => (), //~ error: expected a pattern, found an expression - x._0 => (), //~ error: expected a pattern, found an expression - x.0.1 => (), //~ error: expected a pattern, found an expression - x.4.y.17.__z => (), //~ error: expected a pattern, found an expression + x.y => (), //~ error expected a pattern, found an expression + x.0 => (), //~ error expected a pattern, found an expression + x._0 => (), //~ error expected a pattern, found an expression + x.0.1 => (), //~ error expected a pattern, found an expression + x.4.y.17.__z => (), //~ error expected a pattern, found an expression } - { let x.0e0; } //~ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.` - { let x.-0.0; } //~ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.` - { let x.-0; } //~ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.` + { let x.0e0; } //~ error expected one of `:`, `;`, `=`, `@`, or `|`, found `.` + { let x.-0.0; } //~ error expected one of `:`, `;`, `=`, `@`, or `|`, found `.` + { let x.-0; } //~ error expected one of `:`, `;`, `=`, `@`, or `|`, found `.` - { let x.0u32; } //~ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.` - { let x.0.0_f64; } //~ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.` + { let x.0u32; } //~ error expected one of `:`, `;`, `=`, `@`, or `|`, found `.` + { let x.0.0_f64; } //~ error expected one of `:`, `;`, `=`, `@`, or `|`, found `.` } // IndexExpression, ArrayExpression fn array_indexing() { match 0 { - x[0] => (), //~ error: expected a pattern, found an expression - x[..] => (), //~ error: expected a pattern, found an expression + x[0] => (), //~ error expected a pattern, found an expression + x[..] => (), //~ error expected a pattern, found an expression } - { let x[0, 1, 2]; } //~ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `[` - { let x[0; 20]; } //~ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `[` - { let x[]; } //~ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `[` - { let (x[]); } //~ error: expected one of `)`, `,`, `@`, `if`, or `|`, found `[` + { let x[0, 1, 2]; } //~ error expected one of `:`, `;`, `=`, `@`, or `|`, found `[` + { let x[0; 20]; } //~ error expected one of `:`, `;`, `=`, `@`, or `|`, found `[` + { let x[]; } //~ error expected one of `:`, `;`, `=`, `@`, or `|`, found `[` + { let (x[]); } //~ error expected one of `)`, `,`, `@`, `if`, or `|`, found `[` //~^ missing `,` } // MethodCallExpression, CallExpression, ErrorPropagationExpression fn method_call() { match 0 { - x.f() => (), //~ error: expected a pattern, found an expression - x._f() => (), //~ error: expected a pattern, found an expression - x? => (), //~ error: expected a pattern, found an expression - ().f() => (), //~ error: expected a pattern, found an expression - (0, x)?.f() => (), //~ error: expected a pattern, found an expression - x.f().g() => (), //~ error: expected a pattern, found an expression - 0.f()?.g()?? => (), //~ error: expected a pattern, found an expression + x.f() => (), //~ error expected a pattern, found an expression + x._f() => (), //~ error expected a pattern, found an expression + x? => (), //~ error expected a pattern, found an expression + ().f() => (), //~ error expected a pattern, found an expression + (0, x)?.f() => (), //~ error expected a pattern, found an expression + x.f().g() => (), //~ error expected a pattern, found an expression + 0.f()?.g()?? => (), //~ error expected a pattern, found an expression } } // TypeCastExpression fn type_cast() { match 0 { - x as usize => (), //~ error: expected a pattern, found an expression - 0 as usize => (), //~ error: expected a pattern, found an expression - x.f().0.4 as f32 => (), //~ error: expected a pattern, found an expression + x as usize => (), //~ error expected a pattern, found an expression + 0 as usize => (), //~ error expected a pattern, found an expression + x.f().0.4 as f32 => (), //~ error expected a pattern, found an expression } } // ArithmeticOrLogicalExpression, also check if parentheses are added as needed fn operator() { match 0 { - 1 + 1 => (), //~ error: expected a pattern, found an expression + 1 + 1 => (), //~ error expected a pattern, found an expression (1 + 2) * 3 => (), - //~^ error: expected a pattern, found an expression - //~| error: expected a pattern, found an expression - x.0 > 2 => (), //~ error: expected a pattern, found an expression - x.0 == 2 => (), //~ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression + //~| error expected a pattern, found an expression + x.0 > 2 => (), //~ error expected a pattern, found an expression + x.0 == 2 => (), //~ error expected a pattern, found an expression } // preexisting match arm guard match (0, 0) { - (x, y.0 > 2) if x != 0 => (), //~ error: expected a pattern, found an expression - (x, y.0 > 2) if x != 0 || x != 1 => (), //~ error: expected a pattern, found an expression + (x, y.0 > 2) if x != 0 => (), //~ error expected a pattern, found an expression + (x, y.0 > 2) if x != 0 || x != 1 => (), //~ error expected a pattern, found an expression } } const _: u32 = match 12 { - 1 + 2 * PI.cos() => 2, //~ error: expected a pattern, found an expression + 1 + 2 * PI.cos() => 2, //~ error expected a pattern, found an expression _ => 0, }; fn main() { match u8::MAX { u8::MAX.abs() => (), - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression x.sqrt() @ .. => (), - //~^ error: expected a pattern, found an expression - //~| error: left-hand side of `@` must be a binding + //~^ error expected a pattern, found an expression + //~| error left-hand side of `@` must be a binding z @ w @ v.u() => (), - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression y.ilog(3) => (), - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression n + 1 => (), - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression ("".f() + 14 * 8) => (), - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression 0 | ((1) | 2) | 3 => (), f?() => (), - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression (_ + 1) => (), - //~^ error: expected one of `)`, `,`, `if`, or `|`, found `+` + //~^ error expected one of `)`, `,`, `if`, or `|`, found `+` } let 1 + 1 = 2; - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression let b = matches!(x, (x * x | x.f()) | x[0]); - //~^ error: expected one of `)`, `,`, `@`, `if`, or `|`, found `*` + //~^ error expected one of `)`, `,`, `@`, `if`, or `|`, found `*` } diff --git a/tests/ui/parser/recover/recover-pat-issues.rs b/tests/ui/parser/recover/recover-pat-issues.rs index 5b900fe80e516..098ef23b98e29 100644 --- a/tests/ui/parser/recover/recover-pat-issues.rs +++ b/tests/ui/parser/recover/recover-pat-issues.rs @@ -4,7 +4,7 @@ struct Bar { baz: String } fn foo(foo: Foo) -> bool { match foo { Foo("hi".to_owned()) => true, - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression _ => false } } @@ -12,7 +12,7 @@ fn foo(foo: Foo) -> bool { fn bar(bar: Bar) -> bool { match bar { Bar { baz: "hi".to_owned() } => true, - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression _ => false } } @@ -23,7 +23,7 @@ fn baz() { match foo.as_slice() { &["foo".to_string()] => {} - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression _ => {} }; } @@ -34,13 +34,13 @@ fn qux() { const MAGIC: Magic = Magic(42); if let Some(MAGIC.0 as usize) = None:: {} - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression } fn main() { if let (-1.some(4)) = (0, Some(4)) {} - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression if let (-1.Some(4)) = (0, Some(4)) {} - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression } diff --git a/tests/ui/parser/recover/recover-pat-lets.rs b/tests/ui/parser/recover/recover-pat-lets.rs index 6681cc25db37b..4f1d0245bc1de 100644 --- a/tests/ui/parser/recover/recover-pat-lets.rs +++ b/tests/ui/parser/recover/recover-pat-lets.rs @@ -2,19 +2,19 @@ fn main() { let x = Some(2); let x.expect("foo"); - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression let x.unwrap(): u32; - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression let x[0] = 1; - //~^ error: expected a pattern, found an expression + //~^ error expected a pattern, found an expression - let Some(1 + 1) = x else { //~ error: expected a pattern, found an expression + let Some(1 + 1) = x else { //~ error expected a pattern, found an expression return; }; - if let Some(1 + 1) = x { //~ error: expected a pattern, found an expression + if let Some(1 + 1) = x { //~ error expected a pattern, found an expression return; } } diff --git a/tests/ui/parser/recover/recover-pat-ranges.rs b/tests/ui/parser/recover/recover-pat-ranges.rs index e3f061c625d3d..492f55511efa2 100644 --- a/tests/ui/parser/recover/recover-pat-ranges.rs +++ b/tests/ui/parser/recover/recover-pat-ranges.rs @@ -2,28 +2,28 @@ fn main() { match -1 { 0..=1 => (), 0..=(1) => (), - //~^ error: range pattern bounds cannot have parentheses + //~^ error range pattern bounds cannot have parentheses (-12)..=4 => (), - //~^ error: range pattern bounds cannot have parentheses + //~^ error range pattern bounds cannot have parentheses (0)..=(-4) => (), - //~^ error: range pattern bounds cannot have parentheses - //~| error: range pattern bounds cannot have parentheses + //~^ error range pattern bounds cannot have parentheses + //~| error range pattern bounds cannot have parentheses ..=1 + 2 => (), - //~^ error: expected a pattern range bound, found an expression + //~^ error expected a pattern range bound, found an expression (4).. => (), - //~^ error: range pattern bounds cannot have parentheses + //~^ error range pattern bounds cannot have parentheses (-4 + 0).. => (), - //~^ error: expected a pattern range bound, found an expression - //~| error: range pattern bounds cannot have parentheses + //~^ error expected a pattern range bound, found an expression + //~| error range pattern bounds cannot have parentheses (1 + 4)...1 * 2 => (), - //~^ error: expected a pattern range bound, found an expression - //~| error: expected a pattern range bound, found an expression - //~| error: range pattern bounds cannot have parentheses - //~| warning: `...` range patterns are deprecated - //~| warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! + //~^ error expected a pattern range bound, found an expression + //~| error expected a pattern range bound, found an expression + //~| error range pattern bounds cannot have parentheses + //~| warning `...` range patterns are deprecated + //~| warning this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! 0.x()..="y".z() => (), - //~^ error: expected a pattern range bound, found an expression - //~| error: expected a pattern range bound, found an expression + //~^ error expected a pattern range bound, found an expression + //~| error expected a pattern range bound, found an expression }; } diff --git a/tests/ui/parser/recover/recover-pat-wildcards.rs b/tests/ui/parser/recover/recover-pat-wildcards.rs index d4d28ce63587a..660408d3d03ad 100644 --- a/tests/ui/parser/recover/recover-pat-wildcards.rs +++ b/tests/ui/parser/recover/recover-pat-wildcards.rs @@ -2,59 +2,59 @@ fn a() { match 1 { - _ + 1 => () //~ error: expected one of `=>`, `if`, or `|`, found `+` + _ + 1 => () //~ error expected one of `=>`, `if`, or `|`, found `+` } } fn b() { match 2 { - (_ % 4) => () //~ error: expected one of `)`, `,`, `if`, or `|`, found `%` + (_ % 4) => () //~ error expected one of `)`, `,`, `if`, or `|`, found `%` } } fn c() { match 3 { - _.x() => () //~ error: expected one of `=>`, `if`, or `|`, found `.` + _.x() => () //~ error expected one of `=>`, `if`, or `|`, found `.` } } fn d() { match 4 { - _..=4 => () //~ error: expected one of `=>`, `if`, or `|`, found `..=` + _..=4 => () //~ error expected one of `=>`, `if`, or `|`, found `..=` } } fn e() { match 5 { - .._ => () //~ error: expected one of `=>`, `if`, or `|`, found reserved identifier `_` + .._ => () //~ error expected one of `=>`, `if`, or `|`, found reserved identifier `_` } } fn f() { match 6 { 0..._ => () - //~^ error: inclusive range with no end - //~| error: expected one of `=>`, `if`, or `|`, found reserved identifier `_` + //~^ error inclusive range with no end + //~| error expected one of `=>`, `if`, or `|`, found reserved identifier `_` } } fn g() { match 7 { - (_ * 0)..5 => () //~ error: expected one of `)`, `,`, `if`, or `|`, found `*` + (_ * 0)..5 => () //~ error expected one of `)`, `,`, `if`, or `|`, found `*` } } fn h() { match 8 { - ..(_) => () //~ error: expected one of `=>`, `if`, or `|`, found `(` + ..(_) => () //~ error expected one of `=>`, `if`, or `|`, found `(` } } fn i() { match 9 { 4..=(2 + _) => () - //~^ error: expected a pattern range bound, found an expression - //~| error: range pattern bounds cannot have parentheses + //~^ error expected a pattern range bound, found an expression + //~| error range pattern bounds cannot have parentheses } } diff --git a/tests/ui/parser/recover/recover-ref-dyn-mut.rs b/tests/ui/parser/recover/recover-ref-dyn-mut.rs index 3016275cc0fd2..f1d7a14b02722 100644 --- a/tests/ui/parser/recover/recover-ref-dyn-mut.rs +++ b/tests/ui/parser/recover/recover-ref-dyn-mut.rs @@ -3,7 +3,7 @@ fn main() { let r: &dyn mut Trait; - //~^ ERROR: `mut` must precede `dyn` - //~| HELP: place `mut` before `dyn` - //~| ERROR: cannot find trait `Trait` in this scope [E0405] + //~^ ERROR `mut` must precede `dyn` + //~| HELP place `mut` before `dyn` + //~| ERROR cannot find trait `Trait` in this scope [E0405] } diff --git a/tests/ui/parser/recover/recover-unticked-labels.fixed b/tests/ui/parser/recover/recover-unticked-labels.fixed index f003550cbc222..e068bae5688cf 100644 --- a/tests/ui/parser/recover/recover-unticked-labels.fixed +++ b/tests/ui/parser/recover/recover-unticked-labels.fixed @@ -1,7 +1,7 @@ //@ run-rustfix fn main() { - 'label: loop { break 'label }; //~ error: cannot find value `label` in this scope - 'label: loop { break 'label 0 }; //~ error: expected a label, found an identifier - 'label: loop { continue 'label }; //~ error: expected a label, found an identifier + 'label: loop { break 'label }; //~ error cannot find value `label` in this scope + 'label: loop { break 'label 0 }; //~ error expected a label, found an identifier + 'label: loop { continue 'label }; //~ error expected a label, found an identifier } diff --git a/tests/ui/parser/recover/recover-unticked-labels.rs b/tests/ui/parser/recover/recover-unticked-labels.rs index 2b864f16b8412..9faddaefc23d9 100644 --- a/tests/ui/parser/recover/recover-unticked-labels.rs +++ b/tests/ui/parser/recover/recover-unticked-labels.rs @@ -1,7 +1,7 @@ //@ run-rustfix fn main() { - 'label: loop { break label }; //~ error: cannot find value `label` in this scope - 'label: loop { break label 0 }; //~ error: expected a label, found an identifier - 'label: loop { continue label }; //~ error: expected a label, found an identifier + 'label: loop { break label }; //~ error cannot find value `label` in this scope + 'label: loop { break label 0 }; //~ error expected a label, found an identifier + 'label: loop { continue label }; //~ error expected a label, found an identifier } diff --git a/tests/ui/parser/suggest-remove-compount-assign-let-ice.rs b/tests/ui/parser/suggest-remove-compount-assign-let-ice.rs index 1affee5678e44..c8f65df146df3 100644 --- a/tests/ui/parser/suggest-remove-compount-assign-let-ice.rs +++ b/tests/ui/parser/suggest-remove-compount-assign-let-ice.rs @@ -12,5 +12,5 @@ fn main() { // Adapted from #128845 but with irrelevant components removed and simplified. let x ➖= 1; //~^ ERROR unknown start of token: \u{2796} - //~| ERROR: can't reassign to an uninitialized variable + //~| ERROR can't reassign to an uninitialized variable } diff --git a/tests/ui/parser/unicode-character-literal.fixed b/tests/ui/parser/unicode-character-literal.fixed index e401ecaf5da77..6178761ce5749 100644 --- a/tests/ui/parser/unicode-character-literal.fixed +++ b/tests/ui/parser/unicode-character-literal.fixed @@ -5,17 +5,17 @@ fn main() { let _spade = "♠️"; - //~^ ERROR: character literal may only contain one codepoint - //~| NOTE: this `♠` is followed by the combining mark `\u{fe0f}` - //~| HELP: if you meant to write a string literal, use double quotes + //~^ ERROR character literal may only contain one codepoint + //~| NOTE this `♠` is followed by the combining mark `\u{fe0f}` + //~| HELP if you meant to write a string literal, use double quotes let _s = "ṩ̂̊"; - //~^ ERROR: character literal may only contain one codepoint - //~| NOTE: this `s` is followed by the combining marks `\u{323}\u{307}\u{302}\u{30a}` - //~| HELP: if you meant to write a string literal, use double quotes + //~^ ERROR character literal may only contain one codepoint + //~| NOTE this `s` is followed by the combining marks `\u{323}\u{307}\u{302}\u{30a}` + //~| HELP if you meant to write a string literal, use double quotes let _a = 'Å'; - //~^ ERROR: character literal may only contain one codepoint - //~| NOTE: this `A` is followed by the combining mark `\u{30a}` - //~| HELP: consider using the normalized form `\u{c5}` of this character + //~^ ERROR character literal may only contain one codepoint + //~| NOTE this `A` is followed by the combining mark `\u{30a}` + //~| HELP consider using the normalized form `\u{c5}` of this character } diff --git a/tests/ui/parser/unicode-character-literal.rs b/tests/ui/parser/unicode-character-literal.rs index 428e4e1ac5a08..6ddd428df0004 100644 --- a/tests/ui/parser/unicode-character-literal.rs +++ b/tests/ui/parser/unicode-character-literal.rs @@ -5,17 +5,17 @@ fn main() { let _spade = '♠️'; - //~^ ERROR: character literal may only contain one codepoint - //~| NOTE: this `♠` is followed by the combining mark `\u{fe0f}` - //~| HELP: if you meant to write a string literal, use double quotes + //~^ ERROR character literal may only contain one codepoint + //~| NOTE this `♠` is followed by the combining mark `\u{fe0f}` + //~| HELP if you meant to write a string literal, use double quotes let _s = 'ṩ̂̊'; - //~^ ERROR: character literal may only contain one codepoint - //~| NOTE: this `s` is followed by the combining marks `\u{323}\u{307}\u{302}\u{30a}` - //~| HELP: if you meant to write a string literal, use double quotes + //~^ ERROR character literal may only contain one codepoint + //~| NOTE this `s` is followed by the combining marks `\u{323}\u{307}\u{302}\u{30a}` + //~| HELP if you meant to write a string literal, use double quotes let _a = 'Å'; - //~^ ERROR: character literal may only contain one codepoint - //~| NOTE: this `A` is followed by the combining mark `\u{30a}` - //~| HELP: consider using the normalized form `\u{c5}` of this character + //~^ ERROR character literal may only contain one codepoint + //~| NOTE this `A` is followed by the combining mark `\u{30a}` + //~| HELP consider using the normalized form `\u{c5}` of this character } diff --git a/tests/ui/parser/unmatched-langle-1.rs b/tests/ui/parser/unmatched-langle-1.rs index fdf2ae398014b..4d4f7126cc814 100644 --- a/tests/ui/parser/unmatched-langle-1.rs +++ b/tests/ui/parser/unmatched-langle-1.rs @@ -3,7 +3,7 @@ fn main() { foo::<<<>(); - //~^ ERROR: unmatched angle brackets - //~| ERROR: cannot find function `foo` in this scope [E0425] - //~| ERROR: cannot find type `Ty` in this scope [E0412] + //~^ ERROR unmatched angle brackets + //~| ERROR cannot find function `foo` in this scope [E0425] + //~| ERROR cannot find type `Ty` in this scope [E0412] } diff --git a/tests/ui/parser/unmatched-langle-2.rs b/tests/ui/parser/unmatched-langle-2.rs index 8de0d7d89e4e7..f11fbedafda18 100644 --- a/tests/ui/parser/unmatched-langle-2.rs +++ b/tests/ui/parser/unmatched-langle-2.rs @@ -11,5 +11,5 @@ fn main() { foo::(); - //~^ ERROR: expected `::`, found `(` + //~^ ERROR expected `::`, found `(` } diff --git a/tests/ui/parser/use-as-where-use-ends-with-mod-sep.rs b/tests/ui/parser/use-as-where-use-ends-with-mod-sep.rs index b4bb484182466..f0a35a0470aa6 100644 --- a/tests/ui/parser/use-as-where-use-ends-with-mod-sep.rs +++ b/tests/ui/parser/use-as-where-use-ends-with-mod-sep.rs @@ -1,2 +1,2 @@ use std::any:: as foo; //~ ERROR expected identifier, found keyword `as` -//~^ ERROR: expected one of `::`, `;`, or `as`, found `foo` +//~^ ERROR expected one of `::`, `;`, or `as`, found `foo` diff --git a/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs b/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs index d9d3f9227a9ec..db07488246988 100644 --- a/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs +++ b/tests/ui/parser/variadic-ffi-nested-syntactic-fail.rs @@ -10,5 +10,5 @@ fn f3() where for<> ...: {} fn main() { let _recovery_witness: () = 0; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs b/tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs index 1e376c9ff3c1a..6510e077d9065 100644 --- a/tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs +++ b/tests/ui/patchable-function-entry/patchable-function-entry-attribute.rs @@ -1,17 +1,17 @@ #![feature(patchable_function_entry)] fn main() {} -#[patchable_function_entry(prefix_nops = 256, entry_nops = 0)]//~error: integer value out of range +#[patchable_function_entry(prefix_nops = 256, entry_nops = 0)]//~error integer value out of range pub fn too_high_pnops() {} -#[patchable_function_entry(prefix_nops = "stringvalue", entry_nops = 0)]//~error: invalid literal value +#[patchable_function_entry(prefix_nops = "stringvalue", entry_nops = 0)]//~error invalid literal value pub fn non_int_nop() {} -#[patchable_function_entry]//~error: malformed `patchable_function_entry` attribute input +#[patchable_function_entry]//~error malformed `patchable_function_entry` attribute input pub fn malformed_attribute() {} -#[patchable_function_entry(prefix_nops = 10, something = 0)]//~error: unexpected parameter name +#[patchable_function_entry(prefix_nops = 10, something = 0)]//~error unexpected parameter name pub fn unexpected_parameter_name() {} -#[patchable_function_entry()]//~error: must specify at least one parameter +#[patchable_function_entry()]//~error must specify at least one parameter pub fn no_parameters_given() {} diff --git a/tests/ui/pattern/box-pattern-type-mismatch.rs b/tests/ui/pattern/box-pattern-type-mismatch.rs index 6c98050325638..7f3ebefc2f2be 100644 --- a/tests/ui/pattern/box-pattern-type-mismatch.rs +++ b/tests/ui/pattern/box-pattern-type-mismatch.rs @@ -5,7 +5,7 @@ use std::ops::{ Deref }; struct X(dyn Iterator); -//~^ ERROR: use of undeclared lifetime name `'a` +//~^ ERROR use of undeclared lifetime name `'a` impl Deref for X { type Target = isize; diff --git a/tests/ui/pattern/complexity_limit.rs b/tests/ui/pattern/complexity_limit.rs index 7c1278205115f..8d1f05e075e43 100644 --- a/tests/ui/pattern/complexity_limit.rs +++ b/tests/ui/pattern/complexity_limit.rs @@ -36,7 +36,7 @@ struct BaseCommand { } fn request_key(command: BaseCommand) { - match command { //~ ERROR: reached pattern complexity limit + match command { //~ ERROR reached pattern complexity limit BaseCommand { field01: true, .. } => {} BaseCommand { field02: true, .. } => {} BaseCommand { field03: true, .. } => {} diff --git a/tests/ui/pattern/deref-patterns/cant_move_out_of_pattern.rs b/tests/ui/pattern/deref-patterns/cant_move_out_of_pattern.rs index 84b5ec09dc7d8..7a0d95c5ee054 100644 --- a/tests/ui/pattern/deref-patterns/cant_move_out_of_pattern.rs +++ b/tests/ui/pattern/deref-patterns/cant_move_out_of_pattern.rs @@ -7,7 +7,7 @@ struct Struct; fn cant_move_out_box(b: Box) -> Struct { match b { - //~^ ERROR: cannot move out of a shared reference + //~^ ERROR cannot move out of a shared reference deref!(x) => x, _ => unreachable!(), } @@ -15,7 +15,7 @@ fn cant_move_out_box(b: Box) -> Struct { fn cant_move_out_rc(rc: Rc) -> Struct { match rc { - //~^ ERROR: cannot move out of a shared reference + //~^ ERROR cannot move out of a shared reference deref!(x) => x, _ => unreachable!(), } diff --git a/tests/ui/pattern/deref-patterns/typeck_fail.rs b/tests/ui/pattern/deref-patterns/typeck_fail.rs index 040118449ecca..98934e08c9536 100644 --- a/tests/ui/pattern/deref-patterns/typeck_fail.rs +++ b/tests/ui/pattern/deref-patterns/typeck_fail.rs @@ -6,12 +6,12 @@ fn main() { // place of type `str`. match "foo".to_string() { deref!("foo") => {} - //~^ ERROR: mismatched types + //~^ ERROR mismatched types _ => {} } match &"foo".to_string() { deref!("foo") => {} - //~^ ERROR: mismatched types + //~^ ERROR mismatched types _ => {} } } diff --git a/tests/ui/pattern/issue-14221.rs b/tests/ui/pattern/issue-14221.rs index 13427d2c9b208..2043eac7238f9 100644 --- a/tests/ui/pattern/issue-14221.rs +++ b/tests/ui/pattern/issue-14221.rs @@ -12,7 +12,7 @@ pub mod b { match e { A => "A", //~^ ERROR pattern binding `A` is named the same as one of the variants of the type `E` - B => "B", //~ ERROR: unreachable pattern + B => "B", //~ ERROR unreachable pattern //~^ ERROR pattern binding `B` is named the same as one of the variants of the type `E` } } diff --git a/tests/ui/pattern/issue-17718-patterns.rs b/tests/ui/pattern/issue-17718-patterns.rs index 2ca0f67f80e5e..907d24c9d2b0f 100644 --- a/tests/ui/pattern/issue-17718-patterns.rs +++ b/tests/ui/pattern/issue-17718-patterns.rs @@ -4,8 +4,8 @@ const A3: usize = 1; fn main() { match 1 { - A1 => {} //~ ERROR: match bindings cannot shadow statics - A2 => {} //~ ERROR: match bindings cannot shadow statics + A1 => {} //~ ERROR match bindings cannot shadow statics + A2 => {} //~ ERROR match bindings cannot shadow statics A3 => {} _ => {} } diff --git a/tests/ui/pattern/issue-72565.rs b/tests/ui/pattern/issue-72565.rs index 21edb26de082e..f444447574a6d 100644 --- a/tests/ui/pattern/issue-72565.rs +++ b/tests/ui/pattern/issue-72565.rs @@ -3,6 +3,6 @@ const F: &'static dyn PartialEq = &7u32; fn main() { let a: &dyn PartialEq = &7u32; match a { - F => panic!(), //~ ERROR: `dyn PartialEq` cannot be used in patterns + F => panic!(), //~ ERROR `dyn PartialEq` cannot be used in patterns } } diff --git a/tests/ui/pattern/issue-72574-1.rs b/tests/ui/pattern/issue-72574-1.rs index 1b80a21793a0a..78588f629f750 100644 --- a/tests/ui/pattern/issue-72574-1.rs +++ b/tests/ui/pattern/issue-72574-1.rs @@ -6,5 +6,5 @@ fn main() { } } //~^^^^ ERROR `_x @` is not allowed in a tuple -//~| ERROR: `..` patterns are not allowed here -//~| ERROR: mismatched types +//~| ERROR `..` patterns are not allowed here +//~| ERROR mismatched types diff --git a/tests/ui/pattern/issue-72574-2.rs b/tests/ui/pattern/issue-72574-2.rs index 0ad2db848b281..ccc54a3377004 100644 --- a/tests/ui/pattern/issue-72574-2.rs +++ b/tests/ui/pattern/issue-72574-2.rs @@ -8,5 +8,5 @@ fn main() { } } //~^^^^ ERROR `_x @` is not allowed in a tuple struct -//~| ERROR: `..` patterns are not allowed here -//~| ERROR: this pattern has 2 fields, but the corresponding tuple struct has 3 fields +//~| ERROR `..` patterns are not allowed here +//~| ERROR this pattern has 2 fields, but the corresponding tuple struct has 3 fields diff --git a/tests/ui/pattern/issue-74539.rs b/tests/ui/pattern/issue-74539.rs index 0b25f87ec5340..e9e28ef99f36a 100644 --- a/tests/ui/pattern/issue-74539.rs +++ b/tests/ui/pattern/issue-74539.rs @@ -6,9 +6,9 @@ fn main() { let e = E::A(2, 3); match e { E::A(x @ ..) => { - //~^ ERROR: `x @` is not allowed in a tuple struct - //~| ERROR: `..` patterns are not allowed here - //~| ERROR: this pattern has 1 field, but the corresponding tuple variant has 2 fields + //~^ ERROR `x @` is not allowed in a tuple struct + //~| ERROR `..` patterns are not allowed here + //~| ERROR this pattern has 1 field, but the corresponding tuple variant has 2 fields x } }; diff --git a/tests/ui/pattern/issue-74702.rs b/tests/ui/pattern/issue-74702.rs index 0aeb3b217a26f..fc22db16a188f 100644 --- a/tests/ui/pattern/issue-74702.rs +++ b/tests/ui/pattern/issue-74702.rs @@ -1,7 +1,7 @@ fn main() { let (foo @ ..,) = (0, 0); - //~^ ERROR: `foo @` is not allowed in a tuple - //~| ERROR: `..` patterns are not allowed here - //~| ERROR: mismatched types + //~^ ERROR `foo @` is not allowed in a tuple + //~| ERROR `..` patterns are not allowed here + //~| ERROR mismatched types dbg!(foo); } diff --git a/tests/ui/pattern/missing_lifetime.rs b/tests/ui/pattern/missing_lifetime.rs index 081f667d8f6a9..e9bd3d9846eac 100644 --- a/tests/ui/pattern/missing_lifetime.rs +++ b/tests/ui/pattern/missing_lifetime.rs @@ -4,7 +4,7 @@ //! reported. enum AstKind<'ast> { - //~^ ERROR: `'ast` is never used + //~^ ERROR `'ast` is never used ExprInt, } @@ -15,7 +15,7 @@ enum Foo { enum Other { Other1(Foo), - Other2(AstKind), //~ ERROR: missing lifetime specifier + Other2(AstKind), //~ ERROR missing lifetime specifier } fn main() { diff --git a/tests/ui/pattern/mut_preserve_binding_mode_2021.rs b/tests/ui/pattern/mut_preserve_binding_mode_2021.rs index 282e0ef95d224..ab6c85cb2316b 100644 --- a/tests/ui/pattern/mut_preserve_binding_mode_2021.rs +++ b/tests/ui/pattern/mut_preserve_binding_mode_2021.rs @@ -8,9 +8,9 @@ struct Foo(u8); fn main() { let Foo(mut a) = &Foo(0); a = &42; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let Foo(mut a) = &mut Foo(0); a = &mut 42; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/pattern/non-constant-in-const-path.rs b/tests/ui/pattern/non-constant-in-const-path.rs index 3918485bacb98..e757333cc5096 100644 --- a/tests/ui/pattern/non-constant-in-const-path.rs +++ b/tests/ui/pattern/non-constant-in-const-path.rs @@ -6,13 +6,13 @@ static FOO: u8 = 10; fn main() { let x = 0; let 0u8..=x = 0; - //~^ ERROR: runtime values cannot be referenced in patterns + //~^ ERROR runtime values cannot be referenced in patterns let 0u8..=FOO = 0; - //~^ ERROR: statics cannot be referenced in patterns + //~^ ERROR statics cannot be referenced in patterns match 1 { 0 ..= x => {} - //~^ ERROR: runtime values cannot be referenced in patterns + //~^ ERROR runtime values cannot be referenced in patterns 0 ..= FOO => {} - //~^ ERROR: statics cannot be referenced in patterns + //~^ ERROR statics cannot be referenced in patterns }; } diff --git a/tests/ui/pattern/overflowing-literals.rs b/tests/ui/pattern/overflowing-literals.rs index 13016d3f7d197..92741da2bc93d 100644 --- a/tests/ui/pattern/overflowing-literals.rs +++ b/tests/ui/pattern/overflowing-literals.rs @@ -6,11 +6,11 @@ use std::pat::pattern_type; type TooBig = pattern_type!(u8 is 500..); -//~^ ERROR: literal out of range for `u8` +//~^ ERROR literal out of range for `u8` type TooSmall = pattern_type!(i8 is -500..); -//~^ ERROR: literal out of range for `i8` +//~^ ERROR literal out of range for `i8` type TooBigSigned = pattern_type!(i8 is 200..); -//~^ ERROR: literal out of range for `i8` +//~^ ERROR literal out of range for `i8` fn main() { match 5_u8 { diff --git a/tests/ui/pattern/pattern-binding-disambiguation.rs b/tests/ui/pattern/pattern-binding-disambiguation.rs index 8be70f65d0e84..ce6b00bffb0f7 100644 --- a/tests/ui/pattern/pattern-binding-disambiguation.rs +++ b/tests/ui/pattern/pattern-binding-disambiguation.rs @@ -26,7 +26,7 @@ fn main() { match doesnt_matter { BracedStruct => {} // OK, `BracedStruct` is a fresh binding } - match UnitVariant { //~ ERROR: `E::TupleVariant` and `E::BracedVariant { }` not covered + match UnitVariant { //~ ERROR `E::TupleVariant` and `E::BracedVariant { }` not covered UnitVariant => {} // OK, `UnitVariant` is a unit variant pattern } match doesnt_matter { @@ -48,7 +48,7 @@ fn main() { let UnitStruct = UnitStruct; // OK, `UnitStruct` is a unit struct pattern let TupleStruct = doesnt_matter; //~ ERROR let bindings cannot shadow tuple structs let BracedStruct = doesnt_matter; // OK, `BracedStruct` is a fresh binding - let UnitVariant = UnitVariant; //~ ERROR: refutable pattern in local binding + let UnitVariant = UnitVariant; //~ ERROR refutable pattern in local binding let TupleVariant = doesnt_matter; //~ ERROR let bindings cannot shadow tuple variants let BracedVariant = doesnt_matter; // OK, `BracedVariant` is a fresh binding let CONST = CONST; // OK, `CONST` is a const pattern diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.rs index 621ca7cc792eb..52cc051fccaed 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.rs +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.rs @@ -15,21 +15,21 @@ fn errors_caught_in_hir_typeck_on_stable() { let [&x] = &[&mut 0]; //[stable2021]~^ mismatched types //[stable2021]~| types differ in mutability - //[classic2024]~^^^ ERROR: cannot move out of type + //[classic2024]~^^^ ERROR cannot move out of type #[cfg(any(classic2021, structural2021))] let _: u32 = x; #[cfg(structural2024)] let _: &u32 = x; let [&x] = &mut [&mut 0]; //[stable2021]~^ mismatched types //[stable2021]~| types differ in mutability - //[classic2024]~^^^ ERROR: cannot move out of type + //[classic2024]~^^^ ERROR cannot move out of type #[cfg(any(classic2021, structural2021))] let _: u32 = x; #[cfg(structural2024)] let _: &u32 = x; } pub fn main() { if let Some(&Some(x)) = Some(&Some(&mut 0)) { - //~^ ERROR: cannot move out of a shared reference [E0507] + //~^ ERROR cannot move out of a shared reference [E0507] let _: &u32 = x; } @@ -39,16 +39,16 @@ pub fn main() { // For 2021 edition, this is also a regression test for #136223 // since the maximum mutability is downgraded during the pattern check process. if let &Some(Some(x)) = &Some(&mut Some(0)) { - //[stable2021,classic2021,classic2024]~^ ERROR: cannot borrow data in a `&` reference as mutable + //[stable2021,classic2021,classic2024]~^ ERROR cannot borrow data in a `&` reference as mutable #[cfg(any(structural2021, structural2024))] let _: &u32 = x; } let &[x] = &&mut [0]; - //[stable2021,classic2021,classic2024]~^ ERROR: cannot borrow data in a `&` reference as mutable + //[stable2021,classic2021,classic2024]~^ ERROR cannot borrow data in a `&` reference as mutable #[cfg(any(structural2021, structural2024))] let _: &u32 = x; let [&mut x] = &mut [&mut 0]; - //[classic2024]~^ ERROR: cannot move out of type + //[classic2024]~^ ERROR cannot move out of type #[cfg(any(stable2021, classic2021, structural2021))] let _: u32 = x; #[cfg(structural2024)] let _: &mut u32 = x; } diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/cannot-mutably-deref-shared-ref.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/cannot-mutably-deref-shared-ref.rs index a493b672c929f..ceb47d598eab4 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/cannot-mutably-deref-shared-ref.rs +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/cannot-mutably-deref-shared-ref.rs @@ -7,17 +7,17 @@ pub fn main() { let &mut _ = &&0; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let &mut _ = &&&&&&&&&&&&&&&&&&&&&&&&&&&&0; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let &mut _ = &&mut 0; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let &mut _ = &&&&&&&&&&&&&&&&&&&&&&&&&&&&mut 0; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let &mut &mut &mut &mut _ = &mut &&&&mut &&&mut &mut 0; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/feature-gate-ref_pat_eat_one_layer_2024.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/feature-gate-ref_pat_eat_one_layer_2024.rs index bc12d69b10531..9d7de8ef9393b 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/feature-gate-ref_pat_eat_one_layer_2024.rs +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/feature-gate-ref_pat_eat_one_layer_2024.rs @@ -3,35 +3,35 @@ pub fn main() { if let Some(Some(&x)) = &Some(&Some(0)) { - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let _: u32 = x; } if let Some(Some(&x)) = &Some(Some(&0)) { let _: &u32 = x; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } if let Some(Some(&&x)) = &Some(Some(&0)) { - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let _: u32 = x; } if let Some(&Some(x)) = &Some(Some(0)) { - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let _: u32 = x; } if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) { - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let _: u32 = x; } if let Some(Some(&x)) = &Some(&Some(0)) { - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let _: u32 = x; } if let Some(&mut Some(&x)) = &Some(&mut Some(0)) { - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let _: u32 = x; } if let Some(&Some(&mut x)) = &mut Some(&Some(0)) { - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let _: u32 = x; } } diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mixed-editions.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mixed-editions.rs index 0a22b55ab6374..c35dace61c01a 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mixed-editions.rs +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mixed-editions.rs @@ -24,22 +24,22 @@ fn assert_type_eq>(_: T, _: U) {} /// only when the binding is from edition 2024. fn ref_binding_tests() { let match_ctor!(ref x) = &[0]; - //[classic2024,structural2024]~^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //[classic2024,structural2024]~^ ERROR binding modifiers may only be written when the default binding mode is `move` #[cfg(any(classic2021, structural2021))] assert_type_eq(x, &0u32); let [bind_ref!(y)] = &[0]; - //[classic2021,structural2021]~^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //[classic2021,structural2021]~^ ERROR binding modifiers may only be written when the default binding mode is `move` #[cfg(any(classic2024, structural2024))] assert_type_eq(y, &0u32); } /// Likewise, when binding with `mut`. fn mut_binding_tests() { let match_ctor!(mut x) = &[0]; - //[classic2024,structural2024]~^ ERROR: binding cannot be both mutable and by-reference + //[classic2024,structural2024]~^ ERROR binding cannot be both mutable and by-reference #[cfg(any(classic2021, structural2021))] assert_type_eq(x, 0u32); let [bind_mut!(y)] = &[0]; - //[classic2021,structural2021]~^ ERROR: binding cannot be both mutable and by-reference + //[classic2021,structural2021]~^ ERROR binding cannot be both mutable and by-reference #[cfg(any(classic2024, structural2024))] assert_type_eq(y, 0u32); } @@ -59,30 +59,30 @@ fn layers_eaten_tests() { /// under `ref_pat_eat_one_layer_2024`, these should be errors. fn rule_3_tests() { let match_ref!([x]) = &&mut [0]; - //[classic2021,classic2024]~^ ERROR: cannot borrow data in a `&` reference as mutable + //[classic2021,classic2024]~^ ERROR cannot borrow data in a `&` reference as mutable #[cfg(any(structural2021, structural2024))] assert_type_eq(x, &0u32); let &match_ctor!(y) = &&mut [0]; - //[classic2021,classic2024]~^ ERROR: cannot borrow data in a `&` reference as mutable + //[classic2021,classic2024]~^ ERROR cannot borrow data in a `&` reference as mutable #[cfg(any(structural2021, structural2024))] assert_type_eq(y, &0u32); let &[bind!(z)] = &&mut [0]; - //[classic2021,classic2024]~^ ERROR: cannot borrow data in a `&` reference as mutable + //[classic2021,classic2024]~^ ERROR cannot borrow data in a `&` reference as mutable #[cfg(any(structural2021, structural2024))] assert_type_eq(z, &0u32); } /// Test that the interaction between Rules 3 and 5 doesn't break. fn rules_3_and_5_tests() { let match_ref!([x]) = &mut &mut [0]; - //[classic2021,classic2024]~^ ERROR: cannot borrow as mutable inside an `&` pattern + //[classic2021,classic2024]~^ ERROR cannot borrow as mutable inside an `&` pattern #[cfg(any(structural2021, structural2024))] assert_type_eq(x, &0u32); let &match_ctor!(y) = &mut &mut [0]; - //[classic2021,classic2024]~^ ERROR: cannot borrow as mutable inside an `&` pattern + //[classic2021,classic2024]~^ ERROR cannot borrow as mutable inside an `&` pattern #[cfg(any(structural2021, structural2024))] assert_type_eq(y, &0u32); let &[bind!(z)] = &mut &mut [0]; - //[classic2021,classic2024]~^ ERROR: cannot borrow as mutable inside an `&` pattern + //[classic2021,classic2024]~^ ERROR cannot borrow as mutable inside an `&` pattern #[cfg(any(structural2021, structural2024))] assert_type_eq(z, &0u32); } @@ -108,15 +108,15 @@ fn rule_5_tests() { /// Make sure binding with `ref mut` is an error within a `&` pattern matching a `&mut` reference. fn rule_5_mutability_error_tests() { let match_ref!(ref mut x) = &mut 0; - //~^ ERROR: cannot borrow as mutable inside an `&` pattern + //~^ ERROR cannot borrow as mutable inside an `&` pattern let &bind_ref_mut!(x) = &mut 0; - //~^ ERROR: cannot borrow as mutable inside an `&` pattern + //~^ ERROR cannot borrow as mutable inside an `&` pattern // also test inherited references (assumes rule 4) let [match_ref!(ref mut x)] = &mut [0]; - //~^ ERROR: cannot borrow as mutable inside an `&` pattern + //~^ ERROR cannot borrow as mutable inside an `&` pattern let [&bind_ref_mut!(x)] = &mut [0]; - //~^ ERROR: cannot borrow as mutable inside an `&` pattern + //~^ ERROR cannot borrow as mutable inside an `&` pattern } fn main() {} diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.rs index c8e988ad76d97..ace38cc6cd797 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.rs +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.rs @@ -16,17 +16,17 @@ pub fn main() { struct Foo(u8); let Foo(mut a) = &Foo(0); - //[classic2024,structural2024]~^ ERROR: binding cannot be both mutable and by-reference + //[classic2024,structural2024]~^ ERROR binding cannot be both mutable and by-reference #[cfg(any(stable2021, classic2021, structural2021))] { a = 42 } #[cfg(any(classic2024, structural2024))] { a = &42 } let Foo(mut a) = &mut Foo(0); - //[classic2024,structural2024]~^ ERROR: binding cannot be both mutable and by-reference + //[classic2024,structural2024]~^ ERROR binding cannot be both mutable and by-reference #[cfg(any(stable2021, classic2021, structural2021))] { a = 42 } #[cfg(any(classic2024, structural2024))] { a = &mut 42 } let [&mut mut x] = &[&mut 0]; - //[classic2024]~^ ERROR: mismatched types + //[classic2024]~^ ERROR mismatched types //[classic2024]~| cannot match inherited `&` with `&mut` pattern //[structural2024]~^^^ binding cannot be both mutable and by-reference #[cfg(any(stable2021, classic2021, structural2021))] { x = 0 } diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.rs index 5e677445644a6..ef044b10e8895 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.rs +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.rs @@ -12,49 +12,49 @@ pub fn main() { if let Some(&mut x) = &Some(&mut 0) { - //[classic2024]~^ ERROR: mismatched types + //[classic2024]~^ ERROR mismatched types //[classic2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(any(stable2021, classic2021, structural2021))] let _: u32 = x; #[cfg(structural2024)] let _: &u32 = x; } if let Some(&mut Some(&x)) = &Some(&mut Some(0)) { - //[stable2021,classic2021,structural2021,classic2024]~^ ERROR: mismatched types + //[stable2021,classic2021,structural2021,classic2024]~^ ERROR mismatched types //[stable2021,classic2021,structural2021]~| expected integer, found `&_` //[classic2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(structural2024)] let _: u32 = x; } if let Some(Some(&mut x)) = &Some(Some(&mut 0)) { - //[classic2024]~^ ERROR: mismatched types + //[classic2024]~^ ERROR mismatched types //[classic2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(any(stable2021, classic2021, structural2021))] let _: u32 = x; #[cfg(structural2024)] let _: &u32 = x; } if let Some(&mut Some(&_)) = &Some(&Some(0)) { - //~^ ERROR: mismatched types + //~^ ERROR mismatched types //[stable2021,classic2021,structural2021]~| types differ in mutability //[classic2024,structural2024]~| cannot match inherited `&` with `&mut` pattern } if let Some(&Some(&mut x)) = &Some(&mut Some(0)) { - //[stable2021,classic2021,structural2021,structural2024]~^ ERROR: mismatched types + //[stable2021,classic2021,structural2021,structural2024]~^ ERROR mismatched types //[stable2021]~| types differ in mutability //[classic2021,structural2021]~| expected integer, found `&mut _` //[structural2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(classic2024)] let _: u32 = x; } if let Some(&Some(&mut _)) = &mut Some(&Some(0)) { - //~^ ERROR: mismatched types + //~^ ERROR mismatched types //[stable2021,classic2021,structural2021]~| expected integer, found `&mut _` //[classic2024,structural2024]~| cannot match inherited `&` with `&mut` pattern } if let Some(&Some(Some(&mut x))) = &Some(Some(&mut Some(0))) { - //[stable2021,structural2021,structural2024]~^ ERROR: mismatched types + //[stable2021,structural2021,structural2024]~^ ERROR mismatched types //[stable2021]~| expected `Option<&mut Option<{integer}>>`, found `&_` //[structural2021,structural2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(any(classic2021, classic2024))] let _: u32 = x; } if let Some(&mut Some(x)) = &Some(Some(0)) { - //~^ ERROR: mismatched types + //~^ ERROR mismatched types //[stable2021]~| expected `Option<{integer}>`, found `&mut _` //[classic2021,structural2021,classic2024,structural2024]~| cannot match inherited `&` with `&mut` pattern } @@ -62,37 +62,37 @@ pub fn main() { fn structural_errors_0() { let &[&mut x] = &&mut [0]; - //[stable2021,structural2021,structural2024]~^ ERROR: mismatched types + //[stable2021,structural2021,structural2024]~^ ERROR mismatched types //[stable2021]~| expected integer, found `&mut _` //[structural2021,structural2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(any(classic2021, classic2024))] let _: u32 = x; let &[&mut x] = &mut &mut [0]; - //[stable2021,structural2021,structural2024]~^ ERROR: mismatched types + //[stable2021,structural2021,structural2024]~^ ERROR mismatched types //[stable2021]~| types differ in mutability //[structural2021,structural2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(any(classic2021, classic2024))] let _: u32 = x; let &[&mut ref x] = &&mut [0]; - //[stable2021,structural2021,structural2024]~^ ERROR: mismatched types + //[stable2021,structural2021,structural2024]~^ ERROR mismatched types //[stable2021]~| expected integer, found `&mut _` //[structural2021,structural2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(any(classic2021, classic2024))] let _: &u32 = x; let &[&mut ref x] = &mut &mut [0]; - //[stable2021,structural2021,structural2024]~^ ERROR: mismatched types + //[stable2021,structural2021,structural2024]~^ ERROR mismatched types //[stable2021]~| types differ in mutability //[structural2021,structural2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(any(classic2021, classic2024))] let _: &u32 = x; let &[&mut mut x] = &&mut [0]; - //[stable2021,structural2021,structural2024]~^ ERROR: mismatched types + //[stable2021,structural2021,structural2024]~^ ERROR mismatched types //[stable2021]~| expected integer, found `&mut _` //[structural2021,structural2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(any(classic2021, classic2024))] let _: u32 = x; let &[&mut mut x] = &mut &mut [0]; - //[stable2021,structural2021,structural2024]~^ ERROR: mismatched types + //[stable2021,structural2021,structural2024]~^ ERROR mismatched types //[stable2021]~| types differ in mutability //[structural2021,structural2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(any(classic2021, classic2024))] let _: u32 = x; @@ -100,54 +100,54 @@ fn structural_errors_0() { fn structural_errors_1() { let [&(mut x)] = &[&0]; - //[structural2024]~^ ERROR: binding cannot be both mutable and by-reference + //[structural2024]~^ ERROR binding cannot be both mutable and by-reference #[cfg(any(stable2021, classic2021, structural2021))] let _: u32 = x; #[cfg(classic2024)] let _: &u32 = x; let [&(mut x)] = &mut [&0]; - //[structural2024]~^ ERROR: binding cannot be both mutable and by-reference + //[structural2024]~^ ERROR binding cannot be both mutable and by-reference #[cfg(any(stable2021, classic2021, structural2021))] let _: u32 = x; #[cfg(classic2024)] let _: &u32 = x; } fn structural_errors_2() { let [&&mut x] = &[&mut 0]; - //[stable2021,classic2021,structural2021,structural2024]~^ ERROR: mismatched types + //[stable2021,classic2021,structural2021,structural2024]~^ ERROR mismatched types //[stable2021]~| types differ in mutability //[classic2021,structural2021] expected integer, found `&mut _` //[structural2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(classic2024)] let _: u32 = x; let [&&mut x] = &mut [&mut 0]; - //[stable2021,classic2021,structural2021,structural2024]~^ ERROR: mismatched types + //[stable2021,classic2021,structural2021,structural2024]~^ ERROR mismatched types //[stable2021]~| types differ in mutability //[classic2021,structural2021] expected integer, found `&mut _` //[structural2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(classic2024)] let _: u32 = x; let [&&mut ref x] = &[&mut 0]; - //[stable2021,classic2021,structural2021,structural2024]~^ ERROR: mismatched types + //[stable2021,classic2021,structural2021,structural2024]~^ ERROR mismatched types //[stable2021]~| types differ in mutability //[classic2021,structural2021] expected integer, found `&mut _` //[structural2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(classic2024)] let _: &u32 = x; let [&&mut ref x] = &mut [&mut 0]; - //[stable2021,classic2021,structural2021,structural2024]~^ ERROR: mismatched types + //[stable2021,classic2021,structural2021,structural2024]~^ ERROR mismatched types //[stable2021]~| types differ in mutability //[classic2021,structural2021] expected integer, found `&mut _` //[structural2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(classic2024)] let _: &u32 = x; let [&&mut mut x] = &[&mut 0]; - //[stable2021,classic2021,structural2021,structural2024]~^ ERROR: mismatched types + //[stable2021,classic2021,structural2021,structural2024]~^ ERROR mismatched types //[stable2021]~| types differ in mutability //[classic2021,structural2021] expected integer, found `&mut _` //[structural2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(classic2024)] let _: u32 = x; let [&&mut mut x] = &mut [&mut 0]; - //[stable2021,classic2021,structural2021,structural2024]~^ ERROR: mismatched types + //[stable2021,classic2021,structural2021,structural2024]~^ ERROR mismatched types //[stable2021]~| types differ in mutability //[classic2021,structural2021] expected integer, found `&mut _` //[structural2024]~| cannot match inherited `&` with `&mut` pattern @@ -156,25 +156,25 @@ fn structural_errors_2() { fn classic_errors_0() { let [&mut x] = &[&mut 0]; - //[classic2024]~^ ERROR: mismatched types + //[classic2024]~^ ERROR mismatched types //[classic2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(any(stable2021, classic2021, structural2021))] let _: u32 = x; #[cfg(structural2024)] let _: &u32 = x; let [&mut &x] = &[&mut 0]; - //[stable2021,classic2021,structural2021,classic2024]~^ ERROR: mismatched types + //[stable2021,classic2021,structural2021,classic2024]~^ ERROR mismatched types //[stable2021]~| expected integer, found `&_` //[classic2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(structural2024)] let _: u32 = x; let [&mut &ref x] = &[&mut 0]; - //[stable2021,classic2021,structural2021,classic2024]~^ ERROR: mismatched types + //[stable2021,classic2021,structural2021,classic2024]~^ ERROR mismatched types //[stable2021]~| expected integer, found `&_` //[classic2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(structural2024)] let _: &u32 = x; let [&mut &(mut x)] = &[&mut 0]; - //[stable2021,classic2021,structural2021,classic2024]~^ ERROR: mismatched types + //[stable2021,classic2021,structural2021,classic2024]~^ ERROR mismatched types //[stable2021]~| expected integer, found `&_` //[classic2024]~| cannot match inherited `&` with `&mut` pattern #[cfg(structural2024)] let _: u32 = x; diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.rs index ea6f028fe4b8b..0bdbb1411af08 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.rs +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.rs @@ -15,22 +15,22 @@ /// The eat-outer variant eats the inherited reference, so binding with `ref` isn't a problem. fn errors_from_eating_the_real_reference() { let [&ref x] = &[&0]; - //[structural2024]~^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //[structural2024]~^ ERROR binding modifiers may only be written when the default binding mode is `move` #[cfg(any(stable2021, classic2021, structural2021))] let _: &u32 = x; #[cfg(classic2024)] let _: &&u32 = x; let [&ref x] = &mut [&0]; - //[structural2024]~^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //[structural2024]~^ ERROR binding modifiers may only be written when the default binding mode is `move` #[cfg(any(stable2021, classic2021, structural2021))] let _: &u32 = x; #[cfg(classic2024)] let _: &&u32 = x; let [&mut ref x] = &mut [&mut 0]; - //[structural2024]~^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //[structural2024]~^ ERROR binding modifiers may only be written when the default binding mode is `move` #[cfg(any(stable2021, classic2021, structural2021))] let _: &u32 = x; #[cfg(classic2024)] let _: &&mut u32 = x; let [&mut ref mut x] = &mut [&mut 0]; - //[structural2024]~^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //[structural2024]~^ ERROR binding modifiers may only be written when the default binding mode is `move` #[cfg(any(stable2021, classic2021, structural2021))] let _: &mut u32 = x; #[cfg(classic2024)] let _: &mut &mut u32 = x; } @@ -39,16 +39,16 @@ fn errors_from_eating_the_real_reference() { /// quarantine these typeck errors (from using a `&` pattern to match a `&mut` reference type). fn errors_from_eating_the_real_reference_caught_in_hir_typeck_on_stable() { let [&ref x] = &[&mut 0]; - //[stable2021]~^ ERROR: mismatched types + //[stable2021]~^ ERROR mismatched types //[stable2021]~| types differ in mutability - //[structural2024]~^^^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //[structural2024]~^^^ ERROR binding modifiers may only be written when the default binding mode is `move` #[cfg(any(classic2021, structural2021))] let _: &u32 = x; #[cfg(classic2024)] let _: &&mut u32 = x; let [&ref x] = &mut [&mut 0]; - //[stable2021]~^ ERROR: mismatched types + //[stable2021]~^ ERROR mismatched types //[stable2021]~| types differ in mutability - //[structural2024]~^^^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //[structural2024]~^^^ ERROR binding modifiers may only be written when the default binding mode is `move` #[cfg(any(classic2021, structural2021))] let _: &u32 = x; #[cfg(classic2024)] let _: &&mut u32 = x; } @@ -56,9 +56,9 @@ fn errors_from_eating_the_real_reference_caught_in_hir_typeck_on_stable() { /// This one also needs to be quarantined for a typeck error on `classic2024` (eat-outer). fn errors_dependent_on_eating_order_caught_in_hir_typeck_when_eating_outer() { let [&mut ref x] = &[&mut 0]; - //[classic2024]~^ ERROR: mismatched types + //[classic2024]~^ ERROR mismatched types //[classic2024]~| cannot match inherited `&` with `&mut` pattern - //[structural2024]~^^^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //[structural2024]~^^^ ERROR binding modifiers may only be written when the default binding mode is `move` #[cfg(any(stable2021, classic2021, structural2021))] let _: &u32 = x; } @@ -69,22 +69,22 @@ fn errors_dependent_on_eating_order_caught_in_hir_typeck_when_eating_outer() { /// through borrowck as well, using the old `ref` behavior as a fallback, so we get that error too. fn borrowck_errors_in_old_editions() { let [ref mut x] = &[0]; - //~^ ERROR: cannot borrow data in a `&` reference as mutable - //[classic2024,structural2024]~| ERROR: binding modifiers may only be written when the default binding mode is `move` + //~^ ERROR cannot borrow data in a `&` reference as mutable + //[classic2024,structural2024]~| ERROR binding modifiers may only be written when the default binding mode is `move` } /// The remaining tests are purely for testing `ref` bindings in the presence of an inherited /// reference. These should always fail on edition 2024 and succeed on edition 2021. pub fn main() { let [ref x] = &[0]; - //[classic2024,structural2024]~^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //[classic2024,structural2024]~^ ERROR binding modifiers may only be written when the default binding mode is `move` #[cfg(any(stable2021, classic2021, structural2021))] let _: &u32 = x; let [ref x] = &mut [0]; - //[classic2024,structural2024]~^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //[classic2024,structural2024]~^ ERROR binding modifiers may only be written when the default binding mode is `move` #[cfg(any(stable2021, classic2021, structural2021))] let _: &u32 = x; let [ref mut x] = &mut [0]; - //[classic2024,structural2024]~^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //[classic2024,structural2024]~^ ERROR binding modifiers may only be written when the default binding mode is `move` #[cfg(any(stable2021, classic2021, structural2021))] let _: &mut u32 = x; } diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-mut-inside-shared-ref-pat.classic2024.fixed b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-mut-inside-shared-ref-pat.classic2024.fixed index 57de9cb4c10d0..5aaa31c7b7ce8 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-mut-inside-shared-ref-pat.classic2024.fixed +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-mut-inside-shared-ref-pat.classic2024.fixed @@ -14,14 +14,14 @@ pub fn main() { if let Some(&mut Some(ref mut x)) = &mut Some(Some(0)) { - //[stable2021]~^ ERROR: mismatched types - //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern let _: &mut u8 = x; } if let &mut Some(Some(ref mut x)) = &mut Some(Some(0)) { - //[stable2021]~^ ERROR: mismatched types - //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern let _: &mut u8 = x; } @@ -29,19 +29,19 @@ pub fn main() { ($var:ident) => { ref mut $var }; } let &mut pat!(x) = &mut 0; - //[stable2021]~^ ERROR: mismatched types - //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern let _: &mut u8 = x; let &mut (ref mut a, ref mut b) = &mut (true, false); - //[stable2021]~^ ERROR: mismatched types - //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern - //[classic2021,structural2021,classic2024,structural2024]~| ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern + //[classic2021,structural2021,classic2024,structural2024]~| ERROR cannot borrow as mutable inside an `&` pattern let _: &mut bool = a; let _: &mut bool = b; let &mut [x] = &mut &mut [0]; - //[stable2021]~^ ERROR: mismatched types - //[classic2021,classic2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,classic2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern let _: &u32 = x; } diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-mut-inside-shared-ref-pat.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-mut-inside-shared-ref-pat.rs index 277ff90b673ce..e96c4f630ff73 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-mut-inside-shared-ref-pat.rs +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-mut-inside-shared-ref-pat.rs @@ -14,14 +14,14 @@ pub fn main() { if let Some(&Some(ref mut x)) = &mut Some(Some(0)) { - //[stable2021]~^ ERROR: mismatched types - //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern let _: &mut u8 = x; } if let &Some(Some(ref mut x)) = &mut Some(Some(0)) { - //[stable2021]~^ ERROR: mismatched types - //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern let _: &mut u8 = x; } @@ -29,19 +29,19 @@ pub fn main() { ($var:ident) => { ref mut $var }; } let &pat!(x) = &mut 0; - //[stable2021]~^ ERROR: mismatched types - //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern let _: &mut u8 = x; let &(ref mut a, ref mut b) = &mut (true, false); - //[stable2021]~^ ERROR: mismatched types - //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern - //[classic2021,structural2021,classic2024,structural2024]~| ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern + //[classic2021,structural2021,classic2024,structural2024]~| ERROR cannot borrow as mutable inside an `&` pattern let _: &mut bool = a; let _: &mut bool = b; let &[x] = &mut &mut [0]; - //[stable2021]~^ ERROR: mismatched types - //[classic2021,classic2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,classic2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern let _: &u32 = x; } diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-mut-inside-shared-ref-pat.structural2024.fixed b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-mut-inside-shared-ref-pat.structural2024.fixed index bcde4b90f592c..920241d602ad0 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-mut-inside-shared-ref-pat.structural2024.fixed +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-mut-inside-shared-ref-pat.structural2024.fixed @@ -14,14 +14,14 @@ pub fn main() { if let Some(&mut Some(ref mut x)) = &mut Some(Some(0)) { - //[stable2021]~^ ERROR: mismatched types - //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern let _: &mut u8 = x; } if let &mut Some(Some(ref mut x)) = &mut Some(Some(0)) { - //[stable2021]~^ ERROR: mismatched types - //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern let _: &mut u8 = x; } @@ -29,19 +29,19 @@ pub fn main() { ($var:ident) => { ref mut $var }; } let &mut pat!(x) = &mut 0; - //[stable2021]~^ ERROR: mismatched types - //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern let _: &mut u8 = x; let &mut (ref mut a, ref mut b) = &mut (true, false); - //[stable2021]~^ ERROR: mismatched types - //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern - //[classic2021,structural2021,classic2024,structural2024]~| ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,structural2021,classic2024,structural2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern + //[classic2021,structural2021,classic2024,structural2024]~| ERROR cannot borrow as mutable inside an `&` pattern let _: &mut bool = a; let _: &mut bool = b; let &[x] = &mut &mut [0]; - //[stable2021]~^ ERROR: mismatched types - //[classic2021,classic2024]~^^ ERROR: cannot borrow as mutable inside an `&` pattern + //[stable2021]~^ ERROR mismatched types + //[classic2021,classic2024]~^^ ERROR cannot borrow as mutable inside an `&` pattern let _: &u32 = x; } diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/trait-selection-sanity.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/trait-selection-sanity.rs index cb8fdb489c028..91da1e8003ed2 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/trait-selection-sanity.rs +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/trait-selection-sanity.rs @@ -25,6 +25,6 @@ fn main() { } } - let (&_, b) = generic(); //[without_impl]~ ERROR: the trait bound `&_: main::Ref` is not satisfied [E0277] + let (&_, b) = generic(); //[without_impl]~ ERROR the trait bound `&_: main::Ref` is not satisfied [E0277] assert!(!b); } diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.fixed b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.fixed index bb4ecc09063b7..dc8c6229fd68c 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.fixed +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.fixed @@ -23,23 +23,23 @@ fn main() { assert_type_eq(x, &mut 0u8); let &Foo(mut x) = &Foo(0); - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); let &mut Foo(mut x) = &mut Foo(0); - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); let Foo(x) = &Foo(0); - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, &0u8); let &mut Foo(ref x) = &mut Foo(0); - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, &0u8); let &Foo(x) = &Foo(0); @@ -55,23 +55,23 @@ fn main() { assert_type_eq(x, &0u8); let &Foo(&x) = &Foo(&0); - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); let &Foo(&mut x) = &Foo(&mut 0); - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); let &mut Foo(&x) = &mut Foo(&0); - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); let &mut Foo(&mut x) = &mut Foo(&mut 0); - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); if let Some(x) = &&&&&Some(&0u8) { @@ -79,26 +79,26 @@ fn main() { } if let &&&&&Some(&x) = &&&&&Some(&0u8) { - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); } if let &&&&&Some(&mut x) = &&&&&Some(&mut 0u8) { - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); } if let &&&&&mut Some(&x) = &&&&&mut Some(&0u8) { - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); } if let &mut Some(&mut Some(&mut Some(ref mut x))) = &mut Some(&mut Some(&mut Some(0u8))) { - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, &mut 0u8); } @@ -109,21 +109,21 @@ fn main() { } let &Struct { ref a, mut b, ref c } = &Struct { a: 0, b: 0, c: 0 }; - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); assert_type_eq(b, 0u32); let &Struct { a: &a, ref b, ref c } = &Struct { a: &0, b: &0, c: &0 }; - //~^ ERROR: binding modifiers and reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers and reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, 0u32); assert_type_eq(b, &&0u32); assert_type_eq(c, &&0u32); if let &Struct { a: &Some(a), b: &Some(&b), c: &Some(ref c) } = - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 &(Struct { a: &Some(&0), b: &Some(&0), c: &Some(&0) }) { assert_type_eq(a, &0u32); @@ -135,7 +135,7 @@ fn main() { // The two patterns are the same syntactically, but because they're defined in different // editions they don't mean the same thing. &(Some(mut x), migration_lint_macros::mixed_edition_pat!(y)) => { - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` assert_type_eq(x, 0u32); assert_type_eq(y, 0u32); } @@ -143,49 +143,49 @@ fn main() { } let &mut [&mut &[ref a]] = &mut [&mut &[0]]; - //~^ ERROR: binding modifiers and reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers and reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); let &[&(_)] = &[&0]; - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 // NB: Most of the following tests are for possible future improvements to migration suggestions // Test removing multiple binding modifiers. let Struct { a, b, c } = &Struct { a: 0, b: 0, c: 0 }; - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); assert_type_eq(c, &0u32); // Test that we don't change bindings' modes when removing binding modifiers. let &mut Struct { ref a, ref mut b, ref mut c } = &mut Struct { a: 0, b: 0, c: 0 }; - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); assert_type_eq(b, &mut 0u32); assert_type_eq(c, &mut 0u32); // Test removing multiple reference patterns of various mutabilities, plus a binding modifier. let &mut &Struct { a: &[ref a], b: &mut [&[ref b]], ref c } = &mut &Struct { a: &[0], b: &mut [&[0]], c: 0 }; - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); assert_type_eq(b, &0u32); assert_type_eq(c, &0u32); // Test that we don't change bindings' types when removing reference patterns. let &Foo(&ref a) = &Foo(&0); - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); // Test that we don't change bindings' modes when adding reference paterns (caught early). let &(&a, ref b, &[ref c], &mut [&mut (ref d, &[ref e])]) = &(&0, 0, &[0], &mut [&mut (0, &[0])]); - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, 0u32); assert_type_eq(b, &0u32); assert_type_eq(c, &0u32); @@ -194,38 +194,38 @@ fn main() { // Test that we don't change bindings' modes when adding reference patterns (caught late). let &(ref a, &mut [ref b], &[mut c]) = &(0, &mut [0], &[0]); - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); assert_type_eq(b, &0u32); assert_type_eq(c, 0u32); // Test featuring both additions and removals. let &(&a, &mut (ref b, &[ref c])) = &(&0, &mut (0, &[0])); - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, 0u32); assert_type_eq(b, &0u32); assert_type_eq(c, &0u32); // Test that bindings' subpatterns' modes are updated properly. let &[mut a @ ref b] = &[0]; - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, 0u32); assert_type_eq(b, &0u32); // Test that bindings' subpatterns' modes are checked properly. let &[ref a @ mut b] = &[0]; - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); assert_type_eq(b, 0u32); // Test that we respect bindings' subpatterns' types when rewriting `&ref x` to `x`. let [&Foo(&ref a @ ref b), &Foo(&ref c @ d)] = [&Foo(&0); 2]; - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); assert_type_eq(b, &0u32); assert_type_eq(c, &0u32); @@ -233,8 +233,8 @@ fn main() { // Test that we respect bindings' subpatterns' modes when rewriting `&ref x` to `x`. let [&Foo(&ref a @ [ref b]), &Foo(&ref c @ [d])] = [&Foo(&[0]); 2]; - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &[0u32]); assert_type_eq(b, &0u32); assert_type_eq(c, &[0u32]); @@ -242,12 +242,12 @@ fn main() { // Test that we use the correct message and suggestion style when pointing inside expansions. let &[migration_lint_macros::bind_ref!(a)] = &[0]; - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` assert_type_eq(a, &0u32); // Test that we use the correct span when labeling a `&` whose subpattern is from an expansion. let &[&migration_lint_macros::bind_ref!(a)] = &[&0]; - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); } diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.rs index 2837c8d81dbdd..dee70498b6a6b 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.rs +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.rs @@ -23,23 +23,23 @@ fn main() { assert_type_eq(x, &mut 0u8); let Foo(mut x) = &Foo(0); - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); let Foo(mut x) = &mut Foo(0); - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); let Foo(ref x) = &Foo(0); - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, &0u8); let Foo(ref x) = &mut Foo(0); - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, &0u8); let &Foo(x) = &Foo(0); @@ -55,23 +55,23 @@ fn main() { assert_type_eq(x, &0u8); let Foo(&x) = &Foo(&0); - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); let Foo(&mut x) = &Foo(&mut 0); - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); let Foo(&x) = &mut Foo(&0); - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); let Foo(&mut x) = &mut Foo(&mut 0); - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); if let Some(x) = &&&&&Some(&0u8) { @@ -79,26 +79,26 @@ fn main() { } if let Some(&x) = &&&&&Some(&0u8) { - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); } if let Some(&mut x) = &&&&&Some(&mut 0u8) { - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); } if let Some(&x) = &&&&&mut Some(&0u8) { - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, 0u8); } if let Some(&mut Some(Some(x))) = &mut Some(&mut Some(&mut Some(0u8))) { - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(x, &mut 0u8); } @@ -109,21 +109,21 @@ fn main() { } let Struct { a, mut b, c } = &Struct { a: 0, b: 0, c: 0 }; - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); assert_type_eq(b, 0u32); let Struct { a: &a, b, ref c } = &Struct { a: &0, b: &0, c: &0 }; - //~^ ERROR: binding modifiers and reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers and reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, 0u32); assert_type_eq(b, &&0u32); assert_type_eq(c, &&0u32); if let Struct { a: &Some(a), b: Some(&b), c: Some(c) } = - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 &(Struct { a: &Some(&0), b: &Some(&0), c: &Some(&0) }) { assert_type_eq(a, &0u32); @@ -135,7 +135,7 @@ fn main() { // The two patterns are the same syntactically, but because they're defined in different // editions they don't mean the same thing. (Some(mut x), migration_lint_macros::mixed_edition_pat!(y)) => { - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` assert_type_eq(x, 0u32); assert_type_eq(y, 0u32); } @@ -143,49 +143,49 @@ fn main() { } let [&mut [ref a]] = &mut [&mut &[0]]; - //~^ ERROR: binding modifiers and reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers and reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); let [&(_)] = &[&0]; - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 // NB: Most of the following tests are for possible future improvements to migration suggestions // Test removing multiple binding modifiers. let Struct { ref a, ref b, c } = &Struct { a: 0, b: 0, c: 0 }; - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); assert_type_eq(c, &0u32); // Test that we don't change bindings' modes when removing binding modifiers. let Struct { ref a, ref mut b, c } = &mut Struct { a: 0, b: 0, c: 0 }; - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); assert_type_eq(b, &mut 0u32); assert_type_eq(c, &mut 0u32); // Test removing multiple reference patterns of various mutabilities, plus a binding modifier. let Struct { a: &[ref a], b: &mut [[b]], c } = &mut &Struct { a: &[0], b: &mut [&[0]], c: 0 }; - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); assert_type_eq(b, &0u32); assert_type_eq(c, &0u32); // Test that we don't change bindings' types when removing reference patterns. let Foo(&ref a) = &Foo(&0); - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); // Test that we don't change bindings' modes when adding reference paterns (caught early). let (&a, b, [c], [(d, [e])]) = &(&0, 0, &[0], &mut [&mut (0, &[0])]); - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, 0u32); assert_type_eq(b, &0u32); assert_type_eq(c, &0u32); @@ -194,38 +194,38 @@ fn main() { // Test that we don't change bindings' modes when adding reference patterns (caught late). let (a, [b], [mut c]) = &(0, &mut [0], &[0]); - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); assert_type_eq(b, &0u32); assert_type_eq(c, 0u32); // Test featuring both additions and removals. let (&a, (b, &[ref c])) = &(&0, &mut (0, &[0])); - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, 0u32); assert_type_eq(b, &0u32); assert_type_eq(c, &0u32); // Test that bindings' subpatterns' modes are updated properly. let [mut a @ b] = &[0]; - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, 0u32); assert_type_eq(b, &0u32); // Test that bindings' subpatterns' modes are checked properly. let [a @ mut b] = &[0]; - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); assert_type_eq(b, 0u32); // Test that we respect bindings' subpatterns' types when rewriting `&ref x` to `x`. let [Foo(&ref a @ ref b), Foo(&ref c @ d)] = [&Foo(&0); 2]; - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); assert_type_eq(b, &0u32); assert_type_eq(c, &0u32); @@ -233,8 +233,8 @@ fn main() { // Test that we respect bindings' subpatterns' modes when rewriting `&ref x` to `x`. let [Foo(&ref a @ [ref b]), Foo(&ref c @ [d])] = [&Foo(&[0]); 2]; - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &[0u32]); assert_type_eq(b, &0u32); assert_type_eq(c, &[0u32]); @@ -242,12 +242,12 @@ fn main() { // Test that we use the correct message and suggestion style when pointing inside expansions. let [migration_lint_macros::bind_ref!(a)] = &[0]; - //~^ ERROR: binding modifiers may only be written when the default binding mode is `move` + //~^ ERROR binding modifiers may only be written when the default binding mode is `move` assert_type_eq(a, &0u32); // Test that we use the correct span when labeling a `&` whose subpattern is from an expansion. let [&migration_lint_macros::bind_ref!(a)] = &[&0]; - //~^ ERROR: reference patterns may only be written when the default binding mode is `move` in Rust 2024 - //~| WARN: this changes meaning in Rust 2024 + //~^ ERROR reference patterns may only be written when the default binding mode is `move` in Rust 2024 + //~| WARN this changes meaning in Rust 2024 assert_type_eq(a, &0u32); } diff --git a/tests/ui/pattern/type_mismatch.rs b/tests/ui/pattern/type_mismatch.rs index 408ff75884712..856e0640c3951 100644 --- a/tests/ui/pattern/type_mismatch.rs +++ b/tests/ui/pattern/type_mismatch.rs @@ -21,7 +21,7 @@ fn move_into_fnmut() { consume_fnmut(|| { let Either::Two(ref mut _t) = x; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let X(mut _t) = x; }); diff --git a/tests/ui/pattern/usefulness/conflicting_bindings.rs b/tests/ui/pattern/usefulness/conflicting_bindings.rs index 16737e0a8946b..77b32de1ffdcd 100644 --- a/tests/ui/pattern/usefulness/conflicting_bindings.rs +++ b/tests/ui/pattern/usefulness/conflicting_bindings.rs @@ -3,24 +3,24 @@ fn main() { let mut x = Some(String::new()); let ref mut y @ ref mut z = x; - //~^ ERROR: mutable more than once + //~^ ERROR mutable more than once let Some(ref mut y @ ref mut z) = x else { return }; - //~^ ERROR: mutable more than once + //~^ ERROR mutable more than once if let Some(ref mut y @ ref mut z) = x {} - //~^ ERROR: mutable more than once + //~^ ERROR mutable more than once if let Some(ref mut y @ ref mut z) = x && true {} - //~^ ERROR: mutable more than once + //~^ ERROR mutable more than once if let Some(_) = Some(()) && let Some(ref mut y @ ref mut z) = x && true {} - //~^ ERROR: mutable more than once + //~^ ERROR mutable more than once while let Some(ref mut y @ ref mut z) = x {} - //~^ ERROR: mutable more than once + //~^ ERROR mutable more than once while let Some(ref mut y @ ref mut z) = x && true {} - //~^ ERROR: mutable more than once + //~^ ERROR mutable more than once match x { - ref mut y @ ref mut z => {} //~ ERROR: mutable more than once + ref mut y @ ref mut z => {} //~ ERROR mutable more than once } match () { - () if let Some(ref mut y @ ref mut z) = x => {} //~ ERROR: mutable more than once + () if let Some(ref mut y @ ref mut z) = x => {} //~ ERROR mutable more than once _ => {} } } diff --git a/tests/ui/pattern/usefulness/issue-12369.rs b/tests/ui/pattern/usefulness/issue-12369.rs index 0481c1fd9e1bb..e41fc76b93e5e 100644 --- a/tests/ui/pattern/usefulness/issue-12369.rs +++ b/tests/ui/pattern/usefulness/issue-12369.rs @@ -6,6 +6,6 @@ fn main() { &[] => 0, &[a,b,c] => 3, &[a, ref rest @ ..] => a, - &[10,a, ref rest @ ..] => 10 //~ ERROR: unreachable pattern + &[10,a, ref rest @ ..] => 10 //~ ERROR unreachable pattern }; } diff --git a/tests/ui/pattern/usefulness/issue-13727.rs b/tests/ui/pattern/usefulness/issue-13727.rs index 7fb565ef3bf33..162c0d6c18a3f 100644 --- a/tests/ui/pattern/usefulness/issue-13727.rs +++ b/tests/ui/pattern/usefulness/issue-13727.rs @@ -5,7 +5,7 @@ fn test(val: u8) { match val { 256 => print!("0b1110\n"), 512 => print!("0b1111\n"), - //~^ ERROR: unreachable pattern + //~^ ERROR unreachable pattern _ => print!("fail\n"), } } diff --git a/tests/ui/pattern/usefulness/issue-2111.rs b/tests/ui/pattern/usefulness/issue-2111.rs index d27beaeffd637..2bb8eddda512e 100644 --- a/tests/ui/pattern/usefulness/issue-2111.rs +++ b/tests/ui/pattern/usefulness/issue-2111.rs @@ -1,6 +1,6 @@ fn foo(a: Option, b: Option) { match (a, b) { - //~^ ERROR: non-exhaustive patterns: `(None, None)` and `(Some(_), Some(_))` not covered + //~^ ERROR non-exhaustive patterns: `(None, None)` and `(Some(_), Some(_))` not covered (Some(a), Some(b)) if a == b => {} (Some(_), None) | (None, Some(_)) => {} } diff --git a/tests/ui/pattern/usefulness/issue-50900.rs b/tests/ui/pattern/usefulness/issue-50900.rs index 9cc760e9a10d7..316fc028a4b12 100644 --- a/tests/ui/pattern/usefulness/issue-50900.rs +++ b/tests/ui/pattern/usefulness/issue-50900.rs @@ -13,7 +13,7 @@ impl Tag { fn main() { match Tag::ExifIFDPointer { - //~^ ERROR: non-exhaustive patterns: `Tag(Context::Exif, _)` not covered + //~^ ERROR non-exhaustive patterns: `Tag(Context::Exif, _)` not covered Tag::ExifIFDPointer => {} } } diff --git a/tests/ui/privacy/export-tag-variant.rs b/tests/ui/privacy/export-tag-variant.rs index 46c10067ce20c..2ef7eb2fc0ec2 100644 --- a/tests/ui/privacy/export-tag-variant.rs +++ b/tests/ui/privacy/export-tag-variant.rs @@ -4,4 +4,4 @@ mod foo { enum Y { Y1 } } -fn main() { let z = foo::Y::Y1; } //~ ERROR: enum `Y` is private +fn main() { let z = foo::Y::Y1; } //~ ERROR enum `Y` is private diff --git a/tests/ui/privacy/issue-111220-2-tuple-struct-fields-projection.rs b/tests/ui/privacy/issue-111220-2-tuple-struct-fields-projection.rs index f413b50277861..f4bae34eebd60 100644 --- a/tests/ui/privacy/issue-111220-2-tuple-struct-fields-projection.rs +++ b/tests/ui/privacy/issue-111220-2-tuple-struct-fields-projection.rs @@ -25,7 +25,7 @@ impl Trait for ::Assoc { T: Id, { let Self(a) = self; - //~^ ERROR: tuple struct constructor `A` is private + //~^ ERROR tuple struct constructor `A` is private println!("{a}"); } } diff --git a/tests/ui/privacy/issue-111220-tuple-struct-fields.rs b/tests/ui/privacy/issue-111220-tuple-struct-fields.rs index 78d35fd96da3d..001a736feb1b4 100644 --- a/tests/ui/privacy/issue-111220-tuple-struct-fields.rs +++ b/tests/ui/privacy/issue-111220-tuple-struct-fields.rs @@ -6,7 +6,7 @@ mod b { impl b::A { fn inherent_bypass(&self) { let Self(x) = self; - //~^ ERROR: tuple struct constructor `A` is private + //~^ ERROR tuple struct constructor `A` is private println!("{x}"); } } @@ -18,7 +18,7 @@ pub trait B { impl B for b::A { fn f(&self) { let Self(a) = self; - //~^ ERROR: tuple struct constructor `A` is private + //~^ ERROR tuple struct constructor `A` is private println!("{}", a); } } @@ -38,7 +38,7 @@ pub trait Bypass2 { impl Bypass2 for <() as Projector>::P { fn f2(&self) { let Self(a) = self; - //~^ ERROR: tuple struct constructor `A` is private + //~^ ERROR tuple struct constructor `A` is private println!("{}", a); } } diff --git a/tests/ui/privacy/issue-11593.rs b/tests/ui/privacy/issue-11593.rs index fc7174bb2011e..4115fead06764 100644 --- a/tests/ui/privacy/issue-11593.rs +++ b/tests/ui/privacy/issue-11593.rs @@ -5,6 +5,6 @@ extern crate private_trait_xc; struct Bar; impl private_trait_xc::Foo for Bar {} -//~^ ERROR: trait `Foo` is private +//~^ ERROR trait `Foo` is private fn main() {} diff --git a/tests/ui/privacy/issue-119463.rs b/tests/ui/privacy/issue-119463.rs index 7a7440a790b89..9be854b4710d2 100644 --- a/tests/ui/privacy/issue-119463.rs +++ b/tests/ui/privacy/issue-119463.rs @@ -5,11 +5,11 @@ extern crate issue_119463_extern; struct S; impl issue_119463_extern::PrivateTrait for S { - //~^ ERROR: trait `PrivateTrait` is private + //~^ ERROR trait `PrivateTrait` is private const FOO: usize = 1; fn nonexistent() {} - //~^ ERROR: method `nonexistent` is not a member of trait + //~^ ERROR method `nonexistent` is not a member of trait } fn main() {} diff --git a/tests/ui/privacy/issue-13641.rs b/tests/ui/privacy/issue-13641.rs index 198cea4289cfc..ab7cd986181f7 100644 --- a/tests/ui/privacy/issue-13641.rs +++ b/tests/ui/privacy/issue-13641.rs @@ -7,7 +7,7 @@ mod a { fn main() { a::Foo::new(); - //~^ ERROR: struct `Foo` is private + //~^ ERROR struct `Foo` is private a::Bar::new(); - //~^ ERROR: enum `Bar` is private + //~^ ERROR enum `Bar` is private } diff --git a/tests/ui/privacy/issue-17718-const-privacy.rs b/tests/ui/privacy/issue-17718-const-privacy.rs index 85a5fec161728..1a522da53326e 100644 --- a/tests/ui/privacy/issue-17718-const-privacy.rs +++ b/tests/ui/privacy/issue-17718-const-privacy.rs @@ -2,10 +2,10 @@ extern crate issue_17718_const_privacy as other; -use a::B; //~ ERROR: constant `B` is private +use a::B; //~ ERROR constant `B` is private use other::{ FOO, - BAR, //~ ERROR: constant `BAR` is private + BAR, //~ ERROR constant `BAR` is private FOO2, }; diff --git a/tests/ui/privacy/privacy1.rs b/tests/ui/privacy/privacy1.rs index 9436441ecc6a7..4c63ad1e9cce5 100644 --- a/tests/ui/privacy/privacy1.rs +++ b/tests/ui/privacy/privacy1.rs @@ -74,7 +74,7 @@ mod bar { } self::baz::A; self::baz::A::foo(); - self::baz::A::bar(); //~ ERROR: associated function `bar` is private + self::baz::A::bar(); //~ ERROR associated function `bar` is private self::baz::A.foo2(); // this used to cause an ICE in privacy traversal. @@ -92,30 +92,30 @@ pub fn gpub() {} fn lol() { bar::A; bar::A::foo(); - bar::A::bar(); //~ ERROR: associated function `bar` is private + bar::A::bar(); //~ ERROR associated function `bar` is private bar::A.foo2(); } mod foo { fn test() { ::bar::A::foo(); - ::bar::A::bar(); //~ ERROR: associated function `bar` is private + ::bar::A::bar(); //~ ERROR associated function `bar` is private ::bar::A.foo2(); - ::bar::baz::A::foo(); //~ ERROR: module `baz` is private - ::bar::baz::A::bar(); //~ ERROR: module `baz` is private - //~^ ERROR: associated function `bar` is private - ::bar::baz::A.foo2(); //~ ERROR: module `baz` is private - ::bar::baz::A.bar2(); //~ ERROR: module `baz` is private - //~^ ERROR: method `bar2` is private + ::bar::baz::A::foo(); //~ ERROR module `baz` is private + ::bar::baz::A::bar(); //~ ERROR module `baz` is private + //~^ ERROR associated function `bar` is private + ::bar::baz::A.foo2(); //~ ERROR module `baz` is private + ::bar::baz::A.bar2(); //~ ERROR module `baz` is private + //~^ ERROR method `bar2` is private let _: isize = - ::bar::B::foo(); //~ ERROR: trait `B` is private + ::bar::B::foo(); //~ ERROR trait `B` is private ::lol(); ::bar::Enum::Pub; unsafe { - ::bar::epriv(); //~ ERROR: function `epriv` is private + ::bar::epriv(); //~ ERROR function `epriv` is private ::bar::epub(); } @@ -124,14 +124,14 @@ mod foo { ::bar::gpub(); - ::bar::baz::foo(); //~ ERROR: module `baz` is private - ::bar::baz::bar(); //~ ERROR: module `baz` is private + ::bar::baz::foo(); //~ ERROR module `baz` is private + ::bar::baz::bar(); //~ ERROR module `baz` is private } fn test2() { use bar::baz::{foo, bar}; - //~^ ERROR: module `baz` is private - //~| ERROR: module `baz` is private + //~^ ERROR module `baz` is private + //~| ERROR module `baz` is private foo(); bar(); @@ -139,7 +139,7 @@ mod foo { fn test3() { use bar::baz; - //~^ ERROR: module `baz` is private + //~^ ERROR module `baz` is private } fn test4() { @@ -155,14 +155,14 @@ mod foo { } impl ::bar::B for f32 { fn foo() -> f32 { 1.0 } } - //~^ ERROR: trait `B` is private + //~^ ERROR trait `B` is private } pub mod mytest { // Even though the inner `A` struct is a publicly exported item (usable from // external crates through `foo::foo`, it should not be accessible through // its definition path (which has the private `i` module). - use self::foo::i::A; //~ ERROR: module `i` is private + use self::foo::i::A; //~ ERROR module `i` is private pub mod foo { pub use self::i::A as foo; diff --git a/tests/ui/privacy/privacy4.rs b/tests/ui/privacy/privacy4.rs index 7341c7752bbf7..b06e3dba8ed7b 100644 --- a/tests/ui/privacy/privacy4.rs +++ b/tests/ui/privacy/privacy4.rs @@ -18,7 +18,7 @@ mod bar { pub fn foo() {} fn test2() { - use bar::glob::gpriv; //~ ERROR: module `glob` is private + use bar::glob::gpriv; //~ ERROR module `glob` is private gpriv(); } diff --git a/tests/ui/privacy/projections.rs b/tests/ui/privacy/projections.rs index 0e6590de4f5b4..00fbf289da5e1 100644 --- a/tests/ui/privacy/projections.rs +++ b/tests/ui/privacy/projections.rs @@ -1,6 +1,6 @@ mod m { struct Priv; - pub type Leak = Priv; //~ WARN: `Priv` is more private than the item `Leak` + pub type Leak = Priv; //~ WARN `Priv` is more private than the item `Leak` } trait Trait { @@ -12,7 +12,7 @@ impl Trait for u8 { } fn check() -> ::A { - //~^ ERROR: `Priv` is private + //~^ ERROR `Priv` is private 0 } @@ -22,12 +22,12 @@ trait Trait2 { impl Trait2 for u8 { type A = m::Leak; - //~^ ERROR: `Priv` is private - //~| ERROR: private type `Priv` in public interface + //~^ ERROR `Priv` is private + //~| ERROR private type `Priv` in public interface } fn check2() -> ::A { - //~^ ERROR: `Priv` is private + //~^ ERROR `Priv` is private todo!() } @@ -37,8 +37,8 @@ trait Trait3 { impl Trait3 for u8 { type A = T::A; - //~^ ERROR: `Priv` is private - //~| ERROR: private type `Priv` in public interface + //~^ ERROR `Priv` is private + //~| ERROR private type `Priv` in public interface } fn check3() -> ::A { diff --git a/tests/ui/privacy/projections2.rs b/tests/ui/privacy/projections2.rs index 1afbf6d196e58..5e19f916b3f50 100644 --- a/tests/ui/privacy/projections2.rs +++ b/tests/ui/privacy/projections2.rs @@ -1,7 +1,7 @@ mod m { use super::*; struct Priv; - pub type Leak = Priv; //~ WARN: `Priv` is more private than the item `Leak` + pub type Leak = Priv; //~ WARN `Priv` is more private than the item `Leak` trait Trait3 { type A; @@ -17,8 +17,8 @@ mod m { impl Trait4 for u8 { type A = ::A; - //~^ ERROR: private associated type `Trait3::A` in public interface - //~| ERROR: private trait `Trait3` in public interface + //~^ ERROR private associated type `Trait3::A` in public interface + //~| ERROR private trait `Trait3` in public interface } } diff --git a/tests/ui/privacy/struct-field-type.rs b/tests/ui/privacy/struct-field-type.rs index 6a4a19297e190..0ab8dcb02da6c 100644 --- a/tests/ui/privacy/struct-field-type.rs +++ b/tests/ui/privacy/struct-field-type.rs @@ -1,10 +1,10 @@ mod m { struct Priv; - pub type Leak = Priv; //~ WARN: `Priv` is more private than the item `Leak` + pub type Leak = Priv; //~ WARN `Priv` is more private than the item `Leak` } struct S { - field: m::Leak, //~ ERROR: `Priv` is private + field: m::Leak, //~ ERROR `Priv` is private } fn main() {} diff --git a/tests/ui/privacy/useless-pub.rs b/tests/ui/privacy/useless-pub.rs index e4b671142f9f0..bd7cf77730fb6 100644 --- a/tests/ui/privacy/useless-pub.rs +++ b/tests/ui/privacy/useless-pub.rs @@ -5,7 +5,7 @@ pub trait E { } impl E for A { - pub fn foo(&self) {} //~ ERROR: visibility qualifiers are not permitted here + pub fn foo(&self) {} //~ ERROR visibility qualifiers are not permitted here } enum Foo { diff --git a/tests/ui/privacy/xc-private-method.rs b/tests/ui/privacy/xc-private-method.rs index 33747c63fa4b3..8119e2911adc2 100644 --- a/tests/ui/privacy/xc-private-method.rs +++ b/tests/ui/privacy/xc-private-method.rs @@ -4,8 +4,8 @@ extern crate xc_private_method_lib; fn main() { let _ = xc_private_method_lib::Struct::static_meth_struct(); - //~^ ERROR: associated function `static_meth_struct` is private + //~^ ERROR associated function `static_meth_struct` is private let _ = xc_private_method_lib::Enum::static_meth_enum(); - //~^ ERROR: associated function `static_meth_enum` is private + //~^ ERROR associated function `static_meth_enum` is private } diff --git a/tests/ui/proc-macro/attribute-spans-preserved.rs b/tests/ui/proc-macro/attribute-spans-preserved.rs index 4d5b93797e6e7..f130c2d008790 100644 --- a/tests/ui/proc-macro/attribute-spans-preserved.rs +++ b/tests/ui/proc-macro/attribute-spans-preserved.rs @@ -4,7 +4,7 @@ extern crate attribute_spans_preserved as foo; use foo::foo; -#[ foo ( let y: u32 = "z"; ) ] //~ ERROR: mismatched types -#[ bar { let x: u32 = "y"; } ] //~ ERROR: mismatched types +#[ foo ( let y: u32 = "z"; ) ] //~ ERROR mismatched types +#[ bar { let x: u32 = "y"; } ] //~ ERROR mismatched types fn main() { } diff --git a/tests/ui/proc-macro/attribute-with-error.rs b/tests/ui/proc-macro/attribute-with-error.rs index d44d558badd1e..1b9f4ab9772c2 100644 --- a/tests/ui/proc-macro/attribute-with-error.rs +++ b/tests/ui/proc-macro/attribute-with-error.rs @@ -8,9 +8,9 @@ extern crate test_macros; #[recollect_attr] fn test1() { let a: i32 = "foo"; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let b: i32 = "f'oo"; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } fn test2() { @@ -23,7 +23,7 @@ trait A { // FIXME: should have a #[recollect_attr] attribute here and assert that it works fn foo(&self) { let a: i32 = "foo"; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } } @@ -33,7 +33,7 @@ impl A for B { #[recollect_attr] fn foo(&self) { let a: i32 = "foo"; - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } } diff --git a/tests/ui/proc-macro/attribute.rs b/tests/ui/proc-macro/attribute.rs index 30ed8ff824790..2522ebc4e3e2a 100644 --- a/tests/ui/proc-macro/attribute.rs +++ b/tests/ui/proc-macro/attribute.rs @@ -21,53 +21,53 @@ pub fn foo3(input: TokenStream) -> TokenStream { input } pub fn foo4(input: TokenStream) -> TokenStream { input } #[proc_macro_derive("a")] -//~^ ERROR: not a meta item +//~^ ERROR not a meta item pub fn foo5(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d6 = "")] -//~^ ERROR: must only be one word +//~^ ERROR must only be one word pub fn foo6(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(m::d7)] -//~^ ERROR: must only be one word +//~^ ERROR must only be one word pub fn foo7(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d8(a))] -//~^ ERROR: must only be one word +//~^ ERROR must only be one word pub fn foo8(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(self)] -//~^ ERROR: `self` cannot be a name of derive macro +//~^ ERROR `self` cannot be a name of derive macro pub fn foo9(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(PartialEq)] // OK pub fn foo10(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d11, a)] -//~^ ERROR: second argument must be `attributes` -//~| ERROR: attribute must be of form: `attributes(foo, bar)` +//~^ ERROR second argument must be `attributes` +//~| ERROR attribute must be of form: `attributes(foo, bar)` pub fn foo11(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d12, attributes)] -//~^ ERROR: attribute must be of form: `attributes(foo, bar)` +//~^ ERROR attribute must be of form: `attributes(foo, bar)` pub fn foo12(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d13, attributes("a"))] -//~^ ERROR: attribute must be a meta item, not a literal +//~^ ERROR attribute must be a meta item, not a literal pub fn foo13(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d14, attributes(a = ""))] -//~^ ERROR: attribute must only be a single word +//~^ ERROR attribute must only be a single word pub fn foo14(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d15, attributes(m::a))] -//~^ ERROR: attribute must only be a single word +//~^ ERROR attribute must only be a single word pub fn foo15(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d16, attributes(a(b)))] -//~^ ERROR: attribute must only be a single word +//~^ ERROR attribute must only be a single word pub fn foo16(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d17, attributes(self))] -//~^ ERROR: `self` cannot be a name of derive helper attribute +//~^ ERROR `self` cannot be a name of derive helper attribute pub fn foo17(input: TokenStream) -> TokenStream { input } diff --git a/tests/ui/proc-macro/attributes-included.rs b/tests/ui/proc-macro/attributes-included.rs index 73d1c1a8f05ae..0f440eb0be896 100644 --- a/tests/ui/proc-macro/attributes-included.rs +++ b/tests/ui/proc-macro/attributes-included.rs @@ -14,7 +14,7 @@ use attributes_included::*; #[inline] /// doc fn foo() { - let a: i32 = "foo"; //~ WARN: unused variable + let a: i32 = "foo"; //~ WARN unused variable } fn main() { diff --git a/tests/ui/proc-macro/expand-expr.rs b/tests/ui/proc-macro/expand-expr.rs index 8a4ed9768d53a..a48ece4a49ec6 100644 --- a/tests/ui/proc-macro/expand-expr.rs +++ b/tests/ui/proc-macro/expand-expr.rs @@ -105,17 +105,17 @@ simple_lit!(b'\x00'); simple_lit!(b'\0'); // Extra tokens after the string literal aren't ignored -expand_expr_fail!("string"; hello); //~ ERROR: expected one of `.`, `?`, or an operator, found `;` +expand_expr_fail!("string"; hello); //~ ERROR expected one of `.`, `?`, or an operator, found `;` // Invalid expressions produce errors in addition to returning `Err(())`. -expand_expr_fail!($); //~ ERROR: expected expression, found `$` -expand_expr_fail!(echo_tts!($)); //~ ERROR: expected expression, found `$` -expand_expr_fail!(echo_pm!($)); //~ ERROR: expected expression, found `$` +expand_expr_fail!($); //~ ERROR expected expression, found `$` +expand_expr_fail!(echo_tts!($)); //~ ERROR expected expression, found `$` +expand_expr_fail!(echo_pm!($)); //~ ERROR expected expression, found `$` // We get errors reported and recover during macro expansion if the macro // doesn't produce a valid expression. -expand_expr_is!("string", echo_tts!("string"; hello)); //~ ERROR: macro expansion ignores `hello` and any tokens following -expand_expr_is!("string", echo_pm!("string"; hello)); //~ ERROR: macro expansion ignores `;` and any tokens following +expand_expr_is!("string", echo_tts!("string"; hello)); //~ ERROR macro expansion ignores `hello` and any tokens following +expand_expr_is!("string", echo_pm!("string"; hello)); //~ ERROR macro expansion ignores `;` and any tokens following // For now, fail if a non-literal expression is expanded. expand_expr_fail!(arbitrary_expression() + "etc"); @@ -123,7 +123,7 @@ expand_expr_fail!(echo_tts!(arbitrary_expression() + "etc")); expand_expr_fail!(echo_expr!(arbitrary_expression() + "etc")); expand_expr_fail!(echo_pm!(arbitrary_expression() + "etc")); -const _: u32 = recursive_expand!(); //~ ERROR: recursion limit reached while expanding `recursive_expand!` +const _: u32 = recursive_expand!(); //~ ERROR recursion limit reached while expanding `recursive_expand!` fn main() { // https://github.com/rust-lang/rust/issues/104414 diff --git a/tests/ui/proc-macro/expand-to-unstable.rs b/tests/ui/proc-macro/expand-to-unstable.rs index 8968471ebd872..dd75c152a6314 100644 --- a/tests/ui/proc-macro/expand-to-unstable.rs +++ b/tests/ui/proc-macro/expand-to-unstable.rs @@ -6,7 +6,7 @@ extern crate derive_unstable; #[derive(Unstable)] -//~^ ERROR: use of unstable library feature +//~^ ERROR use of unstable library feature struct A; fn main() { diff --git a/tests/ui/proc-macro/exports.rs b/tests/ui/proc-macro/exports.rs index ebe73e27ca800..749a801ce974c 100644 --- a/tests/ui/proc-macro/exports.rs +++ b/tests/ui/proc-macro/exports.rs @@ -4,10 +4,10 @@ #![crate_type = "proc-macro"] #![allow(warnings)] -pub fn a() {} //~ ERROR: cannot export any items -pub struct B; //~ ERROR: cannot export any items -pub enum C {} //~ ERROR: cannot export any items -pub mod d {} //~ ERROR: cannot export any items +pub fn a() {} //~ ERROR cannot export any items +pub struct B; //~ ERROR cannot export any items +pub enum C {} //~ ERROR cannot export any items +pub mod d {} //~ ERROR cannot export any items mod e {} struct F; diff --git a/tests/ui/proc-macro/illegal-proc-macro-derive-use.rs b/tests/ui/proc-macro/illegal-proc-macro-derive-use.rs index 4efd9e952fc14..1f1f910b29461 100644 --- a/tests/ui/proc-macro/illegal-proc-macro-derive-use.rs +++ b/tests/ui/proc-macro/illegal-proc-macro-derive-use.rs @@ -1,14 +1,14 @@ extern crate proc_macro; #[proc_macro_derive(Foo)] -//~^ ERROR: only usable with crates of the `proc-macro` crate type +//~^ ERROR only usable with crates of the `proc-macro` crate type pub fn foo(a: proc_macro::TokenStream) -> proc_macro::TokenStream { a } // Issue #37590 #[proc_macro_derive(Foo)] -//~^ ERROR: the `#[proc_macro_derive]` attribute may only be used on bare functions +//~^ ERROR the `#[proc_macro_derive]` attribute may only be used on bare functions pub struct Foo { } diff --git a/tests/ui/proc-macro/import.rs b/tests/ui/proc-macro/import.rs index 44a37dad5c536..1bfa589305b01 100644 --- a/tests/ui/proc-macro/import.rs +++ b/tests/ui/proc-macro/import.rs @@ -3,6 +3,6 @@ extern crate test_macros; use test_macros::empty_derive; -//~^ ERROR: unresolved import `test_macros::empty_derive` +//~^ ERROR unresolved import `test_macros::empty_derive` fn main() {} diff --git a/tests/ui/proc-macro/issue-66286.rs b/tests/ui/proc-macro/issue-66286.rs index 882f87fa4ac22..4d76810965745 100644 --- a/tests/ui/proc-macro/issue-66286.rs +++ b/tests/ui/proc-macro/issue-66286.rs @@ -6,7 +6,7 @@ extern crate issue_66286; #[issue_66286::vec_ice] pub extern "C" fn foo(_: Vec(u32)) -> u32 { - //~^ ERROR: parenthesized type parameters may only be used with a `Fn` trait + //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait 0 } diff --git a/tests/ui/proc-macro/issue-75801.rs b/tests/ui/proc-macro/issue-75801.rs index feda5e60b0d42..5cb3644afdd2d 100644 --- a/tests/ui/proc-macro/issue-75801.rs +++ b/tests/ui/proc-macro/issue-75801.rs @@ -14,6 +14,6 @@ macro_rules! foo { }; } -foo!("baz"); //~ ERROR: mismatched types [E0308] +foo!("baz"); //~ ERROR mismatched types [E0308] fn main() {} diff --git a/tests/ui/proc-macro/issue-83510.rs b/tests/ui/proc-macro/issue-83510.rs index 67469511fc367..f3a1126415d9d 100644 --- a/tests/ui/proc-macro/issue-83510.rs +++ b/tests/ui/proc-macro/issue-83510.rs @@ -3,9 +3,9 @@ extern crate issue_83510; issue_83510::dance_like_you_want_to_ice!(); -//~^ ERROR: cannot find type `Foo` in this scope -//~| ERROR: expected trait, found struct `Box` -//~| ERROR: cannot find trait `Baz` in this scope -//~| ERROR: inherent associated types are unstable +//~^ ERROR cannot find type `Foo` in this scope +//~| ERROR expected trait, found struct `Box` +//~| ERROR cannot find trait `Baz` in this scope +//~| ERROR inherent associated types are unstable fn main() {} diff --git a/tests/ui/proc-macro/item-error.rs b/tests/ui/proc-macro/item-error.rs index 5f798faf436a5..0b68dab52de9b 100644 --- a/tests/ui/proc-macro/item-error.rs +++ b/tests/ui/proc-macro/item-error.rs @@ -8,7 +8,7 @@ extern crate derive_b; #[derive(B)] struct A { a: &u64 -//~^ ERROR: missing lifetime specifier +//~^ ERROR missing lifetime specifier } fn main() { diff --git a/tests/ui/proc-macro/load-panic-backtrace.rs b/tests/ui/proc-macro/load-panic-backtrace.rs index 848bdaf9f3725..9ea38d00fd5b5 100644 --- a/tests/ui/proc-macro/load-panic-backtrace.rs +++ b/tests/ui/proc-macro/load-panic-backtrace.rs @@ -9,7 +9,7 @@ extern crate test_macros; #[derive(Panic)] -//~^ ERROR: proc-macro derive panicked +//~^ ERROR proc-macro derive panicked struct Foo; fn main() {} diff --git a/tests/ui/proc-macro/load-panic.rs b/tests/ui/proc-macro/load-panic.rs index 18bfb71050b3d..3affbfef41fe2 100644 --- a/tests/ui/proc-macro/load-panic.rs +++ b/tests/ui/proc-macro/load-panic.rs @@ -5,7 +5,7 @@ extern crate test_macros; #[derive(Panic)] -//~^ ERROR: proc-macro derive panicked +//~^ ERROR proc-macro derive panicked struct Foo; fn main() {} diff --git a/tests/ui/proc-macro/macro-brackets.rs b/tests/ui/proc-macro/macro-brackets.rs index 70686eed0bd64..5907a480bd572 100644 --- a/tests/ui/proc-macro/macro-brackets.rs +++ b/tests/ui/proc-macro/macro-brackets.rs @@ -8,7 +8,7 @@ macro_rules! id { } #[identity_attr] -id![static X: u32 = 'a';]; //~ ERROR: mismatched types +id![static X: u32 = 'a';]; //~ ERROR mismatched types fn main() {} diff --git a/tests/ui/proc-macro/nested-item-spans.rs b/tests/ui/proc-macro/nested-item-spans.rs index f7e2365586d54..7dcc60639214e 100644 --- a/tests/ui/proc-macro/nested-item-spans.rs +++ b/tests/ui/proc-macro/nested-item-spans.rs @@ -6,7 +6,7 @@ extern crate test_macros; #[recollect_attr] fn another() { fn bar() { - let x: u32 = "x"; //~ ERROR: mismatched types + let x: u32 = "x"; //~ ERROR mismatched types } bar(); @@ -15,7 +15,7 @@ fn another() { fn main() { #[recollect_attr] fn bar() { - let x: u32 = "x"; //~ ERROR: mismatched types + let x: u32 = "x"; //~ ERROR mismatched types } bar(); diff --git a/tests/ui/proc-macro/proc-macro-gates.rs b/tests/ui/proc-macro/proc-macro-gates.rs index 04e097eb2f745..06c1c580b467d 100644 --- a/tests/ui/proc-macro/proc-macro-gates.rs +++ b/tests/ui/proc-macro/proc-macro-gates.rs @@ -7,14 +7,14 @@ extern crate test_macros; fn _test_inner() { - #![empty_attr] //~ ERROR: inner macro attributes are unstable + #![empty_attr] //~ ERROR inner macro attributes are unstable } mod _test2_inner { - #![empty_attr] //~ ERROR: inner macro attributes are unstable + #![empty_attr] //~ ERROR inner macro attributes are unstable } -#[empty_attr = "y"] //~ ERROR: key-value macro attributes are not supported +#[empty_attr = "y"] //~ ERROR key-value macro attributes are not supported fn _test3() {} fn attrs() { @@ -23,26 +23,26 @@ fn attrs() { struct S; // Statement, macro - #[empty_attr] //~ ERROR: custom attributes cannot be applied to statements + #[empty_attr] //~ ERROR custom attributes cannot be applied to statements println!(); // Statement, semi - #[empty_attr] //~ ERROR: custom attributes cannot be applied to statements + #[empty_attr] //~ ERROR custom attributes cannot be applied to statements S; // Statement, local - #[empty_attr] //~ ERROR: custom attributes cannot be applied to statements + #[empty_attr] //~ ERROR custom attributes cannot be applied to statements let _x = 2; // Expr - let _x = #[identity_attr] 2; //~ ERROR: custom attributes cannot be applied to expressions + let _x = #[identity_attr] 2; //~ ERROR custom attributes cannot be applied to expressions // Opt expr - let _x = [#[identity_attr] 2]; //~ ERROR: custom attributes cannot be applied to expressions + let _x = [#[identity_attr] 2]; //~ ERROR custom attributes cannot be applied to expressions // Expr macro let _x = #[identity_attr] println!(); - //~^ ERROR: custom attributes cannot be applied to expressions + //~^ ERROR custom attributes cannot be applied to expressions } fn test_case() { diff --git a/tests/ui/proc-macro/proc-macro-gates2.rs b/tests/ui/proc-macro/proc-macro-gates2.rs index 450f64982b01f..64bac0d53c4f0 100644 --- a/tests/ui/proc-macro/proc-macro-gates2.rs +++ b/tests/ui/proc-macro/proc-macro-gates2.rs @@ -10,11 +10,11 @@ extern crate test_macros; // should either require a feature gate or not be allowed on stable. fn _test6<#[empty_attr] T>() {} -//~^ ERROR: expected non-macro attribute, found attribute macro +//~^ ERROR expected non-macro attribute, found attribute macro fn _test7() { match 1 { - #[empty_attr] //~ ERROR: expected non-macro attribute, found attribute macro + #[empty_attr] //~ ERROR expected non-macro attribute, found attribute macro 0 => {} _ => {} } diff --git a/tests/ui/proc-macro/pub-at-crate-root.rs b/tests/ui/proc-macro/pub-at-crate-root.rs index 32e4999a71bc6..9ba835abfc93e 100644 --- a/tests/ui/proc-macro/pub-at-crate-root.rs +++ b/tests/ui/proc-macro/pub-at-crate-root.rs @@ -10,13 +10,13 @@ pub mod a { //~ `proc-macro` crate types currently cannot export any items #[proc_macro_derive(B)] pub fn bar(a: TokenStream) -> TokenStream { - //~^ ERROR: must currently reside in the root of the crate + //~^ ERROR must currently reside in the root of the crate a } } #[proc_macro_derive(B)] fn bar(a: proc_macro::TokenStream) -> proc_macro::TokenStream { -//~^ ERROR: functions tagged with `#[proc_macro_derive]` must be `pub` +//~^ ERROR functions tagged with `#[proc_macro_derive]` must be `pub` a } diff --git a/tests/ui/proc-macro/signature.rs b/tests/ui/proc-macro/signature.rs index 6e2e8561a835d..c7bc1f16f37b3 100644 --- a/tests/ui/proc-macro/signature.rs +++ b/tests/ui/proc-macro/signature.rs @@ -8,6 +8,6 @@ extern crate proc_macro; #[proc_macro_derive(A)] pub unsafe extern "C" fn foo(a: i32, b: u32) -> u32 { - //~^ ERROR: derive proc macro has incorrect signature + //~^ ERROR derive proc macro has incorrect signature loop {} } diff --git a/tests/ui/query-system/issue-83479.rs b/tests/ui/query-system/issue-83479.rs index 32676dfe9c8fa..de842ee92c035 100644 --- a/tests/ui/query-system/issue-83479.rs +++ b/tests/ui/query-system/issue-83479.rs @@ -1,15 +1,15 @@ #![feature(type_alias_impl_trait)] type PairCoupledTypes: Trait< - //~^ ERROR: bounds on `type`s in this context have no effect - //~| ERROR: cannot find trait `Trait` in this scope + //~^ ERROR bounds on `type`s in this context have no effect + //~| ERROR cannot find trait `Trait` in this scope [u32; { - static FOO: usize; //~ ERROR: free static item without body + static FOO: usize; //~ ERROR free static item without body }], > = impl Trait< - //~^ ERROR: cannot find trait `Trait` in this scope + //~^ ERROR cannot find trait `Trait` in this scope [u32; { - static FOO: usize; //~ ERROR: free static item without body + static FOO: usize; //~ ERROR free static item without body }], >; diff --git a/tests/ui/query-system/query_depth.rs b/tests/ui/query-system/query_depth.rs index 29514b58e2422..1323c57c215c1 100644 --- a/tests/ui/query-system/query_depth.rs +++ b/tests/ui/query-system/query_depth.rs @@ -26,6 +26,6 @@ type Byte = Option>>> >>>>; fn main() { -//~^ ERROR: queries overflow the depth limit! +//~^ ERROR queries overflow the depth limit! println!("{}", std::mem::size_of::()); } diff --git a/tests/ui/reachable/unreachable-code.rs b/tests/ui/reachable/unreachable-code.rs index ad0dc8a8b9ccd..b9f3e3452a0c5 100644 --- a/tests/ui/reachable/unreachable-code.rs +++ b/tests/ui/reachable/unreachable-code.rs @@ -4,5 +4,5 @@ fn main() { loop{} - let a = 3; //~ ERROR: unreachable statement + let a = 3; //~ ERROR unreachable statement } diff --git a/tests/ui/regions/issue-78262.rs b/tests/ui/regions/issue-78262.rs index d31b847997eb3..d86e8b92cdfbf 100644 --- a/tests/ui/regions/issue-78262.rs +++ b/tests/ui/regions/issue-78262.rs @@ -10,6 +10,6 @@ impl dyn TT { fn main() { let f = |x: &dyn TT| x.func(); - //[base]~^ ERROR: borrowed data escapes outside of closure - //[polonius]~^^ ERROR: borrowed data escapes outside of closure + //[base]~^ ERROR borrowed data escapes outside of closure + //[polonius]~^^ ERROR borrowed data escapes outside of closure } diff --git a/tests/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs b/tests/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs index 2aa390bfd39f9..4f407fac200f0 100644 --- a/tests/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs +++ b/tests/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs @@ -5,13 +5,13 @@ fn a<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) where 'b: 'a { fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) { // Illegal now because there is no `'b:'a` declaration. - *x = *y; //~ ERROR: lifetime may not live long enough + *x = *y; //~ ERROR lifetime may not live long enough } fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) { // Here we try to call `foo` but do not know that `'a` and `'b` are // related as required. - a(x, y); //~ ERROR: lifetime may not live long enough + a(x, y); //~ ERROR lifetime may not live long enough } fn d() { diff --git a/tests/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs b/tests/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs index baf1693b0ccdf..9c181a533ae4a 100644 --- a/tests/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs +++ b/tests/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs @@ -6,14 +6,14 @@ fn a<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) where fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) { // Illegal now because there is no `'b:'a` declaration. - *x = *y; //~ ERROR: lifetime may not live long enough + *x = *y; //~ ERROR lifetime may not live long enough *z = *y; } fn c<'a,'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) { // Here we try to call `foo` but do not know that `'a` and `'b` are // related as required. - a(x, y, z); //~ ERROR: lifetime may not live long enough + a(x, y, z); //~ ERROR lifetime may not live long enough } fn d() { diff --git a/tests/ui/regions/regions-lifetime-bounds-on-fns.rs b/tests/ui/regions/regions-lifetime-bounds-on-fns.rs index c7b7b52d50d0a..2c1a6f3bce398 100644 --- a/tests/ui/regions/regions-lifetime-bounds-on-fns.rs +++ b/tests/ui/regions/regions-lifetime-bounds-on-fns.rs @@ -5,13 +5,13 @@ fn a<'a, 'b:'a>(x: &mut &'a isize, y: &mut &'b isize) { fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) { // Illegal now because there is no `'b:'a` declaration. - *x = *y; //~ ERROR: lifetime may not live long enough + *x = *y; //~ ERROR lifetime may not live long enough } fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) { // Here we try to call `foo` but do not know that `'a` and `'b` are // related as required. - a(x, y); //~ ERROR: lifetime may not live long enough + a(x, y); //~ ERROR lifetime may not live long enough } fn d() { diff --git a/tests/ui/repeat-expr/copy-check-deferred-after-fallback.rs b/tests/ui/repeat-expr/copy-check-deferred-after-fallback.rs index d9ad93541ecff..74898c303f35b 100644 --- a/tests/ui/repeat-expr/copy-check-deferred-after-fallback.rs +++ b/tests/ui/repeat-expr/copy-check-deferred-after-fallback.rs @@ -19,7 +19,7 @@ fn make_goal, const N: usize>(_: &T, _: [NotCopy; N]) {} fn main() { let a = 1; let b = [NotCopy; _]; - //~^ ERROR: type annotations needed + //~^ ERROR type annotations needed // a is of type `?y` // b is of type `[NotCopy; ?x]` diff --git a/tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.rs b/tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.rs index 0b0672d9c2b56..f650d744cb9fa 100644 --- a/tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.rs +++ b/tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.rs @@ -20,6 +20,6 @@ fn extract(_: [Foo; N]) -> T { fn main() { let x = [Foo(PhantomData); 2]; - //[gai]~^ ERROR: type annotations needed + //[gai]~^ ERROR type annotations needed _ = extract(x).max(2); } diff --git a/tests/ui/repeat-expr/no-conservative-copy-impl-requirement.rs b/tests/ui/repeat-expr/no-conservative-copy-impl-requirement.rs index eb70df62996fb..7805b1d8b475d 100644 --- a/tests/ui/repeat-expr/no-conservative-copy-impl-requirement.rs +++ b/tests/ui/repeat-expr/no-conservative-copy-impl-requirement.rs @@ -15,6 +15,6 @@ fn unify(_: &[Foo; N]) { fn main() { let x = &[Foo::<_>; _]; - //~^ ERROR: type annotations needed for `&[Foo<_>; _]` + //~^ ERROR type annotations needed for `&[Foo<_>; _]` _ = unify(x); } diff --git a/tests/ui/repr/attr-usage-repr.rs b/tests/ui/repr/attr-usage-repr.rs index d8515a12e0557..27338aee85042 100644 --- a/tests/ui/repr/attr-usage-repr.rs +++ b/tests/ui/repr/attr-usage-repr.rs @@ -1,6 +1,6 @@ #![feature(repr_simd)] -#[repr(C)] //~ ERROR: attribute should be applied to a struct, enum, or union +#[repr(C)] //~ ERROR attribute should be applied to a struct, enum, or union fn f() {} #[repr(C)] @@ -12,7 +12,7 @@ struct SPacked(f64, f64); #[repr(simd)] struct SSimd([f64; 2]); -#[repr(i8)] //~ ERROR: attribute should be applied to an enum +#[repr(i8)] //~ ERROR attribute should be applied to an enum struct SInt(f64, f64); #[repr(C)] @@ -27,13 +27,13 @@ enum EAlign { B, } -#[repr(packed)] //~ ERROR: attribute should be applied to a struct +#[repr(packed)] //~ ERROR attribute should be applied to a struct enum EPacked { A, B, } -#[repr(simd)] //~ ERROR: attribute should be applied to a struct +#[repr(simd)] //~ ERROR attribute should be applied to a struct enum ESimd { A, B, diff --git a/tests/ui/repr/invalid_repr_list_help.rs b/tests/ui/repr/invalid_repr_list_help.rs index 77f2a68537b3d..d3cf7d278f1c9 100644 --- a/tests/ui/repr/invalid_repr_list_help.rs +++ b/tests/ui/repr/invalid_repr_list_help.rs @@ -1,21 +1,21 @@ #![crate_type = "lib"] -#[repr(uwu)] //~ERROR: unrecognized representation hint +#[repr(uwu)] //~ERROR unrecognized representation hint pub struct OwO; -#[repr(uwu = "a")] //~ERROR: unrecognized representation hint +#[repr(uwu = "a")] //~ERROR unrecognized representation hint pub struct OwO2(i32); -#[repr(uwu(4))] //~ERROR: unrecognized representation hint +#[repr(uwu(4))] //~ERROR unrecognized representation hint pub struct OwO3 { x: i32, } -#[repr(uwu, u8)] //~ERROR: unrecognized representation hint +#[repr(uwu, u8)] //~ERROR unrecognized representation hint pub enum OwO4 { UwU = 1, } -#[repr(uwu)] //~ERROR: unrecognized representation hint -#[doc(owo)] //~ERROR: unknown `doc` attribute +#[repr(uwu)] //~ERROR unrecognized representation hint +#[doc(owo)] //~ERROR unknown `doc` attribute pub struct Owo5; diff --git a/tests/ui/repr/issue-83505-repr-simd.rs b/tests/ui/repr/issue-83505-repr-simd.rs index bebbc636728fd..b3ef3074c0ff4 100644 --- a/tests/ui/repr/issue-83505-repr-simd.rs +++ b/tests/ui/repr/issue-83505-repr-simd.rs @@ -3,10 +3,10 @@ #![crate_type="lib"] #[repr(simd)] -//~^ ERROR: attribute should be applied to a struct [E0517] -//~| ERROR: unsupported representation for zero-variant enum [E0084] -//~| ERROR: SIMD types are experimental and possibly buggy [E0658] +//~^ ERROR attribute should be applied to a struct [E0517] +//~| ERROR unsupported representation for zero-variant enum [E0084] +//~| ERROR SIMD types are experimental and possibly buggy [E0658] enum Es {} static CLs: Es; -//~^ ERROR: free static item without body +//~^ ERROR free static item without body diff --git a/tests/ui/repr/malformed-repr-hints.rs b/tests/ui/repr/malformed-repr-hints.rs index 09c808a041df3..2666da1880509 100644 --- a/tests/ui/repr/malformed-repr-hints.rs +++ b/tests/ui/repr/malformed-repr-hints.rs @@ -4,40 +4,40 @@ //@ compile-flags: -Zdeduplicate-diagnostics=yes #[repr(packed())] -//~^ ERROR: incorrect `repr(packed)` attribute format +//~^ ERROR incorrect `repr(packed)` attribute format struct S1; #[repr(align)] -//~^ ERROR: invalid `repr(align)` attribute +//~^ ERROR invalid `repr(align)` attribute struct S2; #[repr(align(2, 4))] -//~^ ERROR: incorrect `repr(align)` attribute format +//~^ ERROR incorrect `repr(align)` attribute format struct S3; #[repr(align())] -//~^ ERROR: incorrect `repr(align)` attribute format +//~^ ERROR incorrect `repr(align)` attribute format struct S4; // Regression test for issue #118334: #[repr(Rust(u8))] -//~^ ERROR: invalid representation hint +//~^ ERROR invalid representation hint #[repr(Rust(0))] -//~^ ERROR: invalid representation hint +//~^ ERROR invalid representation hint #[repr(Rust = 0)] -//~^ ERROR: invalid representation hint +//~^ ERROR invalid representation hint struct S5; #[repr(i8())] -//~^ ERROR: invalid representation hint +//~^ ERROR invalid representation hint enum E1 { A, B } #[repr(u32(42))] -//~^ ERROR: invalid representation hint +//~^ ERROR invalid representation hint enum E2 { A, B } #[repr(i64 = 2)] -//~^ ERROR: invalid representation hint +//~^ ERROR invalid representation hint enum E3 { A, B } fn main() {} diff --git a/tests/ui/repr/repr-align.rs b/tests/ui/repr/repr-align.rs index 6b60a765461ab..f74d4c2d76b9d 100644 --- a/tests/ui/repr/repr-align.rs +++ b/tests/ui/repr/repr-align.rs @@ -1,33 +1,33 @@ #![allow(dead_code)] -#[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer +#[repr(align(16.0))] //~ ERROR invalid `repr(align)` attribute: not an unsuffixed integer struct S0(i32); -#[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two +#[repr(align(15))] //~ ERROR invalid `repr(align)` attribute: not a power of two struct S1(i32); -#[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29 +#[repr(align(4294967296))] //~ ERROR invalid `repr(align)` attribute: larger than 2^29 struct S2(i32); #[repr(align(536870912))] // ok: this is the largest accepted alignment struct S3(i32); -#[repr(align(0))] //~ ERROR: invalid `repr(align)` attribute: not a power of two +#[repr(align(0))] //~ ERROR invalid `repr(align)` attribute: not a power of two struct S4(i32); -#[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer +#[repr(align(16.0))] //~ ERROR invalid `repr(align)` attribute: not an unsuffixed integer enum E0 { A, B } -#[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two +#[repr(align(15))] //~ ERROR invalid `repr(align)` attribute: not a power of two enum E1 { A, B } -#[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29 +#[repr(align(4294967296))] //~ ERROR invalid `repr(align)` attribute: larger than 2^29 enum E2 { A, B } #[repr(align(536870912))] // ok: this is the largest accepted alignment enum E3 { A, B } -#[repr(align(0))] //~ ERROR: invalid `repr(align)` attribute: not a power of two +#[repr(align(0))] //~ ERROR invalid `repr(align)` attribute: not a power of two enum E4 { A, B } fn main() {} diff --git a/tests/ui/repr/repr-packed-contains-align.rs b/tests/ui/repr/repr-packed-contains-align.rs index bef5c7d8c62fc..0bb4d7b20ff7a 100644 --- a/tests/ui/repr/repr-packed-contains-align.rs +++ b/tests/ui/repr/repr-packed-contains-align.rs @@ -19,34 +19,34 @@ union UB { } #[repr(packed)] -struct SC(SA); //~ ERROR: packed type cannot transitively contain a `#[repr(align)]` type +struct SC(SA); //~ ERROR packed type cannot transitively contain a `#[repr(align)]` type #[repr(packed)] -struct SD(SB); //~ ERROR: packed type cannot transitively contain a `#[repr(align)]` type +struct SD(SB); //~ ERROR packed type cannot transitively contain a `#[repr(align)]` type #[repr(packed)] -struct SE(UA); //~ ERROR: packed type cannot transitively contain a `#[repr(align)]` type +struct SE(UA); //~ ERROR packed type cannot transitively contain a `#[repr(align)]` type #[repr(packed)] -struct SF(UB); //~ ERROR: packed type cannot transitively contain a `#[repr(align)]` type +struct SF(UB); //~ ERROR packed type cannot transitively contain a `#[repr(align)]` type #[repr(packed)] -union UC { //~ ERROR: packed type cannot transitively contain a `#[repr(align)]` type +union UC { //~ ERROR packed type cannot transitively contain a `#[repr(align)]` type a: UA } #[repr(packed)] -union UD { //~ ERROR: packed type cannot transitively contain a `#[repr(align)]` type +union UD { //~ ERROR packed type cannot transitively contain a `#[repr(align)]` type n: UB } #[repr(packed)] -union UE { //~ ERROR: packed type cannot transitively contain a `#[repr(align)]` type +union UE { //~ ERROR packed type cannot transitively contain a `#[repr(align)]` type a: SA } #[repr(packed)] -union UF { //~ ERROR: packed type cannot transitively contain a `#[repr(align)]` type +union UF { //~ ERROR packed type cannot transitively contain a `#[repr(align)]` type n: SB } diff --git a/tests/ui/repr/repr-transparent-issue-87496.rs b/tests/ui/repr/repr-transparent-issue-87496.rs index d512308377d78..583d870b08a30 100644 --- a/tests/ui/repr/repr-transparent-issue-87496.rs +++ b/tests/ui/repr/repr-transparent-issue-87496.rs @@ -6,7 +6,7 @@ struct TransparentCustomZst(()); extern "C" { fn good17(p: TransparentCustomZst); - //~^ WARNING: `extern` block uses type `TransparentCustomZst`, which is not FFI-safe + //~^ WARNING `extern` block uses type `TransparentCustomZst`, which is not FFI-safe } fn main() {} diff --git a/tests/ui/resolve/issue-116164.rs b/tests/ui/resolve/issue-116164.rs index d30c8f514b3d6..7e56366d93ed0 100644 --- a/tests/ui/resolve/issue-116164.rs +++ b/tests/ui/resolve/issue-116164.rs @@ -15,5 +15,5 @@ use crate::reexports::*; fn main() { ExOne; - //~^ ERROR: cannot find value `ExOne` in this scope + //~^ ERROR cannot find value `ExOne` in this scope } diff --git a/tests/ui/resolve/issue-81508.rs b/tests/ui/resolve/issue-81508.rs index 23605cd2fd91d..28e50a6effacb 100644 --- a/tests/ui/resolve/issue-81508.rs +++ b/tests/ui/resolve/issue-81508.rs @@ -8,7 +8,7 @@ fn main() { let Baz: &str = ""; - println!("{}", Baz::Bar); //~ ERROR: failed to resolve: use of undeclared type `Baz` + println!("{}", Baz::Bar); //~ ERROR failed to resolve: use of undeclared type `Baz` } #[allow(non_upper_case_globals)] @@ -17,6 +17,6 @@ pub const Foo: &str = ""; mod submod { use super::Foo; fn function() { - println!("{}", Foo::Bar); //~ ERROR: failed to resolve: use of undeclared type `Foo` + println!("{}", Foo::Bar); //~ ERROR failed to resolve: use of undeclared type `Foo` } } diff --git a/tests/ui/resolve/issue-82865.rs b/tests/ui/resolve/issue-82865.rs index 4dc12f2f58956..de18cb092fcce 100644 --- a/tests/ui/resolve/issue-82865.rs +++ b/tests/ui/resolve/issue-82865.rs @@ -2,10 +2,10 @@ #![feature(decl_macro)] -use x::y::z; //~ ERROR: failed to resolve: use of unresolved module or unlinked crate `x` +use x::y::z; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `x` macro mac () { - Box::z //~ ERROR: no function or associated item + Box::z //~ ERROR no function or associated item } fn main() { diff --git a/tests/ui/resolve/issue-85348.rs b/tests/ui/resolve/issue-85348.rs index 3a33c19340841..35497366ada8b 100644 --- a/tests/ui/resolve/issue-85348.rs +++ b/tests/ui/resolve/issue-85348.rs @@ -1,11 +1,11 @@ // Checks whether shadowing a const parameter leads to an ICE (#85348). impl ArrayWindowsExample { -//~^ ERROR: cannot find type `ArrayWindowsExample` in this scope [E0412] +//~^ ERROR cannot find type `ArrayWindowsExample` in this scope [E0412] fn next() { let mut N; - //~^ ERROR: let bindings cannot shadow const parameters [E0530] - //~| ERROR: type annotations needed [E0282] + //~^ ERROR let bindings cannot shadow const parameters [E0530] + //~| ERROR type annotations needed [E0282] } } diff --git a/tests/ui/resolve/issue-88472.rs b/tests/ui/resolve/issue-88472.rs index 6bf7caeddbfcd..6cb2907804a9f 100644 --- a/tests/ui/resolve/issue-88472.rs +++ b/tests/ui/resolve/issue-88472.rs @@ -2,37 +2,37 @@ // import an inaccessible struct. #![warn(unused_imports)] -//~^ NOTE: the lint level is defined here +//~^ NOTE the lint level is defined here mod a { struct Foo; - //~^ NOTE: struct `a::Foo` exists but is inaccessible - //~| NOTE: not accessible + //~^ NOTE struct `a::Foo` exists but is inaccessible + //~| NOTE not accessible } mod b { use crate::a::*; - //~^ WARNING: unused import + //~^ WARNING unused import type Bar = Foo; - //~^ ERROR: cannot find type `Foo` in this scope [E0412] - //~| NOTE: not found in this scope + //~^ ERROR cannot find type `Foo` in this scope [E0412] + //~| NOTE not found in this scope } mod c { enum Eee {} - //~^ NOTE: these enums exist but are inaccessible - //~| NOTE: `c::Eee`: not accessible + //~^ NOTE these enums exist but are inaccessible + //~| NOTE `c::Eee`: not accessible mod d { enum Eee {} - //~^ NOTE: `c::d::Eee`: not accessible + //~^ NOTE `c::d::Eee`: not accessible } } mod e { type Baz = Eee; - //~^ ERROR: cannot find type `Eee` in this scope [E0412] - //~| NOTE: not found in this scope + //~^ ERROR cannot find type `Eee` in this scope [E0412] + //~| NOTE not found in this scope } fn main() {} diff --git a/tests/ui/resolve/issue-90113.rs b/tests/ui/resolve/issue-90113.rs index f6658b45ed1a6..115cbc93d5f6e 100644 --- a/tests/ui/resolve/issue-90113.rs +++ b/tests/ui/resolve/issue-90113.rs @@ -14,7 +14,7 @@ mod alias { fn foo(l: crate::alias::Foo) { match l { - Cons(..) => {} //~ ERROR: cannot find tuple struct or tuple variant `Cons` in this scope + Cons(..) => {} //~ ERROR cannot find tuple struct or tuple variant `Cons` in this scope } } diff --git a/tests/ui/resolve/path-attr-in-const-block.rs b/tests/ui/resolve/path-attr-in-const-block.rs index 076511d26d6d3..6b0d2f72edefa 100644 --- a/tests/ui/resolve/path-attr-in-const-block.rs +++ b/tests/ui/resolve/path-attr-in-const-block.rs @@ -4,6 +4,6 @@ fn main() { const { #![path = foo!()] - //~^ ERROR: cannot find macro `foo` in this scope + //~^ ERROR cannot find macro `foo` in this scope } } diff --git a/tests/ui/resolve/prelude-order.rs b/tests/ui/resolve/prelude-order.rs index a3f194270d483..9e968103261c1 100644 --- a/tests/ui/resolve/prelude-order.rs +++ b/tests/ui/resolve/prelude-order.rs @@ -76,7 +76,7 @@ fn e1() {} // NOTE: testing with `-> usize` isn't valid, crates aren't considere // extern/libs -> extern // https://github.com/rust-lang/rust/issues/139095 -fn e2() -> Option { None } //~ ERROR: expected type, found crate +fn e2() -> Option { None } //~ ERROR expected type, found crate // macro/libs -> macro #[test] //~ ERROR mismatched types diff --git a/tests/ui/resolve/shadow-const-param.rs b/tests/ui/resolve/shadow-const-param.rs index c435c16dc6788..ffa8f9adfa352 100644 --- a/tests/ui/resolve/shadow-const-param.rs +++ b/tests/ui/resolve/shadow-const-param.rs @@ -5,13 +5,13 @@ fn foo(i: i32) -> bool { match i { N @ _ => true, - //~^ ERROR: match bindings cannot shadow const parameters [E0530] + //~^ ERROR match bindings cannot shadow const parameters [E0530] } } fn bar(i: i32) -> bool { let N @ _ = 0; - //~^ ERROR: let bindings cannot shadow const parameters [E0530] + //~^ ERROR let bindings cannot shadow const parameters [E0530] match i { N @ _ => true, } diff --git a/tests/ui/resolve/suggest-constructor-cycle-error.rs b/tests/ui/resolve/suggest-constructor-cycle-error.rs index c23d6788eefeb..f3f3dc9a6e92b 100644 --- a/tests/ui/resolve/suggest-constructor-cycle-error.rs +++ b/tests/ui/resolve/suggest-constructor-cycle-error.rs @@ -5,6 +5,6 @@ extern crate suggest_constructor_cycle_error as a; const CONST_NAME: a::Uuid = a::Uuid(()); -//~^ ERROR: cannot initialize a tuple struct which contains private fields [E0423] +//~^ ERROR cannot initialize a tuple struct which contains private fields [E0423] fn main() {} diff --git a/tests/ui/resolve/token-error-correct-2.rs b/tests/ui/resolve/token-error-correct-2.rs index a38755dae0858..f34fe722dc1b7 100644 --- a/tests/ui/resolve/token-error-correct-2.rs +++ b/tests/ui/resolve/token-error-correct-2.rs @@ -2,5 +2,5 @@ fn main() { if foo { - ) //~ ERROR: mismatched closing delimiter: `)` + ) //~ ERROR mismatched closing delimiter: `)` } diff --git a/tests/ui/resolve/token-error-correct.rs b/tests/ui/resolve/token-error-correct.rs index 84ee90e36856c..e0923f9d997ed 100644 --- a/tests/ui/resolve/token-error-correct.rs +++ b/tests/ui/resolve/token-error-correct.rs @@ -3,6 +3,6 @@ fn main() { foo(bar(; } -//~^ ERROR: mismatched closing delimiter: `}` +//~^ ERROR mismatched closing delimiter: `}` fn foo(_: usize) {} diff --git a/tests/ui/resolve/typo-suggestion-named-underscore.rs b/tests/ui/resolve/typo-suggestion-named-underscore.rs index a2b05db035150..29569cd39c317 100644 --- a/tests/ui/resolve/typo-suggestion-named-underscore.rs +++ b/tests/ui/resolve/typo-suggestion-named-underscore.rs @@ -2,7 +2,7 @@ const _: () = (); fn main() { a // Shouldn't suggest underscore - //~^ ERROR: cannot find value `a` in this scope + //~^ ERROR cannot find value `a` in this scope } trait Unknown {} @@ -11,4 +11,4 @@ trait Unknown {} use Unknown as _; fn foo(x: T) {} // Shouldn't suggest underscore -//~^ ERROR: cannot find trait `A` in this scope +//~^ ERROR cannot find trait `A` in this scope diff --git a/tests/ui/return/issue-86188-return-not-in-fn-body.rs b/tests/ui/return/issue-86188-return-not-in-fn-body.rs index 3117cf3fd910d..2c988f39f09d1 100644 --- a/tests/ui/return/issue-86188-return-not-in-fn-body.rs +++ b/tests/ui/return/issue-86188-return-not-in-fn-body.rs @@ -7,7 +7,7 @@ const C: [(); 42] = { [(); return || { - //~^ ERROR: return statement outside of function body [E0572] + //~^ ERROR return statement outside of function body [E0572] let tx; }] }; @@ -16,26 +16,26 @@ struct S {} trait Tr { fn foo(); fn bar() { - //~^ NOTE: ...not the enclosing function body + //~^ NOTE ...not the enclosing function body [(); return]; - //~^ ERROR: return statement outside of function body [E0572] - //~| NOTE: the return is part of this body... + //~^ ERROR return statement outside of function body [E0572] + //~| NOTE the return is part of this body... } } impl Tr for S { fn foo() { - //~^ NOTE: ...not the enclosing function body + //~^ NOTE ...not the enclosing function body [(); return]; - //~^ ERROR: return statement outside of function body [E0572] - //~| NOTE: the return is part of this body... + //~^ ERROR return statement outside of function body [E0572] + //~| NOTE the return is part of this body... } } fn main() { - //~^ NOTE: ...not the enclosing function body + //~^ NOTE ...not the enclosing function body [(); return || { - //~^ ERROR: return statement outside of function body [E0572] - //~| NOTE: the return is part of this body... + //~^ ERROR return statement outside of function body [E0572] + //~| NOTE the return is part of this body... let tx; }]; } diff --git a/tests/ui/return/return-match-array-const.rs b/tests/ui/return/return-match-array-const.rs index b619a4d57f955..968b9b7e5bee5 100644 --- a/tests/ui/return/return-match-array-const.rs +++ b/tests/ui/return/return-match-array-const.rs @@ -1,19 +1,19 @@ fn main() { -//~^ NOTE: not the enclosing function body -//~| NOTE: not the enclosing function body -//~| NOTE: not the enclosing function body +//~^ NOTE not the enclosing function body +//~| NOTE not the enclosing function body +//~| NOTE not the enclosing function body [(); return match 0 { n => n }]; - //~^ ERROR: return statement outside of function body [E0572] - //~| NOTE: the return is part of this body... + //~^ ERROR return statement outside of function body [E0572] + //~| NOTE the return is part of this body... [(); return match 0 { 0 => 0 }]; - //~^ ERROR: return statement outside of function body [E0572] - //~| NOTE: the return is part of this body... + //~^ ERROR return statement outside of function body [E0572] + //~| NOTE the return is part of this body... [(); return match () { 'a' => 0, _ => 0 }]; - //~^ ERROR: return statement outside of function body [E0572] - //~| NOTE: the return is part of this body... - //~| ERROR: mismatched types [E0308] - //~| NOTE: expected `()`, found `char` - //~| NOTE: this expression has type `()` + //~^ ERROR return statement outside of function body [E0572] + //~| NOTE the return is part of this body... + //~| ERROR mismatched types [E0308] + //~| NOTE expected `()`, found `char` + //~| NOTE this expression has type `()` } diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-119271-never-arm-attr-in-guard.rs b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-119271-never-arm-attr-in-guard.rs index 715f5874b2cc2..5171083cbe1db 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-119271-never-arm-attr-in-guard.rs +++ b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-119271-never-arm-attr-in-guard.rs @@ -3,9 +3,9 @@ fn main() {} fn attr_in_guard() { match None:: { Some(!) //~ ERROR `!` patterns are experimental - //~^ ERROR: mismatched types + //~^ ERROR mismatched types if #[deny(unused_mut)] //~ ERROR attributes on expressions are experimental false //~ ERROR a guard on a never pattern will never be run } - match false {} //~ ERROR: `bool` is non-empty + match false {} //~ ERROR `bool` is non-empty } diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-130779-never-arm-no-oatherwise-block.rs b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-130779-never-arm-no-oatherwise-block.rs index 2a7e730af16ba..c0c56fa53630a 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-130779-never-arm-no-oatherwise-block.rs +++ b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-130779-never-arm-no-oatherwise-block.rs @@ -5,8 +5,8 @@ enum E { A } fn main() { match E::A { - ! | //~ ERROR: a trailing `|` is not allowed in an or-pattern - //~^ ERROR: mismatched types - if true => {} //~ ERROR: a never pattern is always unreachable + ! | //~ ERROR a trailing `|` is not allowed in an or-pattern + //~^ ERROR mismatched types + if true => {} //~ ERROR a never pattern is always unreachable } } diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/bindings.rs b/tests/ui/rfcs/rfc-0000-never_patterns/bindings.rs index 11489ccaacd36..cae210804235b 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/bindings.rs +++ b/tests/ui/rfcs/rfc-0000-never_patterns/bindings.rs @@ -15,13 +15,13 @@ fn main() { match x { Ok(_) => {} Err(&(_a, _b, !)), - //~^ ERROR: never patterns cannot contain variable bindings - //~| ERROR: never patterns cannot contain variable bindings + //~^ ERROR never patterns cannot contain variable bindings + //~| ERROR never patterns cannot contain variable bindings } match x { Ok(_ok) | Err(&(_a, _b, !)) => {} - //~^ ERROR: never patterns cannot contain variable bindings - //~| ERROR: never patterns cannot contain variable bindings + //~^ ERROR never patterns cannot contain variable bindings + //~| ERROR never patterns cannot contain variable bindings } } @@ -33,15 +33,15 @@ fn void(void: Void) { let ((_a,) | (!,)) = (void,); let (_a, (! | !)) = (true, void); - //~^ ERROR: never patterns cannot contain variable bindings + //~^ ERROR never patterns cannot contain variable bindings let (_a, (_b | !)) = (true, void); let _a @ ! = void; - //~^ ERROR: never patterns cannot contain variable bindings + //~^ ERROR never patterns cannot contain variable bindings let _a @ (_b | !) = void; let (_a @ (), !) = ((), void); - //~^ ERROR: never patterns cannot contain variable bindings + //~^ ERROR never patterns cannot contain variable bindings let (_a | (_b @ (_, !))) = (true, void); - //~^ ERROR: never patterns cannot contain variable bindings + //~^ ERROR never patterns cannot contain variable bindings } diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/check.rs b/tests/ui/rfcs/rfc-0000-never_patterns/check.rs index 77f79003edc86..8aba257c14c75 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/check.rs +++ b/tests/ui/rfcs/rfc-0000-never_patterns/check.rs @@ -16,12 +16,12 @@ fn no_arms_or_guards(x: Void) { //~^ ERROR a never pattern is always unreachable None => {} } - match &None:: { //~ ERROR: `&Some(!)` not covered + match &None:: { //~ ERROR `&Some(!)` not covered Some(!) if true, //~^ ERROR guard on a never pattern None => {} } - match &None:: { //~ ERROR: `&Some(!)` not covered + match &None:: { //~ ERROR `&Some(!)` not covered Some(!) if true => {} //~^ ERROR a never pattern is always unreachable None => {} diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/diverges-not.rs b/tests/ui/rfcs/rfc-0000-never_patterns/diverges-not.rs index 6b85ada3aadee..943b2ed55aaab 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/diverges-not.rs +++ b/tests/ui/rfcs/rfc-0000-never_patterns/diverges-not.rs @@ -10,12 +10,12 @@ enum Void {} // Contrast with `./diverges.rs`: merely having an empty type around isn't enough to diverge. fn wild_void(_: Void) -> u32 {} -//~^ ERROR: mismatched types +//~^ ERROR mismatched types fn wild_let() -> u32 { let ptr: *const Void = std::ptr::null(); unsafe { - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let _ = *ptr; } } @@ -24,18 +24,18 @@ fn wild_match() -> u32 { let ptr: *const Void = std::ptr::null(); unsafe { match *ptr { - _ => {} //~ ERROR: mismatched types + _ => {} //~ ERROR mismatched types } } } fn binding_void(_x: Void) -> u32 {} -//~^ ERROR: mismatched types +//~^ ERROR mismatched types fn binding_let() -> u32 { let ptr: *const Void = std::ptr::null(); unsafe { - //~^ ERROR: mismatched types + //~^ ERROR mismatched types let _x = *ptr; } } @@ -44,7 +44,7 @@ fn binding_match() -> u32 { let ptr: *const Void = std::ptr::null(); unsafe { match *ptr { - _x => {} //~ ERROR: mismatched types + _x => {} //~ ERROR mismatched types } } } @@ -52,5 +52,5 @@ fn binding_match() -> u32 { // Don't confuse this with a `let !` statement. fn let_chain(x: Void) -> u32 { if let true = true && let ! = x {} - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/parse.rs b/tests/ui/rfcs/rfc-0000-never_patterns/parse.rs index 566bb07164640..f64b0b47fe432 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/parse.rs +++ b/tests/ui/rfcs/rfc-0000-never_patterns/parse.rs @@ -71,7 +71,7 @@ fn parse(x: Void) { let ! = x; let y @ ! = x; - //~^ ERROR: never patterns cannot contain variable bindings + //~^ ERROR never patterns cannot contain variable bindings } fn foo(!: Void) {} diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/typeck.rs b/tests/ui/rfcs/rfc-0000-never_patterns/typeck.rs index bf74b282f6cdf..00caf178c7571 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/typeck.rs +++ b/tests/ui/rfcs/rfc-0000-never_patterns/typeck.rs @@ -22,45 +22,45 @@ fn never_pattern_typeck_fail(void: Void) { // Don't accept on a non-empty type. match () { !, - //[fail]~^ ERROR: mismatched types + //[fail]~^ ERROR mismatched types } match (0, false) { !, - //[fail]~^ ERROR: mismatched types + //[fail]~^ ERROR mismatched types } match (0, false) { (_, !), - //[fail]~^ ERROR: mismatched types + //[fail]~^ ERROR mismatched types } match Some(0) { None => {} Some(!), - //[fail]~^ ERROR: mismatched types + //[fail]~^ ERROR mismatched types } // Don't accept on an arbitrary type, even if there are no more branches. match () { () => {} !, - //[fail]~^ ERROR: mismatched types + //[fail]~^ ERROR mismatched types } // Don't accept even on an empty branch. match None:: { None => {} !, - //[fail]~^ ERROR: mismatched types + //[fail]~^ ERROR mismatched types } match (&[] as &[Void]) { [] => {} !, - //[fail]~^ ERROR: mismatched types + //[fail]~^ ERROR mismatched types } // Let alone if the emptiness is behind a reference. match None::<&Void> { None => {} !, - //[fail]~^ ERROR: mismatched types + //[fail]~^ ERROR mismatched types } } diff --git a/tests/ui/rfcs/rfc-2294-if-let-guard/guard-lifetime-1.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/guard-lifetime-1.rs index 792225e656f42..692b2b66f27fa 100644 --- a/tests/ui/rfcs/rfc-2294-if-let-guard/guard-lifetime-1.rs +++ b/tests/ui/rfcs/rfc-2294-if-let-guard/guard-lifetime-1.rs @@ -6,7 +6,7 @@ fn main() { let x: Option> = Some(Some(String::new())); match x { Some(mut y) if let Some(ref z) = y => { - //~^ ERROR: cannot move out of `x.0` because it is borrowed + //~^ ERROR cannot move out of `x.0` because it is borrowed let _z: &String = z; let _y: Option = y; } diff --git a/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs b/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs index 4cf2d1ac4a6be..5e2054ff371b2 100644 --- a/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs +++ b/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-basic.rs @@ -14,7 +14,7 @@ mod basic_pass { type Opq<'a> = impl Sized + 'a; #[define_opaque(Opq)] fn test() -> impl for<'a> Trait<'a, Ty = Opq<'a>> {} - //~^ ERROR: expected generic lifetime parameter, found `'a` + //~^ ERROR expected generic lifetime parameter, found `'a` } mod capture_rpit { @@ -40,7 +40,7 @@ mod capture_tait_complex_pass { type Opq2 = impl for<'a> Trait<'a, Ty = Opq1<'a>>; #[define_opaque(Opq2)] fn test() -> Opq2 {} - //~^ ERROR: expected generic lifetime parameter, found `'a` + //~^ ERROR expected generic lifetime parameter, found `'a` } // Same as the above, but make sure that different placeholder regions are not equal. @@ -60,7 +60,7 @@ mod constrain_fail0 { type Opq0<'a, 'b> = impl Sized; #[define_opaque(Opq0)] fn test() -> impl for<'a> Trait<'a, Ty = Opq0<'a, 'static>> {} - //~^ ERROR: expected generic lifetime parameter, found `'a` + //~^ ERROR expected generic lifetime parameter, found `'a` } // non-defining use because generic lifetime is used multiple times. @@ -69,7 +69,7 @@ mod constrain_fail { type Opq0<'a, 'b> = impl Sized; #[define_opaque(Opq0)] fn test() -> impl for<'a> Trait<'a, Ty = Opq0<'a, 'a>> {} - //~^ ERROR: expected generic lifetime parameter, found `'a` + //~^ ERROR expected generic lifetime parameter, found `'a` } mod constrain_pass { @@ -79,7 +79,7 @@ mod constrain_pass { type Opq2 = impl for<'a> Trait<'a, Ty = Opq1<'a>>; #[define_opaque(Opq2)] fn test() -> Opq2 {} - //~^ ERROR: expected generic lifetime parameter, found `'a` + //~^ ERROR expected generic lifetime parameter, found `'a` } fn main() {} diff --git a/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-gat.rs b/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-gat.rs index e0b7909c24091..07c239afca2d3 100644 --- a/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-gat.rs +++ b/tests/ui/rfcs/type-alias-impl-trait/higher-ranked-regions-gat.rs @@ -17,7 +17,7 @@ impl Trait for Struct { #[define_opaque(Foo)] fn foo() -> Foo { Struct - //~^ ERROR: expected generic lifetime parameter, found `'a` + //~^ ERROR expected generic lifetime parameter, found `'a` } fn main() {} diff --git a/tests/ui/rust-2018/async-ident-allowed.rs b/tests/ui/rust-2018/async-ident-allowed.rs index 342fafc67e20a..f4c266643a50d 100644 --- a/tests/ui/rust-2018/async-ident-allowed.rs +++ b/tests/ui/rust-2018/async-ident-allowed.rs @@ -6,6 +6,6 @@ // identifiers are enabled. fn main() { - let async = 3; //~ ERROR: is a keyword + let async = 3; //~ ERROR is a keyword //~^ WARN this is accepted in the current edition } diff --git a/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.fixed b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.fixed index 435857224ac31..c73f7e91df6c7 100644 --- a/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.fixed +++ b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.fixed @@ -25,12 +25,12 @@ macro_rules! make_foo { gimme_a! {make_foo!} struct Bar<'a, 'b> { - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred bar: &'a &'b (), } struct BarWhere<'a, 'b> { - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred bar: &'a &'b (), } @@ -39,11 +39,11 @@ mod everything_inside { macro_rules! m { ('b: 'a) => { struct Foo<'a, 'b>(&'a &'b ()); - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct Bar<'a, 'b>(&'a &'b ()) ; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct Baz<'a, 'b>(&'a &'b ()) where (): Sized, ; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred }; } m!('b: 'a); @@ -53,11 +53,11 @@ mod inner_lifetime_outside_colon_inside { macro_rules! m { ($b:lifetime: 'a) => { struct Foo<'a, $b>(&'a &$b ()); - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct Bar<'a, $b>(&'a &$b ()) ; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct Baz<'a, $b>(&'a &$b ()) where (): Sized, ; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred } } m!('b: 'a); @@ -115,9 +115,9 @@ mod everything_outside_with_tt_outer { // struct Foo<$a, $b $colon $a>(&$a &$b ()); // ^ ERROR: outlives requirements can be inferred struct Bar<$a, $b>(&$a &$b ()) ; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct Baz<$a, $b>(&$a &$b ()) where (): Sized, ; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred } } m!('b: 'a); @@ -130,9 +130,9 @@ mod everything_outside_with_tt_both { // struct Foo<$a, $b $colon $a>(&$a &$b ()); // ^ ERROR: outlives requirements can be inferred struct Bar<$a, $b>(&$a &$b ()) ; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct Baz<$a, $b>(&$a &$b ()) where (): Sized, ; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred } } m!('b: 'a); diff --git a/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.rs b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.rs index 6c879231a1681..4071f26c75664 100644 --- a/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.rs +++ b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.rs @@ -25,12 +25,12 @@ macro_rules! make_foo { gimme_a! {make_foo!} struct Bar<'a, 'b: 'a> { - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred bar: &'a &'b (), } struct BarWhere<'a, 'b> where 'b: 'a { - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred bar: &'a &'b (), } @@ -39,11 +39,11 @@ mod everything_inside { macro_rules! m { ('b: 'a) => { struct Foo<'a, 'b: 'a>(&'a &'b ()); - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct Bar<'a, 'b>(&'a &'b ()) where 'b: 'a; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct Baz<'a, 'b>(&'a &'b ()) where (): Sized, 'b: 'a; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred }; } m!('b: 'a); @@ -53,11 +53,11 @@ mod inner_lifetime_outside_colon_inside { macro_rules! m { ($b:lifetime: 'a) => { struct Foo<'a, $b: 'a>(&'a &$b ()); - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct Bar<'a, $b>(&'a &$b ()) where $b: 'a; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct Baz<'a, $b>(&'a &$b ()) where (): Sized, $b: 'a; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred } } m!('b: 'a); @@ -115,9 +115,9 @@ mod everything_outside_with_tt_outer { // struct Foo<$a, $b $colon $a>(&$a &$b ()); // ^ ERROR: outlives requirements can be inferred struct Bar<$a, $b>(&$a &$b ()) where $b $colon $a; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct Baz<$a, $b>(&$a &$b ()) where (): Sized, $b $colon $a; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred } } m!('b: 'a); @@ -130,9 +130,9 @@ mod everything_outside_with_tt_both { // struct Foo<$a, $b $colon $a>(&$a &$b ()); // ^ ERROR: outlives requirements can be inferred struct Bar<$a, $b>(&$a &$b ()) where $b $colon $a; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct Baz<$a, $b>(&$a &$b ()) where (): Sized, $b $colon $a; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred } } m!('b: 'a); diff --git a/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-multispan.rs b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-multispan.rs index d2254acb33f6b..c1f6a6bd7812d 100644 --- a/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-multispan.rs +++ b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-multispan.rs @@ -370,15 +370,15 @@ mod multiple_predicates_with_same_span { macro_rules! m { ($($name:ident)+) => { struct Inline<'a, $($name: 'a,)+>(&'a ($($name,)+)); - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct FullWhere<'a, $($name,)+>(&'a ($($name,)+)) where $($name: 'a,)+; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct PartialWhere<'a, $($name,)+>(&'a ($($name,)+)) where (): Sized, $($name: 'a,)+; - //~^ ERROR: outlives requirements can be inferred + //~^ ERROR outlives requirements can be inferred struct Interleaved<'a, $($name,)+>(&'a ($($name,)+)) where (): Sized, - $($name: 'a, $name: 'a, )+ //~ ERROR: outlives requirements can be inferred + $($name: 'a, $name: 'a, )+ //~ ERROR outlives requirements can be inferred $($name: 'a, $name: 'a, )+; } } diff --git a/tests/ui/rust-2021/ice-return-unsized-can-impl-2.rs b/tests/ui/rust-2021/ice-return-unsized-can-impl-2.rs index 567d37e1b820d..ea53aaf851000 100644 --- a/tests/ui/rust-2021/ice-return-unsized-can-impl-2.rs +++ b/tests/ui/rust-2021/ice-return-unsized-can-impl-2.rs @@ -4,14 +4,14 @@ trait B { fn f(a: A) -> A; - //~^ ERROR: expected a type, found a trait - //~| ERROR: expected a type, found a trait + //~^ ERROR expected a type, found a trait + //~| ERROR expected a type, found a trait } trait A { fn concrete(b: B) -> B; - //~^ ERROR: expected a type, found a trait - //~| ERROR: expected a type, found a trait + //~^ ERROR expected a type, found a trait + //~| ERROR expected a type, found a trait } fn main() {} diff --git a/tests/ui/rust-2021/ice-return-unsized-can-impl.rs b/tests/ui/rust-2021/ice-return-unsized-can-impl.rs index 8b83b7b537a2f..4ea9766957c00 100644 --- a/tests/ui/rust-2021/ice-return-unsized-can-impl.rs +++ b/tests/ui/rust-2021/ice-return-unsized-can-impl.rs @@ -8,8 +8,8 @@ trait B { trait A { fn g(new: B) -> B; - //~^ ERROR: expected a type, found a trait - //~| ERROR: expected a type, found a trait + //~^ ERROR expected a type, found a trait + //~| ERROR expected a type, found a trait } fn main() {} diff --git a/tests/ui/rust-2021/ice-unsized-fn-params-2.rs b/tests/ui/rust-2021/ice-unsized-fn-params-2.rs index 8af56ffe80de7..9bf2c98ef59c1 100644 --- a/tests/ui/rust-2021/ice-unsized-fn-params-2.rs +++ b/tests/ui/rust-2021/ice-unsized-fn-params-2.rs @@ -5,7 +5,7 @@ #![feature(unsized_fn_params)] fn guard(_s: Copy) -> bool { - //~^ ERROR: expected a type, found a trait + //~^ ERROR expected a type, found a trait panic!() } diff --git a/tests/ui/rust-2021/ice-unsized-fn-params.rs b/tests/ui/rust-2021/ice-unsized-fn-params.rs index 6ed67698e96eb..ff41ea883e029 100644 --- a/tests/ui/rust-2021/ice-unsized-fn-params.rs +++ b/tests/ui/rust-2021/ice-unsized-fn-params.rs @@ -4,14 +4,14 @@ trait B { fn f(a: A) -> A; - //~^ ERROR: expected a type, found a trait - //~| ERROR: expected a type, found a trait + //~^ ERROR expected a type, found a trait + //~| ERROR expected a type, found a trait } trait A { fn g(b: B) -> B; - //~^ ERROR: expected a type, found a trait - //~| ERROR: expected a type, found a trait + //~^ ERROR expected a type, found a trait + //~| ERROR expected a type, found a trait } fn main() {} diff --git a/tests/ui/rust-2024/safe-outside-extern.rs b/tests/ui/rust-2024/safe-outside-extern.rs index 674b78dc571ea..4b0b84293079f 100644 --- a/tests/ui/rust-2024/safe-outside-extern.rs +++ b/tests/ui/rust-2024/safe-outside-extern.rs @@ -1,23 +1,23 @@ safe fn foo() {} -//~^ ERROR: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier +//~^ ERROR items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier safe static FOO: i32 = 1; -//~^ ERROR: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier +//~^ ERROR items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier trait Foo { safe fn foo(); - //~^ ERROR: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier + //~^ ERROR items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier } impl Foo for () { safe fn foo() {} - //~^ ERROR: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier + //~^ ERROR items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier } type FnPtr = safe fn(i32, i32) -> i32; -//~^ ERROR: function pointers cannot be declared with `safe` safety qualifier +//~^ ERROR function pointers cannot be declared with `safe` safety qualifier unsafe static LOL: u8 = 0; -//~^ ERROR: static items cannot be declared with `unsafe` safety qualifier outside of `extern` block +//~^ ERROR static items cannot be declared with `unsafe` safety qualifier outside of `extern` block fn main() {} diff --git a/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.rs b/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.rs index f3b8645abaf89..d00a2348f5aad 100644 --- a/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.rs +++ b/tests/ui/rust-2024/unsafe-attributes/in_2024_compatibility.rs @@ -1,7 +1,7 @@ #![deny(rust_2024_compatibility)] #[no_mangle] -//~^ ERROR: unsafe attribute used without unsafe +//~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition extern "C" fn foo() {} diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed index cba3d7f1f9f1c..6e4dd25d7eb2c 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.fixed @@ -11,7 +11,7 @@ macro_rules! tt { macro_rules! ident { ($e:ident) => { #[unsafe($e)] - //~^ ERROR: unsafe attribute used without unsafe + //~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition extern "C" fn bar() {} } @@ -20,7 +20,7 @@ macro_rules! ident { macro_rules! ident2 { ($e:ident, $l:literal) => { #[unsafe($e = $l)] - //~^ ERROR: unsafe attribute used without unsafe + //~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition extern "C" fn bars() {} } @@ -43,28 +43,28 @@ macro_rules! meta2 { macro_rules! with_cfg_attr { () => { #[cfg_attr(all(), unsafe(link_section = ".custom_section"))] - //~^ ERROR: unsafe attribute used without unsafe + //~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition pub extern "C" fn abc() {} }; } tt!([unsafe(no_mangle)]); -//~^ ERROR: unsafe attribute used without unsafe +//~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition ident!(no_mangle); meta!(unsafe(no_mangle)); -//~^ ERROR: unsafe attribute used without unsafe +//~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition meta2!(unsafe(export_name = "baw")); -//~^ ERROR: unsafe attribute used without unsafe +//~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition ident2!(export_name, "bars"); with_cfg_attr!(); #[unsafe(no_mangle)] -//~^ ERROR: unsafe attribute used without unsafe +//~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition extern "C" fn one() {} diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs index 4bbf9b25de54c..0325932cce4ba 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs @@ -11,7 +11,7 @@ macro_rules! tt { macro_rules! ident { ($e:ident) => { #[$e] - //~^ ERROR: unsafe attribute used without unsafe + //~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition extern "C" fn bar() {} } @@ -20,7 +20,7 @@ macro_rules! ident { macro_rules! ident2 { ($e:ident, $l:literal) => { #[$e = $l] - //~^ ERROR: unsafe attribute used without unsafe + //~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition extern "C" fn bars() {} } @@ -43,28 +43,28 @@ macro_rules! meta2 { macro_rules! with_cfg_attr { () => { #[cfg_attr(all(), link_section = ".custom_section")] - //~^ ERROR: unsafe attribute used without unsafe + //~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition pub extern "C" fn abc() {} }; } tt!([no_mangle]); -//~^ ERROR: unsafe attribute used without unsafe +//~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition ident!(no_mangle); meta!(no_mangle); -//~^ ERROR: unsafe attribute used without unsafe +//~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition meta2!(export_name = "baw"); -//~^ ERROR: unsafe attribute used without unsafe +//~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition ident2!(export_name, "bars"); with_cfg_attr!(); #[no_mangle] -//~^ ERROR: unsafe attribute used without unsafe +//~^ ERROR unsafe attribute used without unsafe //~| WARN this is accepted in the current edition extern "C" fn one() {} diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs index 4b161bc34ea06..3c479cee57564 100644 --- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs +++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes.rs @@ -4,7 +4,7 @@ //@[edition2024] edition:2024 -#[no_mangle] //[edition2024]~ ERROR: unsafe attribute used without unsafe +#[no_mangle] //[edition2024]~ ERROR unsafe attribute used without unsafe extern "C" fn foo() {} fn main() {} diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.rs b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.rs index 7bb4f666924d7..aa82a04d509a0 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.rs +++ b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.rs @@ -9,8 +9,8 @@ unsafe extern "C" { fn test2() { test1(TEST1); - //~^ ERROR: call to unsafe function `test1` is unsafe - //~| ERROR: use of extern static is unsafe + //~^ ERROR call to unsafe function `test1` is unsafe + //~| ERROR use of extern static is unsafe } fn test3() { diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.rs b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.rs index 50c97b51768ee..222caec5361ec 100644 --- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.rs +++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.rs @@ -15,8 +15,8 @@ fn test2() { fn test3() { test1(TEST1); - //~^ ERROR: call to unsafe function `test1` is unsafe - //~| ERROR: use of extern static is unsafe + //~^ ERROR call to unsafe function `test1` is unsafe + //~| ERROR use of extern static is unsafe } fn main() {} diff --git a/tests/ui/rustdoc/doc_keyword.rs b/tests/ui/rustdoc/doc_keyword.rs index e0995f336da3b..15fa2d721d309 100644 --- a/tests/ui/rustdoc/doc_keyword.rs +++ b/tests/ui/rustdoc/doc_keyword.rs @@ -15,7 +15,7 @@ fn foo() {} // Regression test for the ICE described in #83512. trait Foo { #[doc(keyword = "match")] - //~^ ERROR: `#[doc(keyword = "...")]` should be used on modules + //~^ ERROR `#[doc(keyword = "...")]` should be used on modules fn quux() {} } diff --git a/tests/ui/self/arbitrary-self-from-method-substs.rs b/tests/ui/self/arbitrary-self-from-method-substs.rs index f2d6585961517..4170d887c9935 100644 --- a/tests/ui/self/arbitrary-self-from-method-substs.rs +++ b/tests/ui/self/arbitrary-self-from-method-substs.rs @@ -7,31 +7,31 @@ use std::marker::PhantomData; struct Foo(u32); impl Foo { fn get>(self: R) -> u32 { - //~^ ERROR: invalid generic `self` parameter type + //~^ ERROR invalid generic `self` parameter type self.0 } fn get1>(self: &R) -> u32 { - //~^ ERROR: invalid generic `self` parameter type + //~^ ERROR invalid generic `self` parameter type self.0 } fn get2>(self: &mut R) -> u32 { - //~^ ERROR: invalid generic `self` parameter type + //~^ ERROR invalid generic `self` parameter type self.0 } fn get3>(self: std::rc::Rc) -> u32 { - //~^ ERROR: invalid generic `self` parameter type + //~^ ERROR invalid generic `self` parameter type self.0 } fn get4>(self: &std::rc::Rc) -> u32 { - //~^ ERROR: invalid generic `self` parameter type + //~^ ERROR invalid generic `self` parameter type self.0 } fn get5>(self: std::rc::Rc<&R>) -> u32 { - //~^ ERROR: invalid generic `self` parameter type + //~^ ERROR invalid generic `self` parameter type self.0 } fn get6(self: FR::Receiver, other: FR) -> u32 { - //[default]~^ ERROR: `::Receiver` cannot be used as the type of `self` + //[default]~^ ERROR `::Receiver` cannot be used as the type of `self` 42 } } @@ -59,7 +59,7 @@ struct Bar(std::marker::PhantomData); impl> Bar { fn get(self: R) {} - //[default]~^ ERROR: `R` cannot be used as the type of `self` + //[default]~^ ERROR `R` cannot be used as the type of `self` } trait FindReceiver { diff --git a/tests/ui/self/arbitrary-self-opaque.rs b/tests/ui/self/arbitrary-self-opaque.rs index b176a982e5fcc..2e65855078c62 100644 --- a/tests/ui/self/arbitrary-self-opaque.rs +++ b/tests/ui/self/arbitrary-self-opaque.rs @@ -6,8 +6,8 @@ type Bar = impl Sized; impl Foo { #[define_opaque(Bar)] fn foo(self: Bar) {} - //~^ ERROR: invalid `self` parameter type: `Bar` - //~| ERROR: item does not constrain + //~^ ERROR invalid `self` parameter type: `Bar` + //~| ERROR item does not constrain } fn main() {} diff --git a/tests/ui/self/arbitrary_self_types_nonnull.rs b/tests/ui/self/arbitrary_self_types_nonnull.rs index ab1589b956e5b..49954cfb2df5a 100644 --- a/tests/ui/self/arbitrary_self_types_nonnull.rs +++ b/tests/ui/self/arbitrary_self_types_nonnull.rs @@ -4,9 +4,9 @@ struct A; impl A { fn m(self: std::ptr::NonNull) {} - //~^ ERROR: invalid `self` parameter type + //~^ ERROR invalid `self` parameter type fn n(self: &std::ptr::NonNull) {} - //~^ ERROR: invalid `self` parameter type + //~^ ERROR invalid `self` parameter type } fn main() { diff --git a/tests/ui/self/arbitrary_self_types_pin_getref.rs b/tests/ui/self/arbitrary_self_types_pin_getref.rs index 29dd907f7ff00..73ab0d83e84d4 100644 --- a/tests/ui/self/arbitrary_self_types_pin_getref.rs +++ b/tests/ui/self/arbitrary_self_types_pin_getref.rs @@ -21,5 +21,5 @@ fn main() { let pinned_a: Pin<&mut A> = pin!(A); let pinned_a: Pin<&A> = pinned_a.as_ref(); let _ = pinned_a.get_ref(); - //[feature]~^ ERROR: multiple applicable items + //[feature]~^ ERROR multiple applicable items } diff --git a/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.rs b/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.rs index 43ad360e1967f..a4dc958610177 100644 --- a/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.rs +++ b/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.rs @@ -6,7 +6,7 @@ struct Foo; impl Foo { async fn f(self: Pin<&Self>) -> impl Clone { self } - //~^ ERROR: captures lifetime that does not appear in bounds + //~^ ERROR captures lifetime that does not appear in bounds } fn main() { diff --git a/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.rs b/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.rs index 4db2fa7dcb81e..9eb1c9dede731 100644 --- a/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.rs +++ b/tests/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.rs @@ -4,7 +4,7 @@ struct Foo; impl Foo { fn f(self: Pin<&Self>) -> impl Clone { self } - //~^ ERROR: captures lifetime that does not appear in bounds + //~^ ERROR captures lifetime that does not appear in bounds } fn main() { diff --git a/tests/ui/self/arbitrary_self_types_unshadowing.rs b/tests/ui/self/arbitrary_self_types_unshadowing.rs index cd195654cc195..8da9a508ccacf 100644 --- a/tests/ui/self/arbitrary_self_types_unshadowing.rs +++ b/tests/ui/self/arbitrary_self_types_unshadowing.rs @@ -40,16 +40,16 @@ impl Wrapper { fn main() { assert_eq!(Wrapper(A).f(), 1); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope assert_eq!(Wrapper(A).g(), 2); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope assert_eq!(Wrapper(A).h(), 3); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope let a = Wrapper(A); assert_eq!(Wrapper(B).f(), 9); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope assert_eq!(Wrapper(C).f(), 10); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope assert_eq!(Wrapper(C).g(), 11); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope } diff --git a/tests/ui/self/arbitrary_self_types_unshadowing_ptrs.rs b/tests/ui/self/arbitrary_self_types_unshadowing_ptrs.rs index 62553c2622a7e..11b602b6510e5 100644 --- a/tests/ui/self/arbitrary_self_types_unshadowing_ptrs.rs +++ b/tests/ui/self/arbitrary_self_types_unshadowing_ptrs.rs @@ -43,19 +43,19 @@ impl Wrapper { fn main() { assert_eq!(Wrapper(A).f(), 1); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope assert_eq!(Wrapper(A).g(), 2); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope assert_eq!(Wrapper(A).h(), 3); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope let a = Wrapper(A); let a_ptr = &a as *const Wrapper; assert_eq!(a_ptr.i(), 4); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope assert_eq!(Wrapper(B).f(), 9); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope assert_eq!(Wrapper(C).f(), 10); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope assert_eq!(Wrapper(C).g(), 11); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope } diff --git a/tests/ui/self/arbitrary_self_types_weak.rs b/tests/ui/self/arbitrary_self_types_weak.rs index 91f2b9e0a95f5..0d6d568289256 100644 --- a/tests/ui/self/arbitrary_self_types_weak.rs +++ b/tests/ui/self/arbitrary_self_types_weak.rs @@ -4,9 +4,9 @@ struct A; impl A { fn m(self: std::rc::Weak) {} - //~^ ERROR: invalid `self` parameter type + //~^ ERROR invalid `self` parameter type fn n(self: std::sync::Weak) {} - //~^ ERROR: invalid `self` parameter type + //~^ ERROR invalid `self` parameter type } fn main() { diff --git a/tests/ui/simd/intrinsic/issue-85855.rs b/tests/ui/simd/intrinsic/issue-85855.rs index cbaa8f046bee3..80e05869ae827 100644 --- a/tests/ui/simd/intrinsic/issue-85855.rs +++ b/tests/ui/simd/intrinsic/issue-85855.rs @@ -7,15 +7,15 @@ #[rustc_intrinsic] unsafe fn simd_saturating_add<'a, T: 'a>(x: T, y: T); -//~^ ERROR: intrinsic has wrong number of lifetime parameters +//~^ ERROR intrinsic has wrong number of lifetime parameters #[rustc_intrinsic] unsafe fn simd_add<'a, T>(x: T, y: T) -> T; #[rustc_intrinsic] unsafe fn simd_sub(x: T, y: U); -//~^ ERROR: intrinsic has wrong number of type parameters +//~^ ERROR intrinsic has wrong number of type parameters #[rustc_intrinsic] unsafe fn simd_mul(x: T, y: T); -//~^ ERROR: intrinsic has wrong number of const parameters +//~^ ERROR intrinsic has wrong number of const parameters diff --git a/tests/ui/simd/not-out-of-bounds.rs b/tests/ui/simd/not-out-of-bounds.rs index 4bd2a69edbf5e..35d5aa4d927b3 100644 --- a/tests/ui/simd/not-out-of-bounds.rs +++ b/tests/ui/simd/not-out-of-bounds.rs @@ -54,12 +54,12 @@ macro_rules! test_shuffle_lanes { } } } -//~^^^^^ ERROR: invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds -//~| ERROR: invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds -//~| ERROR: invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds -//~| ERROR: invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds -//~| ERROR: invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds -//~| ERROR: invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds +//~^^^^^ ERROR invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds +//~| ERROR invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds +//~| ERROR invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds +//~| ERROR invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds +//~| ERROR invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds +//~| ERROR invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds // Because the test is mostly embedded in a macro, all the errors have the same origin point. // And unfortunately, standard comments, as in the UI test harness, disappear in macros! diff --git a/tests/ui/span/borrowck-call-is-borrow-issue-12224.rs b/tests/ui/span/borrowck-call-is-borrow-issue-12224.rs index 938fdaf11f09b..1ff4ed42c4ede 100644 --- a/tests/ui/span/borrowck-call-is-borrow-issue-12224.rs +++ b/tests/ui/span/borrowck-call-is-borrow-issue-12224.rs @@ -10,7 +10,7 @@ struct Test<'a> { fn call(mut f: F) where F: FnMut(Fn) { f(Box::new(|| { - //~^ ERROR: cannot borrow `f` as mutable more than once + //~^ ERROR cannot borrow `f` as mutable more than once f((Box::new(|| {}))) })); } @@ -32,7 +32,7 @@ fn test3(f: &mut F) where F: FnMut() { fn test4(f: &Test) { f.f.call_mut(()) - //~^ ERROR: cannot borrow `f.f` as mutable, as it is behind a `&` reference + //~^ ERROR cannot borrow `f.f` as mutable, as it is behind a `&` reference } fn test5(f: &mut Test) { diff --git a/tests/ui/span/issue-71363.rs b/tests/ui/span/issue-71363.rs index f186e0526a424..4e7d051cf4244 100644 --- a/tests/ui/span/issue-71363.rs +++ b/tests/ui/span/issue-71363.rs @@ -2,8 +2,8 @@ struct MyError; impl std::error::Error for MyError {} -//~^ ERROR: `MyError` doesn't implement `std::fmt::Display` -//~| ERROR: `MyError` doesn't implement `Debug` +//~^ ERROR `MyError` doesn't implement `std::fmt::Display` +//~| ERROR `MyError` doesn't implement `Debug` fn main() {} diff --git a/tests/ui/span/issue-81800.rs b/tests/ui/span/issue-81800.rs index 6ac66fdcb65ad..762d14afee8e1 100644 --- a/tests/ui/span/issue-81800.rs +++ b/tests/ui/span/issue-81800.rs @@ -1,2 +1,2 @@ -fn x˂- //~ ERROR: unknown start of token - //~^ ERROR: expected one of `#`, `>`, `const`, identifier, or lifetime, found `-` +fn x˂- //~ ERROR unknown start of token + //~^ ERROR expected one of `#`, `>`, `const`, identifier, or lifetime, found `-` diff --git a/tests/ui/span/lint-unused-unsafe.rs b/tests/ui/span/lint-unused-unsafe.rs index f008b0abe9fda..3c8ebc9cf7da5 100644 --- a/tests/ui/span/lint-unused-unsafe.rs +++ b/tests/ui/span/lint-unused-unsafe.rs @@ -16,20 +16,20 @@ mod foo { fn callback(_f: F) -> T where F: FnOnce() -> T { panic!() } unsafe fn unsf() {} -fn bad1() { unsafe {} } //~ ERROR: unnecessary `unsafe` block -fn bad2() { unsafe { bad1() } } //~ ERROR: unnecessary `unsafe` block -unsafe fn bad3() { unsafe {} } //~ ERROR: unnecessary `unsafe` block -fn bad4() { unsafe { callback(||{}) } } //~ ERROR: unnecessary `unsafe` block +fn bad1() { unsafe {} } //~ ERROR unnecessary `unsafe` block +fn bad2() { unsafe { bad1() } } //~ ERROR unnecessary `unsafe` block +unsafe fn bad3() { unsafe {} } //~ ERROR unnecessary `unsafe` block +fn bad4() { unsafe { callback(||{}) } } //~ ERROR unnecessary `unsafe` block unsafe fn bad5() { unsafe { unsf() } } fn bad6() { - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { //~ ERROR unnecessary `unsafe` block unsafe { // don't put the warning here unsf() } } } unsafe fn bad7() { - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { //~ ERROR unnecessary `unsafe` block unsafe { unsf() } @@ -64,7 +64,7 @@ mod additional_tests { // some tests fn inner_ignored() { - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { //~ ERROR unnecessary `unsafe` block #[allow(unused_unsafe)] unsafe { unsf() @@ -73,14 +73,14 @@ mod additional_tests { } fn multi_level_unused() { - unsafe { //~ ERROR: unnecessary `unsafe` block - unsafe {} //~ ERROR: unnecessary `unsafe` block - unsafe {} //~ ERROR: unnecessary `unsafe` block + unsafe { //~ ERROR unnecessary `unsafe` block + unsafe {} //~ ERROR unnecessary `unsafe` block + unsafe {} //~ ERROR unnecessary `unsafe` block } } fn granularity() { - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { //~ ERROR unnecessary `unsafe` block unsafe { unsf() } unsafe { unsf() } unsafe { unsf() } @@ -90,9 +90,9 @@ mod additional_tests { fn top_level_used() { unsafe { unsf(); - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block } } @@ -102,9 +102,9 @@ mod additional_tests { unsafe { #[deny(unused_unsafe)] { - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block } } @@ -114,7 +114,7 @@ mod additional_tests { #[deny(unsafe_op_in_unsafe_fn)] unsafe fn inner_ignored_1() { - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { //~ ERROR unnecessary `unsafe` block #[allow(unused_unsafe)] unsafe { unsf() @@ -124,15 +124,15 @@ mod additional_tests { #[deny(unsafe_op_in_unsafe_fn)] unsafe fn multi_level_unused_1() { - unsafe { //~ ERROR: unnecessary `unsafe` block - unsafe {} //~ ERROR: unnecessary `unsafe` block - unsafe {} //~ ERROR: unnecessary `unsafe` block + unsafe { //~ ERROR unnecessary `unsafe` block + unsafe {} //~ ERROR unnecessary `unsafe` block + unsafe {} //~ ERROR unnecessary `unsafe` block } } #[deny(unsafe_op_in_unsafe_fn)] unsafe fn granularity_1() { - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { //~ ERROR unnecessary `unsafe` block unsafe { unsf() } unsafe { unsf() } unsafe { unsf() } @@ -143,9 +143,9 @@ mod additional_tests { unsafe fn top_level_used_1() { unsafe { unsf(); - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block } } @@ -156,9 +156,9 @@ mod additional_tests { unsafe { #[deny(unused_unsafe)] { - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block } } } @@ -168,7 +168,7 @@ mod additional_tests { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn inner_ignored_2() { - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { //~ ERROR unnecessary `unsafe` block #[allow(unused_unsafe)] unsafe { unsf() @@ -178,15 +178,15 @@ mod additional_tests { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn multi_level_unused_2() { - unsafe { //~ ERROR: unnecessary `unsafe` block - unsafe {} //~ ERROR: unnecessary `unsafe` block - unsafe {} //~ ERROR: unnecessary `unsafe` block + unsafe { //~ ERROR unnecessary `unsafe` block + unsafe {} //~ ERROR unnecessary `unsafe` block + unsafe {} //~ ERROR unnecessary `unsafe` block } } #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granularity_2() { - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { //~ ERROR unnecessary `unsafe` block unsafe { unsf() } unsafe { unsf() } unsafe { unsf() } @@ -197,9 +197,9 @@ mod additional_tests { unsafe fn top_level_used_2() { unsafe { unsf(); - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block } } @@ -210,9 +210,9 @@ mod additional_tests { unsafe { #[deny(unused_unsafe)] { - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block + unsafe { unsf() } //~ ERROR unnecessary `unsafe` block } } } @@ -232,7 +232,7 @@ mod additional_tests { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_2() { - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { //~ ERROR unnecessary `unsafe` block unsafe { #[deny(unsafe_op_in_unsafe_fn)] { @@ -245,7 +245,7 @@ mod additional_tests { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_3() { unsafe { - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { //~ ERROR unnecessary `unsafe` block #[deny(unsafe_op_in_unsafe_fn)] { unsf(); @@ -258,7 +258,7 @@ mod additional_tests { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_4() { unsafe { - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { //~ ERROR unnecessary `unsafe` block unsf(); } #[deny(unsafe_op_in_unsafe_fn)] @@ -276,7 +276,7 @@ mod additional_tests_closures { // some tests fn inner_ignored() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block #[allow(unused_unsafe)] let _ = || unsafe { unsf() @@ -285,14 +285,14 @@ mod additional_tests_closures { } fn multi_level_unused() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block }; } fn granularity() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsafe { unsf() }; let _ = || unsafe { unsf() }; let _ = || unsafe { unsf() }; @@ -302,9 +302,9 @@ mod additional_tests_closures { fn top_level_used() { let _ = || unsafe { unsf(); - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block }; } @@ -314,9 +314,9 @@ mod additional_tests_closures { let _ = || unsafe { #[deny(unused_unsafe)] { - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block } }; @@ -326,7 +326,7 @@ mod additional_tests_closures { #[deny(unsafe_op_in_unsafe_fn)] unsafe fn inner_ignored_1() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block #[allow(unused_unsafe)] let _ = || unsafe { unsf() @@ -336,15 +336,15 @@ mod additional_tests_closures { #[deny(unsafe_op_in_unsafe_fn)] unsafe fn multi_level_unused_1() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block }; } #[deny(unsafe_op_in_unsafe_fn)] unsafe fn granularity_1() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsafe { unsf() }; let _ = || unsafe { unsf() }; let _ = || unsafe { unsf() }; @@ -355,9 +355,9 @@ mod additional_tests_closures { unsafe fn top_level_used_1() { let _ = || unsafe { unsf(); - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block }; } @@ -368,9 +368,9 @@ mod additional_tests_closures { let _ = || unsafe { #[deny(unused_unsafe)] { - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block } }; } @@ -380,7 +380,7 @@ mod additional_tests_closures { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn inner_ignored_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block #[allow(unused_unsafe)] let _ = || unsafe { unsf() @@ -390,15 +390,15 @@ mod additional_tests_closures { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn multi_level_unused_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block }; } #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granularity_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsafe { unsf() }; let _ = || unsafe { unsf() }; let _ = || unsafe { unsf() }; @@ -409,9 +409,9 @@ mod additional_tests_closures { unsafe fn top_level_used_2() { let _ = || unsafe { unsf(); - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block }; } @@ -422,9 +422,9 @@ mod additional_tests_closures { let _ = || unsafe { #[deny(unused_unsafe)] { - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block } }; } @@ -444,7 +444,7 @@ mod additional_tests_closures { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsafe { #[deny(unsafe_op_in_unsafe_fn)] { @@ -457,7 +457,7 @@ mod additional_tests_closures { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_3() { let _ = || unsafe { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block #[deny(unsafe_op_in_unsafe_fn)] { unsf(); @@ -470,7 +470,7 @@ mod additional_tests_closures { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_4() { let _ = || unsafe { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block unsf(); }; #[deny(unsafe_op_in_unsafe_fn)] @@ -489,7 +489,7 @@ mod additional_tests_even_more_closures { // some tests fn inner_ignored() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block #[allow(unused_unsafe)] let _ = || unsafe { let _ = || unsf(); @@ -498,14 +498,14 @@ mod additional_tests_even_more_closures { } fn multi_level_unused() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block }; } fn granularity() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsafe { let _ = || unsf(); }; let _ = || unsafe { let _ = || unsf(); }; let _ = || unsafe { let _ = || unsf(); }; @@ -515,9 +515,9 @@ mod additional_tests_even_more_closures { fn top_level_used() { let _ = || unsafe { let _ = || unsf(); - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block }; } @@ -527,9 +527,9 @@ mod additional_tests_even_more_closures { let _ = || unsafe { #[deny(unused_unsafe)] { - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block } }; @@ -539,7 +539,7 @@ mod additional_tests_even_more_closures { #[deny(unsafe_op_in_unsafe_fn)] unsafe fn inner_ignored_1() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block #[allow(unused_unsafe)] let _ = || unsafe { let _ = || unsf(); @@ -549,15 +549,15 @@ mod additional_tests_even_more_closures { #[deny(unsafe_op_in_unsafe_fn)] unsafe fn multi_level_unused_1() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block }; } #[deny(unsafe_op_in_unsafe_fn)] unsafe fn granularity_1() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsafe { let _ = || unsf(); }; let _ = || unsafe { let _ = || unsf(); }; let _ = || unsafe { let _ = || unsf(); }; @@ -568,9 +568,9 @@ mod additional_tests_even_more_closures { unsafe fn top_level_used_1() { let _ = || unsafe { let _ = || unsf(); - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block }; } @@ -581,9 +581,9 @@ mod additional_tests_even_more_closures { let _ = || unsafe { #[deny(unused_unsafe)] { - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block } }; } @@ -593,7 +593,7 @@ mod additional_tests_even_more_closures { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn inner_ignored_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block #[allow(unused_unsafe)] let _ = || unsafe { let _ = || unsf(); @@ -603,15 +603,15 @@ mod additional_tests_even_more_closures { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn multi_level_unused_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block }; } #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granularity_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsafe { let _ = || unsf(); }; let _ = || unsafe { let _ = || unsf(); }; let _ = || unsafe { let _ = || unsf(); }; @@ -622,9 +622,9 @@ mod additional_tests_even_more_closures { unsafe fn top_level_used_2() { let _ = || unsafe { let _ = || unsf(); - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block }; } @@ -635,9 +635,9 @@ mod additional_tests_even_more_closures { let _ = || unsafe { #[deny(unused_unsafe)] { - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; //~ ERROR unnecessary `unsafe` block } }; } @@ -657,7 +657,7 @@ mod additional_tests_even_more_closures { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsafe { #[deny(unsafe_op_in_unsafe_fn)] { @@ -670,7 +670,7 @@ mod additional_tests_even_more_closures { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_3() { let _ = || unsafe { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block #[deny(unsafe_op_in_unsafe_fn)] { let _ = || unsf(); @@ -683,7 +683,7 @@ mod additional_tests_even_more_closures { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_4() { let _ = || unsafe { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsf(); }; #[deny(unsafe_op_in_unsafe_fn)] @@ -701,7 +701,7 @@ mod item_likes { impl S { #[deny(unsafe_op_in_unsafe_fn)] unsafe fn inner_ignored_1() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block #[allow(unused_unsafe)] let _ = || unsafe { unsf() @@ -711,15 +711,15 @@ mod item_likes { #[deny(unsafe_op_in_unsafe_fn)] unsafe fn multi_level_unused_1() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block }; } #[deny(unsafe_op_in_unsafe_fn)] unsafe fn granularity_1() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsafe { unsf() }; let _ = || unsafe { unsf() }; let _ = || unsafe { unsf() }; @@ -730,9 +730,9 @@ mod item_likes { unsafe fn top_level_used_1() { let _ = || unsafe { unsf(); - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block }; } @@ -743,9 +743,9 @@ mod item_likes { let _ = || unsafe { #[deny(unused_unsafe)] { - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block } }; } @@ -755,7 +755,7 @@ mod item_likes { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn inner_ignored_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block #[allow(unused_unsafe)] let _ = || unsafe { unsf() @@ -765,15 +765,15 @@ mod item_likes { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn multi_level_unused_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block }; } #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granularity_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsafe { unsf() }; let _ = || unsafe { unsf() }; let _ = || unsafe { unsf() }; @@ -784,9 +784,9 @@ mod item_likes { unsafe fn top_level_used_2() { let _ = || unsafe { unsf(); - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block }; } @@ -797,9 +797,9 @@ mod item_likes { let _ = || unsafe { #[deny(unused_unsafe)] { - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block } }; } @@ -819,7 +819,7 @@ mod item_likes { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsafe { #[deny(unsafe_op_in_unsafe_fn)] { @@ -832,7 +832,7 @@ mod item_likes { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_3() { let _ = || unsafe { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block #[deny(unsafe_op_in_unsafe_fn)] { unsf(); @@ -845,7 +845,7 @@ mod item_likes { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_4() { let _ = || unsafe { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block unsf(); }; #[deny(unsafe_op_in_unsafe_fn)] @@ -859,7 +859,7 @@ mod item_likes { trait T { #[deny(unsafe_op_in_unsafe_fn)] unsafe fn inner_ignored_1() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block #[allow(unused_unsafe)] let _ = || unsafe { unsf() @@ -869,15 +869,15 @@ mod item_likes { #[deny(unsafe_op_in_unsafe_fn)] unsafe fn multi_level_unused_1() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block }; } #[deny(unsafe_op_in_unsafe_fn)] unsafe fn granularity_1() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsafe { unsf() }; let _ = || unsafe { unsf() }; let _ = || unsafe { unsf() }; @@ -888,9 +888,9 @@ mod item_likes { unsafe fn top_level_used_1() { let _ = || unsafe { unsf(); - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block }; } @@ -901,9 +901,9 @@ mod item_likes { let _ = || unsafe { #[deny(unused_unsafe)] { - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block } }; } @@ -913,7 +913,7 @@ mod item_likes { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn inner_ignored_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block #[allow(unused_unsafe)] let _ = || unsafe { unsf() @@ -923,15 +923,15 @@ mod item_likes { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn multi_level_unused_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe {}; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe {}; //~ ERROR unnecessary `unsafe` block }; } #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granularity_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsafe { unsf() }; let _ = || unsafe { unsf() }; let _ = || unsafe { unsf() }; @@ -942,9 +942,9 @@ mod item_likes { unsafe fn top_level_used_2() { let _ = || unsafe { unsf(); - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block }; } @@ -955,9 +955,9 @@ mod item_likes { let _ = || unsafe { #[deny(unused_unsafe)] { - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block + let _ = || unsafe { unsf() }; //~ ERROR unnecessary `unsafe` block } }; } @@ -977,7 +977,7 @@ mod item_likes { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block let _ = || unsafe { #[deny(unsafe_op_in_unsafe_fn)] { @@ -990,7 +990,7 @@ mod item_likes { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_3() { let _ = || unsafe { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block #[deny(unsafe_op_in_unsafe_fn)] { unsf(); @@ -1003,7 +1003,7 @@ mod item_likes { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_4() { let _ = || unsafe { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { //~ ERROR unnecessary `unsafe` block unsf(); }; #[deny(unsafe_op_in_unsafe_fn)] @@ -1049,30 +1049,30 @@ mod additional_tests_extra { async unsafe fn async_blocks() { #[deny(unsafe_op_in_unsafe_fn)] { - let _ = async { unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = async { unsafe { //~ ERROR unnecessary `unsafe` block let _ = async { unsafe { let _ = async { unsf() }; }}; let _ = async { unsafe { let _ = async { unsf() }; }}; let _ = async { unsafe { let _ = async { unsf() }; }}; }}; let _ = async { unsafe { let _ = async { unsf() }; - let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block - let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block - let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block + let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR unnecessary `unsafe` block + let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR unnecessary `unsafe` block + let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR unnecessary `unsafe` block }}; } #[allow(unsafe_op_in_unsafe_fn)] { - let _ = async { unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = async { unsafe { //~ ERROR unnecessary `unsafe` block let _ = async { unsafe { let _ = async { unsf() }; }}; let _ = async { unsafe { let _ = async { unsf() }; }}; let _ = async { unsafe { let _ = async { unsf() }; }}; }}; let _ = async { unsafe { let _ = async { unsf() }; - let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block - let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block - let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block + let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR unnecessary `unsafe` block + let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR unnecessary `unsafe` block + let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR unnecessary `unsafe` block }}; } } @@ -1082,11 +1082,11 @@ mod additional_tests_extra { } fn unused_unsafe_in_const_1() { - let _x: [(); unsafe { 0 }] = []; //~ ERROR: unnecessary `unsafe` block + let _x: [(); unsafe { 0 }] = []; //~ ERROR unnecessary `unsafe` block } fn unused_unsafe_in_const_2() { - let _x: [(); unsafe { unsafe { size() } }] = []; //~ ERROR: unnecessary `unsafe` block + let _x: [(); unsafe { unsafe { size() } }] = []; //~ ERROR unnecessary `unsafe` block } const unsafe fn size() -> usize { 0 } diff --git a/tests/ui/specialization/issue-33017.rs b/tests/ui/specialization/issue-33017.rs index 8dbadf58d5c88..c486db9903642 100644 --- a/tests/ui/specialization/issue-33017.rs +++ b/tests/ui/specialization/issue-33017.rs @@ -10,7 +10,7 @@ trait UncheckedCopy: Sized { impl UncheckedCopy for T { default type Output = Self; - //~^ ERROR: the trait bound `T: Copy` is not satisfied + //~^ ERROR the trait bound `T: Copy` is not satisfied } fn unchecked_copy(other: &T::Output) -> T { diff --git a/tests/ui/specialization/issue-44861.rs b/tests/ui/specialization/issue-44861.rs index 9d6517e613a22..0497a60ef62ed 100644 --- a/tests/ui/specialization/issue-44861.rs +++ b/tests/ui/specialization/issue-44861.rs @@ -19,7 +19,7 @@ impl MaybeDynCompatible for () {} impl Smartass for T { type Data = ::Data2; default type Data2 = (); - //~^ ERROR: the trait bound `(): CoerceUnsized<*const [u8]>` is not satisfied + //~^ ERROR the trait bound `(): CoerceUnsized<*const [u8]>` is not satisfied } impl Smartass for () { diff --git a/tests/ui/specialization/issue-51892.rs b/tests/ui/specialization/issue-51892.rs index 5c06254143d04..01b764526de4c 100644 --- a/tests/ui/specialization/issue-51892.rs +++ b/tests/ui/specialization/issue-51892.rs @@ -12,7 +12,7 @@ impl Trait for T { impl Trait for *const T { type Type = [u8; std::mem::size_of::<::Type>()]; - //~^ ERROR: unconstrained generic constant + //~^ ERROR unconstrained generic constant } fn main() {} diff --git a/tests/ui/specialization/issue-59435.rs b/tests/ui/specialization/issue-59435.rs index 3239002566279..be27ce1a689af 100644 --- a/tests/ui/specialization/issue-59435.rs +++ b/tests/ui/specialization/issue-59435.rs @@ -9,7 +9,7 @@ trait MyTrait { impl MyTrait for i32 { default type MyType = MyStruct; - //~^ ERROR: the trait bound `MyStruct: Default` is not satisfied + //~^ ERROR the trait bound `MyStruct: Default` is not satisfied } fn main() { diff --git a/tests/ui/specialization/issue-68830-spurious-diagnostics.rs b/tests/ui/specialization/issue-68830-spurious-diagnostics.rs index d11ec79833217..5be03e32d39ed 100644 --- a/tests/ui/specialization/issue-68830-spurious-diagnostics.rs +++ b/tests/ui/specialization/issue-68830-spurious-diagnostics.rs @@ -5,7 +5,7 @@ #![allow(incomplete_features)] struct BadStruct { - err: MissingType //~ ERROR: cannot find type `MissingType` in this scope + err: MissingType //~ ERROR cannot find type `MissingType` in this scope } trait MyTrait { diff --git a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs index a0ee771441772..e9081836cb1a4 100644 --- a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs +++ b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs @@ -7,6 +7,6 @@ struct S; impl Copy for S {} impl Copy for S {} -//~^ ERROR: conflicting implementations of trait `Copy` for type `S<_>` +//~^ ERROR conflicting implementations of trait `Copy` for type `S<_>` fn main() {} diff --git a/tests/ui/specialization/min_specialization/impl-on-opaque2.rs b/tests/ui/specialization/min_specialization/impl-on-opaque2.rs index bcdb54c2b4f77..081be01eb2252 100644 --- a/tests/ui/specialization/min_specialization/impl-on-opaque2.rs +++ b/tests/ui/specialization/min_specialization/impl-on-opaque2.rs @@ -19,7 +19,7 @@ impl Tuple for () {} // FIXME: this passes if we use `<(), ()>` here instead of `<(), Opaque>`, // even though there can't be more overlap from the opaque version impl SpecTrait<(), Opaque> for () { - //~^ ERROR: conflicting implementations + //~^ ERROR conflicting implementations fn f() {} } diff --git a/tests/ui/specialization/min_specialization/issue-79224.rs b/tests/ui/specialization/min_specialization/issue-79224.rs index 15429bf60e5ab..2834418253e55 100644 --- a/tests/ui/specialization/min_specialization/issue-79224.rs +++ b/tests/ui/specialization/min_specialization/issue-79224.rs @@ -26,11 +26,11 @@ impl ToString for Cow<'_, str> { } impl Display for Cow<'_, B> { - //~^ ERROR: the trait bound `B: Clone` is not satisfied [E0277] + //~^ ERROR the trait bound `B: Clone` is not satisfied [E0277] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - //~^ ERROR: the trait bound `B: Clone` is not satisfied [E0277] - //~| ERROR: the trait bound `B: Clone` is not satisfied [E0277] - //~| ERROR: the trait bound `B: Clone` is not satisfied [E0277] + //~^ ERROR the trait bound `B: Clone` is not satisfied [E0277] + //~| ERROR the trait bound `B: Clone` is not satisfied [E0277] + //~| ERROR the trait bound `B: Clone` is not satisfied [E0277] write!(f, "foo") } } diff --git a/tests/ui/specialization/non-defaulted-item-fail.rs b/tests/ui/specialization/non-defaulted-item-fail.rs index b7d6ac829dd14..8fb4d59e3b419 100644 --- a/tests/ui/specialization/non-defaulted-item-fail.rs +++ b/tests/ui/specialization/non-defaulted-item-fail.rs @@ -28,11 +28,11 @@ impl Foo for Box {} // Can't override a non-`default` fn impl Foo for Box { type Ty = Vec<()>; -//~^ error: `Ty` specializes an item from a parent `impl`, but that item is not marked `default` +//~^ error `Ty` specializes an item from a parent `impl`, but that item is not marked `default` const CONST: u8 = 42; -//~^ error: `CONST` specializes an item from a parent `impl`, but that item is not marked `default` +//~^ error `CONST` specializes an item from a parent `impl`, but that item is not marked `default` fn foo(&self) -> bool { true } -//~^ error: `foo` specializes an item from a parent `impl`, but that item is not marked `default` +//~^ error `foo` specializes an item from a parent `impl`, but that item is not marked `default` } @@ -44,11 +44,11 @@ impl Foo for Vec<()> {} impl Foo for Vec { type Ty = Vec<()>; -//~^ error: `Ty` specializes an item from a parent `impl`, but that item is not marked `default` +//~^ error `Ty` specializes an item from a parent `impl`, but that item is not marked `default` const CONST: u8 = 42; -//~^ error: `CONST` specializes an item from a parent `impl`, but that item is not marked `default` +//~^ error `CONST` specializes an item from a parent `impl`, but that item is not marked `default` fn foo(&self) -> bool { true } -//~^ error: `foo` specializes an item from a parent `impl`, but that item is not marked `default` +//~^ error `foo` specializes an item from a parent `impl`, but that item is not marked `default` } fn main() {} diff --git a/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs b/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs index e7d3b67506a79..3a658e7b322b6 100644 --- a/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs +++ b/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs @@ -1,5 +1,5 @@ //@ compile-flags:-Zforce-unstable-if-unmarked -#[unstable()] //~ ERROR: stability attributes may not be used -#[stable()] //~ ERROR: stability attributes may not be used +#[unstable()] //~ ERROR stability attributes may not be used +#[stable()] //~ ERROR stability attributes may not be used fn main() {} diff --git a/tests/ui/stability-attribute/stability-attribute-non-staged.rs b/tests/ui/stability-attribute/stability-attribute-non-staged.rs index 4015f2f971e69..1a310d47bf93e 100644 --- a/tests/ui/stability-attribute/stability-attribute-non-staged.rs +++ b/tests/ui/stability-attribute/stability-attribute-non-staged.rs @@ -1,3 +1,3 @@ -#[unstable()] //~ ERROR: stability attributes may not be used -#[stable()] //~ ERROR: stability attributes may not be used +#[unstable()] //~ ERROR stability attributes may not be used +#[stable()] //~ ERROR stability attributes may not be used fn main() {} diff --git a/tests/ui/static/auxiliary/static-priv-by-default.rs b/tests/ui/static/auxiliary/static-priv-by-default.rs index f36f87c5736a1..1613dc0de624d 100644 --- a/tests/ui/static/auxiliary/static-priv-by-default.rs +++ b/tests/ui/static/auxiliary/static-priv-by-default.rs @@ -12,15 +12,15 @@ mod child { fn foo(_: isize) {} fn full_ref() { - foo(static_priv_by_default::private); //~ ERROR: static `private` is private + foo(static_priv_by_default::private); //~ ERROR static `private` is private foo(static_priv_by_default::public); - foo(child::childs_child::private); //~ ERROR: static `private` is private + foo(child::childs_child::private); //~ ERROR static `private` is private foo(child::childs_child::public); } fn medium_ref() { use child::childs_child; - foo(childs_child::private); //~ ERROR: static `private` is private + foo(childs_child::private); //~ ERROR static `private` is private foo(childs_child::public); } diff --git a/tests/ui/static/missing-type.rs b/tests/ui/static/missing-type.rs index 2569f47b7c38c..0b5c9d13faeff 100644 --- a/tests/ui/static/missing-type.rs +++ b/tests/ui/static/missing-type.rs @@ -1,5 +1,5 @@ // reported as #124164 static S_COUNT: = std::sync::atomic::AtomicUsize::new(0); -//~^ ERROR: missing type for `static` item +//~^ ERROR missing type for `static` item fn main() {} diff --git a/tests/ui/static/raw-ref-deref-without-unsafe.rs b/tests/ui/static/raw-ref-deref-without-unsafe.rs index 97d08c815bf93..c2a9e42e2993f 100644 --- a/tests/ui/static/raw-ref-deref-without-unsafe.rs +++ b/tests/ui/static/raw-ref-deref-without-unsafe.rs @@ -8,7 +8,7 @@ static mut BYTE_PTR: *mut u8 = ptr::addr_of_mut!(BYTE); // An unsafe static's ident is a place expression in its own right, so despite the above being safe // (it's fine to create raw refs to places!) the following derefs the ptr before creating its ref! static mut DEREF_BYTE_PTR: *mut u8 = ptr::addr_of_mut!(*BYTE_PTR); -//~^ ERROR: use of mutable static +//~^ ERROR use of mutable static fn main() { let _ = unsafe { DEREF_BYTE_PTR }; diff --git a/tests/ui/static/static-mut-bad-types.rs b/tests/ui/static/static-mut-bad-types.rs index 8a98b1b7f769e..2c64e9e1471f4 100644 --- a/tests/ui/static/static-mut-bad-types.rs +++ b/tests/ui/static/static-mut-bad-types.rs @@ -2,6 +2,6 @@ static mut a: isize = 3; fn main() { unsafe { - a = true; //~ ERROR: mismatched types + a = true; //~ ERROR mismatched types } } diff --git a/tests/ui/static/static-mut-foreign-requires-unsafe.rs b/tests/ui/static/static-mut-foreign-requires-unsafe.rs index 90aa2537a82bb..dbe0d8aafa877 100644 --- a/tests/ui/static/static-mut-foreign-requires-unsafe.rs +++ b/tests/ui/static/static-mut-foreign-requires-unsafe.rs @@ -3,7 +3,7 @@ extern "C" { } fn main() { - a += 3; //~ ERROR: requires unsafe - a = 4; //~ ERROR: requires unsafe - let _b = a; //~ ERROR: requires unsafe + a += 3; //~ ERROR requires unsafe + a = 4; //~ ERROR requires unsafe + let _b = a; //~ ERROR requires unsafe } diff --git a/tests/ui/static/static-mut-requires-unsafe.rs b/tests/ui/static/static-mut-requires-unsafe.rs index 413b97e431d30..a893e296c4e4c 100644 --- a/tests/ui/static/static-mut-requires-unsafe.rs +++ b/tests/ui/static/static-mut-requires-unsafe.rs @@ -1,7 +1,7 @@ static mut a: isize = 3; fn main() { - a += 3; //~ ERROR: requires unsafe - a = 4; //~ ERROR: requires unsafe - let _b = a; //~ ERROR: requires unsafe + a += 3; //~ ERROR requires unsafe + a = 4; //~ ERROR requires unsafe + let _b = a; //~ ERROR requires unsafe } diff --git a/tests/ui/static/static-priv-by-default2.rs b/tests/ui/static/static-priv-by-default2.rs index f6b05366a9544..74628a6c40b1e 100644 --- a/tests/ui/static/static-priv-by-default2.rs +++ b/tests/ui/static/static-priv-by-default2.rs @@ -13,7 +13,7 @@ fn foo(_: T) {} fn test1() { use child::childs_child::private; - //~^ ERROR: static `private` is private + //~^ ERROR static `private` is private use child::childs_child::public; foo(private); @@ -21,7 +21,7 @@ fn test1() { fn test2() { use static_priv_by_default::private; - //~^ ERROR: static `private` is private + //~^ ERROR static `private` is private use static_priv_by_default::public; foo(private); diff --git a/tests/ui/static/static-vec-repeat-not-constant.rs b/tests/ui/static/static-vec-repeat-not-constant.rs index 61c87b144d9e4..37a12d0688775 100644 --- a/tests/ui/static/static-vec-repeat-not-constant.rs +++ b/tests/ui/static/static-vec-repeat-not-constant.rs @@ -1,6 +1,6 @@ fn foo() -> isize { 23 } static a: [isize; 2] = [foo(); 2]; -//~^ ERROR: E0015 +//~^ ERROR E0015 fn main() {} diff --git a/tests/ui/statics/issue-17718-static-sync.rs b/tests/ui/statics/issue-17718-static-sync.rs index 6f278d76bb18b..c9d40a37c9657 100644 --- a/tests/ui/statics/issue-17718-static-sync.rs +++ b/tests/ui/statics/issue-17718-static-sync.rs @@ -7,6 +7,6 @@ impl !Sync for Foo {} static FOO: usize = 3; static BAR: Foo = Foo; -//~^ ERROR: `Foo` cannot be shared between threads safely [E0277] +//~^ ERROR `Foo` cannot be shared between threads safely [E0277] fn main() {} diff --git a/tests/ui/statics/mutable_memory_validation.rs b/tests/ui/statics/mutable_memory_validation.rs index 3bb572d38bc59..4d24032a44bee 100644 --- a/tests/ui/statics/mutable_memory_validation.rs +++ b/tests/ui/statics/mutable_memory_validation.rs @@ -11,7 +11,7 @@ struct Meh { } const MUH: Meh = Meh { x: unsafe { &mut *(&READONLY as *const _ as *mut _) } }; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value static READONLY: i32 = 0; diff --git a/tests/ui/statics/nested_thread_local.rs b/tests/ui/statics/nested_thread_local.rs index 2590cc579cd27..bbd7f3c34aa49 100644 --- a/tests/ui/statics/nested_thread_local.rs +++ b/tests/ui/statics/nested_thread_local.rs @@ -4,7 +4,7 @@ #[thread_local] static mut FOO: &u32 = { - //~^ ERROR: does not support implicit nested statics + //~^ ERROR does not support implicit nested statics // Prevent promotion (that would trigger on `&42` as an expression) let x = 42; &{ x } diff --git a/tests/ui/statics/uninhabited-static.rs b/tests/ui/statics/uninhabited-static.rs index 0f7c5ae6ef4a3..a00ad6610425c 100644 --- a/tests/ui/statics/uninhabited-static.rs +++ b/tests/ui/statics/uninhabited-static.rs @@ -4,16 +4,16 @@ enum Void {} extern "C" { static VOID: Void; //~ ERROR static of uninhabited type - //~| WARN: previously accepted + //~| WARN previously accepted static NEVER: !; //~ ERROR static of uninhabited type - //~| WARN: previously accepted + //~| WARN previously accepted } static VOID2: Void = unsafe { std::mem::transmute(()) }; //~ ERROR static of uninhabited type -//~| WARN: previously accepted +//~| WARN previously accepted //~| ERROR could not evaluate static initializer static NEVER2: Void = unsafe { std::mem::transmute(()) }; //~ ERROR static of uninhabited type -//~| WARN: previously accepted +//~| WARN previously accepted //~| ERROR could not evaluate static initializer fn main() {} diff --git a/tests/ui/std-uncopyable-atomics.rs b/tests/ui/std-uncopyable-atomics.rs index d85864ecac285..55856eb94c540 100644 --- a/tests/ui/std-uncopyable-atomics.rs +++ b/tests/ui/std-uncopyable-atomics.rs @@ -6,11 +6,11 @@ use std::ptr; fn main() { let x = AtomicBool::new(false); - let x = *&x; //~ ERROR: cannot move out of a shared reference + let x = *&x; //~ ERROR cannot move out of a shared reference let x = AtomicIsize::new(0); - let x = *&x; //~ ERROR: cannot move out of a shared reference + let x = *&x; //~ ERROR cannot move out of a shared reference let x = AtomicUsize::new(0); - let x = *&x; //~ ERROR: cannot move out of a shared reference + let x = *&x; //~ ERROR cannot move out of a shared reference let x: AtomicPtr = AtomicPtr::new(ptr::null_mut()); - let x = *&x; //~ ERROR: cannot move out of a shared reference + let x = *&x; //~ ERROR cannot move out of a shared reference } diff --git a/tests/ui/structs-enums/issue-103869.fixed b/tests/ui/structs-enums/issue-103869.fixed index 074d7519392aa..13d81e386e831 100644 --- a/tests/ui/structs-enums/issue-103869.fixed +++ b/tests/ui/structs-enums/issue-103869.fixed @@ -1,10 +1,10 @@ //@ run-rustfix struct VecOrMap { - //~^ HELP: perhaps you meant to use `struct` here + //~^ HELP perhaps you meant to use `struct` here vec: Vec, //~^ ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found `:` - //~| HELP: enum variants can be `Variant`, `Variant = `, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }` + //~| HELP enum variants can be `Variant`, `Variant = `, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }` } fn main() { diff --git a/tests/ui/structs-enums/issue-103869.rs b/tests/ui/structs-enums/issue-103869.rs index fe23d2d519143..d42d8ef2624f5 100644 --- a/tests/ui/structs-enums/issue-103869.rs +++ b/tests/ui/structs-enums/issue-103869.rs @@ -1,10 +1,10 @@ //@ run-rustfix enum VecOrMap { - //~^ HELP: perhaps you meant to use `struct` here + //~^ HELP perhaps you meant to use `struct` here vec: Vec, //~^ ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found `:` - //~| HELP: enum variants can be `Variant`, `Variant = `, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }` + //~| HELP enum variants can be `Variant`, `Variant = `, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }` } fn main() { diff --git a/tests/ui/structs/struct-field-privacy.rs b/tests/ui/structs/struct-field-privacy.rs index d70dd5c700500..373ef4dbbf053 100644 --- a/tests/ui/structs/struct-field-privacy.rs +++ b/tests/ui/structs/struct-field-privacy.rs @@ -20,19 +20,19 @@ mod inner { fn test(a: A, b: inner::A, c: inner::B, d: xc::A, e: xc::B, z: inner::Z) { a.a; - b.a; //~ ERROR: field `a` of struct `inner::A` is private + b.a; //~ ERROR field `a` of struct `inner::A` is private b.b; c.a; - c.b; //~ ERROR: field `b` of struct `inner::B` is private + c.b; //~ ERROR field `b` of struct `inner::B` is private - d.a; //~ ERROR: field `a` of struct `xc::A` is private + d.a; //~ ERROR field `a` of struct `xc::A` is private d.b; e.a; - e.b; //~ ERROR: field `b` of struct `xc::B` is private + e.b; //~ ERROR field `b` of struct `xc::B` is private z.0; - z.1; //~ ERROR: field `1` of struct `Z` is private + z.1; //~ ERROR field `1` of struct `Z` is private } fn main() {} diff --git a/tests/ui/structs/struct-tuple-field-names.rs b/tests/ui/structs/struct-tuple-field-names.rs index 33f264aa25091..a81ad6ce082e6 100644 --- a/tests/ui/structs/struct-tuple-field-names.rs +++ b/tests/ui/structs/struct-tuple-field-names.rs @@ -10,9 +10,9 @@ fn main() { } let y = S(1, 2.2); match y { - S { } => {} //~ ERROR: tuple variant `S` written as struct variant [E0769] + S { } => {} //~ ERROR tuple variant `S` written as struct variant [E0769] } - if let E::S { 0: a } = x { //~ ERROR: pattern does not mention field `1` + if let E::S { 0: a } = x { //~ ERROR pattern does not mention field `1` } } diff --git a/tests/ui/suggestions/box-future-wrong-output.rs b/tests/ui/suggestions/box-future-wrong-output.rs index 2d45f1b6a51a5..099a6af766b68 100644 --- a/tests/ui/suggestions/box-future-wrong-output.rs +++ b/tests/ui/suggestions/box-future-wrong-output.rs @@ -18,5 +18,5 @@ trait FutureExt: Future { fn main() { let _: BoxFuture<'static, bool> = async {}.boxed(); - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } diff --git a/tests/ui/suggestions/count2len.rs b/tests/ui/suggestions/count2len.rs index f11a789efbc5b..6baff4f79e86f 100644 --- a/tests/ui/suggestions/count2len.rs +++ b/tests/ui/suggestions/count2len.rs @@ -2,7 +2,7 @@ fn main() { let slice = [1,2,3,4]; let vec = vec![1,2,3,4]; - slice.count(); //~ERROR: E0599 - vec.count(); //~ERROR: E0599 - vec.as_slice().count(); //~ERROR: E0599 + slice.count(); //~ERROR E0599 + vec.count(); //~ERROR E0599 + vec.as_slice().count(); //~ERROR E0599 } diff --git a/tests/ui/suggestions/dont-try-removing-the-field.rs b/tests/ui/suggestions/dont-try-removing-the-field.rs index 80bb15441d45d..ca0772edcfb19 100644 --- a/tests/ui/suggestions/dont-try-removing-the-field.rs +++ b/tests/ui/suggestions/dont-try-removing-the-field.rs @@ -10,7 +10,7 @@ struct Foo { fn use_foo(x: Foo) -> (i32, i32) { let Foo { foo, bar, baz } = x; //~ WARNING unused variable: `baz` - //~| help: try ignoring the field + //~| help try ignoring the field return (foo, bar); } diff --git a/tests/ui/suggestions/fn-trait-notation.fixed b/tests/ui/suggestions/fn-trait-notation.fixed index 18494d2fd8647..8785a9ff52156 100644 --- a/tests/ui/suggestions/fn-trait-notation.fixed +++ b/tests/ui/suggestions/fn-trait-notation.fixed @@ -7,14 +7,14 @@ where H: Fn(i32) -> i32, //~ ERROR E0658 { f(3); - //~^ ERROR: cannot use call notation - //~| ERROR: `i32` is not a tuple + //~^ ERROR cannot use call notation + //~| ERROR `i32` is not a tuple g(3, 4); h(3) } fn main() { - e0658( //~ ERROR: mismatched types + e0658( //~ ERROR mismatched types |a| a, |a, b| (b, a), |a| a, diff --git a/tests/ui/suggestions/fn-trait-notation.rs b/tests/ui/suggestions/fn-trait-notation.rs index ef0b52c9aa3ae..4def91d6a9ef2 100644 --- a/tests/ui/suggestions/fn-trait-notation.rs +++ b/tests/ui/suggestions/fn-trait-notation.rs @@ -7,14 +7,14 @@ where H: Fn<(i32,), Output = i32>, //~ ERROR E0658 { f(3); - //~^ ERROR: cannot use call notation - //~| ERROR: `i32` is not a tuple + //~^ ERROR cannot use call notation + //~| ERROR `i32` is not a tuple g(3, 4); h(3) } fn main() { - e0658( //~ ERROR: mismatched types + e0658( //~ ERROR mismatched types |a| a, |a, b| (b, a), |a| a, diff --git a/tests/ui/suggestions/ignore-nested-field-binding.fixed b/tests/ui/suggestions/ignore-nested-field-binding.fixed index c594fcb118657..dcd7de2e89c48 100644 --- a/tests/ui/suggestions/ignore-nested-field-binding.fixed +++ b/tests/ui/suggestions/ignore-nested-field-binding.fixed @@ -9,12 +9,12 @@ struct Inner { i: i32 } struct Outer { o: Inner } fn foo(Outer { o: Inner { i: _ } }: Outer) {} -//~^ ERROR: unused variable: `i` -//~| HELP: try ignoring the field +//~^ ERROR unused variable: `i` +//~| HELP try ignoring the field fn main() { let s = Outer { o: Inner { i: 42 } }; let Outer { o: Inner { i: _ } } = s; - //~^ ERROR: unused variable: `i` - //~| HELP: try ignoring the field + //~^ ERROR unused variable: `i` + //~| HELP try ignoring the field } diff --git a/tests/ui/suggestions/ignore-nested-field-binding.rs b/tests/ui/suggestions/ignore-nested-field-binding.rs index 34815f9d5b905..ab978a5403d0f 100644 --- a/tests/ui/suggestions/ignore-nested-field-binding.rs +++ b/tests/ui/suggestions/ignore-nested-field-binding.rs @@ -9,12 +9,12 @@ struct Inner { i: i32 } struct Outer { o: Inner } fn foo(Outer { o: Inner { i } }: Outer) {} -//~^ ERROR: unused variable: `i` -//~| HELP: try ignoring the field +//~^ ERROR unused variable: `i` +//~| HELP try ignoring the field fn main() { let s = Outer { o: Inner { i: 42 } }; let Outer { o: Inner { i } } = s; - //~^ ERROR: unused variable: `i` - //~| HELP: try ignoring the field + //~^ ERROR unused variable: `i` + //~| HELP try ignoring the field } diff --git a/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs b/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs index c24672816acdb..71490854a7ac6 100644 --- a/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs +++ b/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs @@ -64,8 +64,8 @@ mod bay { fn use_it<'a>(val: Box + 'a>) -> &'a () { val.use_self() - //~^ ERROR: cannot return value referencing function parameter `val` - //~| ERROR: borrowed data escapes outside of function + //~^ ERROR cannot return value referencing function parameter `val` + //~| ERROR borrowed data escapes outside of function } } @@ -88,7 +88,7 @@ mod bax { fn use_it<'a>(val: Box + 'a>) -> &'a () { val.use_self() - //~^ ERROR: cannot return value referencing function parameter `val` + //~^ ERROR cannot return value referencing function parameter `val` } } diff --git a/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs b/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs index 574aea9cc6e63..e664f38f649b1 100644 --- a/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs +++ b/tests/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.rs @@ -36,7 +36,7 @@ mod bar { fn use_it<'a>(val: &'a dyn ObjectTrait) -> &'a () { val.use_self() - //~^ ERROR: borrowed data escapes + //~^ ERROR borrowed data escapes } } @@ -54,7 +54,7 @@ mod baz { fn use_it<'a>(val: &'a Box) -> &'a () { val.use_self() - //~^ ERROR: borrowed data escapes + //~^ ERROR borrowed data escapes } } diff --git a/tests/ui/suggestions/issue-102892.rs b/tests/ui/suggestions/issue-102892.rs index ac7f16f8c65b1..7427bdfca3cf4 100644 --- a/tests/ui/suggestions/issue-102892.rs +++ b/tests/ui/suggestions/issue-102892.rs @@ -9,7 +9,7 @@ struct B; fn process_without_annot(arc: &Arc<(A, B)>) { let (a, b) = **arc; // suggests putting `&**arc` here; with that, fixed! - //~^ ERROR: cannot move out of an `Arc` + //~^ ERROR cannot move out of an `Arc` } fn process_with_annot(arc: &Arc<(A, B)>) { diff --git a/tests/ui/suggestions/issue-103112.rs b/tests/ui/suggestions/issue-103112.rs index 111ae7c73080d..13ca67e8bc229 100644 --- a/tests/ui/suggestions/issue-103112.rs +++ b/tests/ui/suggestions/issue-103112.rs @@ -1,4 +1,4 @@ fn main() { std::process::abort!(); - //~^ ERROR: failed to resolve + //~^ ERROR failed to resolve } diff --git a/tests/ui/suggestions/issue-72766.rs b/tests/ui/suggestions/issue-72766.rs index b9b93f22d9cfe..c6b3fbca8d628 100644 --- a/tests/ui/suggestions/issue-72766.rs +++ b/tests/ui/suggestions/issue-72766.rs @@ -11,7 +11,7 @@ impl SadGirl { async fn async_main() -> Result<(), ()> { // should be `.call().await?` - SadGirl {}.call()?; //~ ERROR: the `?` operator can only be applied to values + SadGirl {}.call()?; //~ ERROR the `?` operator can only be applied to values Ok(()) } diff --git a/tests/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs b/tests/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs index 3c1ad85911d6c..db333cd900f79 100644 --- a/tests/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs +++ b/tests/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs @@ -12,7 +12,7 @@ trait Foo { async fn run(_: &(), foo: impl Foo) -> std::io::Result<()> { let bar = foo.bar(); assert_is_send(&bar); -//~^ ERROR: `::Bar` cannot be sent between threads safely +//~^ ERROR `::Bar` cannot be sent between threads safely Ok(()) } @@ -22,7 +22,7 @@ async fn run(_: &(), foo: impl Foo) -> std::io::Result<()> { async fn run2< >(_: &(), foo: impl Foo) -> std::io::Result<()> { let bar = foo.bar(); assert_is_send(&bar); -//~^ ERROR: `::Bar` cannot be sent between threads safely +//~^ ERROR `::Bar` cannot be sent between threads safely Ok(()) } diff --git a/tests/ui/suggestions/issue-81098.rs b/tests/ui/suggestions/issue-81098.rs index a601b5866f43e..ad90860ba1ccd 100644 --- a/tests/ui/suggestions/issue-81098.rs +++ b/tests/ui/suggestions/issue-81098.rs @@ -1,12 +1,12 @@ // Don't suggest removing a semicolon if the last statement isn't an expression with semicolon // (#81098) -fn wat() -> impl core::fmt::Display { //~ ERROR: `()` doesn't implement `std::fmt::Display` +fn wat() -> impl core::fmt::Display { //~ ERROR `()` doesn't implement `std::fmt::Display` fn why() {} } // Do it if the last statement is an expression with semicolon // (#54771) -fn ok() -> impl core::fmt::Display { //~ ERROR: `()` doesn't implement `std::fmt::Display` +fn ok() -> impl core::fmt::Display { //~ ERROR `()` doesn't implement `std::fmt::Display` 1; } diff --git a/tests/ui/suggestions/issue-82566-1.rs b/tests/ui/suggestions/issue-82566-1.rs index 95c31fbaa289a..d6eb1f5fdd4bf 100644 --- a/tests/ui/suggestions/issue-82566-1.rs +++ b/tests/ui/suggestions/issue-82566-1.rs @@ -15,7 +15,7 @@ impl T3<1, 2, 3> { } fn main() { - T1<1>::C; //~ ERROR: comparison operators cannot be chained - T2<1, 2>::C; //~ ERROR: expected one of `.`, `;`, `?`, `}`, or an operator, found `,` - T3<1, 2, 3>::C; //~ ERROR: expected one of `.`, `;`, `?`, `}`, or an operator, found `,` + T1<1>::C; //~ ERROR comparison operators cannot be chained + T2<1, 2>::C; //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `,` + T3<1, 2, 3>::C; //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `,` } diff --git a/tests/ui/suggestions/issue-82566-2.rs b/tests/ui/suggestions/issue-82566-2.rs index 80c8034bd0adf..a0d492e728f0d 100644 --- a/tests/ui/suggestions/issue-82566-2.rs +++ b/tests/ui/suggestions/issue-82566-2.rs @@ -14,17 +14,17 @@ impl Foo3 { const SUM: usize = N1 + N2 + N3; } -fn foo1() -> [(); Foo1<10>::SUM] { //~ ERROR: comparison operators cannot be chained +fn foo1() -> [(); Foo1<10>::SUM] { //~ ERROR comparison operators cannot be chained todo!() } fn foo2() -> [(); Foo2<10, 20>::SUM] { - //~^ ERROR: expected one of `.`, `?`, `]`, or an operator, found `,` + //~^ ERROR expected one of `.`, `?`, `]`, or an operator, found `,` todo!() } fn foo3() -> [(); Foo3<10, 20, 30>::SUM] { - //~^ ERROR: expected one of `.`, `?`, `]`, or an operator, found `,` + //~^ ERROR expected one of `.`, `?`, `]`, or an operator, found `,` todo!() } diff --git a/tests/ui/suggestions/issue-84973-2.rs b/tests/ui/suggestions/issue-84973-2.rs index 050cf8c64b361..6a117a7bb8e34 100644 --- a/tests/ui/suggestions/issue-84973-2.rs +++ b/tests/ui/suggestions/issue-84973-2.rs @@ -9,5 +9,5 @@ fn foo(i: T) {} fn main() { let a: i32 = 32; foo(a); - //~^ ERROR: the trait bound `i32: Tr` is not satisfied [E0277] + //~^ ERROR the trait bound `i32: Tr` is not satisfied [E0277] } diff --git a/tests/ui/suggestions/issue-84973-blacklist.rs b/tests/ui/suggestions/issue-84973-blacklist.rs index 7edf4d347af25..b50d0730ff49c 100644 --- a/tests/ui/suggestions/issue-84973-blacklist.rs +++ b/tests/ui/suggestions/issue-84973-blacklist.rs @@ -13,17 +13,17 @@ fn f_send(t: T) {} struct S; fn main() { - f_copy("".to_string()); //~ ERROR: the trait bound `String: Copy` is not satisfied [E0277] - f_clone(S); //~ ERROR: the trait bound `S: Clone` is not satisfied [E0277] + f_copy("".to_string()); //~ ERROR the trait bound `String: Copy` is not satisfied [E0277] + f_clone(S); //~ ERROR the trait bound `S: Clone` is not satisfied [E0277] f_unpin(#[coroutine] static || { yield; }); - //~^ ERROR: cannot be unpinned [E0277] + //~^ ERROR cannot be unpinned [E0277] let cl = || (); let ref_cl: &dyn Fn() -> () = &cl; f_sized(*ref_cl); - //~^ ERROR: the size for values of type `dyn Fn()` cannot be known at compilation time [E0277] + //~^ ERROR the size for values of type `dyn Fn()` cannot be known at compilation time [E0277] use std::rc::Rc; let rc = Rc::new(0); - f_send(rc); //~ ERROR: `Rc<{integer}>` cannot be sent between threads safely [E0277] + f_send(rc); //~ ERROR `Rc<{integer}>` cannot be sent between threads safely [E0277] } diff --git a/tests/ui/suggestions/issue-84973-negative.rs b/tests/ui/suggestions/issue-84973-negative.rs index f339251e57dab..821b93f3004e1 100644 --- a/tests/ui/suggestions/issue-84973-negative.rs +++ b/tests/ui/suggestions/issue-84973-negative.rs @@ -7,6 +7,6 @@ fn bar(t: T) {} fn main() { let a = 0i32; let b = 0.0f32; - bar(a); //~ ERROR: the trait bound `i32: Tr` is not satisfied [E0277] - bar(b); //~ ERROR: the trait bound `f32: Tr` is not satisfied [E0277] + bar(a); //~ ERROR the trait bound `i32: Tr` is not satisfied [E0277] + bar(b); //~ ERROR the trait bound `f32: Tr` is not satisfied [E0277] } diff --git a/tests/ui/suggestions/issue-84973.rs b/tests/ui/suggestions/issue-84973.rs index 42468478ed9a2..b2499cad93873 100644 --- a/tests/ui/suggestions/issue-84973.rs +++ b/tests/ui/suggestions/issue-84973.rs @@ -4,7 +4,7 @@ fn main() { let f = Fancy{}; let o = Other::new(f); - //~^ ERROR: the trait bound `Fancy: SomeTrait` is not satisfied [E0277] + //~^ ERROR the trait bound `Fancy: SomeTrait` is not satisfied [E0277] } struct Fancy {} diff --git a/tests/ui/suggestions/issue-86100-tuple-paren-comma.rs b/tests/ui/suggestions/issue-86100-tuple-paren-comma.rs index fa9d1a88928cd..6e620ea34bd1c 100644 --- a/tests/ui/suggestions/issue-86100-tuple-paren-comma.rs +++ b/tests/ui/suggestions/issue-86100-tuple-paren-comma.rs @@ -7,19 +7,19 @@ struct S { _s: (String,) } fn main() { let _x: (i32,) = (5); - //~^ ERROR: mismatched types [E0308] - //~| HELP: use a trailing comma to create a tuple with one element + //~^ ERROR mismatched types [E0308] + //~| HELP use a trailing comma to create a tuple with one element foo((Some(3))); - //~^ ERROR: mismatched types [E0308] - //~| HELP: use a trailing comma to create a tuple with one element + //~^ ERROR mismatched types [E0308] + //~| HELP use a trailing comma to create a tuple with one element let _s = S { _s: ("abc".to_string()) }; - //~^ ERROR: mismatched types [E0308] - //~| HELP: use a trailing comma to create a tuple with one element + //~^ ERROR mismatched types [E0308] + //~| HELP use a trailing comma to create a tuple with one element // Do not issue the suggestion if the found type is already a tuple. let t = (1, 2); let _x: (i32,) = (t); - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] } diff --git a/tests/ui/suggestions/issue-86667.rs b/tests/ui/suggestions/issue-86667.rs index 1f37e9a5f6de3..e20dd88508fe6 100644 --- a/tests/ui/suggestions/issue-86667.rs +++ b/tests/ui/suggestions/issue-86667.rs @@ -4,12 +4,12 @@ //@ compile-flags: --edition 2018 async fn a(s1: &str, s2: &str) -> &str { - //~^ ERROR: missing lifetime specifier [E0106] + //~^ ERROR missing lifetime specifier [E0106] s1 } fn b(s1: &str, s2: &str) -> &str { - //~^ ERROR: missing lifetime specifier [E0106] + //~^ ERROR missing lifetime specifier [E0106] s1 } diff --git a/tests/ui/suggestions/many-type-ascription.rs b/tests/ui/suggestions/many-type-ascription.rs index cc2406d6690e3..e5cf1cf7b201d 100644 --- a/tests/ui/suggestions/many-type-ascription.rs +++ b/tests/ui/suggestions/many-type-ascription.rs @@ -1,4 +1,4 @@ fn main() { - let _ = 0: i32; //~ ERROR: expected one of + let _ = 0: i32; //~ ERROR expected one of let _ = 0: i32; // (error only emitted once) } diff --git a/tests/ui/suggestions/missing-impl-trait-block-but-not-ascii.rs b/tests/ui/suggestions/missing-impl-trait-block-but-not-ascii.rs index ddb6bd1e90209..3a2fd2296854f 100644 --- a/tests/ui/suggestions/missing-impl-trait-block-but-not-ascii.rs +++ b/tests/ui/suggestions/missing-impl-trait-block-but-not-ascii.rs @@ -6,8 +6,8 @@ trait T { fn f(); } impl T for S; -//~^ ERROR: unknown start of token -//~| ERROR: expected `{}` -//~| ERROR: not all trait items implemented, missing: `f` +//~^ ERROR unknown start of token +//~| ERROR expected `{}` +//~| ERROR not all trait items implemented, missing: `f` fn main() {} diff --git a/tests/ui/suggestions/multibyte-escapes.rs b/tests/ui/suggestions/multibyte-escapes.rs index c4105186244db..b482c5a791d1c 100644 --- a/tests/ui/suggestions/multibyte-escapes.rs +++ b/tests/ui/suggestions/multibyte-escapes.rs @@ -2,17 +2,17 @@ fn main() { b'µ'; - //~^ ERROR: non-ASCII character in byte literal - //~| HELP: if you meant to use the unicode code point for 'µ', use a \xHH escape - //~| NOTE: must be ASCII + //~^ ERROR non-ASCII character in byte literal + //~| HELP if you meant to use the unicode code point for 'µ', use a \xHH escape + //~| NOTE must be ASCII b'字'; - //~^ ERROR: non-ASCII character in byte literal - //~| NOTE: this multibyte character does not fit into a single byte - //~| NOTE: must be ASCII + //~^ ERROR non-ASCII character in byte literal + //~| NOTE this multibyte character does not fit into a single byte + //~| NOTE must be ASCII b"字"; - //~^ ERROR: non-ASCII character in byte string literal - //~| HELP: if you meant to use the UTF-8 encoding of '字', use \xHH escapes - //~| NOTE: must be ASCII + //~^ ERROR non-ASCII character in byte string literal + //~| HELP if you meant to use the UTF-8 encoding of '字', use \xHH escapes + //~| NOTE must be ASCII } diff --git a/tests/ui/suggestions/option-content-move2.rs b/tests/ui/suggestions/option-content-move2.rs index b0104d9bafb79..532a6168ffc9c 100644 --- a/tests/ui/suggestions/option-content-move2.rs +++ b/tests/ui/suggestions/option-content-move2.rs @@ -9,7 +9,7 @@ fn foo() { func(|| { // Shouldn't suggest `move ||.as_ref()` here move || { - //~^ ERROR: cannot move out of `var` + //~^ ERROR cannot move out of `var` var = Some(NotCopyable); } }); @@ -19,7 +19,7 @@ fn bar() { func(|| { // Shouldn't suggest `move ||.as_ref()` nor to `clone()` here move || { - //~^ ERROR: cannot move out of `var` + //~^ ERROR cannot move out of `var` var = Some(NotCopyableButCloneable); } }); diff --git a/tests/ui/suggestions/pattern-slice-vec.fixed b/tests/ui/suggestions/pattern-slice-vec.fixed index b49c33e0b708e..443a83b6e6031 100644 --- a/tests/ui/suggestions/pattern-slice-vec.fixed +++ b/tests/ui/suggestions/pattern-slice-vec.fixed @@ -6,26 +6,26 @@ fn main() { fn foo() -> Vec { vec![1, 2, 3] } if let [_, _, _] = foo()[..] {} - //~^ ERROR: expected an array or slice - //~| HELP: consider slicing here + //~^ ERROR expected an array or slice + //~| HELP consider slicing here if let [] = &foo()[..] {} - //~^ ERROR: expected an array or slice - //~| HELP: consider slicing here + //~^ ERROR expected an array or slice + //~| HELP consider slicing here if let [] = foo()[..] {} - //~^ ERROR: expected an array or slice - //~| HELP: consider slicing here + //~^ ERROR expected an array or slice + //~| HELP consider slicing here let v = vec![]; match &v[..] { - //~^ HELP: consider slicing here + //~^ HELP consider slicing here [5] => {} - //~^ ERROR: expected an array or slice + //~^ ERROR expected an array or slice _ => {} } let [..] = vec![1, 2, 3][..]; - //~^ ERROR: expected an array or slice - //~| HELP: consider slicing here + //~^ ERROR expected an array or slice + //~| HELP consider slicing here } diff --git a/tests/ui/suggestions/pattern-slice-vec.rs b/tests/ui/suggestions/pattern-slice-vec.rs index 2c4b115973fe7..38928dd6b39f3 100644 --- a/tests/ui/suggestions/pattern-slice-vec.rs +++ b/tests/ui/suggestions/pattern-slice-vec.rs @@ -6,26 +6,26 @@ fn main() { fn foo() -> Vec { vec![1, 2, 3] } if let [_, _, _] = foo() {} - //~^ ERROR: expected an array or slice - //~| HELP: consider slicing here + //~^ ERROR expected an array or slice + //~| HELP consider slicing here if let [] = &foo() {} - //~^ ERROR: expected an array or slice - //~| HELP: consider slicing here + //~^ ERROR expected an array or slice + //~| HELP consider slicing here if let [] = foo() {} - //~^ ERROR: expected an array or slice - //~| HELP: consider slicing here + //~^ ERROR expected an array or slice + //~| HELP consider slicing here let v = vec![]; match &v { - //~^ HELP: consider slicing here + //~^ HELP consider slicing here [5] => {} - //~^ ERROR: expected an array or slice + //~^ ERROR expected an array or slice _ => {} } let [..] = vec![1, 2, 3]; - //~^ ERROR: expected an array or slice - //~| HELP: consider slicing here + //~^ ERROR expected an array or slice + //~| HELP consider slicing here } diff --git a/tests/ui/suggestions/private-field.rs b/tests/ui/suggestions/private-field.rs index 47e1859cd2b0f..80e4210929b45 100644 --- a/tests/ui/suggestions/private-field.rs +++ b/tests/ui/suggestions/private-field.rs @@ -4,7 +4,7 @@ pub struct S { } pub fn test(s: S) { - dbg!(s.cap) //~ ERROR: no field `cap` on type `S` [E0609] + dbg!(s.cap) //~ ERROR no field `cap` on type `S` [E0609] } pub(crate) mod string { diff --git a/tests/ui/suggestions/range-index-instead-of-colon.rs b/tests/ui/suggestions/range-index-instead-of-colon.rs index 0594d4f4c9cf7..b9a17e93c267a 100644 --- a/tests/ui/suggestions/range-index-instead-of-colon.rs +++ b/tests/ui/suggestions/range-index-instead-of-colon.rs @@ -2,6 +2,6 @@ fn main() { &[1, 2, 3][1:2]; - //~^ ERROR: expected one of - //~| HELP: you might have meant a range expression + //~^ ERROR expected one of + //~| HELP you might have meant a range expression } diff --git a/tests/ui/suggestions/raw-byte-string-prefix.rs b/tests/ui/suggestions/raw-byte-string-prefix.rs index 2d339898a48ae..2e4b61afc7a9e 100644 --- a/tests/ui/suggestions/raw-byte-string-prefix.rs +++ b/tests/ui/suggestions/raw-byte-string-prefix.rs @@ -4,7 +4,7 @@ fn main() { rb"abc"; - //~^ ERROR: prefix `rb` is unknown - //~| HELP: use `br` for a raw byte string - //~| ERROR: expected one of + //~^ ERROR prefix `rb` is unknown + //~| HELP use `br` for a raw byte string + //~| ERROR expected one of } diff --git a/tests/ui/suggestions/sugg-else-for-closure.fixed b/tests/ui/suggestions/sugg-else-for-closure.fixed index f701c40379942..13f0fdbce7f20 100644 --- a/tests/ui/suggestions/sugg-else-for-closure.fixed +++ b/tests/ui/suggestions/sugg-else-for-closure.fixed @@ -4,5 +4,5 @@ fn main() { let x = "com.example.app"; let y: Option<&str> = None; let _s = y.unwrap_or_else(|| x.split('.').nth(1).unwrap()); - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] } diff --git a/tests/ui/suggestions/sugg-else-for-closure.rs b/tests/ui/suggestions/sugg-else-for-closure.rs index d97467e4d3e3f..ed74f87d8fa9f 100644 --- a/tests/ui/suggestions/sugg-else-for-closure.rs +++ b/tests/ui/suggestions/sugg-else-for-closure.rs @@ -4,5 +4,5 @@ fn main() { let x = "com.example.app"; let y: Option<&str> = None; let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap()); - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] } diff --git a/tests/ui/suggestions/try-operator-dont-suggest-semicolon.rs b/tests/ui/suggestions/try-operator-dont-suggest-semicolon.rs index f882a159f9834..3599ca6f89be6 100644 --- a/tests/ui/suggestions/try-operator-dont-suggest-semicolon.rs +++ b/tests/ui/suggestions/try-operator-dont-suggest-semicolon.rs @@ -4,21 +4,21 @@ fn main() -> Result<(), ()> { a(|| { b() - //~^ ERROR: mismatched types [E0308] - //~| NOTE: expected `()`, found `i32` - //~| HELP: consider using a semicolon here + //~^ ERROR mismatched types [E0308] + //~| NOTE expected `()`, found `i32` + //~| HELP consider using a semicolon here })?; // Here, we do want to suggest a semicolon: let x = Ok(42); if true { - //~^ NOTE: expected this to be `()` + //~^ NOTE expected this to be `()` x? - //~^ ERROR: mismatched types [E0308] - //~| NOTE: expected `()`, found integer - //~| HELP: consider using a semicolon here + //~^ ERROR mismatched types [E0308] + //~| NOTE expected `()`, found integer + //~| HELP consider using a semicolon here } - //~^ HELP: consider using a semicolon here + //~^ HELP consider using a semicolon here Ok(()) } diff --git a/tests/ui/suggestions/try-removing-the-field.rs b/tests/ui/suggestions/try-removing-the-field.rs index dc1bde082c4f1..b7fae88b421d0 100644 --- a/tests/ui/suggestions/try-removing-the-field.rs +++ b/tests/ui/suggestions/try-removing-the-field.rs @@ -10,7 +10,7 @@ struct Foo { fn use_foo(x: Foo) -> i32 { let Foo { foo, bar, .. } = x; //~ WARNING unused variable: `bar` - //~| help: try removing the field + //~| help try removing the field return foo; } @@ -18,13 +18,13 @@ fn use_foo(x: Foo) -> i32 { fn use_match(x: Foo) { match x { Foo { foo: unused, .. } => { //~ WARNING unused variable - //~| help: if this is intentional, prefix it with an underscore + //~| help if this is intentional, prefix it with an underscore } } match x { Foo { foo, .. } => { //~ WARNING unused variable - //~| help: try removing the field + //~| help try removing the field } } } diff --git a/tests/ui/suggestions/type-mismatch-byte-literal.rs b/tests/ui/suggestions/type-mismatch-byte-literal.rs index 80cd2ca7dfc9a..f750cefe3937f 100644 --- a/tests/ui/suggestions/type-mismatch-byte-literal.rs +++ b/tests/ui/suggestions/type-mismatch-byte-literal.rs @@ -5,26 +5,26 @@ fn foo(_t: u8) {} fn main() { let _x: u8 = 'X'; - //~^ ERROR: mismatched types [E0308] - //~| HELP: if you meant to write a byte literal, prefix with `b` + //~^ ERROR mismatched types [E0308] + //~| HELP if you meant to write a byte literal, prefix with `b` foo('#'); - //~^ ERROR: mismatched types [E0308] - //~| HELP: if you meant to write a byte literal, prefix with `b` + //~^ ERROR mismatched types [E0308] + //~| HELP if you meant to write a byte literal, prefix with `b` let _a: u8 = '\x20'; - //~^ ERROR: mismatched types [E0308] - //~| HELP: if you meant to write a byte literal, prefix with `b` + //~^ ERROR mismatched types [E0308] + //~| HELP if you meant to write a byte literal, prefix with `b` // Do not issue the suggestion if the char literal is a Unicode escape foo('\u{0080}'); - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] // Do not issue the suggestion if the char literal isn't ASCII let _t: u8 = '€'; - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] // Do not issue the suggestion if the char literal isn't ASCII foo('\u{1f980}'); - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] } diff --git a/tests/ui/suggestions/unnamable-types.rs b/tests/ui/suggestions/unnamable-types.rs index 094584ff850b3..4000b23cc7047 100644 --- a/tests/ui/suggestions/unnamable-types.rs +++ b/tests/ui/suggestions/unnamable-types.rs @@ -4,36 +4,36 @@ #![feature(coroutines, stmt_expr_attributes)] const A = 5; -//~^ ERROR: missing type for `const` item -//~| HELP: provide a type for the constant +//~^ ERROR missing type for `const` item +//~| HELP provide a type for the constant static B: _ = "abc"; -//~^ ERROR: the placeholder `_` is not allowed within types on item signatures for static variables -//~| NOTE: not allowed in type signatures -//~| HELP: replace this with a fully-specified type +//~^ ERROR the placeholder `_` is not allowed within types on item signatures for static variables +//~| NOTE not allowed in type signatures +//~| HELP replace this with a fully-specified type // FIXME: this should also suggest a function pointer, as the closure is non-capturing const C: _ = || 42; -//~^ ERROR: the placeholder `_` is not allowed within types on item signatures for constants -//~| NOTE: not allowed in type signatures -//~| NOTE: however, the inferred type +//~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants +//~| NOTE not allowed in type signatures +//~| NOTE however, the inferred type struct S { t: T } const D = S { t: { let i = 0; move || -> i32 { i } } }; -//~^ ERROR: missing type for `const` item -//~| NOTE: however, the inferred type +//~^ ERROR missing type for `const` item +//~| NOTE however, the inferred type fn foo() -> i32 { 42 } const E = foo; -//~^ ERROR: missing type for `const` item -//~| HELP: provide a type for the constant +//~^ ERROR missing type for `const` item +//~| HELP provide a type for the constant const F = S { t: foo }; -//~^ ERROR: missing type for `const` item -//~| HELP: provide a type for the constant +//~^ ERROR missing type for `const` item +//~| HELP provide a type for the constant const G = #[coroutine] || -> i32 { yield 0; return 1; }; -//~^ ERROR: missing type for `const` item -//~| NOTE: however, the inferred type +//~^ ERROR missing type for `const` item +//~| NOTE however, the inferred type diff --git a/tests/ui/svh/changing-crates.rs b/tests/ui/svh/changing-crates.rs index 39a6473c8d916..22d5c468ca9ac 100644 --- a/tests/ui/svh/changing-crates.rs +++ b/tests/ui/svh/changing-crates.rs @@ -5,6 +5,6 @@ //@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2" extern crate a; -extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on +extern crate b; //~ ERROR found possibly newer version of crate `a` which `b` depends on fn main() {} diff --git a/tests/ui/svh/svh-change-lit.rs b/tests/ui/svh/svh-change-lit.rs index 66f739e144efd..b1de2fb6916eb 100644 --- a/tests/ui/svh/svh-change-lit.rs +++ b/tests/ui/svh/svh-change-lit.rs @@ -5,7 +5,7 @@ //@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2" extern crate a; -extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on +extern crate b; //~ ERROR found possibly newer version of crate `a` which `b` depends on fn main() { b::foo() diff --git a/tests/ui/svh/svh-change-significant-cfg.rs b/tests/ui/svh/svh-change-significant-cfg.rs index 9e736788d1389..dc516479fe6d4 100644 --- a/tests/ui/svh/svh-change-significant-cfg.rs +++ b/tests/ui/svh/svh-change-significant-cfg.rs @@ -5,7 +5,7 @@ //@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2" extern crate a; -extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on +extern crate b; //~ ERROR found possibly newer version of crate `a` which `b` depends on fn main() { b::foo() diff --git a/tests/ui/svh/svh-change-trait-bound.rs b/tests/ui/svh/svh-change-trait-bound.rs index 1e0fa15b94a06..ba7835270fdd7 100644 --- a/tests/ui/svh/svh-change-trait-bound.rs +++ b/tests/ui/svh/svh-change-trait-bound.rs @@ -5,7 +5,7 @@ //@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2" extern crate a; -extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on +extern crate b; //~ ERROR found possibly newer version of crate `a` which `b` depends on fn main() { b::foo() diff --git a/tests/ui/svh/svh-change-type-arg.rs b/tests/ui/svh/svh-change-type-arg.rs index f275a38acc48f..6ace52df8305f 100644 --- a/tests/ui/svh/svh-change-type-arg.rs +++ b/tests/ui/svh/svh-change-type-arg.rs @@ -5,7 +5,7 @@ //@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2" extern crate a; -extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on +extern crate b; //~ ERROR found possibly newer version of crate `a` which `b` depends on fn main() { b::foo() diff --git a/tests/ui/svh/svh-change-type-ret.rs b/tests/ui/svh/svh-change-type-ret.rs index 76118dc9f6968..4c52bfee6b87c 100644 --- a/tests/ui/svh/svh-change-type-ret.rs +++ b/tests/ui/svh/svh-change-type-ret.rs @@ -5,7 +5,7 @@ //@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2" extern crate a; -extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on +extern crate b; //~ ERROR found possibly newer version of crate `a` which `b` depends on fn main() { b::foo() diff --git a/tests/ui/svh/svh-change-type-static.rs b/tests/ui/svh/svh-change-type-static.rs index 6a658ca36dc91..239a2c513058e 100644 --- a/tests/ui/svh/svh-change-type-static.rs +++ b/tests/ui/svh/svh-change-type-static.rs @@ -5,7 +5,7 @@ //@ normalize-stderr: "(crate `(\w+)`:) .*" -> "$1 $$PATH_$2" extern crate a; -extern crate b; //~ ERROR: found possibly newer version of crate `a` which `b` depends on +extern crate b; //~ ERROR found possibly newer version of crate `a` which `b` depends on fn main() { b::foo() diff --git a/tests/ui/svh/svh-use-trait.rs b/tests/ui/svh/svh-use-trait.rs index 4791bfb500661..def6158083c39 100644 --- a/tests/ui/svh/svh-use-trait.rs +++ b/tests/ui/svh/svh-use-trait.rs @@ -10,7 +10,7 @@ //! resolution. extern crate uta; -extern crate utb; //~ ERROR: found possibly newer version of crate `uta` which `utb` depends +extern crate utb; //~ ERROR found possibly newer version of crate `uta` which `utb` depends fn main() { utb::foo() diff --git a/tests/ui/tag-type-args.rs b/tests/ui/tag-type-args.rs index 75a54927443f2..ae41da18bf0f4 100644 --- a/tests/ui/tag-type-args.rs +++ b/tests/ui/tag-type-args.rs @@ -1,5 +1,5 @@ enum Quux { Bar } -//~^ ERROR: parameter `T` is never used +//~^ ERROR parameter `T` is never used fn foo(c: Quux) { assert!((false)); } //~ ERROR missing generics for enum `Quux` diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-attribute.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-attribute.rs index 215e64979f736..3c3bfabe05562 100644 --- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-attribute.rs +++ b/tests/ui/target-feature/forbidden-hardfloat-target-feature-attribute.rs @@ -8,5 +8,5 @@ pub trait Sized {} #[target_feature(enable = "d")] -//~^ERROR: cannot be enabled with +//~^ERROR cannot be enabled with pub unsafe fn my_fun() {} diff --git a/tests/ui/target-feature/forbidden-target-feature-attribute.rs b/tests/ui/target-feature/forbidden-target-feature-attribute.rs index 6bb6f8aaffb6f..19114a6d90054 100644 --- a/tests/ui/target-feature/forbidden-target-feature-attribute.rs +++ b/tests/ui/target-feature/forbidden-target-feature-attribute.rs @@ -8,5 +8,5 @@ pub trait Sized {} #[target_feature(enable = "forced-atomics")] -//~^ERROR: cannot be enabled with +//~^ERROR cannot be enabled with pub unsafe fn my_fun() {} diff --git a/tests/ui/target-feature/gate.rs b/tests/ui/target-feature/gate.rs index 14fdad02f5665..eae04c4de8846 100644 --- a/tests/ui/target-feature/gate.rs +++ b/tests/ui/target-feature/gate.rs @@ -28,7 +28,7 @@ // gate-test-m68k_target_feature #[target_feature(enable = "avx512bw")] -//~^ ERROR: currently unstable +//~^ ERROR currently unstable unsafe fn foo() {} fn main() {} diff --git a/tests/ui/target-feature/invalid-attribute.rs b/tests/ui/target-feature/invalid-attribute.rs index 9ef7a686d253d..d3919bee977da 100644 --- a/tests/ui/target-feature/invalid-attribute.rs +++ b/tests/ui/target-feature/invalid-attribute.rs @@ -67,7 +67,7 @@ trait Baz {} //~^ NOTE not a function #[inline(always)] -//~^ ERROR: cannot use `#[inline(always)]` +//~^ ERROR cannot use `#[inline(always)]` #[target_feature(enable = "sse2")] unsafe fn test() {} @@ -90,7 +90,7 @@ impl Foo {} trait Quux { fn foo(); //~ NOTE `foo` from trait - //~^ NOTE: type in trait + //~^ NOTE type in trait } impl Quux for Foo { @@ -99,9 +99,9 @@ impl Quux for Foo { //~| NOTE cannot be applied to safe trait method fn foo() {} //~^ NOTE not an `unsafe` function - //~| ERROR: incompatible type for trait - //~| NOTE: expected safe fn, found unsafe fn - //~| NOTE: expected signature `fn()` + //~| ERROR incompatible type for trait + //~| NOTE expected safe fn, found unsafe fn + //~| NOTE expected signature `fn()` } fn main() { diff --git a/tests/ui/test-attrs/test-on-not-fn.rs b/tests/ui/test-attrs/test-on-not-fn.rs index deba26f24ca71..d8ad6f388f16d 100644 --- a/tests/ui/test-attrs/test-on-not-fn.rs +++ b/tests/ui/test-attrs/test-on-not-fn.rs @@ -1,9 +1,9 @@ //@ compile-flags: --test -#[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function +#[test] //~ ERROR the `#[test]` attribute may only be used on a non-associated function mod test {} -#[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function +#[test] //~ ERROR the `#[test]` attribute may only be used on a non-associated function mod loooooooooooooong_teeeeeeeeeest { /* this is a comment @@ -17,37 +17,37 @@ mod loooooooooooooong_teeeeeeeeeest { */ } -#[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function +#[test] //~ ERROR the `#[test]` attribute may only be used on a non-associated function extern "C" {} -#[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function +#[test] //~ ERROR the `#[test]` attribute may only be used on a non-associated function trait Foo {} -#[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function +#[test] //~ ERROR the `#[test]` attribute may only be used on a non-associated function impl Foo for i32 {} -#[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function +#[test] //~ ERROR the `#[test]` attribute may only be used on a non-associated function const FOO: i32 = -1_i32; -#[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function +#[test] //~ ERROR the `#[test]` attribute may only be used on a non-associated function static BAR: u64 = 10_000_u64; -#[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function +#[test] //~ ERROR the `#[test]` attribute may only be used on a non-associated function enum MyUnit { Unit, } -#[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function +#[test] //~ ERROR the `#[test]` attribute may only be used on a non-associated function struct NewI32(i32); -#[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function +#[test] //~ ERROR the `#[test]` attribute may only be used on a non-associated function union Spooky { x: i32, y: u32, } #[repr(C, align(64))] -#[test] //~ ERROR: the `#[test]` attribute may only be used on a non-associated function +#[test] //~ ERROR the `#[test]` attribute may only be used on a non-associated function #[derive(Copy, Clone, Debug)] struct MoreAttrs { a: i32, @@ -58,7 +58,7 @@ macro_rules! foo { () => {}; } -#[test] //~ WARN: the `#[test]` attribute may only be used on a non-associated function +#[test] //~ WARN the `#[test]` attribute may only be used on a non-associated function foo!(); // make sure it doesn't erroneously trigger on a real test diff --git a/tests/ui/test-attrs/test-should-panic-attr.rs b/tests/ui/test-attrs/test-should-panic-attr.rs index df2893b63edbc..939b65b79c0a0 100644 --- a/tests/ui/test-attrs/test-should-panic-attr.rs +++ b/tests/ui/test-attrs/test-should-panic-attr.rs @@ -9,28 +9,28 @@ fn test1() { #[test] #[should_panic(expected)] -//~^ WARN: argument must be of the form: +//~^ WARN argument must be of the form: fn test2() { panic!(); } #[test] #[should_panic(expect)] -//~^ WARN: argument must be of the form: +//~^ WARN argument must be of the form: fn test3() { panic!(); } #[test] #[should_panic(expected(foo, bar))] -//~^ WARN: argument must be of the form: +//~^ WARN argument must be of the form: fn test4() { panic!(); } #[test] #[should_panic(expected = "foo", bar)] -//~^ WARN: argument must be of the form: +//~^ WARN argument must be of the form: fn test5() { panic!(); } diff --git a/tests/ui/test-attrs/test-warns-dead-code.rs b/tests/ui/test-attrs/test-warns-dead-code.rs index faa7306eee5e1..1a53eb9be9a76 100644 --- a/tests/ui/test-attrs/test-warns-dead-code.rs +++ b/tests/ui/test-attrs/test-warns-dead-code.rs @@ -2,6 +2,6 @@ #![deny(dead_code)] -fn dead() {} //~ error: function `dead` is never used +fn dead() {} //~ error function `dead` is never used fn main() {} diff --git a/tests/ui/tool-attributes/tool_lints-fail.rs b/tests/ui/tool-attributes/tool_lints-fail.rs index 5cbd63be597fa..928434c3fb89f 100644 --- a/tests/ui/tool-attributes/tool_lints-fail.rs +++ b/tests/ui/tool-attributes/tool_lints-fail.rs @@ -3,6 +3,6 @@ #![deny(unknown_lints)] -#![deny(clippy)] //~ ERROR: unknown lint: `clippy` +#![deny(clippy)] //~ ERROR unknown lint: `clippy` fn main() {} diff --git a/tests/ui/trait-bounds/suggest-maybe-sized-bound.rs b/tests/ui/trait-bounds/suggest-maybe-sized-bound.rs index 15aa27349aa91..cd7b334f843ab 100644 --- a/tests/ui/trait-bounds/suggest-maybe-sized-bound.rs +++ b/tests/ui/trait-bounds/suggest-maybe-sized-bound.rs @@ -6,7 +6,7 @@ fn main() { struct StructB { a: StructA, - //~^ ERROR: the size for values of type `[u8]` cannot be known at compilation time [E0277] + //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time [E0277] } trait Trait { @@ -15,6 +15,6 @@ fn main() { impl Trait for () { type P = [u8]; - //~^ ERROR: the size for values of type `[u8]` cannot be known at compilation time [E0277] + //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time [E0277] } } diff --git a/tests/ui/traits/alias/infinite_normalization.rs b/tests/ui/traits/alias/infinite_normalization.rs index 848afc1efb23a..8990f201b4662 100644 --- a/tests/ui/traits/alias/infinite_normalization.rs +++ b/tests/ui/traits/alias/infinite_normalization.rs @@ -6,6 +6,6 @@ #![feature(trait_alias)] fn foo>() {} trait Baz = Baz>; -//~^ ERROR: cycle detected when computing the implied predicates of `Baz` +//~^ ERROR cycle detected when computing the implied predicates of `Baz` fn main() {} diff --git a/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.fixed b/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.fixed index aa5ec17a28d79..debf0ecdccda6 100644 --- a/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.fixed +++ b/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.fixed @@ -8,6 +8,6 @@ trait Strings = Iterator; struct Struct(S); -//~^ ERROR: expected trait, found type alias `Strings` +//~^ ERROR expected trait, found type alias `Strings` fn main() {} diff --git a/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.rs b/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.rs index 5ed8bc84e0da1..8a2895c62db57 100644 --- a/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.rs +++ b/tests/ui/traits/alias/suggest-trait-alias-instead-of-type.rs @@ -8,6 +8,6 @@ type Strings = Iterator; struct Struct(S); -//~^ ERROR: expected trait, found type alias `Strings` +//~^ ERROR expected trait, found type alias `Strings` fn main() {} diff --git a/tests/ui/traits/bound/on-structs-and-enums-static.rs b/tests/ui/traits/bound/on-structs-and-enums-static.rs index d734893dd7c96..b370e39c49375 100644 --- a/tests/ui/traits/bound/on-structs-and-enums-static.rs +++ b/tests/ui/traits/bound/on-structs-and-enums-static.rs @@ -9,7 +9,7 @@ struct Foo { static X: Foo = Foo { //~^ ERROR E0277 //~| ERROR E0277 - x: 1, //~ ERROR: E0277 + x: 1, //~ ERROR E0277 }; fn main() { diff --git a/tests/ui/traits/bound/unknown-assoc-with-const-arg.rs b/tests/ui/traits/bound/unknown-assoc-with-const-arg.rs index 0da68afb59261..2d529896736a1 100644 --- a/tests/ui/traits/bound/unknown-assoc-with-const-arg.rs +++ b/tests/ui/traits/bound/unknown-assoc-with-const-arg.rs @@ -2,17 +2,17 @@ trait X { fn a() -> T::unknown<{}> {} - //~^ ERROR: associated type `unknown` not found for `T` + //~^ ERROR associated type `unknown` not found for `T` } trait Y { fn a() -> NOT_EXIST::unknown<{}> {} - //~^ ERROR: failed to resolve: use of undeclared type `NOT_EXIST` + //~^ ERROR failed to resolve: use of undeclared type `NOT_EXIST` } trait Z { fn a() -> T::unknown<{}> {} - //~^ ERROR: associated type `unknown` not found for `T` + //~^ ERROR associated type `unknown` not found for `T` } fn main() {} diff --git a/tests/ui/traits/const-traits/call-generic-method-nonconst.rs b/tests/ui/traits/const-traits/call-generic-method-nonconst.rs index 446a74eb7b7d4..a601953543e7d 100644 --- a/tests/ui/traits/const-traits/call-generic-method-nonconst.rs +++ b/tests/ui/traits/const-traits/call-generic-method-nonconst.rs @@ -22,6 +22,6 @@ const fn equals_self(t: &T) -> bool { // it not using the impl. pub const EQ: bool = equals_self(&S); -//~^ ERROR: the trait bound `S: const Foo` is not satisfied +//~^ ERROR the trait bound `S: const Foo` is not satisfied fn main() {} diff --git a/tests/ui/traits/const-traits/const-impl-norecover.rs b/tests/ui/traits/const-traits/const-impl-norecover.rs index bed4e9fd1e610..50110e27b103e 100644 --- a/tests/ui/traits/const-traits/const-impl-norecover.rs +++ b/tests/ui/traits/const-traits/const-impl-norecover.rs @@ -2,7 +2,7 @@ struct Foo; -const impl Foo { //~ ERROR: expected identifier, found keyword +const impl Foo { //~ ERROR expected identifier, found keyword fn bar() {} } diff --git a/tests/ui/traits/const-traits/const-impl-recovery.rs b/tests/ui/traits/const-traits/const-impl-recovery.rs index 837124db04e20..d6b865c5419d4 100644 --- a/tests/ui/traits/const-traits/const-impl-recovery.rs +++ b/tests/ui/traits/const-traits/const-impl-recovery.rs @@ -3,12 +3,12 @@ #[const_trait] trait Foo {} -const impl Foo for i32 {} //~ ERROR: expected identifier, found keyword +const impl Foo for i32 {} //~ ERROR expected identifier, found keyword #[const_trait] trait Bar {} -const impl Bar for T {} //~ ERROR: expected identifier, found keyword +const impl Bar for T {} //~ ERROR expected identifier, found keyword const fn still_implements() {} diff --git a/tests/ui/traits/const-traits/const-impl-requires-const-trait.rs b/tests/ui/traits/const-traits/const-impl-requires-const-trait.rs index 6bea664b65fe6..c0eb08fd10e1b 100644 --- a/tests/ui/traits/const-traits/const-impl-requires-const-trait.rs +++ b/tests/ui/traits/const-traits/const-impl-requires-const-trait.rs @@ -4,6 +4,6 @@ pub trait A {} impl const A for () {} -//~^ ERROR: const `impl` for trait `A` which is not marked with `#[const_trait]` +//~^ ERROR const `impl` for trait `A` which is not marked with `#[const_trait]` fn main() {} diff --git a/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs b/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs index 92427039b4333..9547a04340c72 100644 --- a/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs +++ b/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs @@ -12,6 +12,6 @@ impl Foo for () { fn main() { (const || { (()).foo() })(); - //~^ ERROR: cannot call non-const method `<() as Foo>::foo` in constant functions + //~^ ERROR cannot call non-const method `<() as Foo>::foo` in constant functions // FIXME(const_trait_impl) this should probably say constant closures } diff --git a/tests/ui/traits/const-traits/cross-crate.rs b/tests/ui/traits/const-traits/cross-crate.rs index b07aa8944c05d..4cf0af4959647 100644 --- a/tests/ui/traits/const-traits/cross-crate.rs +++ b/tests/ui/traits/const-traits/cross-crate.rs @@ -17,10 +17,10 @@ fn non_const_context() { const fn const_context() { #[cfg(any(stocknc, gatednc))] NonConst.func(); - //[stocknc]~^ ERROR: cannot call - //[gatednc]~^^ ERROR: the trait bound + //[stocknc]~^ ERROR cannot call + //[gatednc]~^^ ERROR the trait bound Const.func(); - //[stock,stocknc]~^ ERROR: cannot call + //[stock,stocknc]~^ ERROR cannot call } fn main() {} diff --git a/tests/ui/traits/const-traits/gate.rs b/tests/ui/traits/const-traits/gate.rs index d1c93ab9f95af..96dc2b827ea93 100644 --- a/tests/ui/traits/const-traits/gate.rs +++ b/tests/ui/traits/const-traits/gate.rs @@ -2,7 +2,7 @@ fn main() { (const || {})(); - //~^ ERROR: const closures are experimental + //~^ ERROR const closures are experimental } macro_rules! e { diff --git a/tests/ui/traits/const-traits/issue-79450.rs b/tests/ui/traits/const-traits/issue-79450.rs index 5ba5036ce277a..5ae5200a04bf1 100644 --- a/tests/ui/traits/const-traits/issue-79450.rs +++ b/tests/ui/traits/const-traits/issue-79450.rs @@ -6,7 +6,7 @@ trait Tr { fn req(&self); fn prov(&self) { - println!("lul"); //~ ERROR: cannot call non-const function `_print` in constant functions + println!("lul"); //~ ERROR cannot call non-const function `_print` in constant functions self.req(); } } diff --git a/tests/ui/traits/const-traits/mismatched_generic_args.rs b/tests/ui/traits/const-traits/mismatched_generic_args.rs index 21e91c731b363..df351f745f749 100644 --- a/tests/ui/traits/const-traits/mismatched_generic_args.rs +++ b/tests/ui/traits/const-traits/mismatched_generic_args.rs @@ -1,5 +1,5 @@ #![feature(generic_const_exprs)] -//~^ WARN: the feature `generic_const_exprs` is incomplete +//~^ WARN the feature `generic_const_exprs` is incomplete // Regression test for #125770 which would ICE under the old effects desugaring that // created a const generic parameter for constness on `Add`. @@ -9,16 +9,16 @@ use std::ops::Add; pub struct Dimension; pub struct Quantity(S); -//~^ ERROR: `Dimension` is forbidden as the type of a const generic parameter +//~^ ERROR `Dimension` is forbidden as the type of a const generic parameter impl Add for Quantity {} -//~^ ERROR: trait takes at most 1 generic argument -//~| ERROR: `Dimension` is forbidden as the type of a const generic parameter +//~^ ERROR trait takes at most 1 generic argument +//~| ERROR `Dimension` is forbidden as the type of a const generic parameter pub fn add(x: Quantity) -> Quantity { - //~^ ERROR: `Dimension` is forbidden as the type of a const generic parameter + //~^ ERROR `Dimension` is forbidden as the type of a const generic parameter x + y - //~^ ERROR: cannot find value `y` in this scope + //~^ ERROR cannot find value `y` in this scope } fn main() {} diff --git a/tests/ui/traits/const-traits/no-explicit-const-params.rs b/tests/ui/traits/const-traits/no-explicit-const-params.rs index 76663292223b2..e26f69d48896d 100644 --- a/tests/ui/traits/const-traits/no-explicit-const-params.rs +++ b/tests/ui/traits/const-traits/no-explicit-const-params.rs @@ -13,15 +13,15 @@ impl Bar for () { fn main() { foo::(); - //~^ ERROR: function takes 0 generic arguments but 1 generic argument was supplied + //~^ ERROR function takes 0 generic arguments but 1 generic argument was supplied <() as Bar>::bar(); - //~^ ERROR: trait takes 0 generic arguments but 1 generic argument was supplied + //~^ ERROR trait takes 0 generic arguments but 1 generic argument was supplied } const FOO: () = { foo::(); - //~^ ERROR: function takes 0 generic arguments but 1 generic argument was supplied + //~^ ERROR function takes 0 generic arguments but 1 generic argument was supplied <() as Bar>::bar(); - //~^ ERROR: trait takes 0 generic arguments but 1 generic argument was supplied + //~^ ERROR trait takes 0 generic arguments but 1 generic argument was supplied //~| ERROR the trait bound `(): const Bar` is not satisfied }; diff --git a/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.rs b/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.rs index fa0f786964488..62ec83083f45b 100644 --- a/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.rs +++ b/tests/ui/traits/const-traits/non-const-op-const-closure-non-const-outer.rs @@ -11,5 +11,5 @@ impl Foo for () { fn main() { (const || { (()).foo() })(); - //~^ ERROR: cannot call non-const method + //~^ ERROR cannot call non-const method } diff --git a/tests/ui/traits/const-traits/spec-effectvar-ice.rs b/tests/ui/traits/const-traits/spec-effectvar-ice.rs index c85b174696757..d2f64dff73e91 100644 --- a/tests/ui/traits/const-traits/spec-effectvar-ice.rs +++ b/tests/ui/traits/const-traits/spec-effectvar-ice.rs @@ -8,12 +8,12 @@ trait Specialize {} trait Foo {} impl const Foo for T {} -//~^ error: const `impl` for trait `Foo` which is not marked with `#[const_trait]` +//~^ error const `impl` for trait `Foo` which is not marked with `#[const_trait]` impl const Foo for T where T: const Specialize {} -//~^ error: const `impl` for trait `Foo` which is not marked with `#[const_trait]` -//~| error: `const` can only be applied to `#[const_trait]` traits -//~| error: specialization impl does not specialize any associated items -//~| error: cannot specialize on trait `Specialize` +//~^ error const `impl` for trait `Foo` which is not marked with `#[const_trait]` +//~| error `const` can only be applied to `#[const_trait]` traits +//~| error specialization impl does not specialize any associated items +//~| error cannot specialize on trait `Specialize` fn main() {} diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.rs b/tests/ui/traits/const-traits/super-traits-fail-2.rs index 6cc9d7394767a..0eaad7be52d2a 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-2.rs +++ b/tests/ui/traits/const-traits/super-traits-fail-2.rs @@ -9,12 +9,12 @@ trait Foo { #[cfg_attr(any(yy, ny), const_trait)] trait Bar: ~const Foo {} -//[ny,nn]~^ ERROR: `~const` can only be applied to `#[const_trait]` -//[ny,nn]~| ERROR: `~const` can only be applied to `#[const_trait]` -//[ny,nn]~| ERROR: `~const` can only be applied to `#[const_trait]` -//[ny]~| ERROR: `~const` can only be applied to `#[const_trait]` -//[ny]~| ERROR: `~const` can only be applied to `#[const_trait]` -//[yn,nn]~^^^^^^ ERROR: `~const` is not allowed here +//[ny,nn]~^ ERROR `~const` can only be applied to `#[const_trait]` +//[ny,nn]~| ERROR `~const` can only be applied to `#[const_trait]` +//[ny,nn]~| ERROR `~const` can only be applied to `#[const_trait]` +//[ny]~| ERROR `~const` can only be applied to `#[const_trait]` +//[ny]~| ERROR `~const` can only be applied to `#[const_trait]` +//[yn,nn]~^^^^^^ ERROR `~const` is not allowed here const fn foo(x: &T) { x.a(); diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.rs b/tests/ui/traits/const-traits/super-traits-fail-3.rs index d7e0cdc26edd0..7cdf91a51d68b 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-3.rs +++ b/tests/ui/traits/const-traits/super-traits-fail-3.rs @@ -13,30 +13,30 @@ /// nnn: feature not enabled, Foo is not const, Bar is not const #[cfg_attr(any(yyy, yyn, nyy, nyn), const_trait)] -//[nyy,nyn]~^ ERROR: `const_trait` is a temporary placeholder for marking a trait that is suitable for `const` `impls` and all default bodies as `const`, which may be removed or renamed in the future +//[nyy,nyn]~^ ERROR `const_trait` is a temporary placeholder for marking a trait that is suitable for `const` `impls` and all default bodies as `const`, which may be removed or renamed in the future trait Foo { fn a(&self); } #[cfg_attr(any(yyy, yny, nyy, nyn), const_trait)] -//[nyy,nyn]~^ ERROR: `const_trait` is a temporary placeholder for marking a trait that is suitable for `const` `impls` and all default bodies as `const`, which may be removed or renamed in the future +//[nyy,nyn]~^ ERROR `const_trait` is a temporary placeholder for marking a trait that is suitable for `const` `impls` and all default bodies as `const`, which may be removed or renamed in the future trait Bar: ~const Foo {} -//[yny,ynn,nny,nnn]~^ ERROR: `~const` can only be applied to `#[const_trait]` -//[yny,ynn,nny,nnn]~| ERROR: `~const` can only be applied to `#[const_trait]` -//[yny,ynn,nny,nnn]~| ERROR: `~const` can only be applied to `#[const_trait]` -//[yny]~^^^^ ERROR: `~const` can only be applied to `#[const_trait]` -//[yny]~| ERROR: `~const` can only be applied to `#[const_trait]` -//[yyn,ynn,nny,nnn]~^^^^^^ ERROR: `~const` is not allowed here -//[nyy,nyn,nny,nnn]~^^^^^^^ ERROR: const trait impls are experimental +//[yny,ynn,nny,nnn]~^ ERROR `~const` can only be applied to `#[const_trait]` +//[yny,ynn,nny,nnn]~| ERROR `~const` can only be applied to `#[const_trait]` +//[yny,ynn,nny,nnn]~| ERROR `~const` can only be applied to `#[const_trait]` +//[yny]~^^^^ ERROR `~const` can only be applied to `#[const_trait]` +//[yny]~| ERROR `~const` can only be applied to `#[const_trait]` +//[yyn,ynn,nny,nnn]~^^^^^^ ERROR `~const` is not allowed here +//[nyy,nyn,nny,nnn]~^^^^^^^ ERROR const trait impls are experimental const fn foo(x: &T) { - //[yyn,ynn,nny,nnn]~^ ERROR: `~const` can only be applied to `#[const_trait]` - //[yyn,ynn,nny,nnn]~| ERROR: `~const` can only be applied to `#[const_trait]` - //[nyy,nyn,nny,nnn]~^^^ ERROR: const trait impls are experimental + //[yyn,ynn,nny,nnn]~^ ERROR `~const` can only be applied to `#[const_trait]` + //[yyn,ynn,nny,nnn]~| ERROR `~const` can only be applied to `#[const_trait]` + //[nyy,nyn,nny,nnn]~^^^ ERROR const trait impls are experimental x.a(); - //[yyn]~^ ERROR: the trait bound `T: ~const Foo` is not satisfied - //[ynn,yny,nny,nnn]~^^ ERROR: cannot call non-const method `::a` in constant functions - //[nyy,nyn]~^^^ ERROR: cannot call conditionally-const method `::a` in constant functions + //[yyn]~^ ERROR the trait bound `T: ~const Foo` is not satisfied + //[ynn,yny,nny,nnn]~^^ ERROR cannot call non-const method `::a` in constant functions + //[nyy,nyn]~^^^ ERROR cannot call conditionally-const method `::a` in constant functions } fn main() {} diff --git a/tests/ui/traits/default_auto_traits/extern-types.rs b/tests/ui/traits/default_auto_traits/extern-types.rs index 822d4c0637f07..78a9847d46ed9 100644 --- a/tests/ui/traits/default_auto_traits/extern-types.rs +++ b/tests/ui/traits/default_auto_traits/extern-types.rs @@ -42,7 +42,7 @@ mod extern_non_leak { impl !Leak for Opaque {} fn forward_extern_ty(x: &Opaque) { foo(x); - //~^ ERROR: the trait bound `extern_non_leak::Opaque: Leak` is not satisfied + //~^ ERROR the trait bound `extern_non_leak::Opaque: Leak` is not satisfied } } diff --git a/tests/ui/traits/dyn-star-drop-principal.rs b/tests/ui/traits/dyn-star-drop-principal.rs index 1ad99070339ad..f0760448af62c 100644 --- a/tests/ui/traits/dyn-star-drop-principal.rs +++ b/tests/ui/traits/dyn-star-drop-principal.rs @@ -8,5 +8,5 @@ fn main() { // We allow &dyn Trait + Send -> &dyn Send (i.e. dropping principal), // but we don't (currently?) allow the same for dyn* let x: dyn* Trait + Send = 1usize; - x as dyn* Send; //~ error: `dyn* Trait + Send` needs to have the same ABI as a pointer + x as dyn* Send; //~ error `dyn* Trait + Send` needs to have the same ABI as a pointer } diff --git a/tests/ui/traits/generic_param_mismatch_in_unsatisfied_projection.rs b/tests/ui/traits/generic_param_mismatch_in_unsatisfied_projection.rs index bf1278f992b60..20f54677438c1 100644 --- a/tests/ui/traits/generic_param_mismatch_in_unsatisfied_projection.rs +++ b/tests/ui/traits/generic_param_mismatch_in_unsatisfied_projection.rs @@ -16,7 +16,7 @@ impl Wrapper { fn do_something_wrapper(&mut self, _: F) where F: for<'a> FnOnce(>::Type), - //~^ ERROR: trait takes 0 generic arguments but 1 generic argument was supplied + //~^ ERROR trait takes 0 generic arguments but 1 generic argument was supplied { } } diff --git a/tests/ui/traits/impl-1.rs b/tests/ui/traits/impl-1.rs index d22ac72d1cc4d..aa81cdf3ef92c 100644 --- a/tests/ui/traits/impl-1.rs +++ b/tests/ui/traits/impl-1.rs @@ -12,5 +12,5 @@ impl T for i32 {} fn main() { let x = &42i32; - x.foo(); //~ERROR: no method named `foo` found + x.foo(); //~ERROR no method named `foo` found } diff --git a/tests/ui/traits/inductive-overflow/lifetime.rs b/tests/ui/traits/inductive-overflow/lifetime.rs index 2f3c90dcece60..1fe5e4f0dfbd7 100644 --- a/tests/ui/traits/inductive-overflow/lifetime.rs +++ b/tests/ui/traits/inductive-overflow/lifetime.rs @@ -16,13 +16,13 @@ struct C<'a>(&'a ()); struct X(T::P); impl NotAuto for Box {} -impl NotAuto for X where T::P: NotAuto {} //~ NOTE: required +impl NotAuto for X where T::P: NotAuto {} //~ NOTE required //~^ NOTE unsatisfied trait bound introduced here impl<'a> NotAuto for C<'a> {} fn is_send() {} -//~^ NOTE: required -//~| NOTE: required +//~^ NOTE required +//~| NOTE required fn main() { // Should only be a few notes. diff --git a/tests/ui/traits/issue-28576.rs b/tests/ui/traits/issue-28576.rs index fd026044401b6..5300591c51d7e 100644 --- a/tests/ui/traits/issue-28576.rs +++ b/tests/ui/traits/issue-28576.rs @@ -3,8 +3,8 @@ pub trait Foo { } pub trait Bar: Foo { - //~^ ERROR: the size for values of type `Self` cannot be known - //~| ERROR: the size for values of type `Self` cannot be known + //~^ ERROR the size for values of type `Self` cannot be known + //~| ERROR the size for values of type `Self` cannot be known fn new(&self, b: & dyn Bar //~ ERROR the trait `Bar` is not dyn compatible diff --git a/tests/ui/traits/issue-33140-hack-boundaries.rs b/tests/ui/traits/issue-33140-hack-boundaries.rs index 06786dcc8fe87..62b316caf579d 100644 --- a/tests/ui/traits/issue-33140-hack-boundaries.rs +++ b/tests/ui/traits/issue-33140-hack-boundaries.rs @@ -7,7 +7,7 @@ trait Trait0 {} impl Trait0 for dyn Send {} impl Trait0 for dyn Send {} -//~^ ERROR: E0119 +//~^ ERROR E0119 // Problem 1: associated types trait Trait1 { diff --git a/tests/ui/traits/issue-33140.rs b/tests/ui/traits/issue-33140.rs index 01b16f76be567..ff6e8d2f0f863 100644 --- a/tests/ui/traits/issue-33140.rs +++ b/tests/ui/traits/issue-33140.rs @@ -43,7 +43,7 @@ fn main() { assert_eq!(::uvw(), false); assert_eq!(::uvw(), true); assert_eq!(>::abc(), false); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope assert_eq!(>::abc(), true); - //~^ ERROR: multiple applicable items in scope + //~^ ERROR multiple applicable items in scope } diff --git a/tests/ui/traits/issue-72410.rs b/tests/ui/traits/issue-72410.rs index df3738e2730d9..ca576d56a82f7 100644 --- a/tests/ui/traits/issue-72410.rs +++ b/tests/ui/traits/issue-72410.rs @@ -12,7 +12,7 @@ pub trait Foo { pub trait Bar { fn map() where for<'a> &'a mut [dyn Bar]: ; - //~^ ERROR: the trait `Bar` is not dyn compatible + //~^ ERROR the trait `Bar` is not dyn compatible } fn main() {} diff --git a/tests/ui/traits/issue-78372.rs b/tests/ui/traits/issue-78372.rs index f03baf2ceca36..ec0a823895817 100644 --- a/tests/ui/traits/issue-78372.rs +++ b/tests/ui/traits/issue-78372.rs @@ -6,7 +6,7 @@ impl DispatchFromDyn> for T {} //~ ERROR cannot find type `U` //~| ERROR the trait `DispatchFromDyn` may only be implemented for a coercion between structures trait Foo: X {} trait X { - fn foo(self: Smaht); //~ ERROR: invalid `self` parameter type + fn foo(self: Smaht); //~ ERROR invalid `self` parameter type } trait Marker {} impl Marker for dyn Foo {} diff --git a/tests/ui/traits/issue-85735.rs b/tests/ui/traits/issue-85735.rs index fb387a9c90965..c268cd35f421b 100644 --- a/tests/ui/traits/issue-85735.rs +++ b/tests/ui/traits/issue-85735.rs @@ -5,7 +5,7 @@ trait Foo {} impl<'a, 'b, T> Foo for T where T: FnMut(&'a ()), - //~^ ERROR: type annotations needed + //~^ ERROR type annotations needed T: FnMut(&'b ()), { } diff --git a/tests/ui/traits/method-argument-mismatch-variance-ice-119867.rs b/tests/ui/traits/method-argument-mismatch-variance-ice-119867.rs index 4b7862abc91a9..dbfc8bec81254 100644 --- a/tests/ui/traits/method-argument-mismatch-variance-ice-119867.rs +++ b/tests/ui/traits/method-argument-mismatch-variance-ice-119867.rs @@ -6,8 +6,8 @@ struct ArchivedVec(T); impl Deserialize for ArchivedVec { fn deserialize(s: _) {} - //~^ ERROR: `_` is not allowed within types on item signatures - //~| ERROR: has a `&self` declaration in the trait, but not in the impl + //~^ ERROR `_` is not allowed within types on item signatures + //~| ERROR has a `&self` declaration in the trait, but not in the impl } fn main() {} diff --git a/tests/ui/traits/next-solver/diagnostics/alias_relate_error_uses_structurally_normalize.rs b/tests/ui/traits/next-solver/diagnostics/alias_relate_error_uses_structurally_normalize.rs index 5cea9bb74d793..da4fa30851aa7 100644 --- a/tests/ui/traits/next-solver/diagnostics/alias_relate_error_uses_structurally_normalize.rs +++ b/tests/ui/traits/next-solver/diagnostics/alias_relate_error_uses_structurally_normalize.rs @@ -22,7 +22,7 @@ fn bar>(_: T) {} fn main() { let foo = Foo(Default::default()); bar(foo); - //~^ ERROR: type mismatch resolving ` as Trait>::Assoc == u32` + //~^ ERROR type mismatch resolving ` as Trait>::Assoc == u32` // Here diagnostics would manually construct a ` as Trait>::Assoc normalizes-to ?x` goal // which would return a nested goal of `?y: Sized` from the impl. } diff --git a/tests/ui/traits/next-solver/diagnostics/dont-pick-fnptr-bound-as-leaf.rs b/tests/ui/traits/next-solver/diagnostics/dont-pick-fnptr-bound-as-leaf.rs index 995f2c9fbeed3..a795b0d2ce8c9 100644 --- a/tests/ui/traits/next-solver/diagnostics/dont-pick-fnptr-bound-as-leaf.rs +++ b/tests/ui/traits/next-solver/diagnostics/dont-pick-fnptr-bound-as-leaf.rs @@ -17,12 +17,12 @@ impl Trait for T {} struct Foo; fn requires_trait(_: T) {} -//~^ NOTE: required by a bound in `requires_trait` -//~| NOTE: required by this bound in `requires_trait` +//~^ NOTE required by a bound in `requires_trait` +//~| NOTE required by this bound in `requires_trait` fn main() { requires_trait(Foo); - //~^ ERROR: the trait bound `Foo: Trait` is not satisfied - //~| NOTE: the trait `Trait` is not implemented for `Foo` - //~| NOTE: required by a bound introduced by this call + //~^ ERROR the trait bound `Foo: Trait` is not satisfied + //~| NOTE the trait `Trait` is not implemented for `Foo` + //~| NOTE required by a bound introduced by this call } diff --git a/tests/ui/traits/next-solver/fn-trait.rs b/tests/ui/traits/next-solver/fn-trait.rs index 7994dd3052c40..bebd44a3656b7 100644 --- a/tests/ui/traits/next-solver/fn-trait.rs +++ b/tests/ui/traits/next-solver/fn-trait.rs @@ -18,11 +18,11 @@ fn main() { require_fn(f); require_fn(f as fn() -> i32); require_fn(f as unsafe fn() -> i32); - //~^ ERROR: expected a `Fn()` closure, found `unsafe fn() -> i32` + //~^ ERROR expected a `Fn()` closure, found `unsafe fn() -> i32` require_fn(g); - //~^ ERROR: expected a `Fn()` closure, found `extern "C" fn() -> i32 {g}` + //~^ ERROR expected a `Fn()` closure, found `extern "C" fn() -> i32 {g}` require_fn(g as extern "C" fn() -> i32); - //~^ ERROR: expected a `Fn()` closure, found `extern "C" fn() -> i32` + //~^ ERROR expected a `Fn()` closure, found `extern "C" fn() -> i32` require_fn(h); - //~^ ERROR: expected a `Fn()` closure, found `unsafe fn() -> i32 {h}` + //~^ ERROR expected a `Fn()` closure, found `unsafe fn() -> i32 {h}` } diff --git a/tests/ui/traits/normalize-conflicting-impls.rs b/tests/ui/traits/normalize-conflicting-impls.rs index 454b2fd015357..357347e4548db 100644 --- a/tests/ui/traits/normalize-conflicting-impls.rs +++ b/tests/ui/traits/normalize-conflicting-impls.rs @@ -7,12 +7,12 @@ where impl Allocator for DefaultAllocator where - R::Value: DimName, //~ ERROR: `Value` not found for `R` + R::Value: DimName, //~ ERROR `Value` not found for `R` { type Buffer = (); } impl Allocator for DefaultAllocator {} -//~^ ERROR: conflicting implementations +//~^ ERROR conflicting implementations impl DimName for () {} impl DimName for u32 {} impl From> for Point { diff --git a/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs b/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs index 6fcd67b4950f7..7ef0938e01a9b 100644 --- a/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs +++ b/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs @@ -8,8 +8,8 @@ trait Try { fn w<'a, T: 'a, F: Fn(&'a T)>() { let b: &dyn FromResidual = &(); - //~^ ERROR: the trait `FromResidual` is not dyn compatible - //~| ERROR: the trait `FromResidual` is not dyn compatible + //~^ ERROR the trait `FromResidual` is not dyn compatible + //~| ERROR the trait `FromResidual` is not dyn compatible //~| ERROR the type parameter `R` must be explicitly specified } diff --git a/tests/ui/traits/object/issue-44454-1.rs b/tests/ui/traits/object/issue-44454-1.rs index bbaf3188a8963..03056c8784c03 100644 --- a/tests/ui/traits/object/issue-44454-1.rs +++ b/tests/ui/traits/object/issue-44454-1.rs @@ -11,7 +11,7 @@ where } fn bar<'a>(_arg: &'a i32) { - foo::, &'a i32>() //~ ERROR: lifetime may not live long enough + foo::, &'a i32>() //~ ERROR lifetime may not live long enough } fn baz() {} diff --git a/tests/ui/traits/object/issue-44454-2.rs b/tests/ui/traits/object/issue-44454-2.rs index f5178bcdbe224..94c2c01615ed8 100644 --- a/tests/ui/traits/object/issue-44454-2.rs +++ b/tests/ui/traits/object/issue-44454-2.rs @@ -13,7 +13,7 @@ where fn extend_lt<'a>(x: &'a str) -> Box + 'static> { type DynTrait = dyn for<'a> Trait<&'a str, Assoc = &'a str>; - hr::(x) //~ ERROR: borrowed data escapes outside of function + hr::(x) //~ ERROR borrowed data escapes outside of function } fn main() { diff --git a/tests/ui/traits/object/issue-44454-3.rs b/tests/ui/traits/object/issue-44454-3.rs index bff7270353464..01eab8f07a65a 100644 --- a/tests/ui/traits/object/issue-44454-3.rs +++ b/tests/ui/traits/object/issue-44454-3.rs @@ -15,7 +15,7 @@ impl Projector for dyn Animal { fn make_static<'a, T>(t: &'a T) -> &'static T { let x: as Projector>::Foo = t; let any = generic::, &'a T>(x); - //~^ ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough any.downcast_ref::<&'static T>().unwrap() } diff --git a/tests/ui/traits/self-without-lifetime-constraint.rs b/tests/ui/traits/self-without-lifetime-constraint.rs index 50901173b763d..5704ff14028af 100644 --- a/tests/ui/traits/self-without-lifetime-constraint.rs +++ b/tests/ui/traits/self-without-lifetime-constraint.rs @@ -15,7 +15,7 @@ impl<'a> ValueRef<'a> { match *self { ValueRef::Text(t) => { std::str::from_utf8(t).map_err(|_| FromSqlError::InvalidType).map(|x| (x, &x)) - //~^ ERROR: cannot return value referencing function parameter `x` + //~^ ERROR cannot return value referencing function parameter `x` } _ => Err(FromSqlError::InvalidType), } diff --git a/tests/ui/traits/trait-upcasting/deref-upcast-shadowing-lint.rs b/tests/ui/traits/trait-upcasting/deref-upcast-shadowing-lint.rs index ab84527edcff9..9c217b9712671 100644 --- a/tests/ui/traits/trait-upcasting/deref-upcast-shadowing-lint.rs +++ b/tests/ui/traits/trait-upcasting/deref-upcast-shadowing-lint.rs @@ -6,7 +6,7 @@ trait Bar {} trait Foo: Bar {} impl<'a> Deref for dyn Foo + 'a { - //~^ warn: this `Deref` implementation is covered by an implicit supertrait coercion + //~^ warn this `Deref` implementation is covered by an implicit supertrait coercion type Target = dyn Bar + 'a; fn deref(&self) -> &Self::Target { diff --git a/tests/ui/traits/trait-upcasting/inference-behavior-change-deref.rs b/tests/ui/traits/trait-upcasting/inference-behavior-change-deref.rs index 0103aaa2ac996..d4bc540b0b828 100644 --- a/tests/ui/traits/trait-upcasting/inference-behavior-change-deref.rs +++ b/tests/ui/traits/trait-upcasting/inference-behavior-change-deref.rs @@ -29,5 +29,5 @@ fn main() { let x: &dyn Foo = &(); let y = take_dyn(x); let z: u32 = y; - //~^ error: mismatched types + //~^ error mismatched types } diff --git a/tests/ui/traits/trait-upcasting/migrate-lint-deny-regions.rs b/tests/ui/traits/trait-upcasting/migrate-lint-deny-regions.rs index d33d3bfd5dc20..e6c6be4ab179a 100644 --- a/tests/ui/traits/trait-upcasting/migrate-lint-deny-regions.rs +++ b/tests/ui/traits/trait-upcasting/migrate-lint-deny-regions.rs @@ -7,7 +7,7 @@ trait Bar<'a> {} trait Foo<'a>: Bar<'a> {} impl<'a> Deref for dyn Foo<'a> { - //~^ warn: this `Deref` implementation is covered by an implicit supertrait coercion + //~^ warn this `Deref` implementation is covered by an implicit supertrait coercion type Target = dyn Bar<'a>; fn deref(&self) -> &Self::Target { diff --git a/tests/ui/traits/trait-upcasting/migrate-lint-different-substs.rs b/tests/ui/traits/trait-upcasting/migrate-lint-different-substs.rs index 20806f22886c0..145f1565eeac7 100644 --- a/tests/ui/traits/trait-upcasting/migrate-lint-different-substs.rs +++ b/tests/ui/traits/trait-upcasting/migrate-lint-different-substs.rs @@ -10,7 +10,7 @@ trait Foo: Bar { } impl<'a> Deref for dyn Foo + 'a { - //~^ warn: this `Deref` implementation is covered by an implicit supertrait coercion + //~^ warn this `Deref` implementation is covered by an implicit supertrait coercion type Target = dyn Bar + 'a; fn deref(&self) -> &Self::Target { diff --git a/tests/ui/traits/trivial_impl.rs b/tests/ui/traits/trivial_impl.rs index 6ac8c744bc455..0ab01596f3f50 100644 --- a/tests/ui/traits/trivial_impl.rs +++ b/tests/ui/traits/trivial_impl.rs @@ -13,6 +13,6 @@ impl Foo<()> for () { } impl Foo for () {} -//~^ ERROR: not all trait items implemented, missing: `foo` +//~^ ERROR not all trait items implemented, missing: `foo` fn main() {} diff --git a/tests/ui/traits/trivial_impl2.rs b/tests/ui/traits/trivial_impl2.rs index be58096007f2b..d94e0eeffdc38 100644 --- a/tests/ui/traits/trivial_impl2.rs +++ b/tests/ui/traits/trivial_impl2.rs @@ -8,6 +8,6 @@ trait Foo { } impl Foo for () {} -//~^ ERROR: not all trait items implemented, missing: `foo` +//~^ ERROR not all trait items implemented, missing: `foo` fn main() {} diff --git a/tests/ui/traits/trivial_impl_sized.rs b/tests/ui/traits/trivial_impl_sized.rs index 59cc079c2682d..ce70f4fcb31b3 100644 --- a/tests/ui/traits/trivial_impl_sized.rs +++ b/tests/ui/traits/trivial_impl_sized.rs @@ -13,7 +13,7 @@ impl Foo for () { // Must not be allowed impl Foo for i32 {} -//~^ ERROR: not all trait items implemented, missing: `foo` +//~^ ERROR not all trait items implemented, missing: `foo` impl Foo for dyn std::fmt::Debug {} @@ -37,6 +37,6 @@ trait Trait { Self: Sized; } impl Trait for T {} -//~^ ERROR: not all trait items implemented, missing: `foo` +//~^ ERROR not all trait items implemented, missing: `foo` fn main() {} diff --git a/tests/ui/traits/upcast_soundness_bug.rs b/tests/ui/traits/upcast_soundness_bug.rs index 4c89fa135e788..a2a72f7c0c289 100644 --- a/tests/ui/traits/upcast_soundness_bug.rs +++ b/tests/ui/traits/upcast_soundness_bug.rs @@ -56,7 +56,7 @@ pub fn user2() -> &'static dyn Trait { fn main() { let p: *const dyn Trait = &(); let p = p as *const dyn Trait; // <- this is bad! - //~^ error: casting `*const dyn Trait` as `*const dyn Trait` is invalid + //~^ error casting `*const dyn Trait` as `*const dyn Trait` is invalid let p = p as *const dyn Super; // <- this upcast accesses improper vtable entry // accessing from L__unnamed_2 the position for the 'Super vtable (pointer)', // thus reading 'null pointer for missing_method' diff --git a/tests/ui/transmutability/assoc-bound.rs b/tests/ui/transmutability/assoc-bound.rs index e8a20b45cde34..1d6ae786478c9 100644 --- a/tests/ui/transmutability/assoc-bound.rs +++ b/tests/ui/transmutability/assoc-bound.rs @@ -13,7 +13,7 @@ impl B for (T, u8) where T: A, { - type AssocB = T::AssocA; //~ERROR: the trait bound `::AssocA: TransmuteFrom<(), Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not satisfied [E0277] + type AssocB = T::AssocA; //~ERROR the trait bound `::AssocA: TransmuteFrom<(), Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not satisfied [E0277] } @@ -21,5 +21,5 @@ impl B for (T, u16) where for<'a> &'a i32: A, { - type AssocB = <&'static i32 as A>::AssocA; //~ERROR: `()` cannot be safely transmuted into `<&i32 as A>::AssocA` + type AssocB = <&'static i32 as A>::AssocA; //~ERROR `()` cannot be safely transmuted into `<&i32 as A>::AssocA` } diff --git a/tests/ui/transmutability/maybeuninit.rs b/tests/ui/transmutability/maybeuninit.rs index 7b60785b7e082..805cef1cb115e 100644 --- a/tests/ui/transmutability/maybeuninit.rs +++ b/tests/ui/transmutability/maybeuninit.rs @@ -18,7 +18,7 @@ fn validity() { assert::is_maybe_transmutable::>(); // An uninitialized byte is never a valid initialized byte. - assert::is_maybe_transmutable::, u8>(); //~ ERROR: cannot be safely transmuted + assert::is_maybe_transmutable::, u8>(); //~ ERROR cannot be safely transmuted } fn padding() { diff --git a/tests/ui/transmutability/references/unsafecell.rs b/tests/ui/transmutability/references/unsafecell.rs index 4001f139770a5..0fb3214218d10 100644 --- a/tests/ui/transmutability/references/unsafecell.rs +++ b/tests/ui/transmutability/references/unsafecell.rs @@ -24,9 +24,9 @@ fn value_to_value() { fn ref_to_ref() { // We forbid `UnsafeCell`-containing ref-to-ref transmutations, because the // two types may use different, incompatible synchronization strategies. - assert::is_maybe_transmutable::<&'static u8, &'static UnsafeCell>(); //~ ERROR: cannot be safely transmuted + assert::is_maybe_transmutable::<&'static u8, &'static UnsafeCell>(); //~ ERROR cannot be safely transmuted - assert::is_maybe_transmutable::<&'static UnsafeCell, &'static UnsafeCell>(); //~ ERROR: cannot be safely transmuted + assert::is_maybe_transmutable::<&'static UnsafeCell, &'static UnsafeCell>(); //~ ERROR cannot be safely transmuted } fn mut_to_mut() { diff --git a/tests/ui/transmutability/structs/repr/transmute_infinitely_recursive_type.rs b/tests/ui/transmutability/structs/repr/transmute_infinitely_recursive_type.rs index 8d291054365f9..46b50657ed549 100644 --- a/tests/ui/transmutability/structs/repr/transmute_infinitely_recursive_type.rs +++ b/tests/ui/transmutability/structs/repr/transmute_infinitely_recursive_type.rs @@ -1,4 +1,4 @@ -//~ ERROR: cycle detected +//~ ERROR cycle detected //! Safe transmute did not handle cycle errors that could occur during //! layout computation. This test checks that we do not ICE in such //! situations (see #117491). @@ -19,7 +19,7 @@ mod assert { fn should_pad_explicitly_packed_field() { #[repr(C)] struct ExplicitlyPadded(ExplicitlyPadded); - //~^ ERROR: recursive type + //~^ ERROR recursive type assert::is_maybe_transmutable::(); } diff --git a/tests/ui/transmutability/uninhabited.rs b/tests/ui/transmutability/uninhabited.rs index 274104ffb3915..2aeb2e5b34155 100644 --- a/tests/ui/transmutability/uninhabited.rs +++ b/tests/ui/transmutability/uninhabited.rs @@ -26,7 +26,7 @@ fn void() { // anything else. assert::is_maybe_transmutable::(); - assert::is_maybe_transmutable::<(), Void>(); //~ ERROR: cannot be safely transmuted + assert::is_maybe_transmutable::<(), Void>(); //~ ERROR cannot be safely transmuted } // Non-ZST uninhabited types are, nonetheless, uninhabited. @@ -38,7 +38,7 @@ fn yawning_void_struct() { const _: () = { assert!(std::mem::size_of::() == std::mem::size_of::()); // Just to be sure the above constant actually evaluated: - assert!(false); //~ ERROR: evaluation of constant value failed + assert!(false); //~ ERROR evaluation of constant value failed }; // This transmutation is vacuously acceptable; since one cannot construct a @@ -46,7 +46,7 @@ fn yawning_void_struct() { // anything else. assert::is_maybe_transmutable::(); - assert::is_maybe_transmutable::<(), Void>(); //~ ERROR: cannot be safely transmuted + assert::is_maybe_transmutable::<(), Void>(); //~ ERROR cannot be safely transmuted } // Non-ZST uninhabited types are, nonetheless, uninhabited. @@ -60,7 +60,7 @@ fn yawning_void_enum() { const _: () = { assert!(std::mem::size_of::() == std::mem::size_of::()); // Just to be sure the above constant actually evaluated: - assert!(false); //~ ERROR: evaluation of constant value failed + assert!(false); //~ ERROR evaluation of constant value failed }; // This transmutation is vacuously acceptable; since one cannot construct a @@ -68,7 +68,7 @@ fn yawning_void_enum() { // anything else. assert::is_maybe_transmutable::(); - assert::is_maybe_transmutable::<(), Void>(); //~ ERROR: cannot be safely transmuted + assert::is_maybe_transmutable::<(), Void>(); //~ ERROR cannot be safely transmuted } // References to uninhabited types are, logically, uninhabited, but for layout @@ -84,12 +84,12 @@ fn distant_void() { const _: () = { assert!(std::mem::size_of::() == std::mem::size_of::()); // Just to be sure the above constant actually evaluated: - assert!(false); //~ ERROR: evaluation of constant value failed + assert!(false); //~ ERROR evaluation of constant value failed }; assert::is_maybe_transmutable::(); assert::is_maybe_transmutable::(); - assert::is_maybe_transmutable::(); //~ ERROR: cannot be safely transmuted + assert::is_maybe_transmutable::(); //~ ERROR cannot be safely transmuted } fn issue_126267() { @@ -105,5 +105,5 @@ fn issue_126267() { struct Src; type Dst = Error; - assert::is_maybe_transmutable::(); //~ERROR: cannot be safely transmuted + assert::is_maybe_transmutable::(); //~ERROR cannot be safely transmuted } diff --git a/tests/ui/try-trait/bad-question-mark-on-trait-object.rs b/tests/ui/try-trait/bad-question-mark-on-trait-object.rs index 2a0d14b175030..78fd54ade09fa 100644 --- a/tests/ui/try-trait/bad-question-mark-on-trait-object.rs +++ b/tests/ui/try-trait/bad-question-mark-on-trait-object.rs @@ -1,14 +1,14 @@ struct E; -//~^ NOTE `E` needs to implement `std::error::Error` +//~^ NOTE `E` needs to implement `std::error:Error` //~| NOTE alternatively, `E` needs to implement `Into` struct X; //~ NOTE `X` needs to implement `From` -fn foo() -> Result<(), Box> { //~ NOTE required `E: std::error::Error` because of this +fn foo() -> Result<(), Box> { //~ NOTE required `E: std::error:Error` because of this Ok(bar()?) - //~^ ERROR `?` couldn't convert the error: `E: std::error::Error` is not satisfied - //~| NOTE the trait `std::error::Error` is not implemented for `E` + //~^ ERROR `?` couldn't convert the error: `E: std::error:Error` is not satisfied + //~| NOTE the trait `std::error:Error` is not implemented for `E` //~| NOTE the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait - //~| NOTE required for `Box` to implement `From` + //~| NOTE required for `Box` to implement `From` //~| NOTE this has type `Result<_, E>` //~| NOTE in this expansion //~| NOTE in this expansion diff --git a/tests/ui/tuple/array-diagnostics.rs b/tests/ui/tuple/array-diagnostics.rs index 1929dab073169..de35809c04224 100644 --- a/tests/ui/tuple/array-diagnostics.rs +++ b/tests/ui/tuple/array-diagnostics.rs @@ -1,7 +1,7 @@ fn main() { let _tmp = [ ("C200B40A82", 3), - ("C200B40A83", 4) //~ ERROR: expected function, found `(&'static str, {integer})` [E0618] + ("C200B40A83", 4) //~ ERROR expected function, found `(&'static str, {integer})` [E0618] ("C200B40A8537", 5), ]; } diff --git a/tests/ui/type-alias-impl-trait/auto-trait-leakage2.rs b/tests/ui/type-alias-impl-trait/auto-trait-leakage2.rs index 6132eef0db5f8..ba2bdeaafbd45 100644 --- a/tests/ui/type-alias-impl-trait/auto-trait-leakage2.rs +++ b/tests/ui/type-alias-impl-trait/auto-trait-leakage2.rs @@ -18,7 +18,7 @@ fn is_send(_: T) {} fn main() { is_send(foo()); - //~^ ERROR: `Rc` cannot be sent between threads safely [E0277] + //~^ ERROR `Rc` cannot be sent between threads safely [E0277] //~| NOTE cannot be sent //~| NOTE required by a bound } diff --git a/tests/ui/type-alias-impl-trait/bounds-are-checked3.rs b/tests/ui/type-alias-impl-trait/bounds-are-checked3.rs index a8524770a8528..df635761d0875 100644 --- a/tests/ui/type-alias-impl-trait/bounds-are-checked3.rs +++ b/tests/ui/type-alias-impl-trait/bounds-are-checked3.rs @@ -7,7 +7,7 @@ struct Struct(Option); // Make sure that, in contrast to type aliases without opaque types, // we actually do a wf check for the aliased type. type Foo = (impl Debug, Struct); -//~^ ERROR: `T` doesn't implement `std::fmt::Display` +//~^ ERROR `T` doesn't implement `std::fmt::Display` #[define_opaque(Foo)] fn foo() -> Foo { diff --git a/tests/ui/type-alias-impl-trait/coherence_cross_crate.rs b/tests/ui/type-alias-impl-trait/coherence_cross_crate.rs index 73f13f22bee24..e038cda844b0f 100644 --- a/tests/ui/type-alias-impl-trait/coherence_cross_crate.rs +++ b/tests/ui/type-alias-impl-trait/coherence_cross_crate.rs @@ -20,6 +20,6 @@ fn constrain() -> Alias { impl OtherTrait for Alias {} impl OtherTrait for i32 {} -//~^ ERROR: conflicting implementations of trait `OtherTrait` for type `Alias` +//~^ ERROR conflicting implementations of trait `OtherTrait` for type `Alias` fn main() {} diff --git a/tests/ui/type-alias-impl-trait/const_generic_type.rs b/tests/ui/type-alias-impl-trait/const_generic_type.rs index 9b38f1449f89b..a610a4df2bc7f 100644 --- a/tests/ui/type-alias-impl-trait/const_generic_type.rs +++ b/tests/ui/type-alias-impl-trait/const_generic_type.rs @@ -6,7 +6,7 @@ type Bar = impl std::fmt::Display; #[define_opaque(Bar)] async fn test() { - //~^ ERROR: `Bar` is forbidden as the type of a const generic parameter + //~^ ERROR `Bar` is forbidden as the type of a const generic parameter //[no_infer]~^^ ERROR item does not constrain #[cfg(infer)] let x: u32 = N; diff --git a/tests/ui/type-alias-impl-trait/constrain_in_projection2.rs b/tests/ui/type-alias-impl-trait/constrain_in_projection2.rs index 61773cf59d475..0f97764f5eb0b 100644 --- a/tests/ui/type-alias-impl-trait/constrain_in_projection2.rs +++ b/tests/ui/type-alias-impl-trait/constrain_in_projection2.rs @@ -26,9 +26,9 @@ impl Trait for Foo { #[define_opaque(Bar)] fn bop() { let x = >::Assoc::default(); - //[next]~^ ERROR: cannot satisfy `Foo: Trait` - //[current]~^^ ERROR: `Foo: Trait` is not satisfied - //[current]~| ERROR: `Foo: Trait` is not satisfied + //[next]~^ ERROR cannot satisfy `Foo: Trait` + //[current]~^^ ERROR `Foo: Trait` is not satisfied + //[current]~| ERROR `Foo: Trait` is not satisfied } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/define_opaques_attr/foreign_type.rs b/tests/ui/type-alias-impl-trait/define_opaques_attr/foreign_type.rs index c8b6bdbe2b920..2e8f60251365b 100644 --- a/tests/ui/type-alias-impl-trait/define_opaques_attr/foreign_type.rs +++ b/tests/ui/type-alias-impl-trait/define_opaques_attr/foreign_type.rs @@ -1,5 +1,5 @@ #![feature(type_alias_impl_trait)] #[define_opaque(String)] -//~^ ERROR: only opaque types defined in the local crate can be defined +//~^ ERROR only opaque types defined in the local crate can be defined fn main() {} diff --git a/tests/ui/type-alias-impl-trait/define_opaques_attr/generics.rs b/tests/ui/type-alias-impl-trait/define_opaques_attr/generics.rs index 2ca2a753e2016..f71226d153155 100644 --- a/tests/ui/type-alias-impl-trait/define_opaques_attr/generics.rs +++ b/tests/ui/type-alias-impl-trait/define_opaques_attr/generics.rs @@ -1,12 +1,12 @@ #![feature(type_alias_impl_trait)] type Tait = impl Sized; -//~^ ERROR: unconstrained opaque type +//~^ ERROR unconstrained opaque type #[define_opaque(Tait::<()>)] -//~^ ERROR: expected unsuffixed literal +//~^ ERROR expected unsuffixed literal fn foo() {} #[define_opaque(Tait<()>)] -//~^ ERROR: expected one of `(`, `,`, `::`, or `=`, found `<` +//~^ ERROR expected one of `(`, `,`, `::`, or `=`, found `<` fn main() {} diff --git a/tests/ui/type-alias-impl-trait/define_opaques_attr/invalid_path.rs b/tests/ui/type-alias-impl-trait/define_opaques_attr/invalid_path.rs index a02e80c6d89cd..aa5a799b34f10 100644 --- a/tests/ui/type-alias-impl-trait/define_opaques_attr/invalid_path.rs +++ b/tests/ui/type-alias-impl-trait/define_opaques_attr/invalid_path.rs @@ -1,5 +1,5 @@ #![feature(type_alias_impl_trait)] #[define_opaque(Boom)] -//~^ ERROR: cannot find type alias or associated type +//~^ ERROR cannot find type alias or associated type fn main() {} diff --git a/tests/ui/type-alias-impl-trait/define_opaques_attr/missing_parens.rs b/tests/ui/type-alias-impl-trait/define_opaques_attr/missing_parens.rs index 6a5a1b456c3ad..ab18d6a257b04 100644 --- a/tests/ui/type-alias-impl-trait/define_opaques_attr/missing_parens.rs +++ b/tests/ui/type-alias-impl-trait/define_opaques_attr/missing_parens.rs @@ -1,5 +1,5 @@ #![feature(type_alias_impl_trait)] #[define_opaque] -//~^ ERROR: expected list of type aliases +//~^ ERROR expected list of type aliases fn main() {} diff --git a/tests/ui/type-alias-impl-trait/define_opaques_attr/non_type.rs b/tests/ui/type-alias-impl-trait/define_opaques_attr/non_type.rs index 0ad87616a518b..1232cf91264be 100644 --- a/tests/ui/type-alias-impl-trait/define_opaques_attr/non_type.rs +++ b/tests/ui/type-alias-impl-trait/define_opaques_attr/non_type.rs @@ -3,5 +3,5 @@ fn foo() {} #[define_opaque(foo)] -//~^ ERROR: expected type alias or associated type with opaqaue types +//~^ ERROR expected type alias or associated type with opaqaue types fn main() {} diff --git a/tests/ui/type-alias-impl-trait/different_defining_uses_never_type.rs b/tests/ui/type-alias-impl-trait/different_defining_uses_never_type.rs index 38597ccaf4277..b2d3da0b4086c 100644 --- a/tests/ui/type-alias-impl-trait/different_defining_uses_never_type.rs +++ b/tests/ui/type-alias-impl-trait/different_defining_uses_never_type.rs @@ -11,7 +11,7 @@ fn foo() -> Foo { } #[define_opaque(Foo)] -fn bar() -> Foo { //~ ERROR: concrete type differs from previous defining opaque type use +fn bar() -> Foo { //~ ERROR concrete type differs from previous defining opaque type use panic!() } diff --git a/tests/ui/type-alias-impl-trait/different_lifetimes_defining_uses.rs b/tests/ui/type-alias-impl-trait/different_lifetimes_defining_uses.rs index ba3265343c61d..428e531fba5f7 100644 --- a/tests/ui/type-alias-impl-trait/different_lifetimes_defining_uses.rs +++ b/tests/ui/type-alias-impl-trait/different_lifetimes_defining_uses.rs @@ -11,7 +11,7 @@ fn foo<'a, 'b>(a: &'a u32, b: &'b u32) -> OneLifetime<'a, 'b> { #[define_opaque(OneLifetime)] fn bar<'a, 'b>(a: &'a u32, b: &'b u32) -> OneLifetime<'a, 'b> { b - //~^ ERROR: concrete type differs from previous defining opaque type use + //~^ ERROR concrete type differs from previous defining opaque type use } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/fallback.rs b/tests/ui/type-alias-impl-trait/fallback.rs index a2f25acca0d3a..11782d3ebbb6d 100644 --- a/tests/ui/type-alias-impl-trait/fallback.rs +++ b/tests/ui/type-alias-impl-trait/fallback.rs @@ -23,7 +23,7 @@ fn constrained_foo() -> Foo { #[define_opaque(Foo)] fn unconstrained_foo() -> Wrapper { Wrapper::Second - //~^ ERROR: type annotations needed + //~^ ERROR type annotations needed } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/future.rs b/tests/ui/type-alias-impl-trait/future.rs index e233554f6a13f..c7f7f658a5af9 100644 --- a/tests/ui/type-alias-impl-trait/future.rs +++ b/tests/ui/type-alias-impl-trait/future.rs @@ -14,7 +14,7 @@ type FooFuture = impl Future; #[define_opaque(FooFuture)] fn foo(bar: B) -> FooFuture { async move { bar.bar() } - //~^ ERROR: the trait bound `B: Bar` is not satisfied + //~^ ERROR the trait bound `B: Bar` is not satisfied } pub fn mainish(ctx: &mut std::task::Context) { diff --git a/tests/ui/type-alias-impl-trait/generic_nondefining_use.rs b/tests/ui/type-alias-impl-trait/generic_nondefining_use.rs index cf38c93bd921e..7771ae28d7aeb 100644 --- a/tests/ui/type-alias-impl-trait/generic_nondefining_use.rs +++ b/tests/ui/type-alias-impl-trait/generic_nondefining_use.rs @@ -14,18 +14,18 @@ type OneConst = impl Debug; #[define_opaque(OneTy)] fn concrete_ty() -> OneTy { - //~^ ERROR: expected generic type parameter, found `u32` + //~^ ERROR expected generic type parameter, found `u32` 5u32 } #[define_opaque(OneLifetime)] fn concrete_lifetime() -> OneLifetime<'static> { 6u32 - //~^ ERROR: expected generic lifetime parameter, found `'static` + //~^ ERROR expected generic lifetime parameter, found `'static` } #[define_opaque(OneConst)] fn concrete_const() -> OneConst<{ 123 }> { - //~^ ERROR: expected generic constant parameter, found `123` + //~^ ERROR expected generic constant parameter, found `123` 7u32 } diff --git a/tests/ui/type-alias-impl-trait/generic_not_used.rs b/tests/ui/type-alias-impl-trait/generic_not_used.rs index f270f65f43ed9..5371b96f0a217 100644 --- a/tests/ui/type-alias-impl-trait/generic_not_used.rs +++ b/tests/ui/type-alias-impl-trait/generic_not_used.rs @@ -3,7 +3,7 @@ fn main() {} type WrongGeneric = impl 'static; -//~^ ERROR: at least one trait must be specified +//~^ ERROR at least one trait must be specified #[define_opaque(WrongGeneric)] fn wrong_generic(_: U, v: V) -> WrongGeneric { diff --git a/tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs b/tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs index 4b8a1cfc47240..e214f3498122e 100644 --- a/tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs +++ b/tests/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs @@ -7,7 +7,7 @@ fn main() { //~^ ERROR expected generic type parameter, found `&i32` type WrongGeneric = impl 'static; - //~^ ERROR: at least one trait must be specified + //~^ ERROR at least one trait must be specified #[define_opaque(WrongGeneric)] fn wrong_generic(t: T) -> WrongGeneric { diff --git a/tests/ui/type-alias-impl-trait/hidden_behind_projection_behind_struct_field.rs b/tests/ui/type-alias-impl-trait/hidden_behind_projection_behind_struct_field.rs index bf97dd9a25c5d..d17fc0ba2a671 100644 --- a/tests/ui/type-alias-impl-trait/hidden_behind_projection_behind_struct_field.rs +++ b/tests/ui/type-alias-impl-trait/hidden_behind_projection_behind_struct_field.rs @@ -15,10 +15,10 @@ trait Trait: Sized { impl Trait for Bar { type Assoc = impl std::fmt::Debug; - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type fn foo() -> Foo { Foo { field: () } - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } } diff --git a/tests/ui/type-alias-impl-trait/hidden_behind_struct_field2.rs b/tests/ui/type-alias-impl-trait/hidden_behind_struct_field2.rs index b1dcf98f4dd27..0814fa5db483c 100644 --- a/tests/ui/type-alias-impl-trait/hidden_behind_struct_field2.rs +++ b/tests/ui/type-alias-impl-trait/hidden_behind_struct_field2.rs @@ -13,10 +13,10 @@ trait Trait: Sized { impl Trait for Bar { type Assoc = impl std::fmt::Debug; - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type fn foo() -> Foo { Foo { field: () } - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } } diff --git a/tests/ui/type-alias-impl-trait/hidden_behind_struct_field3.rs b/tests/ui/type-alias-impl-trait/hidden_behind_struct_field3.rs index 70697e2fa6581..b45497d331b6d 100644 --- a/tests/ui/type-alias-impl-trait/hidden_behind_struct_field3.rs +++ b/tests/ui/type-alias-impl-trait/hidden_behind_struct_field3.rs @@ -14,7 +14,7 @@ trait Trait: Sized { impl Trait for Bar { type Assoc2 = impl std::fmt::Debug; - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type type Assoc = impl Iterator; fn foo() -> Self::Assoc { vec![Foo { field: () }].into_iter() diff --git a/tests/ui/type-alias-impl-trait/hkl_forbidden2.rs b/tests/ui/type-alias-impl-trait/hkl_forbidden2.rs index 92e383d11f1c0..99fb23945b003 100644 --- a/tests/ui/type-alias-impl-trait/hkl_forbidden2.rs +++ b/tests/ui/type-alias-impl-trait/hkl_forbidden2.rs @@ -13,7 +13,7 @@ impl<'a> Trait<'a> for () { #[define_opaque(Opaque)] fn test() -> &'static dyn for<'a> Trait<'a, Assoc = Opaque<'a>> { &() - //~^ ERROR: expected generic lifetime parameter, found `'a` + //~^ ERROR expected generic lifetime parameter, found `'a` } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/hkl_forbidden3.rs b/tests/ui/type-alias-impl-trait/hkl_forbidden3.rs index c7f04dc07bb12..07927c4e16704 100644 --- a/tests/ui/type-alias-impl-trait/hkl_forbidden3.rs +++ b/tests/ui/type-alias-impl-trait/hkl_forbidden3.rs @@ -8,7 +8,7 @@ fn foo<'a>(x: &'a ()) -> &'a () { #[define_opaque(Opaque)] fn test() -> for<'a> fn(&'a ()) -> Opaque<'a> { - foo //~ ERROR: mismatched types + foo //~ ERROR mismatched types } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/hkl_forbidden4.rs b/tests/ui/type-alias-impl-trait/hkl_forbidden4.rs index 4b4db8ec2ed3b..6feb0691adb0f 100644 --- a/tests/ui/type-alias-impl-trait/hkl_forbidden4.rs +++ b/tests/ui/type-alias-impl-trait/hkl_forbidden4.rs @@ -11,7 +11,7 @@ type FutNothing<'a> = impl 'a + Future; async fn operation(_: &mut ()) -> () { call(operation).await - //~^ ERROR: concrete type differs from previous + //~^ ERROR concrete type differs from previous } #[define_opaque(FutNothing)] diff --git a/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.rs b/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.rs index a9cae611ec55e..a3f65146f75fb 100644 --- a/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.rs +++ b/tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.rs @@ -18,7 +18,7 @@ impl Foo for () { type Baz = impl Sized; //~^ ERROR type `Baz` has 1 type parameter but its trait declaration has 0 type parameters - //~| ERROR: unconstrained opaque type + //~| ERROR unconstrained opaque type fn test<'a>() -> Self::Bar<'a> { &() diff --git a/tests/ui/type-alias-impl-trait/impl_trait_for_tait_bound.rs b/tests/ui/type-alias-impl-trait/impl_trait_for_tait_bound.rs index e0045df08ec7c..e3a838094740a 100644 --- a/tests/ui/type-alias-impl-trait/impl_trait_for_tait_bound.rs +++ b/tests/ui/type-alias-impl-trait/impl_trait_for_tait_bound.rs @@ -8,7 +8,7 @@ impl Yay for Foo {} #[define_opaque(Foo)] fn foo() { - is_yay::(); //~ ERROR: the trait bound `u32: Yay` is not satisfied + is_yay::(); //~ ERROR the trait bound `u32: Yay` is not satisfied is_debug::(); // OK is_yay::(); // OK is_debug::(); // OK diff --git a/tests/ui/type-alias-impl-trait/impl_trait_for_tait_bound2.rs b/tests/ui/type-alias-impl-trait/impl_trait_for_tait_bound2.rs index 0a8dadb89e2ed..3c42428d726fc 100644 --- a/tests/ui/type-alias-impl-trait/impl_trait_for_tait_bound2.rs +++ b/tests/ui/type-alias-impl-trait/impl_trait_for_tait_bound2.rs @@ -9,7 +9,7 @@ impl Yay for u32 {} #[define_opaque(Foo)] fn foo() { - is_yay::(); //~ ERROR: the trait bound `Foo: Yay` is not satisfied + is_yay::(); //~ ERROR the trait bound `Foo: Yay` is not satisfied } fn is_yay() {} diff --git a/tests/ui/type-alias-impl-trait/impl_trait_in_trait_defined_outside_trait.rs b/tests/ui/type-alias-impl-trait/impl_trait_in_trait_defined_outside_trait.rs index a788563ab779e..90c13e4496310 100644 --- a/tests/ui/type-alias-impl-trait/impl_trait_in_trait_defined_outside_trait.rs +++ b/tests/ui/type-alias-impl-trait/impl_trait_in_trait_defined_outside_trait.rs @@ -12,7 +12,7 @@ trait Trait: Sized { impl Trait for () { type Assoc = impl std::fmt::Debug; fn foo() { - let x: Self::Assoc = 42; //~ ERROR: mismatched types + let x: Self::Assoc = 42; //~ ERROR mismatched types } fn bar() -> Self::Assoc { "" @@ -28,7 +28,7 @@ trait Trait2: Sized { impl Trait2 for () { type Assoc = impl std::fmt::Debug; const FOO: () = { - let x: Self::Assoc = 42; //~ ERROR: mismatched types + let x: Self::Assoc = 42; //~ ERROR mismatched types }; fn bar() -> Self::Assoc { "" diff --git a/tests/ui/type-alias-impl-trait/impl_trait_in_trait_defined_outside_trait2.rs b/tests/ui/type-alias-impl-trait/impl_trait_in_trait_defined_outside_trait2.rs index 77cdca198daea..2dcfb493c7a38 100644 --- a/tests/ui/type-alias-impl-trait/impl_trait_in_trait_defined_outside_trait2.rs +++ b/tests/ui/type-alias-impl-trait/impl_trait_in_trait_defined_outside_trait2.rs @@ -11,7 +11,7 @@ trait Trait: Sized { impl Trait for () { type Assoc = impl std::fmt::Debug; type Foo = [(); { - let x: Self::Assoc = 42; //~ ERROR: mismatched types + let x: Self::Assoc = 42; //~ ERROR mismatched types 3 }]; fn foo() -> Self::Assoc { diff --git a/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.rs b/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.rs index 889438d1b733e..38fbaef2d47a2 100644 --- a/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.rs +++ b/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.rs @@ -13,7 +13,7 @@ where test_lifetime_param::Ty<'a>: 'static, { test_lifetime_param::assert_static::<'a>() - //~^ ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } mod test_higher_kinded_lifetime_param { @@ -29,14 +29,14 @@ where for<'b> test_higher_kinded_lifetime_param::Ty<'b>: 'a, { test_higher_kinded_lifetime_param::assert_static::<'a>() - //~^ ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } mod test_higher_kinded_lifetime_param2 { fn assert_static<'a: 'static>() {} fn test<'a>() { assert_static::<'a>() - //~^ ERROR: lifetime may not live long enough + //~^ ERROR lifetime may not live long enough } } @@ -53,7 +53,7 @@ where test_type_param::Ty: 'static, { test_type_param::assert_static::() - //~^ ERROR: parameter type `A` may not live long enough + //~^ ERROR parameter type `A` may not live long enough } mod test_implied_from_fn_sig { diff --git a/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.rs b/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.rs index 5484b91e6f1f4..33ef42acd8f9d 100644 --- a/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.rs +++ b/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.rs @@ -4,7 +4,7 @@ pub type Ty = impl Sized + 'static; #[define_opaque(Ty)] fn defining(s: A) -> Ty { s - //~^ ERROR: the parameter type `A` may not live long enough + //~^ ERROR the parameter type `A` may not live long enough } pub fn assert_static() {} @@ -13,7 +13,7 @@ where Ty: 'static, { assert_static::() - //~^ ERROR: the parameter type `A` may not live long enough + //~^ ERROR the parameter type `A` may not live long enough } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/in-where-clause.rs b/tests/ui/type-alias-impl-trait/in-where-clause.rs index 8d5bfc48a66e9..c4b00dce2be67 100644 --- a/tests/ui/type-alias-impl-trait/in-where-clause.rs +++ b/tests/ui/type-alias-impl-trait/in-where-clause.rs @@ -3,7 +3,7 @@ //! This again requires type checking `foo`. #![feature(type_alias_impl_trait)] type Bar = impl Sized; -//~^ ERROR: cycle +//~^ ERROR cycle #[define_opaque(Bar)] fn foo() -> Bar @@ -11,7 +11,7 @@ where Bar: Send, { [0; 1 + 2] - //~^ ERROR: type annotations needed: cannot satisfy `Bar: Send` + //~^ ERROR type annotations needed: cannot satisfy `Bar: Send` } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/incomplete-inference.rs b/tests/ui/type-alias-impl-trait/incomplete-inference.rs index 70acb1870e223..1af38adc93082 100644 --- a/tests/ui/type-alias-impl-trait/incomplete-inference.rs +++ b/tests/ui/type-alias-impl-trait/incomplete-inference.rs @@ -5,7 +5,7 @@ type Foo = impl Sized; #[define_opaque(Foo)] fn bar() -> Foo { None - //~^ ERROR: type annotations needed [E0282] + //~^ ERROR type annotations needed [E0282] } #[define_opaque(Foo)] diff --git a/tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.rs b/tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.rs index ae9712bd891af..826615d0ea754 100644 --- a/tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.rs +++ b/tests/ui/type-alias-impl-trait/invalid_impl_trait_in_assoc_ty.rs @@ -7,10 +7,10 @@ trait Foo { impl Foo for () { type Foo = impl std::fmt::Debug; - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type fn bar() { let x: Self::Foo = (); - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } } diff --git a/tests/ui/type-alias-impl-trait/issue-109054.rs b/tests/ui/type-alias-impl-trait/issue-109054.rs index a8bb5ee3301fb..f59ef1f2d7020 100644 --- a/tests/ui/type-alias-impl-trait/issue-109054.rs +++ b/tests/ui/type-alias-impl-trait/issue-109054.rs @@ -12,7 +12,7 @@ impl std::ops::Deref for CallMe { #[define_opaque(FnType)] fn deref(&self) -> &Self::Target { - //~^ ERROR: item does not constrain `ReturnType + //~^ ERROR item does not constrain `ReturnType #[define_opaque(ReturnType)] fn inner(val: &u32) -> ReturnType { async move { *val * 2 } diff --git a/tests/ui/type-alias-impl-trait/issue-52843.rs b/tests/ui/type-alias-impl-trait/issue-52843.rs index fd28eb8381d6d..a3e813f9194fa 100644 --- a/tests/ui/type-alias-impl-trait/issue-52843.rs +++ b/tests/ui/type-alias-impl-trait/issue-52843.rs @@ -6,7 +6,7 @@ type Foo = impl Default; #[define_opaque(Foo)] fn foo(t: T) -> Foo { t - //~^ ERROR: the trait bound `T: Default` is not satisfied + //~^ ERROR the trait bound `T: Default` is not satisfied } struct NotDefault; diff --git a/tests/ui/type-alias-impl-trait/issue-63279.rs b/tests/ui/type-alias-impl-trait/issue-63279.rs index 10da40d2f90d2..6908b6581b78b 100644 --- a/tests/ui/type-alias-impl-trait/issue-63279.rs +++ b/tests/ui/type-alias-impl-trait/issue-63279.rs @@ -4,11 +4,11 @@ type Closure = impl FnOnce(); #[define_opaque(Closure)] fn c() -> Closure { - //~^ ERROR: expected a `FnOnce()` closure, found `()` + //~^ ERROR expected a `FnOnce()` closure, found `()` || -> Closure { || () } - //~^ ERROR: mismatched types - //~| ERROR: mismatched types - //~| ERROR: expected a `FnOnce()` closure, found `()` + //~^ ERROR mismatched types + //~| ERROR mismatched types + //~| ERROR expected a `FnOnce()` closure, found `()` } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/issue-63355.rs b/tests/ui/type-alias-impl-trait/issue-63355.rs index 0b29bfeb98f1e..dd3bd09c4128b 100644 --- a/tests/ui/type-alias-impl-trait/issue-63355.rs +++ b/tests/ui/type-alias-impl-trait/issue-63355.rs @@ -41,7 +41,7 @@ impl Baz for () { #[define_opaque(BarImpl)] fn bar() -> Self::Bar { - //~^ ERROR: item does not constrain `FooImpl::{opaque#0}` + //~^ ERROR item does not constrain `FooImpl::{opaque#0}` () } } diff --git a/tests/ui/type-alias-impl-trait/issue-65384.rs b/tests/ui/type-alias-impl-trait/issue-65384.rs index 86bbc93c8bd62..6f71ebe3e4120 100644 --- a/tests/ui/type-alias-impl-trait/issue-65384.rs +++ b/tests/ui/type-alias-impl-trait/issue-65384.rs @@ -7,7 +7,7 @@ impl MyTrait for () {} type Bar = impl MyTrait; impl MyTrait for Bar {} -//~^ ERROR: conflicting implementations of trait `MyTrait` for type `()` +//~^ ERROR conflicting implementations of trait `MyTrait` for type `()` #[define_opaque(Bar)] fn bazr() -> Bar {} diff --git a/tests/ui/type-alias-impl-trait/issue-74244.rs b/tests/ui/type-alias-impl-trait/issue-74244.rs index 60b1bee9ff63e..0f9c58d7a7119 100644 --- a/tests/ui/type-alias-impl-trait/issue-74244.rs +++ b/tests/ui/type-alias-impl-trait/issue-74244.rs @@ -7,7 +7,7 @@ trait Allocator { struct DefaultAllocator; impl Allocator for DefaultAllocator { - //~^ ERROR: the type parameter `T` is not constrained + //~^ ERROR the type parameter `T` is not constrained type Buffer = (); } diff --git a/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.rs b/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.rs index 4391bf01dc91f..c0f42c204438f 100644 --- a/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.rs +++ b/tests/ui/type-alias-impl-trait/issue-84660-unsoundness.rs @@ -22,8 +22,8 @@ impl Trait for Out { type Out = Out; #[define_opaque(Bar)] fn convert(_i: In) -> Self::Out { - //[next]~^ ERROR: cannot satisfy `Bar == _` - //[current]~^^ ERROR: item does not constrain `Bar::{opaque#0}` + //[next]~^ ERROR cannot satisfy `Bar == _` + //[current]~^^ ERROR item does not constrain `Bar::{opaque#0}` unreachable!(); } } diff --git a/tests/ui/type-alias-impl-trait/issue-89686.rs b/tests/ui/type-alias-impl-trait/issue-89686.rs index 5370b8844ffa8..7afe0802d1eca 100644 --- a/tests/ui/type-alias-impl-trait/issue-89686.rs +++ b/tests/ui/type-alias-impl-trait/issue-89686.rs @@ -17,7 +17,7 @@ trait Trait { Self: Sized, { async move { self.f().await } - //~^ ERROR: the trait bound `T: Trait` is not satisfied + //~^ ERROR the trait bound `T: Trait` is not satisfied } } diff --git a/tests/ui/type-alias-impl-trait/issue-90400-1.rs b/tests/ui/type-alias-impl-trait/issue-90400-1.rs index 50207605748c8..9f73866a7d68a 100644 --- a/tests/ui/type-alias-impl-trait/issue-90400-1.rs +++ b/tests/ui/type-alias-impl-trait/issue-90400-1.rs @@ -19,7 +19,7 @@ impl Foo for MyFoo { type FooFn = impl FnOnce(); fn foo(&self, bar: B) -> Self::FooFn { - move || bar.bar() //~ ERROR: the trait bound `B: Bar` is not satisfied + move || bar.bar() //~ ERROR the trait bound `B: Bar` is not satisfied } } diff --git a/tests/ui/type-alias-impl-trait/issue-90400-2.rs b/tests/ui/type-alias-impl-trait/issue-90400-2.rs index 60ff962ea2e30..03e2296f2c50c 100644 --- a/tests/ui/type-alias-impl-trait/issue-90400-2.rs +++ b/tests/ui/type-alias-impl-trait/issue-90400-2.rs @@ -22,7 +22,7 @@ impl Foo for MyFoo { type FooFn = impl Baz; fn foo(&self, bar: B) -> Self::FooFn { - MyBaz(bar) //~ ERROR: the trait bound `B: Bar` is not satisfied + MyBaz(bar) //~ ERROR the trait bound `B: Bar` is not satisfied } } diff --git a/tests/ui/type-alias-impl-trait/issue-94429.rs b/tests/ui/type-alias-impl-trait/issue-94429.rs index 11beed06a20cd..e4b716eb9752d 100644 --- a/tests/ui/type-alias-impl-trait/issue-94429.rs +++ b/tests/ui/type-alias-impl-trait/issue-94429.rs @@ -13,7 +13,7 @@ impl Runnable for Implementor { type Coro = impl Coroutine; fn run(&mut self) -> Self::Coro { - //~^ ERROR: type mismatch resolving + //~^ ERROR type mismatch resolving #[coroutine] move || { yield 1; diff --git a/tests/ui/type-alias-impl-trait/lazy_subtyping_of_opaques.rs b/tests/ui/type-alias-impl-trait/lazy_subtyping_of_opaques.rs index 075b0bd75fa53..6c8aef2263df8 100644 --- a/tests/ui/type-alias-impl-trait/lazy_subtyping_of_opaques.rs +++ b/tests/ui/type-alias-impl-trait/lazy_subtyping_of_opaques.rs @@ -8,10 +8,10 @@ type Tait = impl FnOnce() -> (); #[define_opaque(Tait)] fn reify_as_tait() -> Thunk { - //~^ ERROR: expected a `FnOnce()` closure, found `()` + //~^ ERROR expected a `FnOnce()` closure, found `()` Thunk::new(|cont| cont) - //~^ ERROR: mismatched types - //~| ERROR: expected a `FnOnce()` closure, found `()` + //~^ ERROR mismatched types + //~| ERROR expected a `FnOnce()` closure, found `()` } struct Thunk(F); diff --git a/tests/ui/type-alias-impl-trait/method_resolution.rs b/tests/ui/type-alias-impl-trait/method_resolution.rs index a9162d0e28bee..e13fc62f33fdd 100644 --- a/tests/ui/type-alias-impl-trait/method_resolution.rs +++ b/tests/ui/type-alias-impl-trait/method_resolution.rs @@ -20,7 +20,7 @@ impl Bar { impl Bar { fn foo(self) { self.bar() - //~^ ERROR: no method named `bar` + //~^ ERROR no method named `bar` } } diff --git a/tests/ui/type-alias-impl-trait/method_resolution3.rs b/tests/ui/type-alias-impl-trait/method_resolution3.rs index a18dcc9a2fe3a..c3bd1244c6cad 100644 --- a/tests/ui/type-alias-impl-trait/method_resolution3.rs +++ b/tests/ui/type-alias-impl-trait/method_resolution3.rs @@ -14,11 +14,11 @@ struct Bar(T); impl Bar { fn bar(self: Bar) { - //~^ ERROR: invalid `self` parameter + //~^ ERROR invalid `self` parameter self.foo() } fn baz(self: &Bar) { - //~^ ERROR: invalid `self` parameter + //~^ ERROR invalid `self` parameter self.foo() } } diff --git a/tests/ui/type-alias-impl-trait/method_resolution4.rs b/tests/ui/type-alias-impl-trait/method_resolution4.rs index 8a1b60b0c6e3a..49afb862b6711 100644 --- a/tests/ui/type-alias-impl-trait/method_resolution4.rs +++ b/tests/ui/type-alias-impl-trait/method_resolution4.rs @@ -23,11 +23,11 @@ impl Bar { impl Bar { fn foo(self: Bar) { - //~^ ERROR: invalid `self` parameter + //~^ ERROR invalid `self` parameter self.bar() } fn foomp(self: &Bar) { - //~^ ERROR: invalid `self` parameter + //~^ ERROR invalid `self` parameter self.bar() } } diff --git a/tests/ui/type-alias-impl-trait/method_resolution_trait_method_from_opaque.rs b/tests/ui/type-alias-impl-trait/method_resolution_trait_method_from_opaque.rs index 93461fcbb0b2a..d6f8f8968f7e8 100644 --- a/tests/ui/type-alias-impl-trait/method_resolution_trait_method_from_opaque.rs +++ b/tests/ui/type-alias-impl-trait/method_resolution_trait_method_from_opaque.rs @@ -24,9 +24,9 @@ impl Foo { #[define_opaque(Tait)] fn foo(&mut self) { - //[current]~^ ERROR: item does not constrain + //[current]~^ ERROR item does not constrain self.bar.next().unwrap(); - //[next]~^ ERROR: type annotations needed + //[next]~^ ERROR type annotations needed } } diff --git a/tests/ui/type-alias-impl-trait/missing_lifetime_bound.rs b/tests/ui/type-alias-impl-trait/missing_lifetime_bound.rs index d77efa39aeb61..edd7ed6d46841 100644 --- a/tests/ui/type-alias-impl-trait/missing_lifetime_bound.rs +++ b/tests/ui/type-alias-impl-trait/missing_lifetime_bound.rs @@ -4,6 +4,6 @@ type Opaque2 = impl Sized; type Opaque<'a, T> = Opaque2; #[define_opaque(Opaque)] fn defining<'a, T>(x: &'a i32) -> Opaque { x } //~ WARNING elided lifetime has a name -//~^ ERROR: hidden type for `Opaque2` captures lifetime that does not appear in bounds +//~^ ERROR hidden type for `Opaque2` captures lifetime that does not appear in bounds fn main() {} diff --git a/tests/ui/type-alias-impl-trait/nested-tait-inference.rs b/tests/ui/type-alias-impl-trait/nested-tait-inference.rs index d4ad72797cfe9..3bbce2662bbe4 100644 --- a/tests/ui/type-alias-impl-trait/nested-tait-inference.rs +++ b/tests/ui/type-alias-impl-trait/nested-tait-inference.rs @@ -16,7 +16,7 @@ impl Foo<()> for () {} #[define_opaque(FooX)] fn foo() -> impl Foo { - //[current]~^ ERROR: the trait bound `(): Foo` is not satisfied + //[current]~^ ERROR the trait bound `(): Foo` is not satisfied // FIXME(type-alias-impl-trait): We could probably make this work. () } diff --git a/tests/ui/type-alias-impl-trait/nested-tait-inference2.rs b/tests/ui/type-alias-impl-trait/nested-tait-inference2.rs index 4aeecb9140c52..d9de1862921d9 100644 --- a/tests/ui/type-alias-impl-trait/nested-tait-inference2.rs +++ b/tests/ui/type-alias-impl-trait/nested-tait-inference2.rs @@ -16,9 +16,9 @@ impl Foo for () {} #[define_opaque(FooX)] fn foo() -> impl Foo { - //[current]~^ ERROR: the trait bound `(): Foo` is not satisfied + //[current]~^ ERROR the trait bound `(): Foo` is not satisfied () - //[next]~^ ERROR: cannot satisfy `impl Foo == ()` + //[next]~^ ERROR cannot satisfy `impl Foo == ()` } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/nested-tait-inference3.rs b/tests/ui/type-alias-impl-trait/nested-tait-inference3.rs index 3e7b8c80d1b24..d214b67ea1d1c 100644 --- a/tests/ui/type-alias-impl-trait/nested-tait-inference3.rs +++ b/tests/ui/type-alias-impl-trait/nested-tait-inference3.rs @@ -11,7 +11,7 @@ impl Foo for () {} #[define_opaque(FooX)] fn foo() -> impl Foo { - //~^ ERROR: item does not constrain + //~^ ERROR item does not constrain () } diff --git a/tests/ui/type-alias-impl-trait/nested.rs b/tests/ui/type-alias-impl-trait/nested.rs index 1a89039af8a7e..cd585e5731c83 100644 --- a/tests/ui/type-alias-impl-trait/nested.rs +++ b/tests/ui/type-alias-impl-trait/nested.rs @@ -9,7 +9,7 @@ impl Trait for U {} #[define_opaque(Bar)] fn bar() -> Bar { - //~^ ERROR: item does not constrain + //~^ ERROR item does not constrain 42 } diff --git a/tests/ui/type-alias-impl-trait/no_inferrable_concrete_type.rs b/tests/ui/type-alias-impl-trait/no_inferrable_concrete_type.rs index 8e5e47194153a..9122e3cb386db 100644 --- a/tests/ui/type-alias-impl-trait/no_inferrable_concrete_type.rs +++ b/tests/ui/type-alias-impl-trait/no_inferrable_concrete_type.rs @@ -8,7 +8,7 @@ pub type Foo = impl Copy; // make compiler happy about using 'Foo' #[define_opaque(Foo)] pub fn bar(x: Foo) -> Foo { - //~^ ERROR: item does not constrain `Foo::{opaque#0}` + //~^ ERROR item does not constrain `Foo::{opaque#0}` x } diff --git a/tests/ui/type-alias-impl-trait/not-matching-trait-refs-isnt-defining.rs b/tests/ui/type-alias-impl-trait/not-matching-trait-refs-isnt-defining.rs index 112ee4d557156..bdc0e1e13f4c7 100644 --- a/tests/ui/type-alias-impl-trait/not-matching-trait-refs-isnt-defining.rs +++ b/tests/ui/type-alias-impl-trait/not-matching-trait-refs-isnt-defining.rs @@ -9,7 +9,7 @@ trait Foo { struct DefinesOpaque; impl Foo for () { type Assoc = impl Sized; - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type // This test's return type is `u32`, *not* the opaque that is defined above. // Previously we were only checking that the self type of the assoc matched, diff --git a/tests/ui/type-alias-impl-trait/param_mismatch.rs b/tests/ui/type-alias-impl-trait/param_mismatch.rs index 4e4e06acfd40c..dded574143822 100644 --- a/tests/ui/type-alias-impl-trait/param_mismatch.rs +++ b/tests/ui/type-alias-impl-trait/param_mismatch.rs @@ -11,7 +11,7 @@ type Opaque<'a> = impl Sized + 'a; #[define_opaque(Opaque)] fn test(s: &str) -> (Opaque<'_>, impl Fn(&str) -> Opaque<'_>) { (s, id) - //~^ ERROR: expected generic lifetime parameter, found `'_` + //~^ ERROR expected generic lifetime parameter, found `'_` } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/param_mismatch2.rs b/tests/ui/type-alias-impl-trait/param_mismatch2.rs index f6a9971141105..a7bc714945e76 100644 --- a/tests/ui/type-alias-impl-trait/param_mismatch2.rs +++ b/tests/ui/type-alias-impl-trait/param_mismatch2.rs @@ -11,7 +11,7 @@ type Opaque<'a> = impl Sized + 'a; #[define_opaque(Opaque)] fn test(s: &str) -> (impl Fn(&str) -> Opaque<'_>, impl Fn(&str) -> Opaque<'_>) { - (id, id) //~ ERROR: expected generic lifetime parameter, found `'_` + (id, id) //~ ERROR expected generic lifetime parameter, found `'_` } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/param_mismatch3.rs b/tests/ui/type-alias-impl-trait/param_mismatch3.rs index 17b6f8bce2a81..f0bebf10c5661 100644 --- a/tests/ui/type-alias-impl-trait/param_mismatch3.rs +++ b/tests/ui/type-alias-impl-trait/param_mismatch3.rs @@ -22,7 +22,7 @@ type Opaque2<'a> = impl Sized + 'a; #[define_opaque(Opaque2)] fn test2(s: &str) -> (impl Fn(&str) -> Opaque2<'_>, Opaque2<'_>) { - (id, s) //~ ERROR: expected generic lifetime parameter, found `'_` + (id, s) //~ ERROR expected generic lifetime parameter, found `'_` } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/path_resolution_taint.rs b/tests/ui/type-alias-impl-trait/path_resolution_taint.rs index b320e88450bd6..c6afc13eb834b 100644 --- a/tests/ui/type-alias-impl-trait/path_resolution_taint.rs +++ b/tests/ui/type-alias-impl-trait/path_resolution_taint.rs @@ -3,7 +3,7 @@ #![feature(type_alias_impl_trait)] fn dyn_hoops() -> *const dyn Iterator { - //~^ ERROR: cannot find trait `Captures` in this scope + //~^ ERROR cannot find trait `Captures` in this scope loop {} } diff --git a/tests/ui/type-alias-impl-trait/reveal_local.rs b/tests/ui/type-alias-impl-trait/reveal_local.rs index 1e1e118937b2b..545477cd5b010 100644 --- a/tests/ui/type-alias-impl-trait/reveal_local.rs +++ b/tests/ui/type-alias-impl-trait/reveal_local.rs @@ -21,7 +21,7 @@ fn not_gooder() -> Foo { // while we could know this from the hidden type, it would // need extra roundabout logic to support it. is_send::(); - //~^ ERROR: type annotations needed: cannot satisfy `Foo: Send` + //~^ ERROR type annotations needed: cannot satisfy `Foo: Send` x } diff --git a/tests/ui/type-alias-impl-trait/taint.rs b/tests/ui/type-alias-impl-trait/taint.rs index 3d67c9bca4162..539f35b5001f9 100644 --- a/tests/ui/type-alias-impl-trait/taint.rs +++ b/tests/ui/type-alias-impl-trait/taint.rs @@ -11,7 +11,7 @@ fn set(x: &mut isize) -> isize { #[define_opaque(Two)] fn d(x: Two) { - let c1 = || set(x); //~ ERROR: expected generic lifetime parameter, found `'_` + let c1 = || set(x); //~ ERROR expected generic lifetime parameter, found `'_` c1; } diff --git a/tests/ui/type-alias-impl-trait/type-alias-impl-trait-fn-type.rs b/tests/ui/type-alias-impl-trait/type-alias-impl-trait-fn-type.rs index 46c2c22cac1c9..95ab209de8b05 100644 --- a/tests/ui/type-alias-impl-trait/type-alias-impl-trait-fn-type.rs +++ b/tests/ui/type-alias-impl-trait/type-alias-impl-trait-fn-type.rs @@ -4,7 +4,7 @@ // FIXME: this is ruled out for now but should work type Foo = fn() -> impl Send; -//~^ ERROR: `impl Trait` is not allowed in `fn` pointer return types +//~^ ERROR `impl Trait` is not allowed in `fn` pointer return types fn make_foo() -> Foo { || 15 diff --git a/tests/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs b/tests/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs index 95d52e1ff96ec..67c4bd34313b5 100644 --- a/tests/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs +++ b/tests/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs @@ -18,7 +18,7 @@ fn bla() -> TE { #[define_opaque(TE)] fn bla2() -> TE { - //~^ ERROR: item does not constrain `TE::{opaque#0}` + //~^ ERROR item does not constrain `TE::{opaque#0}` bla() } diff --git a/tests/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs b/tests/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs index b232097fdb332..20d166051a3a0 100644 --- a/tests/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs +++ b/tests/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs @@ -12,7 +12,7 @@ impl<'a, I: Iterator> Trait for (i32, I) { type Associated = (i32, impl Iterator); fn into(self) -> Self::Associated { (0_i32, [0_i32].iter().copied()) - //~^ ERROR: expected generic lifetime parameter, found `'_` + //~^ ERROR expected generic lifetime parameter, found `'_` } } diff --git a/tests/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.rs b/tests/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.rs index 115df16bd3eac..96354e5c11dff 100644 --- a/tests/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.rs +++ b/tests/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.rs @@ -1,14 +1,14 @@ #![feature(type_alias_impl_trait)] type Foo = impl 'static; -//~^ ERROR: at least one trait must be specified +//~^ ERROR at least one trait must be specified #[define_opaque(Foo)] fn foo() -> Foo { "foo" } -fn bar() -> impl 'static { //~ ERROR: at least one trait must be specified +fn bar() -> impl 'static { //~ ERROR at least one trait must be specified "foo" } diff --git a/tests/ui/type-alias-impl-trait/underef-index-out-of-bounds-121472.rs b/tests/ui/type-alias-impl-trait/underef-index-out-of-bounds-121472.rs index 2dab81cba6f6a..7b53bd72aae68 100644 --- a/tests/ui/type-alias-impl-trait/underef-index-out-of-bounds-121472.rs +++ b/tests/ui/type-alias-impl-trait/underef-index-out-of-bounds-121472.rs @@ -5,7 +5,7 @@ mod foo { pub trait T {} pub type Alias<'a> = impl T; - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type fn bar() { super::with_positive(|&n| ()); //~^ ERROR mismatched types diff --git a/tests/ui/type-alias-impl-trait/unnameable_type.rs b/tests/ui/type-alias-impl-trait/unnameable_type.rs index 0b97cc2941f6b..1138fffa11bd1 100644 --- a/tests/ui/type-alias-impl-trait/unnameable_type.rs +++ b/tests/ui/type-alias-impl-trait/unnameable_type.rs @@ -18,7 +18,7 @@ type MyPrivate = impl Sized; impl Trait for u32 { #[define_opaque(MyPrivate)] fn dont_define_this(private: MyPrivate) { - //~^ ERROR: incompatible type for trait + //~^ ERROR incompatible type for trait let _: () = private; } } diff --git a/tests/ui/type-alias-impl-trait/variance.rs b/tests/ui/type-alias-impl-trait/variance.rs index ecd7158223c80..ddefc05798763 100644 --- a/tests/ui/type-alias-impl-trait/variance.rs +++ b/tests/ui/type-alias-impl-trait/variance.rs @@ -6,21 +6,21 @@ trait Captures<'a> {} impl Captures<'_> for T {} type NotCapturedEarly<'a> = impl Sized; //~ ['a: *, 'a: o] -//~^ ERROR: unconstrained opaque type +//~^ ERROR unconstrained opaque type type CapturedEarly<'a> = impl Sized + Captures<'a>; //~ ['a: *, 'a: o] -//~^ ERROR: unconstrained opaque type +//~^ ERROR unconstrained opaque type type NotCapturedLate<'a> = dyn for<'b> Iterator; //~ ['a: *, 'a: o, 'b: o] //~^ ERROR `impl Trait` cannot capture higher-ranked lifetime from `dyn` type -//~| ERROR: unconstrained opaque type +//~| ERROR unconstrained opaque type type Captured<'a> = dyn for<'b> Iterator>; //~ ['a: *, 'a: o, 'b: o] //~^ ERROR `impl Trait` cannot capture higher-ranked lifetime from `dyn` type -//~| ERROR: unconstrained opaque type +//~| ERROR unconstrained opaque type type Bar<'a, 'b: 'b, T> = impl Sized; //~ ERROR ['a: *, 'b: *, T: o, 'a: o, 'b: o] -//~^ ERROR: unconstrained opaque type +//~^ ERROR unconstrained opaque type trait Foo<'i> { type ImplicitCapture<'a>; @@ -32,24 +32,24 @@ trait Foo<'i> { impl<'i> Foo<'i> for &'i () { type ImplicitCapture<'a> = impl Sized; //~ ['i: *, 'a: *, 'i: o, 'a: o] - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type type ExplicitCaptureFromHeader<'a> = impl Sized + Captures<'i>; //~ ['i: *, 'a: *, 'i: o, 'a: o] - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type type ExplicitCaptureFromGat<'a> = impl Sized + Captures<'a>; //~ ['i: *, 'a: *, 'i: o, 'a: o] - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type } impl<'i> Foo<'i> for () { type ImplicitCapture<'a> = impl Sized; //~ ['i: *, 'a: *, 'i: o, 'a: o] - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type type ExplicitCaptureFromHeader<'a> = impl Sized + Captures<'i>; //~ ['i: *, 'a: *, 'i: o, 'a: o] - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type type ExplicitCaptureFromGat<'a> = impl Sized + Captures<'a>; //~ ['i: *, 'a: *, 'i: o, 'a: o] - //~^ ERROR: unconstrained opaque type + //~^ ERROR unconstrained opaque type } trait Nesting<'a> { diff --git a/tests/ui/type/issue-101866.rs b/tests/ui/type/issue-101866.rs index d332c4adb0060..4a4533a7723f8 100644 --- a/tests/ui/type/issue-101866.rs +++ b/tests/ui/type/issue-101866.rs @@ -10,6 +10,6 @@ impl TraitA for StructA { fn main() { TraitA::::func(); - //~^ ERROR: cannot call associated function on trait without specifying the corresponding `impl` type [E0790] - //~| help: use the fully-qualified path to the only available implementation + //~^ ERROR cannot call associated function on trait without specifying the corresponding `impl` type [E0790] + //~| help use the fully-qualified path to the only available implementation } diff --git a/tests/ui/type/issue-102598.rs b/tests/ui/type/issue-102598.rs index 93808f18b9971..08230a39ebf9e 100644 --- a/tests/ui/type/issue-102598.rs +++ b/tests/ui/type/issue-102598.rs @@ -1,8 +1,8 @@ fn foo<'a>(_: impl 'a Sized) {} -//~^ ERROR: expected `+` between lifetime and Sized -//~| ERROR: expected one of `:`, `@`, or `|`, found `)` -//~| ERROR: expected one of `)`, `+`, or `,`, found `Sized` -//~| ERROR: at least one trait must be specified +//~^ ERROR expected `+` between lifetime and Sized +//~| ERROR expected one of `:`, `@`, or `|`, found `)` +//~| ERROR expected one of `)`, `+`, or `,`, found `Sized` +//~| ERROR at least one trait must be specified fn main(){ } diff --git a/tests/ui/type/issue-58355.rs b/tests/ui/type/issue-58355.rs index 3b62fdece403b..d7e2c3199bfe4 100644 --- a/tests/ui/type/issue-58355.rs +++ b/tests/ui/type/issue-58355.rs @@ -3,5 +3,5 @@ pub fn foo(callback: fn() -> dyn ToString) { let mut x: Option dyn ToString>> = None; x = Some(Box::new(callback)); - //~^ ERROR: the size for values of type `dyn ToString` cannot be known at compilation time + //~^ ERROR the size for values of type `dyn ToString` cannot be known at compilation time } diff --git a/tests/ui/type/pattern_types/assoc_const.rs b/tests/ui/type/pattern_types/assoc_const.rs index 90508801990e8..6f98b74673177 100644 --- a/tests/ui/type/pattern_types/assoc_const.rs +++ b/tests/ui/type/pattern_types/assoc_const.rs @@ -15,10 +15,10 @@ trait Foo { } fn foo(_: pattern_type!(u32 is ::START..=::END)) {} -//[default]~^ ERROR: generic parameters may not be used in const operations -//[default]~| ERROR: generic parameters may not be used in const operations +//[default]~^ ERROR generic parameters may not be used in const operations +//[default]~| ERROR generic parameters may not be used in const operations fn bar(_: pattern_type!(u32 is T::START..=T::END)) {} -//[default]~^ ERROR: generic parameters may not be used in const operations -//[default]~| ERROR: generic parameters may not be used in const operations +//[default]~^ ERROR generic parameters may not be used in const operations +//[default]~| ERROR generic parameters may not be used in const operations fn main() {} diff --git a/tests/ui/type/pattern_types/bad_pat.rs b/tests/ui/type/pattern_types/bad_pat.rs index 549b0d11dd187..85b6fc158fbf2 100644 --- a/tests/ui/type/pattern_types/bad_pat.rs +++ b/tests/ui/type/pattern_types/bad_pat.rs @@ -4,10 +4,10 @@ use std::pat::pattern_type; type NonNullU32_2 = pattern_type!(u32 is 1..=); -//~^ ERROR: inclusive range with no end +//~^ ERROR inclusive range with no end type Positive2 = pattern_type!(i32 is 0..=); -//~^ ERROR: inclusive range with no end +//~^ ERROR inclusive range with no end type Wild = pattern_type!(() is _); -//~^ ERROR: pattern not supported in pattern types +//~^ ERROR pattern not supported in pattern types fn main() {} diff --git a/tests/ui/type/pattern_types/derives.rs b/tests/ui/type/pattern_types/derives.rs index 3878c47554d98..fd9193db8db79 100644 --- a/tests/ui/type/pattern_types/derives.rs +++ b/tests/ui/type/pattern_types/derives.rs @@ -8,7 +8,7 @@ use std::pat::pattern_type; #[derive(Clone, Copy, PartialEq)] #[repr(transparent)] struct Nanoseconds(NanoI32); -//~^ ERROR: binary operation `==` cannot be applied to type `(i32) is 0..=999999999` +//~^ ERROR binary operation `==` cannot be applied to type `(i32) is 0..=999999999` type NanoI32 = crate::pattern_type!(i32 is 0..=999_999_999); diff --git a/tests/ui/type/pattern_types/feature-gate-pattern_types2.rs b/tests/ui/type/pattern_types/feature-gate-pattern_types2.rs index c6b4b325fa35a..a5c207654f152 100644 --- a/tests/ui/type/pattern_types/feature-gate-pattern_types2.rs +++ b/tests/ui/type/pattern_types/feature-gate-pattern_types2.rs @@ -9,4 +9,4 @@ type Percent = pattern_type!(u32 is 0..=100); type Negative = pattern_type!(i32 is ..=0); type Positive = pattern_type!(i32 is 0..); type Always = pattern_type!(Option is Some(_)); -//~^ ERROR: pattern not supported in pattern types +//~^ ERROR pattern not supported in pattern types diff --git a/tests/ui/type/pattern_types/literals.rs b/tests/ui/type/pattern_types/literals.rs index 7fd630dab3ad9..1addea944c9b1 100644 --- a/tests/ui/type/pattern_types/literals.rs +++ b/tests/ui/type/pattern_types/literals.rs @@ -20,12 +20,12 @@ fn in_range() -> pattern_type!(u32 is 1..) { fn negative_lit_on_unsigned_ty() -> pattern_type!(u32 is 1..) { -3 - //~^ ERROR: cannot apply unary operator `-` to type `(u32) is 1..` + //~^ ERROR cannot apply unary operator `-` to type `(u32) is 1..` } fn negative_lit_in_range() -> pattern_type!(i8 is -5..5) { -2 - //~^ ERROR: cannot apply unary operator `-` to type `(i8) is -5..=4` + //~^ ERROR cannot apply unary operator `-` to type `(i8) is -5..=4` } fn positive_lit_in_range_of_signed() -> pattern_type!(i8 is -5..5) { diff --git a/tests/ui/type/pattern_types/nested.rs b/tests/ui/type/pattern_types/nested.rs index fd950d7329148..514bee26878e9 100644 --- a/tests/ui/type/pattern_types/nested.rs +++ b/tests/ui/type/pattern_types/nested.rs @@ -8,25 +8,25 @@ use std::pat::pattern_type; // Undoing an inner pattern type's restrictions should either be forbidden, // or still validate correctly. const BAD_NESTING: pattern_type!(pattern_type!(u32 is 1..) is 0..) = todo!(); -//~^ ERROR: not a valid base type for range patterns -//~| ERROR: mismatched types +//~^ ERROR not a valid base type for range patterns +//~| ERROR mismatched types // We want to get the most narrowest version that a pattern could be const BAD_NESTING2: pattern_type!(pattern_type!(i32 is 1..) is ..=-1) = todo!(); -//~^ ERROR: not a valid base type for range patterns -//~| ERROR: cannot apply unary operator `-` to type `(i32) is 1..` +//~^ ERROR not a valid base type for range patterns +//~| ERROR cannot apply unary operator `-` to type `(i32) is 1..` const BAD_NESTING3: pattern_type!(pattern_type!(i32 is 1..) is ..0) = todo!(); -//~^ ERROR: not a valid base type for range patterns -//~| ERROR: not a valid base type for range patterns -//~| ERROR: mismatched types +//~^ ERROR not a valid base type for range patterns +//~| ERROR not a valid base type for range patterns +//~| ERROR mismatched types const BAD_NESTING4: pattern_type!(() is ..0) = todo!(); -//~^ ERROR: not a valid base type for range patterns -//~| ERROR: not a valid base type for range patterns -//~| ERROR: mismatched types +//~^ ERROR not a valid base type for range patterns +//~| ERROR not a valid base type for range patterns +//~| ERROR mismatched types const BAD_NESTING5: pattern_type!(f32 is 1.0 .. 2.0) = todo!(); -//~^ ERROR: not a valid base type for range patterns +//~^ ERROR not a valid base type for range patterns fn main() {} diff --git a/tests/ui/type/pattern_types/pattern_type_mismatch.rs b/tests/ui/type/pattern_types/pattern_type_mismatch.rs index 0c88f27d83686..699da2910d8c4 100644 --- a/tests/ui/type/pattern_types/pattern_type_mismatch.rs +++ b/tests/ui/type/pattern_types/pattern_type_mismatch.rs @@ -6,11 +6,11 @@ use std::pat::pattern_type; const BAD_NESTING4: pattern_type!(u8 is 'a'..='a') = todo!(); -//~^ ERROR: mismatched types -//~| ERROR: mismatched types +//~^ ERROR mismatched types +//~| ERROR mismatched types const BAD_NESTING5: pattern_type!(char is 1..=1) = todo!(); -//~^ ERROR: mismatched types -//~| ERROR: mismatched types +//~^ ERROR mismatched types +//~| ERROR mismatched types fn main() {} diff --git a/tests/ui/type/pattern_types/range_patterns.rs b/tests/ui/type/pattern_types/range_patterns.rs index 21c1454d6cd53..ee30ad9886329 100644 --- a/tests/ui/type/pattern_types/range_patterns.rs +++ b/tests/ui/type/pattern_types/range_patterns.rs @@ -23,7 +23,7 @@ type EMPTY = pattern_type!(u32 is 1..1); //~ ERROR unknown layout #[rustc_layout(debug)] type WRAP = pattern_type!(u32 is 1..0); //~ ERROR unknown layout -//~^ ERROR: evaluation of constant value failed +//~^ ERROR evaluation of constant value failed #[rustc_layout(debug)] type WRAP2 = pattern_type!(u32 is 5..2); //~ ERROR unknown layout diff --git a/tests/ui/type/pattern_types/range_patterns_trait_impls2.rs b/tests/ui/type/pattern_types/range_patterns_trait_impls2.rs index 90f80a2f34645..2d303836b585f 100644 --- a/tests/ui/type/pattern_types/range_patterns_trait_impls2.rs +++ b/tests/ui/type/pattern_types/range_patterns_trait_impls2.rs @@ -10,6 +10,6 @@ use std::pat::pattern_type; type Y = pattern_type!(u32 is 1..); impl Eq for Y {} -//~^ ERROR: only traits defined in the current crate can be implemented for arbitrary types +//~^ ERROR only traits defined in the current crate can be implemented for arbitrary types fn main() {} diff --git a/tests/ui/type/pattern_types/range_patterns_unusable.rs b/tests/ui/type/pattern_types/range_patterns_unusable.rs index 98f13ca0bc0bb..1a3b894d74215 100644 --- a/tests/ui/type/pattern_types/range_patterns_unusable.rs +++ b/tests/ui/type/pattern_types/range_patterns_unusable.rs @@ -10,5 +10,5 @@ type Z = Option; fn main() { let z: Z = Some(unsafe { std::mem::transmute(42_u32) }); - let _: Option = unsafe { std::mem::transmute(z) }; //~ ERROR: different sizes + let _: Option = unsafe { std::mem::transmute(z) }; //~ ERROR different sizes } diff --git a/tests/ui/type/pattern_types/reverse_range.rs b/tests/ui/type/pattern_types/reverse_range.rs index e698e9dd541d5..a8e6b7693528c 100644 --- a/tests/ui/type/pattern_types/reverse_range.rs +++ b/tests/ui/type/pattern_types/reverse_range.rs @@ -5,7 +5,7 @@ use std::pat::pattern_type; const NONE: pattern_type!(u8 is 1..0) = unsafe { std::mem::transmute(3_u8) }; -//~^ NOTE: exclusive range end at minimum value of type -//~| ERROR: evaluation of constant value failed +//~^ NOTE exclusive range end at minimum value of type +//~| ERROR evaluation of constant value failed fn main() {} diff --git a/tests/ui/type/pattern_types/signed_ranges.rs b/tests/ui/type/pattern_types/signed_ranges.rs index 3725fbda7292a..5c1f3cef1bab7 100644 --- a/tests/ui/type/pattern_types/signed_ranges.rs +++ b/tests/ui/type/pattern_types/signed_ranges.rs @@ -4,10 +4,10 @@ use std::pat::pattern_type; type Sign = pattern_type!(u32 is -10..); -//~^ ERROR: cannot apply unary operator `-` +//~^ ERROR cannot apply unary operator `-` type SignedChar = pattern_type!(char is -'A'..); -//~^ ERROR: cannot apply unary operator `-` +//~^ ERROR cannot apply unary operator `-` fn main() { match 42_u8 { diff --git a/tests/ui/type/pattern_types/unimplemented_pat.rs b/tests/ui/type/pattern_types/unimplemented_pat.rs index 44851ec1a1049..55ac7e533e805 100644 --- a/tests/ui/type/pattern_types/unimplemented_pat.rs +++ b/tests/ui/type/pattern_types/unimplemented_pat.rs @@ -6,9 +6,9 @@ use std::pat::pattern_type; type Always = pattern_type!(Option is Some(_)); -//~^ ERROR: pattern not supported +//~^ ERROR pattern not supported type Binding = pattern_type!(Option is x); -//~^ ERROR: pattern not supported +//~^ ERROR pattern not supported fn main() {} diff --git a/tests/ui/type/pattern_types/validity.rs b/tests/ui/type/pattern_types/validity.rs index c61bb71ac252f..5e33be17557ed 100644 --- a/tests/ui/type/pattern_types/validity.rs +++ b/tests/ui/type/pattern_types/validity.rs @@ -8,32 +8,32 @@ use std::pat::pattern_type; const BAD: pattern_type!(u32 is 1..) = unsafe { std::mem::transmute(0) }; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value const BAD_UNINIT: pattern_type!(u32 is 1..) = - //~^ ERROR: evaluation of constant value failed + //~^ ERROR evaluation of constant value failed unsafe { std::mem::transmute(std::mem::MaybeUninit::::uninit()) }; const BAD_PTR: pattern_type!(usize is 1..) = unsafe { std::mem::transmute(&42) }; -//~^ ERROR: evaluation of constant value failed +//~^ ERROR evaluation of constant value failed const BAD_AGGREGATE: (pattern_type!(u32 is 1..), u32) = (unsafe { std::mem::transmute(0) }, 0); -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value struct Foo(Bar); struct Bar(pattern_type!(u32 is 1..)); const BAD_FOO: Foo = Foo(Bar(unsafe { std::mem::transmute(0) })); -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value const CHAR_UNINIT: pattern_type!(char is 'A'..'Z') = - //~^ ERROR: evaluation of constant value failed + //~^ ERROR evaluation of constant value failed unsafe { std::mem::transmute(std::mem::MaybeUninit::::uninit()) }; const CHAR_OOB_PAT: pattern_type!(char is 'A'..'Z') = unsafe { std::mem::transmute('a') }; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value const CHAR_OOB: pattern_type!(char is 'A'..'Z') = unsafe { std::mem::transmute(u32::MAX) }; -//~^ ERROR: it is undefined behavior to use this value +//~^ ERROR it is undefined behavior to use this value fn main() {} diff --git a/tests/ui/typeck/check-args-on-fn-err.rs b/tests/ui/typeck/check-args-on-fn-err.rs index 04b98ddd95295..e009d87dd486e 100644 --- a/tests/ui/typeck/check-args-on-fn-err.rs +++ b/tests/ui/typeck/check-args-on-fn-err.rs @@ -1,6 +1,6 @@ fn main() { unknown(1, |glyf| { - //~^ ERROR: cannot find function `unknown` in this scope + //~^ ERROR cannot find function `unknown` in this scope let actual = glyf; }); } diff --git a/tests/ui/typeck/const-in-fn-call-generics.rs b/tests/ui/typeck/const-in-fn-call-generics.rs index 675dbcc305475..2d9c8f879a93f 100644 --- a/tests/ui/typeck/const-in-fn-call-generics.rs +++ b/tests/ui/typeck/const-in-fn-call-generics.rs @@ -9,7 +9,7 @@ impl Collate for i32 { type Pass = (); fn collate(self) -> Self::Pass { generic::<{ true }>() - //~^ ERROR: mismatched types + //~^ ERROR mismatched types } } diff --git a/tests/ui/typeck/cyclic_type_ice.rs b/tests/ui/typeck/cyclic_type_ice.rs index 7899b354f3837..4efceee53c844 100644 --- a/tests/ui/typeck/cyclic_type_ice.rs +++ b/tests/ui/typeck/cyclic_type_ice.rs @@ -1,7 +1,7 @@ fn thing() { let f = |_, _| (); - f(f); //~ ERROR: closure/coroutine type that references itself - //~^ ERROR: this function takes 2 arguments but 1 argument was supplied + f(f); //~ ERROR closure/coroutine type that references itself + //~^ ERROR this function takes 2 arguments but 1 argument was supplied } fn main() {} diff --git a/tests/ui/typeck/issue-100164.fixed b/tests/ui/typeck/issue-100164.fixed index 4af32cfa3f1a2..c3885c725e4d1 100644 --- a/tests/ui/typeck/issue-100164.fixed +++ b/tests/ui/typeck/issue-100164.fixed @@ -1,9 +1,9 @@ //@ run-rustfix const _A: i32 = 123; -//~^ ERROR: missing type for `const` item +//~^ ERROR missing type for `const` item fn main() { const _B: i32 = 123; - //~^ ERROR: missing type for `const` item + //~^ ERROR missing type for `const` item } diff --git a/tests/ui/typeck/issue-100164.rs b/tests/ui/typeck/issue-100164.rs index 46ec1dea0c038..57d3c2c589679 100644 --- a/tests/ui/typeck/issue-100164.rs +++ b/tests/ui/typeck/issue-100164.rs @@ -1,9 +1,9 @@ //@ run-rustfix const _A: = 123; -//~^ ERROR: missing type for `const` item +//~^ ERROR missing type for `const` item fn main() { const _B: = 123; - //~^ ERROR: missing type for `const` item + //~^ ERROR missing type for `const` item } diff --git a/tests/ui/typeck/issue-10401.rs b/tests/ui/typeck/issue-10401.rs index d77ff381e1a09..24d57b63f60b6 100644 --- a/tests/ui/typeck/issue-10401.rs +++ b/tests/ui/typeck/issue-10401.rs @@ -1,5 +1,5 @@ fn main() { let mut a = "a"; a += { "b" }; - //~^ ERROR: binary assignment operation `+=` cannot be applied + //~^ ERROR binary assignment operation `+=` cannot be applied } diff --git a/tests/ui/typeck/issue-104582.rs b/tests/ui/typeck/issue-104582.rs index 104669dadbea1..47b47fc7f034e 100644 --- a/tests/ui/typeck/issue-104582.rs +++ b/tests/ui/typeck/issue-104582.rs @@ -1,5 +1,5 @@ fn main(){ let my_var: String(String?); - //~^ ERROR: invalid `?` in type - //~| ERROR: parenthesized type parameters may only be used with a `Fn` trait + //~^ ERROR invalid `?` in type + //~| ERROR parenthesized type parameters may only be used with a `Fn` trait } diff --git a/tests/ui/typeck/issue-105946.rs b/tests/ui/typeck/issue-105946.rs index 0ee70f9346c8a..eb5eb6c573e74 100644 --- a/tests/ui/typeck/issue-105946.rs +++ b/tests/ui/typeck/issue-105946.rs @@ -1,11 +1,11 @@ fn digit() -> str { //~^ ERROR the size for values of type return {}; - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] } fn main() { let [_y..] = [Box::new(1), Box::new(2)]; - //~^ ERROR: cannot find value `_y` in this scope [E0425] - //~| ERROR: `X..` patterns in slices are experimental [E0658] - //~| ERROR: pattern requires 1 element but array has 2 [E0527] + //~^ ERROR cannot find value `_y` in this scope [E0425] + //~| ERROR `X..` patterns in slices are experimental [E0658] + //~| ERROR pattern requires 1 element but array has 2 [E0527] } diff --git a/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.rs b/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.rs index 6bbac9d45bbe5..704a61bd3ab26 100644 --- a/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.rs +++ b/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.rs @@ -10,7 +10,7 @@ trait Trait { fn func() -> [(); N]; - //~^ ERROR: the constant `N` is not of type `usize` + //~^ ERROR the constant `N` is not of type `usize` } struct S {} diff --git a/tests/ui/typeck/issue-57404.rs b/tests/ui/typeck/issue-57404.rs index ecabca66a00cf..a5a036f4cf1e4 100644 --- a/tests/ui/typeck/issue-57404.rs +++ b/tests/ui/typeck/issue-57404.rs @@ -3,5 +3,5 @@ fn main() { let handlers: Option FnMut<&'a mut (), Output=()>>> = None; - handlers.unwrap().as_mut().call_mut(&mut ()); //~ ERROR: `&mut ()` is not a tuple + handlers.unwrap().as_mut().call_mut(&mut ()); //~ ERROR `&mut ()` is not a tuple } diff --git a/tests/ui/typeck/issue-75883.rs b/tests/ui/typeck/issue-75883.rs index c50ea0a086b14..673e2fbc471a4 100644 --- a/tests/ui/typeck/issue-75883.rs +++ b/tests/ui/typeck/issue-75883.rs @@ -4,8 +4,8 @@ pub struct UI {} impl UI { pub fn run() -> Result<_> { - //~^ ERROR: enum takes 2 generic arguments but 1 generic argument was supplied - //~| ERROR: the placeholder `_` is not allowed within types on item signatures for return types + //~^ ERROR enum takes 2 generic arguments but 1 generic argument was supplied + //~| ERROR the placeholder `_` is not allowed within types on item signatures for return types let mut ui = UI {}; ui.interact(); @@ -13,8 +13,8 @@ impl UI { } pub fn interact(&mut self) -> Result<_> { - //~^ ERROR: enum takes 2 generic arguments but 1 generic argument was supplied - //~| ERROR: the placeholder `_` is not allowed within types on item signatures for return types + //~^ ERROR enum takes 2 generic arguments but 1 generic argument was supplied + //~| ERROR the placeholder `_` is not allowed within types on item signatures for return types unimplemented!(); } } diff --git a/tests/ui/typeck/issue-80779.rs b/tests/ui/typeck/issue-80779.rs index 1624f6b7742b0..317ca1b575e55 100644 --- a/tests/ui/typeck/issue-80779.rs +++ b/tests/ui/typeck/issue-80779.rs @@ -3,11 +3,11 @@ pub struct T<'a>(&'a str); pub fn f<'a>(val: T<'a>) -> _ { - //~^ ERROR: the placeholder `_` is not allowed within types on item signatures for return types + //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types g(val) } pub fn g(_: T<'static>) -> _ {} -//~^ ERROR: the placeholder `_` is not allowed within types on item signatures for return types +//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types fn main() {} diff --git a/tests/ui/typeck/issue-81293.rs b/tests/ui/typeck/issue-81293.rs index 076b8c944b8a4..c8862f21fbd58 100644 --- a/tests/ui/typeck/issue-81293.rs +++ b/tests/ui/typeck/issue-81293.rs @@ -3,7 +3,7 @@ fn main() { let b: u16 = 42; let c: usize = 5; - a = c + b * 5; //~ ERROR: mismatched types [E0308] - //~| ERROR: mismatched types [E0308] - //~| ERROR: cannot add `u16` to `usize` [E0277] + a = c + b * 5; //~ ERROR mismatched types [E0308] + //~| ERROR mismatched types [E0308] + //~| ERROR cannot add `u16` to `usize` [E0277] } diff --git a/tests/ui/typeck/issue-83621-placeholder-static-in-extern.rs b/tests/ui/typeck/issue-83621-placeholder-static-in-extern.rs index 16ec2a546434c..7a1aab1064a05 100644 --- a/tests/ui/typeck/issue-83621-placeholder-static-in-extern.rs +++ b/tests/ui/typeck/issue-83621-placeholder-static-in-extern.rs @@ -1,7 +1,7 @@ // Regression test for #83621. extern "C" { - static x: _; //~ ERROR: [E0121] + static x: _; //~ ERROR [E0121] } fn main() {} diff --git a/tests/ui/typeck/issue-83693.rs b/tests/ui/typeck/issue-83693.rs index 02a0bb30d7ce1..2d615d501748d 100644 --- a/tests/ui/typeck/issue-83693.rs +++ b/tests/ui/typeck/issue-83693.rs @@ -4,16 +4,16 @@ #![crate_type="lib"] impl F { -//~^ ERROR: cannot find type `F` in this scope [E0412] +//~^ ERROR cannot find type `F` in this scope [E0412] fn call() { ::call - //~^ ERROR: cannot find type `TestResult` in this scope [E0412] + //~^ ERROR cannot find type `TestResult` in this scope [E0412] //~| associated item constraints are not allowed here [E0229] } } fn call() { ::call - //~^ ERROR: cannot find type `x` in this scope [E0412] - //~| ERROR: associated item constraints are not allowed here [E0229] + //~^ ERROR cannot find type `x` in this scope [E0412] + //~| ERROR associated item constraints are not allowed here [E0229] } diff --git a/tests/ui/typeck/issue-84768.rs b/tests/ui/typeck/issue-84768.rs index 3ba5dffcf07af..14f59c6ef7feb 100644 --- a/tests/ui/typeck/issue-84768.rs +++ b/tests/ui/typeck/issue-84768.rs @@ -5,6 +5,6 @@ fn transform_mut(f: F) where F: for<'b> FnOnce(&'b mut u8) { ::call_once(f, 1) - //~^ ERROR: associated item constraints are not allowed here [E0229] - //~| ERROR: mismatched types [E0308] + //~^ ERROR associated item constraints are not allowed here [E0229] + //~| ERROR mismatched types [E0308] } diff --git a/tests/ui/typeck/issue-86721-return-expr-ice.rs b/tests/ui/typeck/issue-86721-return-expr-ice.rs index ea3a2f2fbfe6e..23cef620a3d58 100644 --- a/tests/ui/typeck/issue-86721-return-expr-ice.rs +++ b/tests/ui/typeck/issue-86721-return-expr-ice.rs @@ -7,11 +7,11 @@ #[cfg(any(rev1))] trait T { const U: usize = return; - //[rev1]~^ ERROR: return statement outside of function body [E0572] + //[rev1]~^ ERROR return statement outside of function body [E0572] } #[cfg(any(rev2))] trait T2 { fn foo(a: [(); return]); - //[rev2]~^ ERROR: return statement outside of function body [E0572] + //[rev2]~^ ERROR return statement outside of function body [E0572] } diff --git a/tests/ui/typeck/issue-88643.rs b/tests/ui/typeck/issue-88643.rs index 4435cba020765..6618e1c72416b 100644 --- a/tests/ui/typeck/issue-88643.rs +++ b/tests/ui/typeck/issue-88643.rs @@ -8,12 +8,12 @@ use std::collections::HashMap; pub trait T {} static CALLBACKS: HashMap<*const dyn T, dyn FnMut(&mut _) + 'static> = HashMap::new(); -//~^ ERROR: the placeholder `_` is not allowed within types on item signatures for static items [E0121] +//~^ ERROR the placeholder `_` is not allowed within types on item signatures for static items [E0121] static CALLBACKS2: Vec = Vec::new(); -//~^ ERROR: the placeholder `_` is not allowed within types on item signatures for static items [E0121] +//~^ ERROR the placeholder `_` is not allowed within types on item signatures for static items [E0121] static CALLBACKS3: Option = None; -//~^ ERROR: the placeholder `_` is not allowed within types on item signatures for static items [E0121] +//~^ ERROR the placeholder `_` is not allowed within types on item signatures for static items [E0121] fn main() {} diff --git a/tests/ui/typeck/issue-88844.rs b/tests/ui/typeck/issue-88844.rs index 116c75aabdbdf..a75553d8b788c 100644 --- a/tests/ui/typeck/issue-88844.rs +++ b/tests/ui/typeck/issue-88844.rs @@ -1,11 +1,11 @@ // Regression test for #88844. struct Struct { value: i32 } -//~^ NOTE: similarly named struct `Struct` defined here +//~^ NOTE similarly named struct `Struct` defined here impl Stuct { -//~^ ERROR: cannot find type `Stuct` in this scope [E0412] -//~| HELP: a struct with a similar name exists +//~^ ERROR cannot find type `Stuct` in this scope [E0412] +//~| HELP a struct with a similar name exists fn new() -> Self { Self { value: 42 } } diff --git a/tests/ui/typeck/issue-89856.fixed b/tests/ui/typeck/issue-89856.fixed index 213a672e397be..303dc75bc08ef 100644 --- a/tests/ui/typeck/issue-89856.fixed +++ b/tests/ui/typeck/issue-89856.fixed @@ -6,13 +6,13 @@ fn main() { let option: Option = Some(string.clone()); take_str_maybe(option.as_deref()); - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] let option_ref = Some(&string); take_str_maybe(option_ref.map(|x| x.as_str())); - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] let option_ref_ref = option_ref.as_ref(); take_str_maybe(option_ref_ref.map(|x| x.as_str())); - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] } diff --git a/tests/ui/typeck/issue-89856.rs b/tests/ui/typeck/issue-89856.rs index 83d88ff34cac6..f4ecc35fe6c56 100644 --- a/tests/ui/typeck/issue-89856.rs +++ b/tests/ui/typeck/issue-89856.rs @@ -6,13 +6,13 @@ fn main() { let option: Option = Some(string.clone()); take_str_maybe(option); - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] let option_ref = Some(&string); take_str_maybe(option_ref); - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] let option_ref_ref = option_ref.as_ref(); take_str_maybe(option_ref_ref); - //~^ ERROR: mismatched types [E0308] + //~^ ERROR mismatched types [E0308] } diff --git a/tests/ui/typeck/issue-91210-ptr-method.fixed b/tests/ui/typeck/issue-91210-ptr-method.fixed index 7fe9bdc6a1bb7..4e3a14059187b 100644 --- a/tests/ui/typeck/issue-91210-ptr-method.fixed +++ b/tests/ui/typeck/issue-91210-ptr-method.fixed @@ -8,8 +8,8 @@ struct Foo { read: i32 } unsafe fn blah(x: *mut Foo) { (*x).read = 4; - //~^ ERROR: attempted to take value of method - //~| HELP: to access the field, dereference first + //~^ ERROR attempted to take value of method + //~| HELP to access the field, dereference first } fn main() {} diff --git a/tests/ui/typeck/issue-91210-ptr-method.rs b/tests/ui/typeck/issue-91210-ptr-method.rs index 1ae9331e642be..9b1afb21ac47a 100644 --- a/tests/ui/typeck/issue-91210-ptr-method.rs +++ b/tests/ui/typeck/issue-91210-ptr-method.rs @@ -8,8 +8,8 @@ struct Foo { read: i32 } unsafe fn blah(x: *mut Foo) { x.read = 4; - //~^ ERROR: attempted to take value of method - //~| HELP: to access the field, dereference first + //~^ ERROR attempted to take value of method + //~| HELP to access the field, dereference first } fn main() {} diff --git a/tests/ui/typeck/issue-91267.rs b/tests/ui/typeck/issue-91267.rs index 1bffa09e64360..69a34b17981e3 100644 --- a/tests/ui/typeck/issue-91267.rs +++ b/tests/ui/typeck/issue-91267.rs @@ -2,7 +2,7 @@ fn main() { type_ascribe!(0, u8=e>) - //~^ ERROR: cannot find type `e` in this scope [E0412] - //~| ERROR: associated item constraints are not allowed here [E0229] - //~| ERROR: mismatched types [E0308] + //~^ ERROR cannot find type `e` in this scope [E0412] + //~| ERROR associated item constraints are not allowed here [E0229] + //~| ERROR mismatched types [E0308] } diff --git a/tests/ui/typeck/issue-91328.fixed b/tests/ui/typeck/issue-91328.fixed index bd646e9f40bfd..dc51966eab2b3 100644 --- a/tests/ui/typeck/issue-91328.fixed +++ b/tests/ui/typeck/issue-91328.fixed @@ -6,40 +6,40 @@ fn foo(r: Result, i32>) -> i32 { match r.as_deref() { - //~^ HELP: consider using `as_deref` here + //~^ HELP consider using `as_deref` here Ok([a, b]) => a + b, - //~^ ERROR: expected an array or slice - //~| NOTE: pattern cannot match with input type + //~^ ERROR expected an array or slice + //~| NOTE pattern cannot match with input type _ => 42, } } fn bar(o: Option>) -> i32 { match o.as_deref() { - //~^ HELP: consider using `as_deref` here + //~^ HELP consider using `as_deref` here Some([a, b]) => a + b, - //~^ ERROR: expected an array or slice - //~| NOTE: pattern cannot match with input type + //~^ ERROR expected an array or slice + //~| NOTE pattern cannot match with input type _ => 42, } } fn baz(v: Vec) -> i32 { match v[..] { - //~^ HELP: consider slicing here + //~^ HELP consider slicing here [a, b] => a + b, - //~^ ERROR: expected an array or slice - //~| NOTE: pattern cannot match with input type + //~^ ERROR expected an array or slice + //~| NOTE pattern cannot match with input type _ => 42, } } fn qux(a: &Option>) -> i32 { match a.as_deref() { - //~^ HELP: consider using `as_deref` here + //~^ HELP consider using `as_deref` here Some([a, b]) => a + b, - //~^ ERROR: expected an array or slice - //~| NOTE: pattern cannot match with input type + //~^ ERROR expected an array or slice + //~| NOTE pattern cannot match with input type _ => 42, } } diff --git a/tests/ui/typeck/issue-91328.rs b/tests/ui/typeck/issue-91328.rs index 6d2643dbead93..f55ffe5d83c46 100644 --- a/tests/ui/typeck/issue-91328.rs +++ b/tests/ui/typeck/issue-91328.rs @@ -6,40 +6,40 @@ fn foo(r: Result, i32>) -> i32 { match r { - //~^ HELP: consider using `as_deref` here + //~^ HELP consider using `as_deref` here Ok([a, b]) => a + b, - //~^ ERROR: expected an array or slice - //~| NOTE: pattern cannot match with input type + //~^ ERROR expected an array or slice + //~| NOTE pattern cannot match with input type _ => 42, } } fn bar(o: Option>) -> i32 { match o { - //~^ HELP: consider using `as_deref` here + //~^ HELP consider using `as_deref` here Some([a, b]) => a + b, - //~^ ERROR: expected an array or slice - //~| NOTE: pattern cannot match with input type + //~^ ERROR expected an array or slice + //~| NOTE pattern cannot match with input type _ => 42, } } fn baz(v: Vec) -> i32 { match v { - //~^ HELP: consider slicing here + //~^ HELP consider slicing here [a, b] => a + b, - //~^ ERROR: expected an array or slice - //~| NOTE: pattern cannot match with input type + //~^ ERROR expected an array or slice + //~| NOTE pattern cannot match with input type _ => 42, } } fn qux(a: &Option>) -> i32 { match a { - //~^ HELP: consider using `as_deref` here + //~^ HELP consider using `as_deref` here Some([a, b]) => a + b, - //~^ ERROR: expected an array or slice - //~| NOTE: pattern cannot match with input type + //~^ ERROR expected an array or slice + //~| NOTE pattern cannot match with input type _ => 42, } } diff --git a/tests/ui/typeck/issue-91450-inner-ty-error.rs b/tests/ui/typeck/issue-91450-inner-ty-error.rs index 3c7c990d4e27c..8027c8275d267 100644 --- a/tests/ui/typeck/issue-91450-inner-ty-error.rs +++ b/tests/ui/typeck/issue-91450-inner-ty-error.rs @@ -1,7 +1,7 @@ // Regression test for #91450. // This test ensures that the compiler does not suggest `Foo<[type error]>` in diagnostic messages. -fn foo() -> Option<_> {} //~ ERROR: [E0308] -//~^ ERROR: the placeholder `_` is not allowed +fn foo() -> Option<_> {} //~ ERROR [E0308] +//~^ ERROR the placeholder `_` is not allowed fn main() {} diff --git a/tests/ui/typeck/issue-96530.rs b/tests/ui/typeck/issue-96530.rs index 4ab93ab4938f4..de5e553a6bf75 100644 --- a/tests/ui/typeck/issue-96530.rs +++ b/tests/ui/typeck/issue-96530.rs @@ -6,7 +6,7 @@ struct Person { fn first_woman(man: &Person) -> Person { Person { first_name: "Eve".to_string(), - ..man.clone() //~ ERROR: mismatched types + ..man.clone() //~ ERROR mismatched types } } diff --git a/tests/ui/typeck/issue-96738.rs b/tests/ui/typeck/issue-96738.rs index ce2556f869c7c..19b162b6d793b 100644 --- a/tests/ui/typeck/issue-96738.rs +++ b/tests/ui/typeck/issue-96738.rs @@ -1,4 +1,4 @@ fn main() { - Some.nonexistent_method(); //~ ERROR: no method named `nonexistent_method` found - Some.nonexistent_field; //~ ERROR: no field `nonexistent_field` + Some.nonexistent_method(); //~ ERROR no method named `nonexistent_method` found + Some.nonexistent_field; //~ ERROR no field `nonexistent_field` } diff --git a/tests/ui/typeck/issue-98260.rs b/tests/ui/typeck/issue-98260.rs index cf48294e1997f..44ac75783facf 100644 --- a/tests/ui/typeck/issue-98260.rs +++ b/tests/ui/typeck/issue-98260.rs @@ -1,7 +1,7 @@ fn main() {} trait A { fn a(aa: B) -> Result<_, B> { - //~^ ERROR: the placeholder `_` is not allowed within types on item signatures for return types [E0121] + //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types [E0121] Ok(()) } } diff --git a/tests/ui/typeck/repeat-expr-checks-wf.rs b/tests/ui/typeck/repeat-expr-checks-wf.rs index b8a2a0ceb5880..b3a20f1e38e4c 100644 --- a/tests/ui/typeck/repeat-expr-checks-wf.rs +++ b/tests/ui/typeck/repeat-expr-checks-wf.rs @@ -4,7 +4,7 @@ trait Foo { fn bar() { let a = [T::ASSOC; 2]; - //~^ ERROR: the size for values of type `[u8]` cannot be known at compilation time + //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time } fn main() {} diff --git a/tests/ui/typeck/type-placeholder-fn-in-const.rs b/tests/ui/typeck/type-placeholder-fn-in-const.rs index bbb95a5798af5..e1d731c663c53 100644 --- a/tests/ui/typeck/type-placeholder-fn-in-const.rs +++ b/tests/ui/typeck/type-placeholder-fn-in-const.rs @@ -2,14 +2,14 @@ struct MyStruct; trait Test { const TEST: fn() -> _; - //~^ ERROR: the placeholder `_` is not allowed within types on item signatures for functions [E0121] - //~| ERROR: the placeholder `_` is not allowed within types on item signatures for associated constants [E0121] + //~^ ERROR the placeholder `_` is not allowed within types on item signatures for functions [E0121] + //~| ERROR the placeholder `_` is not allowed within types on item signatures for associated constants [E0121] } impl Test for MyStruct { const TEST: fn() -> _ = 42; - //~^ ERROR: the placeholder `_` is not allowed within types on item signatures for functions [E0121] - //~| ERROR: the placeholder `_` is not allowed within types on item signatures for associated constants [E0121] + //~^ ERROR the placeholder `_` is not allowed within types on item signatures for functions [E0121] + //~| ERROR the placeholder `_` is not allowed within types on item signatures for associated constants [E0121] } fn main() {} diff --git a/tests/ui/ufcs/ufcs-explicit-self-bad.rs b/tests/ui/ufcs/ufcs-explicit-self-bad.rs index 29586dccfc950..a2ad61b0508d2 100644 --- a/tests/ui/ufcs/ufcs-explicit-self-bad.rs +++ b/tests/ui/ufcs/ufcs-explicit-self-bad.rs @@ -7,7 +7,7 @@ struct Foo { impl Foo { fn foo(self: isize, x: isize) -> isize { //~^ ERROR invalid `self` parameter type - self.f + x //~ ERROR: doesn't have fields + self.f + x //~ ERROR doesn't have fields } } @@ -53,10 +53,10 @@ fn main() { f: 1, }); println!("{}", foo.foo(2)); - //~^ ERROR: no method named `foo` + //~^ ERROR no method named `foo` let bar = Box::new(Bar { f: 1, }); println!("{} {}", bar.foo(2), bar.bar(2)); - //~^ ERROR: no method named `bar` + //~^ ERROR no method named `bar` } diff --git a/tests/ui/unboxed-closures/issue-30906.rs b/tests/ui/unboxed-closures/issue-30906.rs index e2d219e470384..a7bf0f3aa3ad4 100644 --- a/tests/ui/unboxed-closures/issue-30906.rs +++ b/tests/ui/unboxed-closures/issue-30906.rs @@ -16,7 +16,7 @@ where fn bad(f: fn(&'static str) -> T) { test(Compose(f, |_| {})); - //~^ ERROR: implementation of `FnOnce` is not general enough + //~^ ERROR implementation of `FnOnce` is not general enough } fn main() {} diff --git a/tests/ui/unboxed-closures/non-tupled-arg-mismatch.rs b/tests/ui/unboxed-closures/non-tupled-arg-mismatch.rs index 2278285bf8f15..2f78c61a643af 100644 --- a/tests/ui/unboxed-closures/non-tupled-arg-mismatch.rs +++ b/tests/ui/unboxed-closures/non-tupled-arg-mismatch.rs @@ -4,5 +4,5 @@ fn a>(f: F) {} //~^ ERROR type parameter to bare `Fn` trait must be a tuple fn main() { - a(|_: usize| {}); //~ ERROR: mismatched types + a(|_: usize| {}); //~ ERROR mismatched types } diff --git a/tests/ui/union/union-lint-dead-code.rs b/tests/ui/union/union-lint-dead-code.rs index cb2cdd4dba008..c2c5fe01bc8ca 100644 --- a/tests/ui/union/union-lint-dead-code.rs +++ b/tests/ui/union/union-lint-dead-code.rs @@ -2,7 +2,7 @@ union Foo { x: usize, - b: bool, //~ ERROR: field `b` is never read + b: bool, //~ ERROR field `b` is never read _unused: u16, } diff --git a/tests/ui/unop/unop-move-semantics.rs b/tests/ui/unop/unop-move-semantics.rs index 8168da8242fd4..aeb06ced1bb41 100644 --- a/tests/ui/unop/unop-move-semantics.rs +++ b/tests/ui/unop/unop-move-semantics.rs @@ -5,25 +5,25 @@ use std::ops::Not; fn move_then_borrow + Clone>(x: T) { !x; - x.clone(); //~ ERROR: borrow of moved value + x.clone(); //~ ERROR borrow of moved value } fn move_borrowed>(x: T, mut y: T) { let m = &x; let n = &mut y; - !x; //~ ERROR: cannot move out of `x` because it is borrowed + !x; //~ ERROR cannot move out of `x` because it is borrowed - !y; //~ ERROR: cannot move out of `y` because it is borrowed + !y; //~ ERROR cannot move out of `y` because it is borrowed use_mut(n); use_imm(m); } fn illegal_dereference>(mut x: T, y: T) { let m = &mut x; let n = &y; - !*m; //~ ERROR: cannot move out of `*m` + !*m; //~ ERROR cannot move out of `*m` - !*n; //~ ERROR: cannot move out of `*n` + !*n; //~ ERROR cannot move out of `*n` use_imm(n); use_mut(m); } fn main() {} diff --git a/tests/ui/unpretty/mir-unpretty.rs b/tests/ui/unpretty/mir-unpretty.rs index c58ef3865aa9b..7d287263a750a 100644 --- a/tests/ui/unpretty/mir-unpretty.rs +++ b/tests/ui/unpretty/mir-unpretty.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Z unpretty=mir fn main() { - let x: () = 0; //~ ERROR: mismatched types + let x: () = 0; //~ ERROR mismatched types } diff --git a/tests/ui/unsafe/unsafe-assign.rs b/tests/ui/unsafe/unsafe-assign.rs index 02ce238854d87..c8a02625f66d4 100644 --- a/tests/ui/unsafe/unsafe-assign.rs +++ b/tests/ui/unsafe/unsafe-assign.rs @@ -7,7 +7,7 @@ fn nested_field() { let mut foo = unsafe { NonZero((1,)) }; foo.0.0 = 0; - //~^ ERROR: mutation of layout constrained field is unsafe + //~^ ERROR mutation of layout constrained field is unsafe } fn block() { diff --git a/tests/ui/unsafe/unsafe-borrow.rs b/tests/ui/unsafe/unsafe-borrow.rs index ab0e59489a96a..286886413146f 100644 --- a/tests/ui/unsafe/unsafe-borrow.rs +++ b/tests/ui/unsafe/unsafe-borrow.rs @@ -7,7 +7,7 @@ fn tuple_struct() { let mut foo = unsafe { NonZero((1,)) }; let a = &mut foo.0.0; - //~^ ERROR: mutation of layout constrained field is unsafe + //~^ ERROR mutation of layout constrained field is unsafe } fn slice() { @@ -27,7 +27,7 @@ fn array() { let nums = [1, 2, 3, 4]; let mut foo = unsafe { NonZero(nums) }; let a = &mut foo.0[2]; - //~^ ERROR: mutation of layout constrained field is unsafe + //~^ ERROR mutation of layout constrained field is unsafe } fn block() { @@ -46,7 +46,7 @@ fn mtch() { let mut foo = unsafe { NonZero((1,)) }; match &mut foo { NonZero((a,)) => *a = 0, - //~^ ERROR: mutation of layout constrained field is unsafe + //~^ ERROR mutation of layout constrained field is unsafe } } diff --git a/tests/ui/unsafe/unsafe-not-inherited.rs b/tests/ui/unsafe/unsafe-not-inherited.rs index 6d797caa0f94d..df9af9d3c36c4 100644 --- a/tests/ui/unsafe/unsafe-not-inherited.rs +++ b/tests/ui/unsafe/unsafe-not-inherited.rs @@ -4,21 +4,21 @@ static mut FOO: u64 = 0; fn static_mod() { unsafe {static BAR: u64 = FOO;} - //~^ ERROR: use of mutable static is unsafe - //~| NOTE: use of mutable static - //~| NOTE: mutable statics can be mutated by multiple threads - //~| NOTE: items do not inherit unsafety + //~^ ERROR use of mutable static is unsafe + //~| NOTE use of mutable static + //~| NOTE mutable statics can be mutated by multiple threads + //~| NOTE items do not inherit unsafety } unsafe fn unsafe_call() {} fn foo() { unsafe { - //~^ NOTE: items do not inherit unsafety + //~^ NOTE items do not inherit unsafety fn bar() { unsafe_call(); - //~^ ERROR: call to unsafe function - //~| NOTE: call to unsafe function - //~| NOTE: consult the function's documentation + //~^ ERROR call to unsafe function + //~| NOTE call to unsafe function + //~| NOTE consult the function's documentation } } } diff --git a/tests/ui/unsigned-literal-negation.rs b/tests/ui/unsigned-literal-negation.rs index 943c7f79742ab..8a0202bfe9a92 100644 --- a/tests/ui/unsigned-literal-negation.rs +++ b/tests/ui/unsigned-literal-negation.rs @@ -1,5 +1,5 @@ fn main() { - let x = -1 as usize; //~ ERROR: cannot apply unary operator `-` - let x = (-1) as usize; //~ ERROR: cannot apply unary operator `-` - let x: u32 = -1; //~ ERROR: cannot apply unary operator `-` + let x = -1 as usize; //~ ERROR cannot apply unary operator `-` + let x = (-1) as usize; //~ ERROR cannot apply unary operator `-` + let x: u32 = -1; //~ ERROR cannot apply unary operator `-` } diff --git a/tests/ui/unsized-locals/unsized-locals-using-unsized-fn-params.rs b/tests/ui/unsized-locals/unsized-locals-using-unsized-fn-params.rs index 15263954ced77..1b31752cba019 100644 --- a/tests/ui/unsized-locals/unsized-locals-using-unsized-fn-params.rs +++ b/tests/ui/unsized-locals/unsized-locals-using-unsized-fn-params.rs @@ -3,13 +3,13 @@ #[allow(dead_code)] fn f1(box box _b: Box>) {} -//~^ ERROR: the size for values of type `[u8]` cannot be known at compilation time [E0277] +//~^ ERROR the size for values of type `[u8]` cannot be known at compilation time [E0277] fn f2((_x, _y): (i32, [i32])) {} -//~^ ERROR: the size for values of type `[i32]` cannot be known at compilation time [E0277] +//~^ ERROR the size for values of type `[i32]` cannot be known at compilation time [E0277] fn main() { let foo: Box<[u8]> = Box::new(*b"foo"); let _foo: [u8] = *foo; - //~^ ERROR: the size for values of type `[u8]` cannot be known at compilation time [E0277] + //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time [E0277] } diff --git a/tests/ui/unsized/issue-71659.rs b/tests/ui/unsized/issue-71659.rs index c463ed125bb6a..9470f2b3ef7c0 100644 --- a/tests/ui/unsized/issue-71659.rs +++ b/tests/ui/unsized/issue-71659.rs @@ -32,5 +32,5 @@ impl Foo for [i32; 0] {} fn main() { let x: &dyn Foo = &[]; let x = x.cast::<[i32]>(); - //~^ ERROR: the trait bound `dyn Foo: CastTo<[i32]>` is not satisfied + //~^ ERROR the trait bound `dyn Foo: CastTo<[i32]>` is not satisfied } diff --git a/tests/ui/unsized/issue-75707.rs b/tests/ui/unsized/issue-75707.rs index 9f04cdbb92211..ea764d3cf81dc 100644 --- a/tests/ui/unsized/issue-75707.rs +++ b/tests/ui/unsized/issue-75707.rs @@ -13,5 +13,5 @@ fn f() { fn main() { struct MyCall; f::>(); - //~^ ERROR: the trait bound `MyCall: Callback` is not satisfied + //~^ ERROR the trait bound `MyCall: Callback` is not satisfied } diff --git a/tests/ui/use/use-after-move-implicity-coerced-object.rs b/tests/ui/use/use-after-move-implicity-coerced-object.rs index 47fbb5bf1c362..dd1820d87e0a4 100644 --- a/tests/ui/use/use-after-move-implicity-coerced-object.rs +++ b/tests/ui/use/use-after-move-implicity-coerced-object.rs @@ -26,5 +26,5 @@ fn main() { l.push(n); let x = n.to_string(); - //~^ ERROR: borrow of moved value: `n` + //~^ ERROR borrow of moved value: `n` } diff --git a/tests/ui/variance/variance-associated-consts.rs b/tests/ui/variance/variance-associated-consts.rs index 97edb7e266ad0..ea74c44d9d14b 100644 --- a/tests/ui/variance/variance-associated-consts.rs +++ b/tests/ui/variance/variance-associated-consts.rs @@ -12,7 +12,7 @@ trait Trait { #[rustc_variance] struct Foo { //~ ERROR [T: o] field: [u8; ::Const] - //~^ ERROR: unconstrained generic constant + //~^ ERROR unconstrained generic constant } fn main() { } diff --git a/tests/ui/variance/variance-regions-direct.rs b/tests/ui/variance/variance-regions-direct.rs index 2bcacec33ea5a..e9d7565ee3466 100644 --- a/tests/ui/variance/variance-regions-direct.rs +++ b/tests/ui/variance/variance-regions-direct.rs @@ -50,7 +50,7 @@ struct Test6<'a, 'b:'a> { //~ ERROR ['a: +, 'b: o] #[rustc_variance] struct Test7<'a> { //~ ERROR ['a: *] - //~^ ERROR: `'a` is never used + //~^ ERROR `'a` is never used x: isize } diff --git a/tests/ui/variance/variance-regions-indirect.rs b/tests/ui/variance/variance-regions-indirect.rs index aaa4d3f877995..80f55b4011364 100644 --- a/tests/ui/variance/variance-regions-indirect.rs +++ b/tests/ui/variance/variance-regions-indirect.rs @@ -6,7 +6,7 @@ #[rustc_variance] enum Base<'a, 'b, 'c:'b, 'd> { //~ ERROR ['a: -, 'b: +, 'c: o, 'd: *] - //~^ ERROR: `'d` is never used + //~^ ERROR `'d` is never used Test8A(extern "Rust" fn(&'a isize)), Test8B(&'b [isize]), Test8C(&'b mut &'c str), @@ -14,19 +14,19 @@ enum Base<'a, 'b, 'c:'b, 'd> { //~ ERROR ['a: -, 'b: +, 'c: o, 'd: *] #[rustc_variance] struct Derived1<'w, 'x:'y, 'y, 'z> { //~ ERROR ['w: *, 'x: o, 'y: +, 'z: -] - //~^ ERROR: `'w` is never used + //~^ ERROR `'w` is never used f: Base<'z, 'y, 'x, 'w> } #[rustc_variance] // Combine - and + to yield o struct Derived2<'a, 'b:'a, 'c> { //~ ERROR ['a: o, 'b: o, 'c: *] - //~^ ERROR: `'c` is never used + //~^ ERROR `'c` is never used f: Base<'a, 'a, 'b, 'c> } #[rustc_variance] // Combine + and o to yield o (just pay attention to 'a here) struct Derived3<'a:'b, 'b, 'c> { //~ ERROR ['a: o, 'b: +, 'c: *] - //~^ ERROR: `'c` is never used + //~^ ERROR `'c` is never used f: Base<'a, 'b, 'a, 'c> } diff --git a/tests/ui/variance/variance-trait-bounds.rs b/tests/ui/variance/variance-trait-bounds.rs index f86fa2bbef7a0..d19f745274c11 100644 --- a/tests/ui/variance/variance-trait-bounds.rs +++ b/tests/ui/variance/variance-trait-bounds.rs @@ -19,19 +19,19 @@ struct TestStruct> { //~ ERROR [U: +, T: +] #[rustc_variance] enum TestEnum> { //~ ERROR [U: *, T: +] - //~^ ERROR: `U` is never used + //~^ ERROR `U` is never used Foo(T) } #[rustc_variance] struct TestContraStruct> { //~ ERROR [U: *, T: +] - //~^ ERROR: `U` is never used + //~^ ERROR `U` is never used t: T } #[rustc_variance] struct TestBox+Setter> { //~ ERROR [U: *, T: +] - //~^ ERROR: `U` is never used + //~^ ERROR `U` is never used t: T } diff --git a/tests/ui/wasm/wasm-bindgen-broken-error.rs b/tests/ui/wasm/wasm-bindgen-broken-error.rs index d985e87980314..fb511071572de 100644 --- a/tests/ui/wasm/wasm-bindgen-broken-error.rs +++ b/tests/ui/wasm/wasm-bindgen-broken-error.rs @@ -22,7 +22,7 @@ //@[v1_0_0] rustc-env:CARGO_PKG_VERSION_PATCH=0 #![crate_name = "wasm_bindgen"] -//[v0_1_0]~^ ERROR: older versions of the `wasm-bindgen` crate -//[v0_2_87]~^^ ERROR: older versions of the `wasm-bindgen` crate +//[v0_1_0]~^ ERROR older versions of the `wasm-bindgen` crate +//[v0_2_87]~^^ ERROR older versions of the `wasm-bindgen` crate fn main() {} diff --git a/tests/ui/wasm/wasm-custom-section-relocations.rs b/tests/ui/wasm/wasm-custom-section-relocations.rs index 30358c7a8d98f..f670a7ef6e640 100644 --- a/tests/ui/wasm/wasm-custom-section-relocations.rs +++ b/tests/ui/wasm/wasm-custom-section-relocations.rs @@ -1,7 +1,7 @@ //@ only-wasm32 #[link_section = "test"] -pub static A: &[u8] = &[1]; //~ ERROR: no extra levels of indirection +pub static A: &[u8] = &[1]; //~ ERROR no extra levels of indirection #[link_section = "test"] pub static B: [u8; 3] = [1, 2, 3]; @@ -10,6 +10,6 @@ pub static B: [u8; 3] = [1, 2, 3]; pub static C: usize = 3; #[link_section = "test"] -pub static D: &usize = &C; //~ ERROR: no extra levels of indirection +pub static D: &usize = &C; //~ ERROR no extra levels of indirection fn main() {} diff --git a/tests/ui/wasm/wasm-import-module.rs b/tests/ui/wasm/wasm-import-module.rs index bff08847d37dd..1e4bea8c337db 100644 --- a/tests/ui/wasm/wasm-import-module.rs +++ b/tests/ui/wasm/wasm-import-module.rs @@ -1,21 +1,21 @@ #![feature(link_cfg)] -#[link(name = "...", wasm_import_module)] //~ ERROR: must be of the form +#[link(name = "...", wasm_import_module)] //~ ERROR must be of the form extern "C" {} -#[link(name = "...", wasm_import_module(x))] //~ ERROR: must be of the form +#[link(name = "...", wasm_import_module(x))] //~ ERROR must be of the form extern "C" {} -#[link(name = "...", wasm_import_module())] //~ ERROR: must be of the form +#[link(name = "...", wasm_import_module())] //~ ERROR must be of the form extern "C" {} -#[link(wasm_import_module = "foo", name = "bar")] //~ ERROR: `wasm_import_module` is incompatible with other arguments +#[link(wasm_import_module = "foo", name = "bar")] //~ ERROR `wasm_import_module` is incompatible with other arguments extern "C" {} -#[link(wasm_import_module = "foo", kind = "dylib")] //~ ERROR: `wasm_import_module` is incompatible with other arguments +#[link(wasm_import_module = "foo", kind = "dylib")] //~ ERROR `wasm_import_module` is incompatible with other arguments extern "C" {} -#[link(wasm_import_module = "foo", cfg(FALSE))] //~ ERROR: `wasm_import_module` is incompatible with other arguments +#[link(wasm_import_module = "foo", cfg(FALSE))] //~ ERROR `wasm_import_module` is incompatible with other arguments extern "C" {} fn main() {} diff --git a/tests/ui/wf/issue-87495.rs b/tests/ui/wf/issue-87495.rs index ce5c617bbbd38..e8dccfed7a909 100644 --- a/tests/ui/wf/issue-87495.rs +++ b/tests/ui/wf/issue-87495.rs @@ -2,7 +2,7 @@ trait T { const CONST: (bool, dyn T); - //~^ ERROR: the trait `T` is not dyn compatible [E0038] + //~^ ERROR the trait `T` is not dyn compatible [E0038] } fn main() {} diff --git a/tests/ui/wf/wf-foreign-fn-decl-ret.rs b/tests/ui/wf/wf-foreign-fn-decl-ret.rs index b9d956c056869..e30148069d476 100644 --- a/tests/ui/wf/wf-foreign-fn-decl-ret.rs +++ b/tests/ui/wf/wf-foreign-fn-decl-ret.rs @@ -9,10 +9,10 @@ pub trait Foo { extern "C" { pub fn lint_me() -> <() as Foo>::Assoc; - //~^ ERROR: the trait bound `(): Foo` is not satisfied [E0277] + //~^ ERROR the trait bound `(): Foo` is not satisfied [E0277] pub fn lint_me_aswell() -> Bar; - //~^ ERROR: the trait bound `u32: Unsatisfied` is not satisfied [E0277] + //~^ ERROR the trait bound `u32: Unsatisfied` is not satisfied [E0277] } fn main() {} diff --git a/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs b/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs index 0be5127dcc4da..d36b4d9e805f3 100644 --- a/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs +++ b/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs @@ -10,7 +10,7 @@ pub struct Wrapper(T); #[repr(transparent)] pub struct Ref<'a>(&'a u8); -impl Trait for Ref {} //~ ERROR: implicit elided lifetime not allowed here +impl Trait for Ref {} //~ ERROR implicit elided lifetime not allowed here extern "C" { pub fn repro(_: Wrapper); diff --git a/tests/ui/where-clauses/normalization-of-unknown-type.rs b/tests/ui/where-clauses/normalization-of-unknown-type.rs index c3ff7ed125acf..6c41a23c1b086 100644 --- a/tests/ui/where-clauses/normalization-of-unknown-type.rs +++ b/tests/ui/where-clauses/normalization-of-unknown-type.rs @@ -21,7 +21,7 @@ struct AndThen; impl Filter for AndThen where - Foo: Filter, //~ ERROR: cannot find type `Foo` + Foo: Filter, //~ ERROR cannot find type `Foo` { type Future = (); } diff --git a/tests/ui/where-clauses/self-in-where-clause-allowed.rs b/tests/ui/where-clauses/self-in-where-clause-allowed.rs index a4c2d82b4837f..4ee5aca11a9b8 100644 --- a/tests/ui/where-clauses/self-in-where-clause-allowed.rs +++ b/tests/ui/where-clauses/self-in-where-clause-allowed.rs @@ -18,5 +18,5 @@ fn main() { let trait_object = &() as &dyn Trait; trait_object.static_lifetime_bound(); trait_object.arg_lifetime_bound(&()); - trait_object.autotrait_bound(); //~ ERROR: the trait bound `dyn Trait: AutoTrait` is not satisfied + trait_object.autotrait_bound(); //~ ERROR the trait bound `dyn Trait: AutoTrait` is not satisfied } diff --git a/tests/ui/where-clauses/where-for-self.rs b/tests/ui/where-clauses/where-for-self.rs index 9380e72cd7c8b..f9d1e268e0902 100644 --- a/tests/ui/where-clauses/where-for-self.rs +++ b/tests/ui/where-clauses/where-for-self.rs @@ -13,7 +13,7 @@ impl<'a, 'b> Bar<'b> for &'a u32 { fn foo(x: &T) where for<'a> &'a T: for<'b> Bar<'b> - //~^ error: nested quantification of lifetimes + //~^ error nested quantification of lifetimes {} fn main() {} From 3abc6bf9f15eaf8827aa7c6aa804a826d0c94acd Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 6 Apr 2025 13:23:10 +0300 Subject: [PATCH 2/2] UI tests: Fix fallout from removing redundant colons in line annotations --- tests/ui/coercion/coerce-issue-49593-box-never.rs | 4 ++-- tests/ui/consts/const-eval/issue-85155.rs | 2 +- tests/ui/lint/dead-code/tuple-struct-field.rs | 2 +- tests/ui/lint/lint-qualification.fixed | 2 +- tests/ui/parser/brace-in-let-chain.stderr | 4 ++-- .../ui/try-trait/bad-question-mark-on-trait-object.rs | 10 +++++----- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/ui/coercion/coerce-issue-49593-box-never.rs b/tests/ui/coercion/coerce-issue-49593-box-never.rs index 903fb7f4d3053..e556959204590 100644 --- a/tests/ui/coercion/coerce-issue-49593-box-never.rs +++ b/tests/ui/coercion/coerce-issue-49593-box-never.rs @@ -16,13 +16,13 @@ fn foo(x: !) -> Box { // Method resolution will generate new inference vars and relate them. // Thus fallback will not fall back to `!`, but `()` instead. Box::<_ /* ! */>::new(x) - //[nofallback]~^ ERROR trait bound `(): std::error:Error` is not satisfied + //[nofallback]~^ ERROR trait bound `(): std::error::Error` is not satisfied } fn foo_raw_ptr(x: !) -> *mut dyn Error { /* *mut $0 is coerced to *mut Error here */ raw_ptr_box::<_ /* ! */>(x) - //[nofallback]~^ ERROR trait bound `(): std::error:Error` is not satisfied + //[nofallback]~^ ERROR trait bound `(): std::error::Error` is not satisfied } fn no_coercion(d: *mut dyn Error) -> *mut dyn Error { diff --git a/tests/ui/consts/const-eval/issue-85155.rs b/tests/ui/consts/const-eval/issue-85155.rs index 3abea25af750f..cb5b3a08375d0 100644 --- a/tests/ui/consts/const-eval/issue-85155.rs +++ b/tests/ui/consts/const-eval/issue-85155.rs @@ -20,5 +20,5 @@ fn main() { //~^ NOTE the above error was encountered while instantiating } -//~? ERROR evaluation of `post_monomorphization_error:ValidateConstImm::<2, 0, 1>::VALID` failed +//~? ERROR evaluation of `post_monomorphization_error::ValidateConstImm::<2, 0, 1>::VALID` failed //~? NOTE erroneous constant encountered diff --git a/tests/ui/lint/dead-code/tuple-struct-field.rs b/tests/ui/lint/dead-code/tuple-struct-field.rs index de8d3e7b63338..4b89ea1761041 100644 --- a/tests/ui/lint/dead-code/tuple-struct-field.rs +++ b/tests/ui/lint/dead-code/tuple-struct-field.rs @@ -6,7 +6,7 @@ use std::marker::PhantomData; const LEN: usize = 4; struct UnusedAtTheEnd(i32, f32, [u8; LEN], String, u8); -//~^ ERRORfields `1`, `2`, `3`, and `4` are never read +//~^ ERROR fields `1`, `2`, `3`, and `4` are never read //~| NOTE fields in this struct //~| HELP consider removing these fields diff --git a/tests/ui/lint/lint-qualification.fixed b/tests/ui/lint/lint-qualification.fixed index 10a7ad7a15553..0306e84945bb6 100644 --- a/tests/ui/lint/lint-qualification.fixed +++ b/tests/ui/lint/lint-qualification.fixed @@ -21,7 +21,7 @@ fn main() { //~^ ERROR unnecessary qualification //~| ERROR unnecessary qualification - + //~^ ERROR unused import: `std::fmt` let _: std::fmt::Result = Ok(()); // don't report unnecessary qualification because fix(#122373) for issue #121331 diff --git a/tests/ui/parser/brace-in-let-chain.stderr b/tests/ui/parser/brace-in-let-chain.stderr index 12af95c278688..1adc5fb4112f2 100644 --- a/tests/ui/parser/brace-in-let-chain.stderr +++ b/tests/ui/parser/brace-in-let-chain.stderr @@ -1,5 +1,5 @@ error: this file contains an unclosed delimiter - --> $DIR/brace-in-let-chain.rs:58:54 + --> $DIR/brace-in-let-chain.rs:58:53 | LL | fn main() { | - unclosed delimiter @@ -25,7 +25,7 @@ LL | && let () = () LL | } | - ...as it matches this but it has different indentation LL | } - | ^ + | ^ error: aborting due to 1 previous error diff --git a/tests/ui/try-trait/bad-question-mark-on-trait-object.rs b/tests/ui/try-trait/bad-question-mark-on-trait-object.rs index 78fd54ade09fa..2a0d14b175030 100644 --- a/tests/ui/try-trait/bad-question-mark-on-trait-object.rs +++ b/tests/ui/try-trait/bad-question-mark-on-trait-object.rs @@ -1,14 +1,14 @@ struct E; -//~^ NOTE `E` needs to implement `std::error:Error` +//~^ NOTE `E` needs to implement `std::error::Error` //~| NOTE alternatively, `E` needs to implement `Into` struct X; //~ NOTE `X` needs to implement `From` -fn foo() -> Result<(), Box> { //~ NOTE required `E: std::error:Error` because of this +fn foo() -> Result<(), Box> { //~ NOTE required `E: std::error::Error` because of this Ok(bar()?) - //~^ ERROR `?` couldn't convert the error: `E: std::error:Error` is not satisfied - //~| NOTE the trait `std::error:Error` is not implemented for `E` + //~^ ERROR `?` couldn't convert the error: `E: std::error::Error` is not satisfied + //~| NOTE the trait `std::error::Error` is not implemented for `E` //~| NOTE the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait - //~| NOTE required for `Box` to implement `From` + //~| NOTE required for `Box` to implement `From` //~| NOTE this has type `Result<_, E>` //~| NOTE in this expansion //~| NOTE in this expansion